Giter Site home page Giter Site logo

message-classification's Introduction

Disaster Response Pipeline Project - Multi-label Classification of Messages

Table of Contents

  1. Project Motivation
  2. Installation
  3. File Structure
  4. Usage Instructions
  5. Output
  6. Acknowledgements

Project Motivation

This project was created as part of Udacity's Data Scientist for Enterprise nanodegree.

The main objectives of this project were the following:

  • An ETL pipeline for loading data from csv files, transforming and cleaning the data, and finally storing it to an sqlite database.
  • A Machine learning pipeline to predict the categories of different messages recorded during natural disasters.
  • A web app that displays few visualisations of the data and classifies new input messages into multiple categories.

Installation

The code should run using any Python versions 3.*. I used python 3.6.

Libraries Used : numpy, pandas, sklearn, nltk, sqlalchemy, plotly, flask, bootstrap

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, contains code for visualization and prediction.

- data
|- disaster_categories.csv  # data to process
|- disaster_messages.csv  # data to process
|- process_data.py   # ETL Pipeline
|- DisasterResponse.db   # database to save clean data

- models
|- train_classifier.py   # Machine Learning Pipeline
|- classifier.pkl  # saved model

- notebooks   # contains Jupyter notebooks used to create ETL and ML Pipelines.
- README.md

Usage Instructions

1. Run the following commands in the project's root directory to set up your database and model.
    - To run 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 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's directory to run your web app.
    `python run.py`

3. Go to http://localhost:3001

Output

In the web app, user can input a new message and get the predicted categories.

alt text alt text

The web app also shows some visualizations for the training data in database.

alt text alt text alt text

Acknowledgements

Thanks to Figure Eight for the data, and Udacity for course material.

message-classification's People

Contributors

rehan-ahmar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.