0

I am trying to use allennlp predictor for biaffine parser. Here is the code:-

from allennlp.predictors.predictor import Predictor
predictor = Predictor.from_path("https://s3-us-west-2.amazonaws.com/allennlp/models/biaffine-dependency-parser-ptb-2018.08.23.tar.gz")

However, I get this error:-

ConfigurationError                        Traceback (most recent call last)
<ipython-input-3-74e2bcfcbf43> in <module>()
      1 from allennlp.predictors.predictor import Predictor
----> 2 predictor = Predictor.from_path("https://s3-us-west-2.amazonaws.com/allennlp/models/biaffine-dependency-parser-ptb-2018.08.23.tar.gz")

4 frames
/usr/local/lib/python3.6/dist-packages/allennlp/common/params.py in pop_choice(self, key, choices, default_to_first_choice, allow_class_names)
    350                 """{"model": "my_module.models.MyModel"} to have it imported automatically."""
    351             )
--> 352             raise ConfigurationError(message)
    353         return value
    354 

ConfigurationError: universal_dependencies not in acceptable choices for dataset_reader.type: ['conll2003', 'interleaving', 'sequence_tagging', 'sharded', 'babi', 'text_classification_json']. You should either use the --include-package flag to make sure the correct module is loaded, or use a fully qualified class name in your config file like {"model": "my_module.models.MyModel"} to have it imported automatically.
Ankit Garg
  • 11
  • 1
  • Where did you find the link to that model? I'm just curious because it's so old. – petew Dec 18 '20 at 17:47
  • @petew , just trying to reproduce some results of a research paper. They had used the older version of the parser in their code. – Ankit Garg Dec 20 '20 at 15:17
  • Gotcha. In that case, if you really need to use that exact model, you'll have to find use an older version of AllenNLP. Unfortunately I can't tell you which version would work off the top of my head. But v0.9.0 might be a good place to start. – petew Dec 21 '20 at 17:12

1 Answers1

0

That's a very old model, the newer version should work fine: https://storage.googleapis.com/allennlp-public-models/biaffine-dependency-parser-ptb-2020.04.06.tar.gz

petew
  • 671
  • 8
  • 13