Highlight
spaCy, Flask, unit test, static code analysis, Javascript/HTML/CSS
Overview
In this project, we make use of the spaCy, to create an application that would perform sentiment analysis on a provided text. We then deploy this application over the web using Flask framework.
Main Steps
Figure 1 Main Steps
The main steps for completing this project are shown in Figure 1. And the running code can be found on GitHub.
- Step 1 & 2: Create a sentiment analysis application & Package the application
Create a folder
SentimentAnalysis
(aka Package). Create two files__init__.py
andsentiment_analysis.py
(aka module) in the folder, definesentiment_analysis_func
insentiment_analysis.py
file.
- Step 3 & 4: Run unit tests on the application & Run static code analysis
Create a file
test_sentiment_analysis.py
.
Check the quality of the code as per the PEP8 guidelines by running static code analysis using
PyLint
library.
pylint server.py
- Step 5: Deploy as web application using Flask
Create
*.html
file intemplates
folder and*.js
file instatic
folder. The purpose is to create the front-end of the application.
Create
server.py
file.