How shreashi-saha/fake-news-detection-nlp works
This is a small, single-script fake-news classifier. It combines labeled real and fake article CSVs, cleans the text, trains a logistic-regression model, evaluates it, and prompts for an article to classify. The script also compares Naive Bayes and SVM models and plots evaluation results. All processing stages are implemented in main.py; the graph separates their responsibilities rather than implying separate modules. Evidence is limited to the provided main.py excerpt.
Main entry points: main.py Interactive prediction · Fake.csv Fake articles · True.csv Real articles
Components 12
Data preparation
- Fake articles
Fake.csv - Real articles
True.csv - Load and label data
main.py - Clean article text
main.py - Train/test split
main.py
Classification
- TF-IDF vectors
main.py - Logistic regression
main.py - Model comparisons
main.py
Evaluation and use
- Metrics and plots
main.py - Interactive prediction
main.py - Fake/real label
main.py
Other components
- Article submitter
Connections 15
- Load and label data → Fake articles: reads
main.py - Load and label data → Real articles: reads
main.py - Load and label data → Clean article text: passes articles
main.py - Clean article text → Train/test split: passes cleaned text
main.py - Train/test split → TF-IDF vectors: fits and transforms
main.py - TF-IDF vectors → Logistic regression: provides vectors
main.py - Logistic regression → Metrics and plots: provides predictions
main.py - TF-IDF vectors → Model comparisons: provides vectors
main.py - Train/test split → Model comparisons: provides labels
main.py - Article submitter → Interactive prediction: enters article
main.py - Interactive prediction → Clean article text: cleans input
main.py - Interactive prediction → TF-IDF vectors: transforms input
main.py - Interactive prediction → Logistic regression: requests prediction
main.py - Interactive prediction → Fake/real label: returns label
main.py - Fake/real label → Article submitter: prints result
main.py