Disaster messages have been used for any emergency situations in the world, people who need help or need to report disaster situations related to the environment, security, weather, etc. The project consists of a web app where the user can input a new message and get classification results in several categories (Floating, Military, Earthquake, etc.), classified by the machine learning model that I have trained.
$ pip install requirements.txt
-
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/disaster_project.db
- To run ML pipeline that trains classifier and saves
python models/train_classifier.py data/disaster_project.db models/classifier.pkl
- To run ETL pipeline that cleans data and stores in database
-
Run the following command in the app's directory to run your web app.
python app/run.py
-
Go to http://0.0.0.0:3001/
$ docker build . --tag img_disaster_project:latest &&
$ docker rm -f disaster_project &&
$ docker run -d -p 80:80 --name disaster_project img_disaster_project:latest &&
- app
- template
- master.html # main page of web app
- go.html # classification result page of web app
- run.py # Flask file that runs app
- template
- data
- disaster_categories.csv # data to process
- disaster_messages.csv # data to process
- process_data.py # clean, process and save data for training the machine learning model
- disaster_project.db # database to save clean data to
- models
- train_classifier.py # train model
- classifier.pkl # saved model
- README.md
This project lives under MIT License. See LICENSE for more details. © - Paulo Mota