Code Monkey home page Code Monkey logo

disasterresponsepipeline's Introduction

Disaster Response Pipeline Project

Intro Pic

Table of Contents

  1. Description
  2. Files Descriptions
  3. Getting Started
    1. Dependencies
    2. Installation

Description

Following a disaster, responsible agencies are inundated with a multitude of direct or social media communications at a time when disaster response organizations are least equipped to sift through and prioritize the most crucial messages. It is common for only one message in a thousand to hold relevance for disaster response professionals. In such situations, various organizations typically handle specific aspects of the problem. For instance, one organization focuses on providing clean water, another deals with clearing blocked roads, and yet another ensures the availability of medical supplies.

The project aim is to build a Natural Language Processing (NLP) model to categorize messages on a real time basis. The dataset contains pre-labelled tweet and messages from real-life disaster events.

This project is divided in the following key sections:

  1. Processing data, building an ETL pipeline to extract data from source, clean the data and save them in a SQLite DB
  2. Build a machine learning pipeline to train a model that can classify text message in various categories
  3. Run a web app which can show model results in real time

Files Descriptions

The files structure is arranged as below:

- README.md: read me file
- requirement.txt: dependencies list
- workspace
	- \app
		- run.py: flask file to run the app
		- \templates
			- master.html: main page of the web application 
			- go.html: result web page
	- \data
		- disaster_categories.csv: categories dataset
		- disaster_messages.csv: messages dataset
		- process_data.py: ETL process
	- \models
		- train_classifier.py: ML & NLP pipeline code

Getting Started

Dependencies

  • Python 3.6+
  • Machine Learning Libraries: NumPy, SciPy, Pandas, Sciki-Learn
  • Natural Language Process Libraries: NLTK
  • SQLlite Database Libraqries: SQLalchemy
  • Web App and Data Visualization: Flask, Plotly

Installation

  1. Clone the git repository:

git clone https://github.com/eljandoubi/DisasterResponsePipeline.git

  1. Change directory

cd DisasterResponsePipeline

  1. Create conda environment

conda create -n "DisasterResponsePipeline" python=3.6

  1. Install dependencies

pip install -r requirements.txt

  1. You can run the following commands in the project's directory to set up the database, train model and save the model.

    • To run ETL pipeline to clean data and store the processed data in the database

      python data/process_data.py data/disaster_messages.csv data/disaster_categories.csv data/disaster_response_db.db

    • To run the ML pipeline that loads data from DB, trains classifier and saves the classifier as a pickle file

      python models/train_classifier.py data/disaster_response_db.db models/classifier.pkl

  2. Run the following command in the app's directory to run your web app. python app/run.py

disasterresponsepipeline's People

Contributors

eljandoubi avatar

Watchers

 avatar  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.