Named-entity recognition model deployment
The purpose of this project is the deployment of a NLP model and providing access to it through a web API.
The components of the web service API are the following:
- spacy
- flask
From the project folder, implement the following steps:
-
Create a virtual environment
conda create --name <venv> python=3.9.6 -y
-
Enable the new virtual enviroment:
conda activate <venv>
-
Install the Flask web server:
conda install flask=1.1.2 -y
-
Install the spacy NLP library:
conda install spacy=2.3.5 -y
-
Install the English core component for spacy:
conda install -c conda-forge spacy-model-en_core_web_md -y
-
Set the FLASKAPP environemtn variable to app.py:
export FLASKAPP=app.py
-
Start the flask web server:
flask run
-
Click on the URL that was provided by the
flask run
step above: -
In the text area, enter some text:
-
Select the named entity of interest. The possible choices are Organization , Person, Geopolitical, and Money.
-
After hitting the
Submit
button, the text is analyzed by the spacy NLP model and a list of entities matching the selected type are returned.