I am looking to upgrade to the Individual plan and was hoping to port my NLP code into Anvil. I use SpaCy too, so will I experience this issue as well (referring to the issue posted [here])(Server error when loading Spacy lib)
Right now I use uplink to call SpaCy related functions. It’s not bad in terms of speed. Will I be better off using Uplink? My NLP code sits in my local machine, so its not ideal to depend on uplink.
You could activate your free trial of the Full Python 3 runtime and try it out. It will also depend on what SpaCy model you are trying to load into memory. In that other post you reference, they were loading the largest model, which requires a fair bit more memory than the medium and small models.
So I have now upgraded and moved to the full Python version in anvil.
In my server module, I have:
but when I try to load the model:
nlp = spacy.load("en_core_web_sm")
I get the following error:
OSError: [E050] Can't find model 'en_core_web_sm'. It doesn't seem to be a shortcut link,
a Python package or a valid path to a data directory. at /usr/local/lib/python3.7/site-packages/spacy/util.py, line 119
Not sure what I am missing. In my local machine, after installing spacy, this code was enough to load the model and work off it. Given it is already installed in Anvil's environment, I don't need to download and install again?
Is somebody able to respond to this please? I am unable to make any progress if I do not have SpaCy working in my app. I was hoping that by upgrading, I will not have to depend on Uplink for the NLP aspects, however I have not any luck so far.
After a little digging myself, I think you are correct that the model needs to be downloaded separately as is implied in the Spacy docs. I will poke the relevant person to download this for you during the (UK) workday tomorrow. Hopefully the Uplink will suffice until then!
I had a couple users report that they are experiencing an error when they try using a feature in the app that uses SpaCy. Please refer to the conversation above.
I tried it now and indeed I get this error:
The error is at this line:
nlp = spacy.load(“en_core_web_sm”)
The last time this code was successfully accessed was around noon UK time, dec 15th.
I have not changed anything related to this feature since this version of the app got published. Any ideas please?
You could wait for someone who knows better to answer but…
Have you heard about the new ability to install packages? You might want to try installing the newest version of SpaCy directly into your anvil server and see if that works?