This project uses NLP techniques to classify news articles as real or fake. It employs text preprocessing, TF-IDF feature extraction, and Logistic Regression for classification.
data/raw/: Place downloaded CSVs here (fake.csv, true.csv).data/processed/: Generated cleaned data.notebooks/: Jupyter notebooks for exploration, preprocessing, training, and evaluation.src/: Python scripts for preprocessing, feature extraction, training, evaluation, and prediction.models/: Saved models and vectorizers.tests/: Unit tests.reports/: Figures and final report.
- Download dataset from Kaggle and place in
data/raw/. - Install dependencies:
pip install -r requirements.txt - Run notebooks in order: 01 -> 02 -> 03 -> 04.
- Or use scripts:
python src/train.pyto train and save model.
- Train:
python src/train.py - Evaluate:
python src/evaluate.py - Predict:
python src/predict.py "Your news text here" - Tests:
pytest
- Preprocessing: Cleaning, stopword removal, lemmatization.
- Features: TF-IDF.
- Classifier: Logistic Regression (accurate for this task).