allenai / allenai/scibert

How to load finetuned NER model in allenlp?

オープン
#110 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
1.7k
フォーク
232
PR マージ指標
30日以内にマージされた PR はありません

説明

I have trained the NER model on sciie dataset using the following config:

```
DATASET='sciie'
TASK='ner'
with_finetuning='_finetune' #'_finetune' # or '' for not fine tuning
dataset_size=38124

export BERT_VOCAB=/home/tomaz/neo4j/scibert/model/vocab.txt
export BERT_WEIGHTS=/home/tomaz/neo4j/scibert/model/weights.tar.gz
```

This worked nicely and I got a model.tar.gz as an output. Now when I try to load it in AllenNLP lib:

```
from allennlp.predictors.predictor import Predictor
predictor = Predictor.from_path("model.tar.gz")
```

I get the following error:

> ConfigurationError: bert-pretrained not in acceptable choices for dataset_reader.token_indexers.bert.type: ['single_id', 'characters', 'elmo_characters', 'spacy', 'pretrained_transformer', 'pretrained_transformer_mismatched']. 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.

Any idea how to fix this?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。