Skip to content

Building a Disaster Response web application that classifies SOS messages, to assist organizations in targeted delivery of disaster relief.

Notifications You must be signed in to change notification settings

nazianafis/Disaster-Response-Pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disaster-Response-Pipeline

Table of Contents

  1. Overview
  2. File Description
  3. Getting Started
    1. Dependencies
    2. Installation
  4. Project Motivation
  5. Web Application Demo
  6. Author
  7. Acknowledgments

Overview

The omnipresence of smartphones has enabled people to call for help in the event of a disaster/emergency in real-time. This project monitors such SOS messages, which can then be forwarded to respective relief organizations for a targeted disaster response.

Getting Started

File Description

Disaster-Response-Pipeline
    ├── data                   
    │   ├── disaster_categories.csv          # Disaster categories dataset for processing
    │   ├── disaster_messages.csv            # Sample disaster messages dataset for processing
    │   └── process_data.py                  # Data cleaning processing script
    |   └── DisasterResponse.db              # Final database, generated as a result of process_data.py
    ├── app     
    │   ├── run.py                           # Flask file that runs the web app
    │   └── templates   
    │       ├── go.html                      # Classification result page of web app
    │       └── master.html                  # Main page of web app
    ├── models
    │   ├── train_classifier.py              # ML model processing script
    |   └── classifier.pkl                   # Trained ML model, generated as a result of train_classifier.py
    ├── webapp-demo.PNG
    └── README.md

Dependencies

  • Python 3.5+
  • Machine Learning Libraries: NumPy, SciPy, Pandas, Sciki-Learn
  • Natural Language Process Libraries: NLTK
  • SQLlite Database Libraqries: SQLalchemy
  • Model Loading and Saving Library: Pickle, joblib
  • Web App and Data Visualization: Flask, Plotly

Installation

Datasets: The set of sample disaster SOS messages can be downloaded from here. Disaster categories are available here.

To run the project:

Run the following commands in the project's root directory.

To run the ETL pipeline that cleans data and stores it in a database:

  $ python3 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 the model in a pickle file:

  $ python3 models/train_classifier.py data/DisasterResponse.db models/classifier.pkl

To run the web app:

  $ python3 app/run.py

Go to http://0.0.0.0:3001/ or localhost:3001

Project Motivation

For this project, I have tried to build a disaster response web application that can classify SOS messages into different categories like medical supplies, food, or block road. This categorised data can then be used by organizations for providing targeted disaster relief.

Web Application Demo

The web application successfully classifies the message "Due to heavy rains, there's flood in Mumbai. Help neeeded" into categories such as aid related, and search and rescue.

demo-image

Author

Acknowledgements

  • Udacity and Figure Eight for providing the relevant dataset to train the model.

About

Building a Disaster Response web application that classifies SOS messages, to assist organizations in targeted delivery of disaster relief.

Topics

Resources

Stars

Watchers

Forks