Вы можете изменить путь к модели и попытаться использовать свой
from allennlp.predictors.predictor import Predictor
predictor = Predictor.from_path("https://s3-us-west-2.amazonaws.com/allennlp/models/ner-model-2018.12.18.tar.gz") # change model path
sentence = "Did Uriah honestly think he could beat The Legend of Zelda in under three hours?"
result = predictor.predict(sentence)
lang = {}
completeWord = ""
for word, tag in zip(result["words"], result["tags"]):
if(tag.startswith("B")):
completeWord = completeWord + " " +word
completeWord = completeWord + " " +word
elif(tag.startswith("L")):
completeWord = completeWord + " " +word
lang[completeWord] = tag.split("-")[1]
completeWord = ""
else:
lang[word] = tag
print(lang)
>>>{' The Legend of Zelda': 'MISC',
'?': 'O',
'Did': 'O',
'Uriah': 'U-PER',
'beat': 'O',
'could': 'O',
'he': 'O',
'honestly': 'O',
'hours': 'O',
'in': 'O',
'think': 'O',
'three': 'O',
'under': 'O'}
Пожалуйста, отметьте его как принятый, если это необходимо.