This project is a website that allows you to classify input text using a neural network, whether it is about a natural disaster or not.
To classify text, a machine learning model, or more precisely a recurrent neural network, is used. The model was made using python and TensorFlow library. The data used to train the model was taken from Kaggle, specifically from the Natural Language Processing with Disaster Tweets competition.
The website was created using two libraries: React for front-end and Flask for back-end.
Docker and TensorFlow/serving were used to deploy the model.
To run the project locally, you need to enter the commands below. To do this, you will need to open 3 instances of terminal that you will be using. Each instance will be associated with back-end, front-end or tensorflow/serving model.
Note
In the following commands, the path to the newly cloned project will be specified as
[project dir].Example
Let's say you cloned this project into this directory:
C:\Projects\Then
[project dir]is:C:\Projects\nlp-natural-disaster\So if you need to enter a command:
cd [project dir]Then, instead, you should enter this:
cd C:\Projects\nlp-natural-disaster\
Make sure that you have Python installed.
cd [project dir]python -m venv venvImportant
Windows Powershell:
venv\Scripts\activate.ps1Windows Command Prompt:
venv\Scripts\activate
pip install -r requirements.txtcd back-endpython server.py -dMake sure that you have node.js installed.
cd [project dir]cd front-endnpm installnpm startMake sure that you have Docker installed and running.
Note
[project dir]in this command should be substituted by you project directory path.
docker run --rm -it -v [project dir]\tensorflow-model\models:/models -p 8605:8605 --entrypoint /bin/bash tensorflow/servingtensorflow_model_server --rest_api_port=8605 --model_name=nlp_natural_disaster --model_base_path=/models/Your app should now be running on localhost:4000.
Here are all the technologies that were used to create this project:
Languages
Frameworks/Libraries
Other
