Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Pad coreference model input to 5 #2933

Merged
merged 2 commits into from
Jun 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion allennlp/pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ def neural_coreference_resolution_lee_2017() -> predictors.CorefPredictor:
warnings.simplefilter(action="ignore", category=DeprecationWarning)
model = PretrainedModel('https://s3-us-west-2.amazonaws.com/allennlp/models/coref-model-2018.02.05.tar.gz',
'coreference-resolution')
return model.predictor() # type: ignore
predictor = model.predictor()
# pylint: disable=protected-access
predictor._dataset_reader._token_indexers['token_characters']._min_padding_length = 5 # type: ignore
return predictor # type: ignore

def named_entity_recognition_with_elmo_peters_2018() -> predictors.SentenceTaggerPredictor:
with warnings.catch_warnings():
Expand Down