Giter VIP home page Giter VIP logo

disasterresponse's Introduction

Udacity - Disaster Response Pipeline

This repository contains ETL and NLP pipelines as well as a Flask app that I have created as a part of Udacity's Data Science Nanodegree.

Table of Contents

Installation
Project Motivation
File Descriptions
Results
Licensing & Acknowledgements

Installation

The following libraries have been installed alongside a standard Anaconda distribution of Python:

pandas
numpy
nltk
sqlalchemy
sklearn
sys
re
flask
langdetect
iso639
plotly
json

The code should run with no issues using Python 3.6.7.

Make sure that all your packages are up-to-date if you want to use my code!

Project Motivation

This code has been written to complete an assignment which forms a part of Udacity's Data Science Nanodegree.

The aim of the project was threefold:

  • to build an ETL pipeline - combine text messages related to disasters with their labels/categories
  • to create an NLP pipeline - clean the text, extract features, perform classification, evaluate the model and save it
  • to prepare a Flask app - visualise the characteristics of the training data; allow any user to type a message and run the model to check how it would be classified

Please note that the repository DOES NOT contain the pickled model needed to make predictions in the Flask app! It has not been added due to its large size and GitHub's restrictions.

File Descriptions

Apart from the README file, there is a number of files in this repository:

- 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 # ETL pipeline
|- discover_languages.py # script to detect languages 
|- InsertDatabaseName.db # database where tables are stored 

- models
|- train_classifier.py # NLP pipeline

- README.md

Results

To prepare all files needed by the app, run the commands in the following order:

# In the "data" folder:
python process_data.py disaster_messages.csv disaster_categories.csv DisasterResponse.db
python discover_languages.py

# In the "models" folder:
python train_classifier.py ../data/DisasterResponse.db classifier.pkl

Your data is now ready and your pickled model has been created!

Finally, you can run the app!

Licensing & Acknowledgements

Feel free to use the code here as you would like!

disasterresponse's People

Contributors

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