Build and deploy a machine learning app from scratch 🚀
MIT License
In this job, I collaborated with Ahmed BESBES
Medium post here.
You may also read about it here and here.
In this post, we'll go through the necessary steps to build and deploy a machine learning application. This starts from data collection to deployment; and the journey, you'll see, is exciting and fun. 😀
Before we begin, let's have a look at the app we'll build:
As you see, this web app allows a user to evaluate random brands by writing reviews. While writing, the user will see the sentiment score of his input updating in real-time, alongside a proposed 1 to 5 rating.
The user can then change the rating in case the suggested one does not reflect his views, and submit.
You can think of this as a crowd sourcing app of brand reviews, with a sentiment analysis model that suggests ratings that the user can tweak and adapt afterwards.
To build this application, we'll follow these steps:
Selenium
and Scrapy
PyTorch
Dash
REST API
and a Postgres
databaseDocker Compose
AWS
To run this project locally using Docker Compose
run
:
docker-compose build
docker-compose up
You can then access the dash app at http://localhost:8050
If you want to contribute to this project and run each service independently:
In order to launch the API, you will first need to run a local postgres
db using Docker
:
docker run --name postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password -e POSTGRES_DB=postgres -p 5432:5432 -d postgres
Then you'll have to type the following commands:
cd src/api/
python app.py
In order to run the dash
server to visualize the output:
cd src/dash/
python app.py
Feel free to contribute! Report any bugs in the issue section.
Here are the few things we noticed, and wanted to add.
GET /api/reviews
route.MIT