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

Commit

Permalink
Pad coreference model input to 5 (#2933)
Browse files Browse the repository at this point in the history
* Pad coreference model input to 5.

It has a 5-wide Conv1D layer.

* mypy
  • Loading branch information
darabos authored and matt-gardner committed Jun 10, 2019
1 parent 9a0e01f commit 8e180cb
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit 8e180cb

Please sign in to comment.