Spaces:
Sleeping
Download README.md from basaktamer/NLP_Disaster_Tweets: direct link, hf CLI and curl.
- Browser
- Download file 2.32 kB
-
https://huggingface.co/spaces/basaktamer/NLP_Disaster_Tweets/resolve/main/README.md
- Command line
-
hf download hf://spaces/basaktamer/NLP_Disaster_Tweets/README.md
-
curl -L -o README.md https://huggingface.co/spaces/basaktamer/NLP_Disaster_Tweets/resolve/main/README.md
A newer version of the Streamlit SDK is available: 1.67.0
title: Disaster Tweet Classifier
emoji: π¨
colorFrom: red
colorTo: gray
sdk: streamlit
sdk_version: 1.22.0
python_version: '3.10'
app_file: app.py
pinned: false
license: mit
Disaster Tweet Classification using Deep Learning
This repository contains an end-to-end Natural Language Processing (NLP) project designed to distinguish between tweets regarding actual disasters and those using hyperbolic or casual language.
π Project Overview
In emergency situations, social media is a critical source of real-time information. However, the high volume of "noisy" data makes it difficult for relief agencies to filter for actionable reports. This project implements a Sequential Neural Network to automate this classification.
π οΈ Technical Stack
- Python Version: 3.10
- Model: Deep Neural Network (Keras/TensorFlow)
- Vectorization: CountVectorizer (Bag-of-Words)
- Deployment: Streamlit & Hugging Face Spaces
- Key Techniques: Early Stopping, Dropout, Validation Monitoring
π Dataset & Training
The model was trained on the Kaggle "Natural Language Processing with Disaster Tweets" dataset.
- Preprocessing: Text cleaning via
neattext, removal of URLs, and punctuation. - Optimization: Utilized
EarlyStoppingto restore the best weights from the point of minimum validation loss. - Performance: Achieved a validation accuracy of ~80%.
π§ Key Insights
The model demonstrates high sensitivity to emergency keywords (e.g., fire, flood, earthquake). Through analysis of the Confusion Matrix, it was observed that the "Bag-of-Words" approach occasionally flags metaphorical statements (e.g., "This exam was a disaster") as real emergencies. This highlights the importance of context-aware modeling in future iterations.
π Structure
app.py: Streamlit application script.disaster_model_v1.h5: Trained Keras model.vectorizer.pkl: Pickled CountVectorizer instance.requirements.txt: Environment dependencies.disaster_wordcloud.png: Visual representation of top emergency tokens.
π§ Local Setup (Python 3.10)
# Create environment
python -m venv venv
source venv/bin/activate # venv\Scripts\activate on Windows
# Install dependencies
pip install -r requirements.txt
# Run app
streamlit run app.py