Open tomasonjo opened 3 years ago
I have made a lot of progress, currently I use:
from allennlp.predictors.predictor import Predictor
from scibert.models.bert_crf_tagger import *
from scibert.models.bert_text_classifier import *
from scibert.models.dummy_seq2seq import *
from scibert.dataset_readers.classification_dataset_reader import *
predictor = Predictor.from_path("scibert_ner/model.tar.gz")
dataset_reader="classification_dataset_reader")
predictor.predict(
sentence="Did Uriah honestly think he could beat The Legend of Zelda in under three hours?"
)
and I get the following error:
No default predictor for model type bert_crf_tagger.\nPlease specify a predictor explicitly
There is an option to add a predictor_name parameter to load module from path, but I don't know what to pick that would work
I'm also having trouble running the model (#107), but I could at least load my model in a hacky way.
Please keep me updated if you get it running!
If someone still encounter this issue, I could be able to solve it by including predictor_name while loading model. something like this.
predictor = Predictor.from_path("scibert_ner/model.tar.gz",predictor_name="sentence-tagger")
I have trained the NER model on sciie dataset using the following config:
This worked nicely and I got a model.tar.gz as an output. Now when I try to load it in AllenNLP lib:
I get the following error:
Any idea how to fix this?