首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用Allennlp双仿射解析器模型

无法使用Allennlp双仿射解析器模型
EN

Stack Overflow用户
提问于 2020-12-13 00:54:34
回答 1查看 298关注 0票数 0

我正在尝试使用allennlp predictor作为biaffine解析器。以下是代码:

代码语言:javascript
复制
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")

然而,我得到了这个错误:-

代码语言:javascript
复制
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.
EN

回答 1

Stack Overflow用户

发布于 2020-12-19 01:46:08

这是一个非常旧的模型,新版本应该可以很好地工作:https://storage.googleapis.com/allennlp-public-models/biaffine-dependency-parser-ptb-2020.04.06.tar.gz

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65267452

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档