title | emoji | colorFrom | colorTo | sdk | app_file | app_port | pinned | license | python_version | env | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ClaimCracker |
🔍 |
blue |
red |
docker |
web/main.py |
10000 |
false |
mit |
3.11.11 |
|
Fake news detection system combining ML with a modern web API.
-
ML Pipeline
- DistilBERT-based classification (96.03% accuracy)
- Fast inference (~13.94ms/text)
- Efficient text preprocessing
- Production-optimized model loading
-
Web API
- FastAPI with async support
- Request caching and rate limiting
- Prometheus monitoring
- Comprehensive error handling
- OpenAPI documentation
- Python 3.11.11
- Conda (recommended) or virtualenv
# Create conda environment
conda create -n claimcracker2 python=3.11.11
# Activate environment
conda activate claimcracker2
# Install dependencies
pip install -r requirements.txt
# Create virtual environment
python -m venv venv
# Activate environment (Windows)
.\venv\Scripts\activate
# OR (Unix/macOS)
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
- Environment Setup
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
- Run API
cd web
uvicorn main:app --host 0.0.0.0 --port 10000
API will be available at:
- API: http://localhost:10000
- Docs: http://localhost:10000/docs
- Metrics: http://localhost:10000/metrics
GET /
- Welcome and statusGET /health
- Health checkPOST /predict
- Fake news detection
GET /metrics
- Prometheus metricsGET /cache/stats
- Cache statisticsPOST /cache/clear
- Clear prediction cache
/predict
: 30 requests/minute/health
: 60 requests/minute/cache/*
: 10 requests/minute
- Validation Accuracy: 96.03%
- F1 Score: 0.9603
- Inference Time: 13.94ms/text
- Model Size: <500MB
- Response Time: <1s
- Cache Hit Ratio: ~70%
- Memory Usage: <512MB
- Python 3.11
- FastAPI
- PyTorch
- Transformers
pytest tests/
ClaimCracker-v2/
├── Dataset/ # Training data
├── src/ # ML pipeline
│ └── ml/
│ ├── config/ # Configuration
│ ├── data/ # Data processing
│ ├── models/ # Model architecture
│ └── training/ # Training logic
├── web/ # FastAPI application
├── tests/ # Test suite
└── models/ # Model artifacts
- API Reference: docs/api_reference.md
- Model Details: models/final_model/README.md