{"id":19771969,"url":"https://github.com/danieldacosta/disaster-webapp","last_synced_at":"2025-04-30T17:33:06.152Z","repository":{"id":40752979,"uuid":"258366072","full_name":"DanielDaCosta/disaster-webapp","owner":"DanielDaCosta","description":"The project consists of a Multi-Label Text Classifier project using a Random Forest Classifier with MultiOuputClassifier from Sklearn.","archived":false,"fork":false,"pushed_at":"2024-10-29T03:00:13.000Z","size":11216,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T04:16:41.734Z","etag":null,"topics":["disaster-messages","random-forest-classifier","sklearn","webapplication"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DanielDaCosta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-24T00:40:41.000Z","updated_at":"2024-10-29T03:00:11.000Z","dependencies_parsed_at":"2024-10-29T04:26:52.360Z","dependency_job_id":null,"html_url":"https://github.com/DanielDaCosta/disaster-webapp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielDaCosta%2Fdisaster-webapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielDaCosta%2Fdisaster-webapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielDaCosta%2Fdisaster-webapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielDaCosta%2Fdisaster-webapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanielDaCosta","download_url":"https://codeload.github.com/DanielDaCosta/disaster-webapp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224219691,"owners_count":17275477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["disaster-messages","random-forest-classifier","sklearn","webapplication"],"created_at":"2024-11-12T05:04:57.329Z","updated_at":"2024-11-12T05:04:57.894Z","avatar_url":"https://github.com/DanielDaCosta.png","language":"Python","readme":"# Multi Label Text Classifier Project\nThe project consists of a Multi-Label Text Classifier project using a Random Forest Classifier with MultiOuputClassifier from Scikit-learn.\n\nThe dataset consists of disaster messages that are classified into 36 different classes. The model aims to classify an input message into these different classes.\n\nA Web Application was developed, allowing you to analyze the dataset and write your own message to be classified.\n\n## Dataset\nThe dataset consists of disaster messages classified into 36 different classes. The dataset is highly imbalanced, with different distributions for each class. To reduce this problem, a class-weighted approach was used, where we made the classifier aware of the imbalanced data by incorporating the weights of classes into the cost function.\n\nIn the **Random Forest** model, the parameter *class_weight* was set to *'balanced'*, using the values of y to automatically adjust weights inversely proportional to class frequencies in the input data\n\n## Web Application\n\u003cimg src=\"Images/Image_1.png\" width=\"1000\"\u003e\n\u003cimg src=\"Images/Image_2.png\" width=\"1000\"\u003e\n\n**Message Classifier**\n\u003cimg src=\"Images/Image_3.png\" width=\"1000\"\u003e\n\n## Usage\n\n- data/ : ETL folder. Data preparation. To load the data from scratch:\n\n```python process_data.py disaster_messages.csv disaster_categories.csv DisasterResponse.db ```\n\n- models/ : Machine Learning models. To train the model:\n\n```python train_classifier.py ../data/DisasterResponse.db classifier.pkl```\n\n- app/ : Contains the scripts for the web application. In order to run de application go into the app/ folder an run the command:\n\n``` python run.py```\n\n### File Structure\n\n```\n.\n├── LICENSE\n├── README.md\n├── app\n│   ├── run.py # Flask file that runs app\n│   └── templates\n│       ├── go.html # classification result page of web app\n│       └── master.html # main page of web app\n├── data\n│   ├── DisasterResponse.db # database to save clean data to\n│   ├── disaster_categories.csv # data to process\n│   ├── disaster_messages.csv # data to process\n│   └── process_data.py\n├── models\n│   ├── classifier.pkl # saved model \n│   └── train_classifier.py\n└── requirements.txt\n```\n\n## Installation\n\n```\npip install -r requirements.py\n```\n## Development\nOther models of architectures were also explored. You can check the solution for the same problem using **RNN with keras** in this other GitHub Repo: [Multi-Label Text classification problem with Keras](https://github.com/DanielDaCosta/RNN-Keras/blob/master/ML-Pipeline-RNN.ipynb)\n\n## Acknowledgments and References\nSpecial thanks to [Figure Eight](https://appen.com/) for the dataset.\n- https://towardsdatascience.com/another-twitter-sentiment-analysis-bb5b01ebad90\n- https://www.kaggle.com/gunesevitan/nlp-with-disaster-tweets-eda-cleaning-and-bert#3.-Target-and-N-grams\n- https://towardsdatascience.com/accuracy-precision-recall-or-f1-331fb37c5cb9\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieldacosta%2Fdisaster-webapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanieldacosta%2Fdisaster-webapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieldacosta%2Fdisaster-webapp/lists"}