- Fine-tuned BERT model weights exported in a lightweight Flask API within Docker container ready for inference.
- Front-end app to accept text input from user. This input is sent to the model for classification.
- Backend MYSQL DB (separate Docker container) to store correctly classified texts with option to further fine-tune the BERT model with new data.
- Complete logging infrastructure to track inputs and performance of APP
- Incorrect predictions are not stored in DB as it would negatively imapct model performance
Using airline review data, I compared the performance of a Naive Bayes Classifier with a fine-tuned BERT model. The task is ultimately a binary classification with reviews being either negative or not-negative. The aim is to accurately classify any input text into either 'negative' or 'not-negative' categories.
Checkout the notebooks for the model training and comparison process. It includes lots of comments to follow my thought process.
- Git clone this repo
- re-run bert-training.ipynb to obtain model weights and save in a model_weights directory.
- Create a .env file with MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_TABLE variables to store your specific DB credentials
- run
docker-compose build && docker-compose up
- the app is hosted on port 5001 (enter http://localhost:5001 into your browser)