Skip to content

A simple NLP-powered Flask web app for classifying emergency messages into disaster response categories.

Notifications You must be signed in to change notification settings

rmwenzel/disaster_response

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disaster Response NLP Pipeline and Web App

The user can input a text message and see which categories it is classified into, as well as view visualizations of the dataset used for training, Multilingual Disaster Response Messages.

The final model is optimized for F-beta score, which is similar to f1 score but allows to one weight recall higher than precision (or vice versa). Emphasizing recall over precision makes more sense for this application.

For more discussion, and more detailed analysis of the data and the ETL and ML pipelines, see the notebooks.

Instructions:

  1. Run the following commands in the project's root directory to set up the database and model.

    • To run the 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 the ML pipeline that trains classifier and saves python models/train_classifier.py data/DisasterResponse.db models/classifier.pkl
  2. Run the following command in the app directory to run the web app. python run.py

  3. Go to http://0.0.0.0:3001/ to use the web app

Structure:

.
├── README.md
├── app
│   ├── run.py
│   └── templates
│       ├── go.html
│       └── master.html
├── data
│   ├── DisasterResponse.db
│   ├── disaster_categories.csv
│   ├── disaster_messages.csv
│   └── process_data.py
├── models
│   └── train_classifier.py
└── notebooks
    ├── ETL.ipynb
    └── ML.ipynb

Directory overview:

  • app - html templates and script for running the Flask app.
  • data - original data as csvs, SQL database file for cleaned and processed data, and script for doing the processing.
  • model - classifier model training script.
  • notebooks - Jupyter notebooks for data processing, exploration, and machine learning model building and evaluation. Most code from these notebooks is used to create the data processing and training scripts.

About

A simple NLP-powered Flask web app for classifying emergency messages into disaster response categories.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published