This is a project that uses dataset of tagged disaster response messages to create a model that will then predict tags for messages.
The following subsections contain instructions to install the app on a local machine and start the application.
Use git clone https://github.com/Maple-Lazuli/Disaster-Message-Categorization.git in the terminal to make a copy on the local machine or navigate to the repository directly on github here and download the project as an archive.
In the root of the project directory, execute one of the following command sequences based on the OS in use:
-
Linux/macOS:
a. python3 -m pip install --user virtualenv
b. python3 -m venv env
-
Windows:
a. py -m pip install --user virtualenv
b. py -m venv env
Execute pip install -r requirements.txt in the terminal from the root project directory to have pip install all the dependencies used by this project.
The machine learning models are too large for github and need to be created. Run the following commands based on OS to process the data and create the models. (Linux users can alternatively use the start.sh script)
-
Linux/macOS:
a. source venv/bin/activate
b. python data/process_data.py data/disaster_messages.csv data/disaster_categories.csv data/DisasterResponse.db
c. python models/train_classifier.py data/DisasterResponse.db models/classifier.pkl
-
Windows:
a. venv/bin/activate.bat
b. python data/process_data.py data/disaster_messages.csv data/disaster_categories.csv data/DisasterResponse.db
c. python models/train_classifier.py data/DisasterResponse.db models/classifier.pkl
Navigate to the app directory by entering cd app in the terminal and execute the run.py in that directory by entering python run.py
After the app starts, it will listen at 0.0.0.0:3001/ and allow for messages to be entered and classified. Just navigate to that link by clicking it or pasting http://0.0.0.0:3001/ in the web browser.
The following sources were crucial to the development of this project
- Udacity - Udacity's Data Scientist course introduced me to Flask as well as variety of natural language processing and machine learning practices that were used in this project.
- Plotly - Plotly was used to render the graphs and data table seen on the overview page.
- scikit-learn - scikit-learn was used for the machine learning portions of this project.
- SQLAlchemy - SQLAlchemy was used to load the dataset after extraction and transformation.
- Natural Language Tool Kit (NTLK) - NLTK was used for the natural language processing portion of this project
- Numpy - Numpy was used for numerical computations in the extraction and transformation portion of this project
- Pandas - Pandas was used for data analysis in the exploratory, extraction, and transformation portions of this project.