Skip to content

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.

Notifications You must be signed in to change notification settings

SpectreSpect/nlp-natural-disaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLP natural disaster

Docker CSS3 HRML5 JavaScript ReactJS TensorFlow Python Flask Git TensorFlowServing

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.

Running Locally

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\

Terminal instance #1 (back-end)

Make sure that you have Python installed.

cd [project dir]
python -m venv venv

Important

Windows Powershell:

venv\Scripts\activate.ps1

Windows Command Prompt:

venv\Scripts\activate
pip install -r requirements.txt
cd back-end
python server.py -d

Terminal instance #2 (front-end)

Make sure that you have node.js installed.

cd [project dir]
cd front-end
npm install
npm start

Terminal instance #3 (tensorflow/serving)

Make 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/serving
tensorflow_model_server --rest_api_port=8605 --model_name=nlp_natural_disaster --model_base_path=/models/

Your app should now be running on localhost:4000.

Techonlogies used

Here are all the technologies that were used to create this project:

Languages

JavaScript Python HRML5 CSS3

Frameworks/Libraries

TensorFlow Flask ReactJS

Other

TensorFlowServing Docker Git

Preview

This is what the application looks like when it's running: app_preview

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages