How manishvgiri/ai-fake-news-detection works
This repository is a command-line fake-news classification workflow: raw fake and real articles are prepared into a labeled dataset, used to train and evaluate a TF-IDF/Logistic Regression model, then classified with a prediction and confidence score. Dataset inspection and exploratory analysis are supporting capabilities. The processed dataset is documented and referenced by source, but is not present in the supplied file tree; its node uses the existing enclosing data directory. Evidence is limited to the README and sampled source files.
Main entry points: predict.py Prediction CLI · data Prepared dataset · train.py Train and evaluate · prepare_dataset.py Dataset preparation
Components 12
Dataset preparation
- Fake articles
ml-service/data/raw/Fake.csv - Real articles
ml-service/data/raw/True.csv - Dataset preparation
ml-service/src/prepare_dataset.py - Prepared dataset
ml-service/data
Model training
- Train and evaluate
ml-service/src/train.py - TF-IDF vectorizer
ml-service/models/tfidf_vectorizer.joblib - Logistic model
ml-service/models/fake_news_model.joblib
News classification
- Prediction CLI
ml-service/src/predict.py - Label and confidence
Data exploration
- Dataset inspection
ml-service/src/inspect_dataset.py - Exploratory analysis
ml-service/src/eda.py
Other components
- CLI user
Connections 13
- Fake articles → Dataset preparation: loads
- Real articles → Dataset preparation: loads
- Dataset preparation → Prepared dataset: writes
- Prepared dataset → Train and evaluate: loads
- Train and evaluate → TF-IDF vectorizer: saves
- Train and evaluate → Logistic model: saves
- CLI user → Prediction CLI: enters article
- Prediction CLI → TF-IDF vectorizer: loads and transforms
- Prediction CLI → Logistic model: loads and classifies
- Prediction CLI → Label and confidence: prints
- Fake articles → Dataset inspection: reads
- Real articles → Dataset inspection: reads
- Prepared dataset → Exploratory analysis: loads