AI-powered Real-Time Disaster Tweet Classification & Alerting System
- 🌆 SDG 11 – Sustainable Cities and Communities: Safer, more resilient cities with disaster-preparedness tools.
- 🌍 SDG 13 – Climate Action: Timely action against climate-related disasters through early detection.
During natural disasters or humanitarian crises, timely information is critical.
- Twitter (X) provides real-time updates but is often noisy or metaphorical.
- Distinguishing real disaster tweets from irrelevant chatter is difficult.
Challenge: Automatically detect genuine disaster-related tweets to assist responders, NGOs, and media in rapid situational awareness.
ResQTweet leverages NLP + ML + summarization to:
- Preprocess and clean tweets.
- Extract TF-IDF features from text and keywords.
- Classify tweets as disaster or non-disaster using ML models.
- Summarize disaster tweets with HuggingFace DistilBART for concise alerts.
- Real-time Detection: Classifies tweets instantly with a lightweight ML model.
- Alert Generation: Produces human-readable, concise alerts.
- Keyword + Semantic Understanding: Captures context beyond simple keyword matches.
- Scalable & Extensible: Future multilingual support for global crises.
| Layer | Tools & Frameworks |
|---|---|
| Programming | Python |
| Data Handling | Pandas, NumPy |
| ML Models | Scikit-learn (Logistic Regression, Naïve Bayes) |
| NLP | Hugging Face Transformers (DistilBART) |
| Vectorization | TF-IDF (unigrams + bigrams) |
| Visualization | Matplotlib, Seaborn |
| Deployment (Future) | Streamlit / Dash + Twitter API |
| Environment | Google Colab |
Algorithms Evaluated: Multinomial Naïve Bayes, Complement Naïve Bayes, Logistic Regression
Features: TF-IDF vectors (text + keyword) + binary keyword flag
| Model | Accuracy | Precision | Recall | F1-score |
|---|---|---|---|---|
| MultinomialNB | 81.29% | 0.816 | 0.728 | 0.770 |
| ComplementNB | 80.70% | 0.785 | 0.758 | 0.771 |
| Logistic Regression | 81.48% | 0.804 | 0.752 | 0.777 |
📌 Best model → Logistic Regression (balanced accuracy & F1).
┌─────────────────────────────┐
│ Load tweets_data.csv │
│ │
└─────────────┬───────────────┘
│
┌──────────▼─────────────┐
│ Preprocessing │
│ - Clean text & |
| keyword columns │
│ - Remove URLs, |
| mentions,hashtags,|
| non-alphabetic chars │
│ - Lowercase all text │
│ - Remove extra spaces │
│ - Handle NaNs │
│ - Drop irrelevant cols│
└──────────┬─────────────┘
│
┌─────────────────┴──────────────────┐
│ │
┌────────▼─────────┐ ┌────────▼─────────┐
│ TF-IDF on text │ │ TF-IDF on keyword│
│(unigrams+bigrams)│ │ (unigrams, all) │
└────────┬─────────┘ └────────┬─────────┘
│ │
└────────────────┬───────────────────┘
▼
┌───────────────────────────────────────────────┐
│ Combine Features (hstack) │
│ [text TF-IDF + keyword TF-IDF + keyword_flag] │
└───────────────────┬───────────────────────────┘
│
┌────────────▼───────────────┐
│ Split train/validation │
│ (stratified 80-20 split) │
└───────────┬────────────────┘
│
┌───────────▼───────────────┐
│ Train Model │
│ LogisticRegression │
│ MultinomialNB |
| ComplementNB │
└───────────┬───────────────┘
│
┌───────────▼───────────────┐
│ Evaluate Model │
│ Accuracy / F1-score / │
│ Confusion Matrix │
└───────────┬───────────────┘
│
┌───────────▼───────────────┐
│ Save / Select Best Model│
│ LogisticRegression chosen │
└───────────┬───────────────┘
│
┌───────────▼───────────────┐
│ Predict on New Tweets │
│ (raw text input) │
└───────────┬───────────────┘
│
┌───────────▼───────────────┐
│ Generate Alerts │
│ - Summarize if disaster │
│ - Return 🚨 or ✅ │
└───────────────────────────┘
disaster_alert_system("Earthquake of 6.1 magnitude hits California.")
# 🚨 DISASTER ALERT: Earthquake of 6.1 magnitude hits California.
disaster_alert_system("Huge flood of messages in my inbox 😂")
# ✅ No disaster detected.
disaster_alert_system("Explosion at chemical plant in Houston, authorities evacuating nearby areas.")
# 🚨 DISASTER ALERT: Explosion at chemical plant in Houston, authorities evacuating nearby areas.
ResQTweet/
│── Code/ # Code (.ipynb) & Dataset (tweets_data.csv)
│ ├── ResQTweet.ipynb
│ ├── tweets_data.csv
│── WriteUp/ # Core scripts
│ ├── WriteUp.md
│ ├── Word Documet
│
│── requirements.txt # Dependencies
│── README.md # Project documentation
🏛️ Governments: Faster disaster response & prioritization
🆘 NGOs: Smarter humanitarian aid allocation
📰 Media: Early verification of breaking crises
🌎 Future: Multilingual expansion for global early-warning system
Vaibhavi Srivastava
🔗 Github : archangel2006
📅 Hackathon : Global AI Buildathon 2025