A Flask Web app to classify texts from disaster response times into a 36 fixed set of categories.Dataset is used from Figure 8.Project is part of Udacity Data Scientist nanodegree program.In disaster time, this app will help categorize disaster messages so that you can send the messages to an appropriate disaster relief agency. An emergency worker can input a new message in this web app and get classification results in several categories.The web app will also display visualizations of the data.
-- app
| -- templates
| -- master.html # main page of web app
| -- go.html # classification result page of web app
|-- run.py # Flask file that runs app
|--data
| -- disaster_categories.csv # data to process
| -- disaster_messages.csv # data to process
| -- process_data.py
| -- DisasterResponse.db # database to save clean data
|--models
| -- train_classifier.py
| -- classifier.pkl # saved model
| -- X_test.csv #test data set
| -- Y_prediction.csv # predicted class
| -- Y_test.csv # actual class
|--screen_shots
-- README.md
-- Requirements.txt
- nltk
- flask
- sqlalchemy
- sklearn
- joblib
- icecream
- pandas
- 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 store 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 save
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 app/run.py
-
Go to https://0.0.0.0:3001/
Welcome screen
- Execution time: 48 minutes for classifier
- precision: 0.8868079851821362
- recall: 0.8376749611197511
- f1: 0.6628273389112246