Pad coreference model input to 5
* Pad coreference model input to 5.
It has a 5-wide Conv1D layer.
* mypy
@@ -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():
