Featured image of post Disaster Response Web App

Disaster Response Web App

Disaster Response Web Application is a Web app that can help emergency organizations analyze incoming messages and classify the messages into specific categories (e.g. Water, Food, Hospitals, Aid-Related) during a disaster event. The app is based on Nature Language Processing and Random Forest Classifier ML model. The data was collected by Figure Eight and provided by Udacity.

Disaster Response Web Application is a Web app that can help emergency organizations analyze incoming messages and classify the messages into specific categories (e.g. Water, Food, Hospitals, Aid-Related) during a disaster event. The app is based on Nature Language Processing and Random Forest Classifier ML model. The data was collected by Figure Eight and provided by Udacity.

The techniques I used in this project include:

  • SQLite in Python
  • Bag of Words (BOW)
  • Multilabel classification
  • Build Machine Learning Pipeline
  • Grid Search Cross Validation
  • Random Forest Classifier
  • K nearest neighbors (KNN)
  • Build a Flask web app

You can find the full analysis in my GitHub repo.

Data

The data files associated with this project are from Figure Eight

  • messages.csv: FIgure Eight provide 26,248 messages
  • categories.csv: Raw categories data, total 36 categories.

Project Process

  1. ETL Pipeline

    • Loads messages and categories dataset
    • Clean data
    • Feature Engineering
    • Stores it in a SQLite database
  2. ML Pipeline

    • Loads data from the SQLite database
    • text processing and machine learning pipeline
    • Trains and tunes a model using GridSearchCV
    • Exports the model
  3. Build web app

    • Create HTML templates
    • Build Flask web application

Folder Structure

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
โ”œโ”€โ”€ README.md          
โ”‚
โ”œโ”€โ”€ models                   <- Trained models and ML pipeline
โ”‚   โ”œโ”€โ”€ classifier.pkl       <- Saved model
โ”‚   โ””โ”€โ”€ train_classifier.py  <- Scripts to train model sdf
โ”‚
โ”œโ”€โ”€ requirements.txt         <- File for reproducing the environment
โ”‚
โ”œโ”€โ”€ data                     <- Raw and processed Data; data     
โ”‚   โ”‚                           cleaning script
โ”‚   โ”œโ”€โ”€ messages.csv         <- Raw messages data
โ”‚   โ”œโ”€โ”€ categories.csv       <- Raw categories data
โ”‚   โ”œโ”€โ”€ DisasterResponse.db  <- Saved processed data
โ”‚   โ””โ”€โ”€ process_data.py      <- Scripts to process data
โ”‚
โ”œโ”€โ”€ notebooks                <- Jupyter notebooks
โ”‚
โ””โ”€โ”€ App                      <- Source code for use in this project.
    โ”œโ”€โ”€ templates            <- Flask html templates 
    โ””โ”€โ”€ run.py               <- Scripts to create start Flask server. 

Full Instructions

  • Installation Install Python 3.5+ Run pip install -r requirements.txt

  • Prepare data

    1. Clone or download the repo
    2. Open terminal and navigate to the project folder
    3. Run python data/process_data.py data/disaster_messages.csv data/disaster_categories.csv data/DisasterResponse.db
  • Train model 5. Run python models/train_classifier.py data/DisasterResponse.db models/classifier.pkl

  • Start Web app 6. Run cd app 7. Run python run.py 8. Open web browser and go to http://loclhost:3001 or http://0.0.0.0:3001

Screen Shot


comments powered by Disqus
All contents licensed under CC BY-NC-SA 4.0 ๆœฌ็ซ™ๆ‰€ๆœ‰ๅ†…ๅฎนๅŸบไบŽCC BY-NC-SA 4.0ๅ่ฎฎๅ‘ๅธƒ๏ผŒ่ฝฌ่ฝฝ้œ€่ฆ็ฝฒๅ
Built with Hugo
Theme Stack designed by Jimmy