Skip to content

Disaster Response Classification Web App that allows you to classify messages, aimed to help emergency worker to allocate assistance more efficiently

Notifications You must be signed in to change notification settings

fairgelle/disaster-response-pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disaster Response Classification Web App

Table of Content

  1. Project Motivation
  2. Installation
  3. About the Data
  4. About the Web App
  5. Licensing, Authors & Acknowledgements

Project Motivation

Climate change has increased the number and severity of natural disasters all over the world. The shorter the response time of emergency services, the greater the number of lives that can be saved. This app is using a machine learning model that was trained on over 25,000 natural disaster- related messages.

Disaster relief workers can use this app to input messages and it will return a classification of the message, such as "aid-related", "medical help", "water". With better identification of messages, we hope that emergency services could allocate resources or assistance more effectively.

See the live dashboard here

Installation

You can replicate this dashboard locally by following these instructions.

The code should using Python version 3.6 and above.

  1. Start by cloning the repository into your local machine
  2. The additional libraries required to execute the code can be installed by running pip install -r requirements.txt
  3. Go ito the app/ directory and run python run.py to run the web app locally
  4. Open http://0.0.0.0:3001/ on your browser to view the web app

Code Overview

  • Dataset: disaster_messages.csv and disaster_categories.csv contain messages data and the corresponding classification of the messages
  • process_data.py: This script cleans up and merges the two dataset. The result is then saved into an SQLite DB. In this project, the DB is named as DisasterResponse DB. The whole process is executed by running python data/process_data.py data/disaster_messages.csv data/disaster_categories.csv data/DisasterResponse.db
  • train_classifier.py: This script loads the data from the DisasterResponse.db and uses it as an input for the ML model. The fine-tuned model is then saved as a pickle file called classifier.pkl. This whole process is executed by running python models/train_classifier.py data/DisasterResponse.db models/classifier.pkl
  • templates folder: Contains files used for the frontend part of the web app
  • run.py: A file that contains pre-processing of the data that will be passed into the files in the templates folder. This also contains the script necessary to render the web app.

About the Data

Imbalanced Dataset

Some of the labels in the original dataset are highly imbalanced; this affects the model's F1 score. For simplicity's purposes, these highly imbalanced fields are dropped in the process_data.py file. In the future, pre-processing methods to deal with imbalanced dataset for classification such as MLSMOTE can be used.

About the Web App

  1. Input messages into the field. Click on 'Classify Message'. messages

  2. Result of the message classification classification

Licensing, Authors & Acknowledgements

This project was completed as a part of Udacity Data Science Nanodegree. Credits to Figure Eight for providing the dataset.

About

Disaster Response Classification Web App that allows you to classify messages, aimed to help emergency worker to allocate assistance more efficiently

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published