Complete Technical Paper Content โ Ai Crisis Detection
1. Executive Abstract, Problem Formulation & Background
Pangram is AI content detection software developed by Pangram Labs. Its text detector classifies passages as human-written, AI-assisted or AI-generated. The company released Pangram 4 in July 2026. It also provides an image detector. Independent studies of earlier versions found low error rates, but also found that some AI-generated texts escaped detection when prompted to imitate human authors. For Pangram 4, the company reported a false positive rate of 0.0041%, approximately one in 24,000, on an English-language benchmark. Its use in education and publishing has prompted debate about whether detector results provide sufficient evidence of undisclosed AI use.
Pangram Labs trains its detector on human writing paired with AI-generated texts matched by topic, length and tone. To reduce false positives, it identifies human texts the model has misclassified and adds them to the training data alongside corresponding AI examples. Pangram 4 uses a mixture of experts architecture to classify individual tokens, or units of text, then groups the results into labeled passages. Pangram 4 analyzes prose of at least 50 words and reports how much and which parts of the text it classifies as human-written, AI-assisted or AI-generated. The company distinguishes its trained classifier from detection methods based on perplexity, which measure how predictable a text is to a language model. Its confidence labels do not give a calibrated probability that a classification is correct.
In tests published on July 15, 2026, Epoch AI found that Pangram correctly classified all 495 human-written passages and all 297 AI passages generated from basic prompts. Pangram failed to classify 30 of 297 passages imitating particular human authors as fully AI-generated, a rate of 10.1%. The evaluation counted a "Mixed" verdict on wholly AI-generated text as a missed detection. In July 2026, before the release of Pangram 4, the Reuters Institute for the Study of Journalism reported that Pangram had labeled 86% of 588 AI-generated samples compiled by researcher Alexios Mantzarlis as human-written. The samples used techniques such as rhyme, repetition and archaic language to evade detection. An August 2026 preprint by Jonathan A. Karr Jr. and colleagues at the University of Notre Dame tested Pangram 3.2 on academic abstracts. After the rewrites were processed with the humanizer Undetectable AI, Pangram missed more than 96% at the threshold used in the study. The authors cautioned against treating detector scores as sufficient evidence of academic misconduct.
In statistics and machine learning, leakage (also known as data leakage or target leakage) refers to the use of information during model training that would not be available at prediction time. This results in overly optimistic performance estimates, as the model appears to perform better during evaluation than it actually would in a production environment. Leakage is often subtle and indirect, making it difficult to detect and eliminate. It can lead a statistician or modeler to select a suboptimal model, which may be outperformed by a leakage-free alternative.
Premature featurization; leaking from premature featurization before Cross-validation/Train/Test split (must fit min-max scaling/ngrams/etc on only the train split, then transform the test set) Duplicate rows between train/validation/test (for example, oversampling a dataset to pad its size before splitting; or, different rotations/augmentations of a single image; bootstrap sampling before splitting; or duplicating rows to up sample the minority class) Non-independent and identically distributed random (non-IID) data Time leakage (for example, splitting a time-series dataset randomly instead of newer data in test set using a train/test split or rolling-origin cross-validation) Group leakageโnot including a grouping split column (for example, Andrew Ng's group had 100k x-rays of 30k patients, meaning ~3 images per patient. The paper used random splitting instead of ensuring that all images of a patient were in the same split. Hence the model partially memorized the patients instead of learning to recognize pneumonia in chest x-rays.) A 2023 review found data leakage to be "a widespread failure mode in machine-learning (ML)-based science", having affected at least 294 academic publications across 17 disciplines, and causing a potential reproducibility crisis.
๐ง Crisis Signal Detector Real-Time Mental Health Crisis Detection using Fine-Tuned BERT An AI-powered Natural Language Processing (NLP) application that detects crisis-related text using a fine-tuned BERT (Bidirectional Encoder Representations from Transformers) model and provides real-time predictions through an interactive Streamlit dashboard deployed on Hugging Face Spaces . ๐ Live Demo ๐ Live Demo: Try the Crisis Signal Detector ๐ Table of Contents Overview Problem Statement Features Dashboard Preview System Architecture Model Workflow Dataset Methodology Technology Stack Repository Structure Installation Usage Project Documentation Results Challenges Faced Model Weights Future Improvements Author License ๐ Overview Crisis Signal Detector is a Natural Language Processing (NLP) application that identifies whether an input text contains a potential crisis signal. The project leverages a fine-tuned BERT model from Hugging Face Transformers for binary text classification and provides predictions through an intuitive Streamlit web interface. This project was developed as the final capstone project during the NAVTTC-sponsored Artificial Intelligence & Machine Learning Training Program conducted at Corvit Systems Bahawalpur . The primary objective of this project is to demonstrate how transformer-based NLP models can assist in the early detection of crisis-related text, providing a foundation for intelligent mental health support systems. ๐ฏ Problem Statement Mental health issues have become an increasing global concern, and identifying crisis-related language at an early stage can help support timely intervention. The objective of this project is to build an AI-powered system capable of classifying textual input into one of two categories: Crisis Signal Normal Text using a fine-tuned BERT model trained for binary text classification. โจ Features ๐น Real-time crisis text detection ๐น Fine-tuned BERT model ๐น Binary text classification ๐น Confidence score prediction ๐น Interactive Streamlit interface ๐น Hugging Face deployment ๐น Docker support ๐น Clean and responsive dashboard ๐น Fast inference using Transformer architecture ๐ธ Dashboard Preview ๐๏ธ System Architecture ๐ง Model Workflow User Input โ โผ Text Preprocessing โ โผ BERT Tokenizer โ โผ Fine-Tuned BERT Model โ โผ Softmax Layer โ โผ Binary Classification โ โผ Prediction + Confidence Score ๐ Dataset The dataset used for this project was obtained from Kaggle . Dataset Link Dataset: Suicide Watch Dataset (Kaggle) Dataset Details Source: Kaggle Task: Binary Text Classification Original Dataset Size: 130,000+ text samples Classes: Crisis Signal Normal Text Training Dataset Although the original dataset contains over 130,000 samples , the model was fine-tuned using a subset of 10,000 samples . This decision was made because the project was developed on hardware with limited computational resources during the NAVTTC training program. Using a carefully selected subset allowed efficient training while still producing reliable predictions for the prototype application. ๐ฌ Methodology The project followed the complete Machine Learning and Deep Learning pipeline: Dataset Collection Data Cleaning Exploratory Data Analysis (EDA) Text Preprocessing Tokenization using the BERT Tokenizer Fine-tuning the pre-trained BERT model Model Evaluation Deployment using Streamlit on Hugging Face Spaces The trained model predicts whether an input sentence represents a crisis signal and displays the prediction together with a confidence score. ๐ Technology Stack Category Technologies Programming Language Python Deep Learning Framework PyTorch Natural Language Processing Hugging Face Transformers Pre-trained Model BERT Data Processing Pandas, NumPy Data Visualization Matplotlib, Seaborn Web Framework Streamlit Deployment Hugging Face Spaces Containerization Docker Version Control Git & GitHub ๐ Repository Structure crisis-signal-detector/ โ โโโ app.py โโโ requirements.txt โโโ Dockerfile โโโ README.md โโโ LICENSE โ โโโ model/ โ โโโ config.json โ โโโ tokenizer.json โ โโโ tokenizer_config.json โ โโโ (model.safetensors not included) โ โโโ notebook/ โ โโโ training.ipynb โ โโโ presentation/ โ โโโ CrisisSignalDetector.pdf โ โโโ screenshots/ โโโ dashboard.png โโโ architecture.png Note: The trained model weights ( model.safetensors ) are not included in this repository because they exceed GitHub's file size limit. The complete application is deployed and available on Hugging Face Spaces. โ๏ธ Installation Clone the repository git clone https://github.com/mshakeelrasheed/crisis-signal-detector.git Navigate to the project directory cd crisis-signal-detector Install dependencies pip install -r requirements.txt Run the application streamlit run app.py ๐ Usage Launch the Streamlit application. Enter any text into the input field. Click Run Prediction . The application will display: Predicted Class (Crisis / Normal) Confidence Score Probability Visualization ๐ Project Documentation This repository contains: โ Source Code โ Training Notebook โ Project Presentation โ Model Configuration Files โ Docker Configuration โ Dashboard Screenshots โ System Architecture โ Deployment Resources ๐ Results The fine-tuned BERT model successfully performs binary text classification to identify crisis-related language. Output Includes โ Crisis / Normal Classification โ Confidence Score โ Probability Visualization โ Real-time Prediction The application has been successfully deployed on Hugging Face Spaces , allowing users to test the model through an interactive web interface. โ ๏ธ Challenges Faced During the development of this project, several technical challenges were encountered: Working with a transformer-based BERT model on limited hardware resources. Training on a subset of the original dataset to reduce computational requirements. Managing the large size of the trained model during deployment. GitHub's file size limitation prevented uploading the model.safetensors file. Configuring and deploying the application successfully on Hugging Face Spaces. Organizing the repository to provide clear documentation while keeping it lightweight. These challenges were addressed through dataset optimization, efficient deployment practices, and proper project organization. โ ๏ธ Model Weights The trained model weights ( model.safetensors ) are not included in this repository because they exceed GitHub's maximum file size limit. To explore the complete application, please use the deployed version on Hugging Face Spaces . ๐ฎ Future Improvements Future enhancements planned for this project include: ๐ Multi-language crisis detection ๐ค Support for additional transformer models ๐ฑ Mobile application integration โ๏ธ REST API using FastAPI ๐ง Explainable AI (XAI) for prediction interpretation ๐ Training on the complete dataset using high-performance hardware ๐ Continuous model retraining with updated datasets ๐ Performance monitoring and model versioning ๐จโ๐ป Author Muhammad Shakeel Rasheed BS Artificial Intelligence Islamia University Bahawalpur Passionate about Artificial Intelligence, Machine Learning, Deep Learning, Natural Language Processing, and AI Automation. Connect with me GitHub: https://github.com/mshakeelrasheed LinkedIn: https://www.linkedin.com/in/muhammad-shakeel-rasheed ๐ License This project is licensed under the MIT License . Feel free to use, modify, and distribute this project in accordance with the license terms. โญ If you found this project useful, consider giving it a Star! Thank you for visiting this repository.
An AI-powered Natural Language Processing (NLP) application that detects crisis-related text using a fine-tuned BERT (Bidirectional Encoder Representations from Transformers) model and provides real-time predictions through an interactive Streamlit dashboard deployed on Hugging Face Spaces .
2. Related Work, Literature Survey & Algorithmic Foundations
Crisis Signal Detector is a Natural Language Processing (NLP) application that identifies whether an input text contains a potential crisis signal.
The project leverages a fine-tuned BERT model from Hugging Face Transformers for binary text classification and provides predictions through an intuitive Streamlit web interface.
This project was developed as the final capstone project during the NAVTTC-sponsored Artificial Intelligence & Machine Learning Training Program conducted at Corvit Systems Bahawalpur .
The primary objective of this project is to demonstrate how transformer-based NLP models can assist in the early detection of crisis-related text, providing a foundation for intelligent mental health support systems.
Mental health issues have become an increasing global concern, and identifying crisis-related language at an early stage can help support timely intervention.
The objective of this project is to build an AI-powered system capable of classifying textual input into one of two categories:
User Input โ โผ Text Preprocessing โ โผ BERT Tokenizer โ โผ Fine-Tuned BERT Model โ โผ Softmax Layer โ โผ Binary Classification โ โผ Prediction + Confidence Score
3. Dataset Ingestion, Preprocessing & Stochastic Augmentations
Although the original dataset contains over 130,000 samples , the model was fine-tuned using a subset of 10,000 samples .
This decision was made because the project was developed on hardware with limited computational resources during the NAVTTC training program. Using a carefully selected subset allowed efficient training while still producing reliable predictions for the prototype application.
The trained model predicts whether an input sentence represents a crisis signal and displays the prediction together with a confidence score.
crisis-signal-detector/ โ โโโ app.py โโโ requirements.txt โโโ Dockerfile โโโ README.md โโโ LICENSE โ โโโ model/ โ โโโ config.json โ โโโ tokenizer.json โ โโโ tokenizer_config.json โ โโโ (model.safetensors not included) โ โโโ notebook/ โ โโโ training.ipynb โ โโโ presentation/ โ โโโ CrisisSignalDetector.pdf โ โโโ screenshots/ โโโ dashboard.png โโโ architecture.png
Note: The trained model weights ( model.safetensors ) are not included in this repository because they exceed GitHub's file size limit. The complete application is deployed and available on Hugging Face Spaces.
The fine-tuned BERT model successfully performs binary text classification to identify crisis-related language.
The application has been successfully deployed on Hugging Face Spaces , allowing users to test the model through an interactive web interface.
4. Neural Network Backbone, Layer Specifications & Loss Formulations
During the development of this project, several technical challenges were encountered:
These challenges were addressed through dataset optimization, efficient deployment practices, and proper project organization.
The trained model weights ( model.safetensors ) are not included in this repository because they exceed GitHub's maximum file size limit.
To explore the complete application, please use the deployed version on Hugging Face Spaces .
Passionate about Artificial Intelligence, Machine Learning, Deep Learning, Natural Language Processing, and AI Automation.
Feel free to use, modify, and distribute this project in accordance with the license terms.
AI-powered NLP application for real-time crisis signal detection using a fine-tuned BERT model.
5. Training Protocol, Convergence Behavior & Experimental Evaluation
CrisisSignalDetector with NLP Real-Time Crisis Detection in Social Media Using Machine Learning ๐ Project Overview CrisisSignalDetector is a machine learning system that identifies crisis-related tweets in real-time social media streams. The project demonstrates a complete ML pipeline from data preprocessing through model evaluation, comparing 6 different algorithms to determine the optimal solution for interpretability and accuracy. Key Achievement: Implemented 6 ML models and achieved evidence-based decision making instead of speculation about model performance. Real-World Application Use Case: Monitor social media during disasters and alert emergency responders Impact: Route rescue resources efficiently, potentially save lives Challenge: Balance accuracy (detecting all crises) with interpretability (understanding why the system flagged a tweet) ๐ฏ Technical Highlights Models Implemented & Tested Model Accuracy Precision Recall F1-Score Interpretability Notes Rule-Based (Ours) 61.16% 56.40% 42.20% 0.4828 100% โ Chosen for interpretability Logistic Regression 80.78% 82.57% 70.03% 0.7579 70% Best balance SVM 80.69% 84.09% 67.89% 0.7513 50% High precision Random Forest 79.77% 83.40% 66.06% 0.7372 40% Ensemble voting LSTM 78.28% 77.84% 69.11% 0.7322 20% Deep learning BERT 83.76% 87.47% 72.58% 0.7933 10% Pre-trained transformer Dataset Source: Kaggle Disaster Tweets Dataset Size: 7,613 tweets (43% crisis, 57% non-crisis) Train/Test: 70/30 split (5,329 train, 2,284 test) Preprocessing: URL removal, lowercasing, special character handling Architecture Input: Raw Tweet Text โ Text Preprocessing (clean, lowercase, remove noise) โ Feature Extraction (signal words, TF-IDF vectorization) โ ML Models (6 different algorithms) โ Evaluation (accuracy, precision, recall, F1-score) โ Output: Crisis/Non-Crisis with Confidence Score ๐ก Key Learning: Why Rule-Based Won Despite achieving only 61% accuracy, the rule-based approach was optimal because: 100% Interpretability - Can explain every decision to non-technical stakeholders 7-Week Timeline - Completed in time vs BERT needs 12+ hours training No GPU Required - Works on standard hardware Easy to Update - Add/remove signal words without retraining Trust in Safety-Critical Systems - Emergency responders need to understand why system flagged a tweet Key Insight: Good ML is engineering tradeoffs, not just maximizing accuracy. ๐ Project Structure crisis-signal-detector-nlp/ โโโ README.md # Project documentation โโโ RESULTS.md # Complete results summary โโโ HOW_IT_WORKS.md # Technical explanation โ โโโ data/ โ โโโ X_train_clean.csv # Training tweets (5,329) โ โโโ y_train.csv # Training labels โ โโโ X_test_clean.csv # Test tweets (2,284) โ โโโ y_test.csv # Test labels โ โโโ signal_words_dict.json # 54 signal words, 12 categories โ โโโ notebooks/ โ โโโ PHASE_1_Data_Preparation.ipynb โ โโโ PHASE_2_Signal_Word_Dictionary.ipynb โ โโโ PHASE_3_Build_Crisis_Detector.ipynb โ โโโ PHASE_4_Visualization_Reporting.ipynb โ โโโ PHASE_5_Model_Comparison.ipynb โ โโโ LIVE_DEMO.ipynb # Interactive demo for faculty โ โโโ src/ โ โโโ crisis_detector.py # Main detector class โ โโโ data_preprocessing.py # Data cleaning functions โ โโโ evaluation.py # Metrics calculation โ โโโ results/ โ โโโ crisis_detector.pkl # Trained model โ โโโ model_comparison_results.csv # All 6 models' metrics โ โโโ confusion_matrix.png # Visualization โ โโโ metrics_comparison.png # Side-by-side comparison โ โโโ docs/ โโโ HOW_INTERPRETABILITY_CALCULATED.md โโโ HOW_MODELS_LEARN.md โโโ LEARNING_JOURNEY.md ๐ Quick Start Installation git clone https://github.com/yourusername/crisis-signal-detector-nlp.git cd crisis-signal-detector-nlp pip install -r requirements.txt Basic Usage from src . crisis_detector import CrisisDetector import json # Load detector and signal words detector = CrisisDetector ( threshold = 0.1 ) with open ( 'data/signal_words_dict.json' ) as f : signal_words = json . load ( f ) # Test on sample tweets tweets = [ "earthquake hits california help needed" , "beautiful day at the beach" , "fire spreading evacuation urgent" ] for tweet in tweets : result = detector . predict ( tweet ) print ( f" { tweet } " ) print ( f"Crisis: { result [ 'is_crisis' ] } , Confidence: { result [ 'confidence' ]:.2f } \n " ) Output earthquake hits california help needed Crisis: True, Confidence: 0.92 beautiful day at the beach Crisis: False, Confidence: 0.0 fire spreading evacuation urgent Crisis: True, Confidence: 0.88 ๐ Results Summary Performance Metrics Accuracy: 61.16% - Correctly classifies 61% of all tweets Precision: 56.40% - 56% of detected crises are actual crises Recall: 42.20% - Catches 42% of actual crisis tweets F1-Score: 0.4828 - Balanced measure of precision and recall Confusion Matrix Predicted Non-Crisis Predicted Crisis Actual Non-Crisis 983 320 Actual Crisis 567 414 Key Metrics Interpretation โ 983 True Negatives - Correctly rejected non-crisis tweets โ 414 True Positives - Correctly identified crisis tweets โ ๏ธ 320 False Positives - Non-crisis marked as crisis (figurative language) โ ๏ธ 567 False Negatives - Missed crises (not enough signal words) ๐ฌ Technical Skills Demonstrated Machine Learning โ Supervised learning (classification) โ Feature engineering and extraction โ Model evaluation (accuracy, precision, recall, F1) โ Confusion matrix interpretation โ Hyperparameter tuning and optimization โ Model comparison and selection NLP Techniques โ Text preprocessing and cleaning โ Tokenization โ TF-IDF vectorization โ Feature extraction from text โ Signal word analysis Deep Learning โ LSTM architecture design โ Bidirectional models โ BERT fine-tuning โ Backpropagation and gradient descent โ Early stopping and regularization Software Engineering โ Data pipeline design โ Modular code organization โ Error handling โ Documentation โ Version control (Git) Professional Skills โ Technical writing and documentation โ Data visualization โ Comparative analysis โ Research-based decision making โ Presenting results to non-technical audiences ๐ Model Learning Process How Each Model Learns Rule-Based: Manual dictionary building (no learning) Analyzed data to identify signal words Assigned weights based on crisis likelihood Fixed rules, no adaptation Logistic Regression: Gradient descent optimization Learns optimal weights for 5,000 words Minimizes loss function iteratively 1,000 iterations in 0.06 seconds SVM: Decision boundary optimization Finds optimal boundary separating crisis from non-crisis Uses kernel trick for non-linear separation 6.5 seconds training time Random Forest: Ensemble learning Builds 100 decision trees Each tree learns from random data subset Voting mechanism for final prediction LSTM: Deep neural network Learns 500,000 internal weights through backpropagation 15 epochs (iterations) through training data 3.5 minutes training time BERT: Transfer learning Pre-trained on 3 billion tweets (by Google) Fine-tunes only 500 new weights for our task 12 hours training time but achieves 83.76% accuracy ๐ฏ Why This Project Matters for Recruiters End-to-End ML Pipeline - Shows ability to implement complete ML system from scratch Research-Based Decision Making - Implemented 6 models instead of guessing which is best Interpretability Focus - Understanding ML decisions is crucial for production systems Real-World Problem - Crisis detection has genuine impact Complete Documentation - Professional code and comprehensive explanations Multiple Technologies - Python, Pandas, Scikit-learn, TensorFlow, BERT transformers Communication Skills - Ability to explain complex ML concepts clearly ๐ Documentation HOW_IT_WORKS.md - Technical deep dive into each component RESULTS.md - Detailed analysis of all 6 models INTERPRETABILITY.md - How interpretability percentages were calculated LEARNING_JOURNEY.md - Complete learning process explanation ๐ Model Comparison & Selection Why Not Deep Learning? Dataset too small (7,613 tweets, deep learning needs 50,000+) No GPU available (BERT needs GPU) LSTM/BERT took long but didn't outperform simple models much Interpretability more important than marginal accuracy gains Why Logistic Regression is Production Choice If accuracy was priority: 80.78% accuracy (vs 61% rule-based) 70% interpretable (can see which words matter) 0.06 seconds training (instant) Linear model, easy to understand Why BERT Achieves Best Accuracy Pre-trained on massive text corpus 110 million parameters Learns deep language understanding Problem: Complete black box, unexplainable predictions ๐ฎ Future Improvements Expand Signal Dictionary - Currently 54 words, could add 200+ Multi-Label Classification - Identify multiple crisis types (earthquake, fire, flood) Real-Time Processing - Deploy as API for live social media monitoring Confidence Calibration - Better uncertainty estimates Multilingual Support - Detect crises in other languages Hybrid Approach - Combine rule-based and statistical models ๐ References Papers Used "Paper 3: Signal Words in Crisis Detection" - GTU Mini Project "Why Should I Trust You?" - LIME paper on interpretability "Attention is All You Need" - Transformer architecture (BERT) Datasets Kaggle Disaster Tweets Dataset (7,613 labeled tweets) Libraries Scikit-learn - Machine Learning TensorFlow/Keras - Deep Learning Transformers - BERT Fine-tuning Pandas - Data Manipulation Matplotlib/Seaborn - Visualization ๐ License This project is licensed under the MIT License - see LICENSE.txt for details. ๐ค Contributing Suggestions for improvements welcome! Open an issue or submit a pull request. ๐ Contact LinkedIn: [( https://www.linkedin.com/in/miasa-brunel-christiano-567bb7339/ )] โญ If you found this project useful, please consider giving it a star!
CrisisSignalDetector is a machine learning system that identifies crisis-related tweets in real-time social media streams. The project demonstrates a complete ML pipeline from data preprocessing through model evaluation, comparing 6 different algorithms to determine the optimal solution for interpretability and accuracy.
Key Achievement: Implemented 6 ML models and achieved evidence-based decision making instead of speculation about model performance.
Input: Raw Tweet Text โ Text Preprocessing (clean, lowercase, remove noise) โ Feature Extraction (signal words, TF-IDF vectorization) โ ML Models (6 different algorithms) โ Evaluation (accuracy, precision, recall, F1-score) โ Output: Crisis/Non-Crisis with Confidence Score
crisis-signal-detector-nlp/ โโโ README.md # Project documentation โโโ RESULTS.md # Complete results summary โโโ HOW_IT_WORKS.md # Technical explanation โ โโโ data/ โ โโโ X_train_clean.csv # Training tweets (5,329) โ โโโ y_train.csv # Training labels โ โโโ X_test_clean.csv # Test tweets (2,284) โ โโโ y_test.csv # Test labels โ โโโ signal_words_dict.json # 54 signal words, 12 categories โ โโโ notebooks/ โ โโโ PHASE_1_Data_Preparation.ipynb โ โโโ PHASE_2_Signal_Word_Dictionary.ipynb โ โโโ PHASE_3_Build_Crisis_Detector.ipynb โ โโโ PHASE_4_Visualization_Reporting.ipynb โ โโโ PHASE_5_Model_Comparison.ipynb โ โโโ LIVE_DEMO.ipynb # Interactive demo for faculty โ โโโ src/ โ โโโ crisis_detector.py # Main detector class โ โโโ data_preprocessing.py # Data cleaning functions โ โโโ evaluation.py # Metrics calculation โ โโโ results/ โ โโโ crisis_detector.pkl # Trained model โ โโโ model_comparison_results.csv # All 6 models' metrics โ โโโ confusion_matrix.png # Visualization โ โโโ metrics_comparison.png # Side-by-side comparison โ โโโ docs/ โโโ HOW_INTERPRETABILITY_CALCULATED.md โโโ HOW_MODELS_LEARN.md โโโ LEARNING_JOURNEY.md
git clone https://github.com/yourusername/crisis-signal-detector-nlp.git cd crisis-signal-detector-nlp pip install -r requirements.txt
from src . crisis_detector import CrisisDetector import json # Load detector and signal words detector = CrisisDetector ( threshold = 0.1 ) with open ( 'data/signal_words_dict.json' ) as f : signal_words = json . load ( f ) # Test on sample tweets tweets = [ "earthquake hits california help needed" , "beautiful day at the beach" , "fire spreading evacuation urgent" ] for tweet in tweets : result = detector . predict ( tweet ) print ( f" { tweet } " ) print ( f"Crisis: { result [ 'is_crisis' ] } , Confidence: { result [ 'confidence' ]:.2f } \n " )
Model Figures & Evaluation Curves (4 Images)
Deep Learning Execution Pipeline
(Preprocessing)
(Feature Extraction)
(Self-Attention)
(Loss Optimization)