This project uses a Python library called FastAPI to serve a pretrained sentiment analysis model created using Tensorflow as a REST API service.
In the project root directory you will need to pip install
using the requirements.txt into a new Conda(or equivalent) environment:
In the project root directory, you can run:
This will run the server in development mode and will reload when changes are made.
or simply run:
Trains the model.
Make prediction with request body {"text": "This movie is not very good. I won't see it again"}
.
Returns the model accuracy eg {"results": {"loss": 0.75, "accuracy": 0.62}}
.
Saves the trained weights to a file called model_weights.h5.
Loads the model weights.
You will need to visit OMDb API and get a freely available API key and then make a .env file in the client directory.
.env should contain REACT_APP_API_KEY=<OMDb API key>
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
- Improve the styles of the app, at the moment it is a little more functionality over style.
- Improve how the model runs sentiment analysis on the provided text, at the moment it is really a bad at telling whether the review text is positive or negative.