Welcome to the FactCheck documentation. This guide provides comprehensive information about the fake news detection system, including technical methodology, API references, and usage examples.
FactCheck is a machine learning system for detecting fake news articles. Before diving into the documentation, ensure you have:
- Python 3.8+ installed
- Virtual environment set up
- Dependencies installed via
pip install -r requirements.txt - Dataset placed in
dataset/directory
| Document | Description |
|---|---|
| Methodology | Technical approach, algorithms, and model architecture |
| API Reference | Complete function and class documentation |
| Results Analysis | Detailed performance analysis and insights |
| Guide | Description |
|---|---|
| Installation Guide | Step-by-step setup instructions |
| Training Guide | How to train and evaluate models |
| Deployment Guide | Deploying models in production |
# Train all models
python train.py
# Train specific model
python train.py --model logistic_regression# Command line
python predict.py "Your article text here"
# Interactive mode
python predict.py --interactivefrom predict import FakeNewsPredictor
predictor = FakeNewsPredictor()
result = predictor.predict("News article text...")
print(result['prediction']) # 'REAL' or 'FAKE'┌─────────────────────────────────────────────────────────────┐
│ FactCheck System │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Input │───▶│ Preprocessing │───▶│ Feature │ │
│ │ Text │ │ Pipeline │ │ Extraction │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Output │◀───│ Ensemble │◀───│ TF-IDF │ │
│ │ Prediction │ │ Model │ │ Vectors │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
Text cleaning and feature extraction utilities.
TextPreprocessor: Clean and normalize textFeatureExtractor: TF-IDF vectorizationload_and_prepare_data(): Dataset loading
Machine learning model implementations.
ModelFactory: Create model instancesFakeNewsClassifier: Main classifier wrapperEnsembleModel: Voting ensembleModelEvaluator: Metric calculations
Plotting and visualization functions.
plot_confusion_matrix(): Confusion matrix heatmapplot_model_comparison(): Model performance comparisonplot_feature_importance(): Feature importance charts
Helper utilities and configuration.
Config: Project configurationsave_model()/load_model(): Model persistenceprint_metrics(): Formatted metric display
- Read the Methodology for technical details
- Check the API Reference for function documentation
- Explore the Jupyter notebook for interactive analysis