Riccorl / transformer-srl

Reimplementation of a BERT based model (Shi et al, 2019), currently the state-of-the-art for English SRL. This model implements also predicate disambiguation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Predicting is returning none

Lisa-aa opened this issue · comments

The code to predict runs but it always returns none.
I used python 3.11 and transformer-srl 2.4.6. This should work right?

Not exactly sure this python version is the issue for this case but I had success with python 3.7. 13 and transformer-srl 2.4.6

Okay, I fixed it for now by changing the code to this:
from transformer_srl import dataset_readers, models, predictors
predictor = predictors.SrlTransformersPredictor.from_path("srl_bert_base_conll2012.tar.gz", "transformer_srl")
result = predictor.predict_instances(predictor._sentence_to_srl_instances({"sentence": "Did Uriah honestly think he could beat the game in under three hours?"}))