-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Prediction Error when doing Textual Entailment using roberta #4192
Comments
Looks like this was fixed here: allenai/allennlp-models@0b040af. @dirkgr, did you upload an updated model anywhere after fixing that? I'm currently looking into what the underlying cause of this problem was, but if there's an updated model already, we can point people to that for now. |
Ok, the underlying issue is that there is no vocabulary saved with this model. So, when it gets loaded, it has only an empty vocabulary, and so |
I have a solution for this. Use the model archive at https://storage.googleapis.com/allennlp-public-models/snli-roberta-large-2020.04.30.tar.gz. I didn't solve it by addressing the no-vocab issue though. That's not what I saw. The problem is that it was using the wrong vocab namespace. |
Ah, ok, thanks. I missed that the transformer vocabulary gets added to the model's vocabulary at the call of The commit that introduced this particular failure is this one: d709e59. We should update the usage info in the demo, and I'll open an issue there if there isn't one already. I'm closing this one, as as far as the library is concerned it's fixed. |
Thanks for the help. |
Describe the bug
I tried to run textual entailment using the demo code given on allennlp:
from allennlp.predictors.predictor import Predictor import allennlp_models.nli predictor = Predictor.from_path("https://storage.googleapis.com/allennlp-public-models/snli-roberta-large-2020.02.27.tar.gz", predictor_name="textual-entailment") predictor.predict(hypothesis="Two women are sitting on a blanket near some rocks talking about politics.",premise="Two women are wandering along the shore drinking iced tea.")
First, I tried to run it on my local jupyter notebook and got this error:
Then I tried to run the same code on the google-colab and got this error:
To Reproduce
Steps to reproduce the behavior
pip install allennlp==1.0.0rc3 allennlp-models==1.0.0rc3
from allennlp.predictors.predictor import Predictor
import allennlp_models.nli
predictor = Predictor.from_path("https://storage.googleapis.com/allennlp-public-models/snli-roberta-large-2020.02.27.tar.gz", predictor_name="textual-entailment")
predictor.predict( hypothesis="Two women are sitting on a blanket near some rocks talking about politics.", premise="Two women are wandering along the shore drinking iced tea." )
Expected behavior
Should return values describing entailment, contradiction and neutrality.
System (please complete the following information):
The text was updated successfully, but these errors were encountered: