Giter VIP home page Giter VIP logo

disaster-response's Introduction

Disaster Response Pipeline Project

Table of Contents

  1. Goal
  2. Description
  3. Getting Started
    1. Dependencies
    2. File Structure
    3. Installing
    4. Instructions
    5. Deployment!
  4. Screenshots
  5. Acknowledgement
  6. License

Goal

This project is designed to showcase the data and ML capabilities to deliver the solution for real-world problems, In this project, we collected the labelled data of the disaster relief agency and we create a beta app to categorise this event so that we can send messages to the appropriate disaster relief agency. 

Description

This is built on top of a Natural Language Processing (NLP) trained model, and training based on the various prelabed dataset. This project is part of Data Science Nanodegree Program by Udacity in collaboration with Figure Eight.

Projects includes

  1. Data pipeline to clean, balance, select the relavent entities.
  2. Saved the output of the data pipeline to the SQLite database.
  3. Used processed data, to create ML model for the disaster relief.
  4. Expose the model with the help of web app to classify messages in real time.

Getting Started

Dependencies

  • Python 3.8
  • Notebook: Jupyter Notebook
  • SQLite database libraries: SQLalchemy
  • Data analysis libraries: Pandas, Numpy
  • Machine Learning libraries: Scikit-Learn
  • Natural Language Processing libraries: NLTK
  • Web App and Data Visualization libraries: Flask, Plotly

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.       # preprocessing of csv files
|- DisasterResponse.db   # database to save clean data

- models
|- train_classifier.py
|- classifier.joblib  # saved model 

- notebook
|- etl_pipeline.ipynb  # Note book of the ELT work
|- ml_pipeline.ipynb  # Note book of ML work

- sceenshots
|- 1.png
|- 2.png
|- 3.png

- README.md
- LICENSE

Installing

  • Clone the repository.
    git clone https://github.com/iamkamleshrangi/disaster-response.git
    
  • Proper conda/virtualenv enviroment ready with python3+.
  • Install the necessary libraries provided in requirements.txt file.
  • Follow the instructions provided in the next section.

Instructions

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://0.0.0.0:3001/

Deployment

production: To deploy the project live, you need a cloud service provider like AWS, then run the app.py on the server and access the service with the help of server_public_ip:3001 url, however I suggest to run app on the nginx as server and postgres as database.

development: You can run it based on your requirement.

Screenshots!

  1. The main page shows some graphs about training dataset

Main Page

  1. Input as an example of a message

Sample Input

  1. Click Classify Message, the message will be categorized and the belonging message categories will highlighted in green.

Sample Prediction

Acknowledgements

  • Udacity for proposing this project as part of the Data Science Nanodegree Program.
  • Figure Eight for providing the data.

License

License: GPLv3

disaster-response's People

Contributors

iamkamleshrangi avatar mend-bolt-for-github[bot] avatar

Stargazers

 avatar

Watchers

 avatar

disaster-response's Issues

CVE-2020-11022 (Medium) detected in jquery-3.3.1.min.js

CVE-2020-11022 - Medium Severity Vulnerability

Vulnerable Library - jquery-3.3.1.min.js

JavaScript library for DOM operations

Library home page: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js

Path to dependency file: /app/templates/master.html

Path to vulnerable library: /app/templates/master.html

Dependency Hierarchy:

  • jquery-3.3.1.min.js (Vulnerable Library)

Found in HEAD commit: 26fc6691585241f2b7de07014fe69233c6e9d46f

Found in base branch: main

Vulnerability Details

In jQuery versions greater than or equal to 1.2 and before 3.5.0, passing HTML from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code. This problem is patched in jQuery 3.5.0.

Publish Date: 2020-04-29

URL: CVE-2020-11022

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11022

Release Date: 2020-04-29

Fix Resolution: jQuery - 3.5.0


Step up your Open Source Security Game with Mend here

CVE-2020-23064 (Medium) detected in jquery-3.3.1.min.js - autoclosed

CVE-2020-23064 - Medium Severity Vulnerability

Vulnerable Library - jquery-3.3.1.min.js

JavaScript library for DOM operations

Library home page: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js

Path to dependency file: /app/templates/master.html

Path to vulnerable library: /app/templates/master.html

Dependency Hierarchy:

  • jquery-3.3.1.min.js (Vulnerable Library)

Found in HEAD commit: 26fc6691585241f2b7de07014fe69233c6e9d46f

Found in base branch: main

Vulnerability Details

Cross Site Scripting vulnerability in jQuery 2.2.0 through 3.x before 3.5.0 allows a remote attacker to execute arbitrary code via the element.

Publish Date: 2023-06-26

URL: CVE-2020-23064

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/

Release Date: 2023-06-26

Fix Resolution: jquery - 3.5.0


Step up your Open Source Security Game with Mend here

CVE-2019-11358 (Medium) detected in jquery-3.3.1.min.js

CVE-2019-11358 - Medium Severity Vulnerability

Vulnerable Library - jquery-3.3.1.min.js

JavaScript library for DOM operations

Library home page: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js

Path to dependency file: /app/templates/master.html

Path to vulnerable library: /app/templates/master.html

Dependency Hierarchy:

  • jquery-3.3.1.min.js (Vulnerable Library)

Found in HEAD commit: 26fc6691585241f2b7de07014fe69233c6e9d46f

Found in base branch: main

Vulnerability Details

jQuery before 3.4.0, as used in Drupal, Backdrop CMS, and other products, mishandles jQuery.extend(true, {}, ...) because of Object.prototype pollution. If an unsanitized source object contained an enumerable proto property, it could extend the native Object.prototype.

Publish Date: 2019-04-20

URL: CVE-2019-11358

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11358

Release Date: 2019-04-20

Fix Resolution: jquery - 3.4.0


Step up your Open Source Security Game with Mend here

CVE-2020-11023 (Medium) detected in jquery-3.3.1.min.js

CVE-2020-11023 - Medium Severity Vulnerability

Vulnerable Library - jquery-3.3.1.min.js

JavaScript library for DOM operations

Library home page: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js

Path to dependency file: /app/templates/master.html

Path to vulnerable library: /app/templates/master.html

Dependency Hierarchy:

  • jquery-3.3.1.min.js (Vulnerable Library)

Found in HEAD commit: 26fc6691585241f2b7de07014fe69233c6e9d46f

Found in base branch: main

Vulnerability Details

In jQuery versions greater than or equal to 1.0.3 and before 3.5.0, passing HTML containing elements from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code. This problem is patched in jQuery 3.5.0.

Publish Date: 2020-04-29

URL: CVE-2020-11023

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://github.com/jquery/jquery/security/advisories/GHSA-jpcq-cgw6-v4j6,https://github.com/rails/jquery-rails/blob/master/CHANGELOG.md#440

Release Date: 2020-04-29

Fix Resolution: jquery - 3.5.0;jquery-rails - 4.4.0


Step up your Open Source Security Game with Mend here

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.