Skip to content

hellogaga/Disaster_Response_Message_Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A Disaster Message Classification Tool

The location of this Github repo is here.

Table of contents

Installation

The package is based on the following package. The project can be compatible with lower or higher versions of the above packages. However, a detailed test is not carried out. Users might find problems of incompatibilities when executing the code. Please raise a issue when having a problem.

  • Python: 3.8.5
  • pandas: 1.1.1
  • numpy: 1.19.1
  • scikit-learn: 0.23.2
  • pandas: 1.1.3
  • plotly: 4.11.0
  • flask: 1.1.2

File Structure

  • app
    • template
      • 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 (file to process data)
    • DataResponse.db (database to save clean data to)
  • models
    • train_classifier.py (training and saving model)
    • classifier.pkl (saved model. It is NOT uploaded to Github due to the size. However, it can be downloaded from the developer's dropbox, which is available before 2020-11-30.Use this link to download.)
  • README.md

How to Use the Package.

  • Step 1: Use git clone or web download to download all the files into a local place in your machine.
  • Step 2: Navigate to downloaded folder.
  • Step 3: Data Process that cleans the raw data and save a clean database. Can be executed through:
 python data/process_data.py data/disaster_messages.csv data/disaster_categories.csv data/DisasterResponse.db 
  • Step 4: Train the model. Can be executed through:
 python models/train_classifier.py data/DisasterResponse.db models/classifier.pkl 
  • Step 5: Navigate to the folder of run.py
  • Step 6: Run the web application. The app will be rendered in a local host. Can be executed through:
 python run.py 

NOTE1: The package is tested on a local machine with Windows 10 as the operation system. Users with Linux or Mac system might have problems in the file locations. Please go to process_data.py and train_classifier.py and revise the file locations accordingly.
NOTE2: By default, the app will be rendered in a local host. In cloud-based system, such as Udacity's online workspace, revise the line as app.run(host='0.0.0.0', port=3001, debug=True) in run.py.

Project Motivation

This project is motived by the Udacity Data Science Nanodegree project. A disaster-related database was provided by Figure Eight. I am supposed to train a model that can classify a coming text message. It is a multiple output classification problem.

Results

The main results of the project is the trained model in the 'models' folder. The main outcome of the project is a web application which can be used to classify incoming messages.

Licensing, Authors, Acknowledgements

The code released subjects to the MIT license. The author appreciate the data provided by the Figure Eight and the code structure from Udacity.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors