oozr_
Deploying a Flask app with a Spacy pipeline
Hi all! I've deployed a web app using Flask, via Railway.app. Using Github. Couldn't believe how easy it was.
Project ID: 8ce9ac55-ca78-4140-aaae-601754cc857c
Repository: https://github.com/oozr/globalscaleoflanguages
Website: www.globalscaleoflanguages.com
The web app is a text anlyser. Asks for input text from the user, then analyses the text using the Python library Textstat.
All good so far. I'm now trying to make it more advanced by integrating Spacy library to lemmatize the text (to then lookup the lemmatized words in a sql table of words that I have with rated difficulty). It works in my offline environment because I have the pipeline downloaded on my local host. My issue is in loading the pipeline for the deployed app: error with the code: nlp = spacy.load("en_core_web_sm").
Spacy is in my requirements.txt file. But I'm not sure how to load/add the pipeline for visitors to the web app. Is this something that needs to be loaded every time a user comes to the web app/makes a request? If so how do I go about loading the pipeline. Or would it be better to go via an API route?
This is the best help I could find on StackOverflow, but to be honest I don't really understand it as I'm fairly new to CS.
https://stackoverflow.com/questions/46990884/how-to-use-spacy-nlp-from-within-a-website - answer from Ines Montahy.
Thanks guys, any advice appreciated.
9 replies