Model() got multiple values for argument 'nr_class' - SpaCy multi-classification model (BERT integration)

江枫思渺然 提交于 2019-12-04 06:59:28

This is a regression in the most recent version we released of spacy-pytorch-transformers. Sorry about this!

The root cause is, this is another case of the evils of **kwargs. I'm looking forward to refining the spaCy API to prevent these issues in future.

You can see the offending line here: https://github.com/explosion/spacy-pytorch-transformers/blob/c1def95e1df783c69bff9bc8b40b5461800e9231/spacy_pytorch_transformers/pipeline/textcat.py#L71 . We provide the nr_class positional argument, which overlaps with the explicit argument you passed in during the config.

In order to workaround the problem, you can simply remove the nr_class key from your the config dict you're passing into spacy.create_pipe().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!