masashi-y / depccg

A* CCG Parser with a Supertag and Dependency Factored Model
MIT License
92 stars 28 forks source link

Incompatible with AllenNLP >= 1.0 #17

Open niklaskorz opened 3 years ago

niklaskorz commented 3 years ago

The current my_allennlp implementation tries to access variables that have been removed after version 0.9, e.g. DEFAULT_PREDICTORS. The current version of AllenNLP is 2.1.0. I have tried installing 0.9.0 instead, but this seems to fail on my system with Python 3.8. I can install AllenNLP 1.5.0 and 2.1.0 just fine.

niklaskorz commented 3 years ago

At least for allennlp 1.5.0, the fix seems to be quite easy: Instead of accessing the former global DEFAULT_PREDICTORS in my_allennlp/predictor/supertagger_predictor.py, a property default_predictor has to be defined in my_allennlp/models/supertagger.py as part of the class:

@Model.register("supertagger")
class Supertagger(Model):
    default_predictor = "supertagger-predictor"
    ...

I haven't tried whether this also works with 2.1.0 yet.