This Project is part of Data Science Nanodegree Program by Udacity in collaboration with Figure Eight. The dataset contains pre-labelled tweet and messages from real-life disaster events. The project aim is to build a Natural Language Processing (NLP) model to categorize messages on a real time basis.
The project is divided into 3 main parts:
- Pre-process data, build an ETL pipeline to extract,clean data from source, and save it in SQLite DB format.
- Build a machine learning pipeline to train a model to classify text messages by respective categories.
- Run a web app that shows classification of results in real time
Clone the git repository:
git clone https://github.com/taijiensing/udacity-disaster-response-pipeline.git
-
Run the following commands in the project's root directory to set up your database and model.
-
To run ETL pipeline that cleans data and stores in database
python data/process_data.py data/disaster_messages.csv data/disaster_categories.csv data/DisasterResponse.db
-
To run ML pipeline that trains classifier and saves
python models/train_classifier.py data/DisasterResponse.db models/classifier.pkl
-
-
Run the following command in the app's directory to run your web app.
python run.py
-
Go to http://0.0.0.0:3001/
-
When working out of udacity workspace, http://0.0.0.0:3001/ was not able to load.
-
To resolve this, once app in running (python run.py):
-
Open another terminal and type:
env|grep WORK
-
This will show something along the lines of SPACEID=view******** (combination of digits and characters)
-
Open browser window and type:
https://view********-3001.udacity-student-workspaces.com
-
Press enter and the app should now execute.
-
- process_data.py: Read, clean, and store data in SQL DB.
- disaster_categories.csv: Dataset
- DisasterResponse.db: Resulting database from process_date job
- train_classifier.py
- classifier.rar: Compressed classifier.pkl file
- run.py: Flask app with UI to predict results and display them.
- templates: folder containing html templates