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.
69 stars 9 forks source link

Predicting is returning none #23

Closed Lisa-aa closed 10 months ago

Lisa-aa commented 10 months ago

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?

Suneal commented 10 months ago

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

Lisa-aa commented 10 months ago

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?"}))