Loading a NLP model

Hello, I have created an NLP model to classify text. I am using it to create an app. I am using streamlit for the same. I am getting error while loading the nlp model whereas computer vision model gets easily loaded with load_learner function. Am I missing something?

Can you include the error message?


I am using pycharm. My computer vision model and tabular model is running perfectly. I have created and exported the model from kaggle

a google search pointed me to here. Loading a pickle file gives "AttributeError: type object 'EnglishDefaults' has no attribute 'is_base_form'" error if you want to try that.

1 Like

yes But I didnt get any luck

EnglishDefaults I cannot really find it but I am guessing it comes from SpaCy. Have you checked that your SpaCy version matches? In particular, there are big changes across version so v2 and v3 uses totally different mechanism. I checked the notebook I created on 2nd November uses SpaCy v3.1.3 on Kaggle.

Also, check that you download spacy’s library as well (the en_core_web_sm thingy for example) in your local computer. I guess Kaggle did that for us.

If it is a spacy thing like suggested, if you go in the venv where you install streamlit and do a (or equivalent if you are using Pipfile or something else)

pip install -q spacy==2.2.4

that might fix it.
If you’re still stuck and looking for an alternative to streamlit, I’m glad to help get your model onto https://yhat.pub