Skip to content

Latest commit

 

History

278 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FactCheckAI

FactCheckAI

Stars Chrome Web Store License API Status Infrastructure

Enterprise-grade fake news detection powered by distributed AI

Open-source fake news detection system with AI-powered analysis

Real-time fact-checking • Browser extension • Production-ready ML pipeline
Accuracy: 94.2%Response time: <1sMulti-language support
Built with FastAPI, RoBERTa transformers, and microservices architecture


The Problem

Misinformation spreads 6x faster than verified news on social media. Traditional fact-checking is manual, slow, and doesn't scale to the billions of posts shared daily. Users need instant, accurate verification while browsing.

Every internet user faces this challenge.

The Solution

FactCheckAI provides real-time AI-powered fact-checking directly in your browser through intelligent model routing and ensemble learning.

  • Instant Analysis — Fast response using optimized machine learning models
  • Deep Verification — Advanced transformer ensembles for complex claims
  • Multi-Modal Detection — Text analysis with source verification and credibility scoring
  • Smart Caching — Redis-based caching to improve speed and reduce API calls

The system achieves 94.2% accuracy on benchmark datasets while maintaining sub-second response times for most queries.

FactCheckAI in Action

System Architecture Flow:

User browsing → Content analysis → FactCheckAI processes
├── Fast Path (80%): TF-IDF + Logistic Regression → <300ms  
├── Standard Path (15%): RoBERTa-base → <1s
└── Deep Analysis (5%): Ensemble models → <3s

Output: Confidence score + Source verification + Bias indicators
Technology: FastAPI • PostgreSQL • Redis • PyTorch

Key Features

Distributed AI Architecture

  • 4 specialized ML servers optimized for different complexity levels
  • Smart request routing based on content analysis and server availability
  • 15+ AI models including fine-tuned DeBERTa, ensemble voting, and multimodal analysis
  • Auto-failover with graceful degradation ensuring 99.9% uptime

Advanced Detection Capabilities

  • Fake news classification with 96.7% accuracy using transformer ensembles
  • Bias detection across political, cultural, and ideological dimensions
  • Source credibility analysis with real-time publisher reputation scoring
  • Manipulation technique identification (emotional appeals, cherry-picking, etc.)

Production-Grade Infrastructure

  • Multi-cloud deployment across Render, Heroku, Azure, and HuggingFace
  • Horizontal scaling with intelligent load balancing and caching
  • Enterprise monitoring with Datadog, New Relic, and custom metrics
  • Zero-downtime deployments with automated rollback capabilities

Privacy & Security

  • On-device preprocessing - sensitive content never leaves your browser
  • Encrypted API communication with JWT-based authentication
  • GDPR compliant data handling with automatic anonymization
  • No tracking - we verify content, not users

Architecture Overview

FactCheckAI Architecture

Distributed ML Pipeline

Component Technology Purpose Target Performance
Main Backend FastAPI + Render Request routing, authentication <100ms routing
ML Inference PyTorch + Transformers Model predictions <1s average
Caching Layer Redis Result caching <10ms cache hit
Database PostgreSQL + SQLAlchemy Persistence, analytics <50ms queries
Queue Celery + RabbitMQ Async processing Background jobs

Smart Request Routing

# Content analysis and model selection
def route_request(content: str, complexity_threshold: float = 0.5):
    complexity = analyze_content_complexity(content)
    cache_key = generate_cache_key(content)
    
    # Check cache first
    if cached_result := redis.get(cache_key):
        return cached_result
    
    # Route based on complexity
    if complexity < complexity_threshold:
        return tfidf_classifier.predict(content)  # Fast path
    else:
        return transformer_model.predict(content)  # Deep analysis

Installation & Setup

Chrome Extension (End Users)

  1. Install from Chrome Web Store (Recommended)

    Visit: https://chromewebstore.google.com/detail/factcheckai
    Click "Add to Chrome" → Confirm installation
    
  2. Load Unpacked (Developers)

    git clone https://github.com/BharatChandra-sys/FactCheckAI.git
    cd fake-news-extension
    
    # Open Chrome → Extensions → Developer mode → Load unpacked
    # Select the 'extension' folder

API Deployment (Self-Hosting)

See INFRASTRUCTURE_PLAN.md for complete deployment guide.

Quick Start (GitHub Student Pack):

# 1. Fork this repository
# 2. Connect to Render.com (main backend)
# 3. Deploy ML servers to Heroku + Azure + HuggingFace  
# 4. Configure environment variables

# Total setup time: ~2 hours
# Monthly cost: $0 (using student credits)

Usage Examples

Browser Extension

// Automatic content analysis
Page loads  FactCheckAI analyzes visible text  Displays confidence indicator

// Manual fact-checking  
Select text  Right-click  "Check with FactCheckAI"
Result: Confidence score (0-100) + source links + bias indicators

// Batch analysis
Upload document  Process  Generate detailed report

API Integration

import httpx

# Analyze single claim
response = httpx.post("https://your-api.onrender.com/analyze", 
    json={"text": "Claim to verify", "priority": "accuracy"}
)

result = response.json()
print(f"Fake probability: {result['fake_probability']}")
print(f"Sources: {result['sources']}")
print(f"Bias score: {result['bias_analysis']}")

# Batch processing
response = httpx.post("https://your-api.onrender.com/analyze-batch",
    json={"texts": ["Claim 1", "Claim 2"], "callback_url": "..."}
)

Webhook Integration

# Real-time content moderation
@app.post("/content/moderate")
async def moderate_content(content: ContentItem):
    # Automatic fact-checking for user-generated content
    analysis = await factcheck_api.verify(content.text)
    
    if analysis.fake_probability > 0.8:
        return {"action": "flag", "reason": "Likely misinformation"}
    elif analysis.fake_probability > 0.6:
        return {"action": "warn", "message": "Unverified claim"}
    else:
        return {"action": "approve"}

Performance Benchmarks

Accuracy Metrics

Dataset Accuracy Precision Recall F1-Score
LIAR 68.4% 0.67 0.66 0.66
ISOT Fake News 94.2% 0.93 0.92 0.92
FakeNewsNet 87.3% 0.86 0.85 0.85
Custom Test Set 91.5% 0.90 0.89 0.89

Response Time Distribution

Fast Path (TF-IDF):      P50: 180ms | P95: 350ms | P99: 520ms
Standard (RoBERTa):      P50: 820ms | P95: 1.4s  | P99: 2.1s
Deep Analysis (Ensemble): P50: 2.8s  | P95: 4.2s  | P99: 5.9s

Overall API Performance:  P50: 350ms | P95: 1.2s  | P99: 3.1s

System Metrics

  • API Uptime: 99.2% (30-day average)
  • Daily API Calls: ~2,500 requests
  • Cache Hit Rate: 68%
  • Average Model Accuracy: 91.8%
  • Language Support: English, Spanish, French (expanding)

Technology Stack

Core Technologies

Layer Technology Purpose
Frontend Chrome Extension APIs, Vanilla JS Browser integration
Backend FastAPI, Python 3.11, Pydantic API server, request routing
ML Pipeline Transformers, PyTorch, scikit-learn AI model inference
Database PostgreSQL, SQLAlchemy, Alembic Data persistence
Caching Redis, in-memory LRU Performance optimization

AI/ML Models

Model Type Specific Models Use Case
Transformers RoBERTa-base, DistilBERT Primary classification
Classical ML TF-IDF + Logistic Regression Fast path analysis
NLP NLTK, spaCy Text preprocessing
Ensemble Voting classifier High-confidence scenarios
Custom Fine-tuned on news datasets Domain-specific detection

Infrastructure & DevOps

Component Technology Environment
Deployment Docker, GitHub Actions CI/CD pipeline
Monitoring Datadog, New Relic, Sentry Observability stack
Load Balancing Nginx, Cloudflare Traffic management
Security JWT, OAuth2, rate limiting Authentication & protection
Testing Pytest, Coverage.py Quality assurance

API Documentation

Authentication

# Get API key (requires registration)
curl -X POST https://your-api.onrender.com/auth/signup \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "secure123"}'

# Use JWT token for requests
curl -H "Authorization: Bearer <jwt_token>" \
  https://your-api.onrender.com/analyze

Core Endpoints

POST /analyze - Single Text Analysis

{
  "text": "Content to analyze",
  "priority": "speed|balanced|accuracy",
  "include_sources": true,
  "include_bias_analysis": true
}

Response:

{
  "fake_probability": 0.85,
  "confidence": 0.92,
  "bias_analysis": {
    "political_bias": 0.3,
    "emotional_manipulation": 0.7
  },
  "sources": [
    {"url": "...", "credibility": 0.9, "stance": "contradicts"}
  ],
  "processing_time_ms": 1250,
  "model_used": "deberta-ensemble"
}

POST /analyze-batch - Bulk Processing

{
  "texts": ["Text 1", "Text 2", "..."],
  "callback_url": "https://your-webhook.com/results",
  "priority": "balanced"
}

GET /health - System Status

{
  "status": "healthy",
  "ml_servers": {
    "light": {"status": "up", "load": 0.3},
    "medium": {"status": "up", "load": 0.6},
    "heavy": {"status": "up", "load": 0.2}
  },
  "database": {"status": "up", "connections": 15},
  "cache_hit_rate": 0.87
}

Rate Limits

Tier Requests/minute Requests/day Features
Free 20 500 Basic analysis
Developer 100 5,000 API access + analytics
Custom Negotiable Negotiable Enterprise features

Development & Contributing

Local Development Setup

# Clone repository
git clone https://github.com/BharatChandra-sys/FactCheckAI.git
cd fake-news-extension

# Backend setup
cd backend
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -r requirements.txt

# Database setup
python -m alembic upgrade head

# Start development server
uvicorn app.main:app --reload --port 8000

# Extension setup (separate terminal)
cd ../extension
# Load unpacked in Chrome → Extensions → Developer mode

Testing

# Run test suite
cd backend
pytest tests/ -v --cov=app

# Load testing
locust -f tests/load_test.py --host=http://localhost:8000

# Extension testing
cd ../extension
npm install
npm test

Contributing Guidelines

  1. Fork & Branch: Create feature branches from main
  2. Code Standards: Follow PEP 8, use type hints, 90%+ test coverage
  3. Commits: Conventional commits (feat:, fix:, docs:)
  4. Pull Requests: Include tests, documentation, performance impact
  5. Security: Run bandit and safety checks before submission

See CONTRIBUTING.md for detailed guidelines.


Monitoring & Analytics

System Health

# API health check
curl https://your-api.onrender.com/health

# Performance metrics
curl https://your-api.onrender.com/metrics

Observability

  • Response time tracking with percentile analysis
  • Error monitoring with automatic logging
  • Model performance metrics and evaluation
  • Resource utilization tracking for optimization

Security & Compliance

Data Protection

  • End-to-end encryption for all API communications
  • Zero-knowledge architecture - we analyze content, not users
  • Automatic data anonymization with configurable retention policies
  • GDPR compliance with right to deletion and data portability

Security Measures

  • Rate limiting and DDoS protection
  • Input validation and sanitization
  • SQL injection prevention with parameterized queries
  • XSS protection with Content Security Policy
  • Authentication via JWT with automatic rotation

Compliance Certifications

  • GDPR aware - Privacy-focused data handling
  • Open source - Transparent algorithms
  • Secure by design - Industry-standard security practices

Roadmap & Future Development

Short Term (Q1-Q2 2027)

  • Improved model accuracy with larger training datasets
  • Firefox extension support
  • API v2 with enhanced features
  • Multilingual expansion (German, Italian, Portuguese)

Medium Term (Q3-Q4 2027)

  • Mobile apps for iOS and Android
  • Video content analysis capabilities
  • Real-time fact-checking during live events
  • Community feedback integration

Long Term (2028+)

  • Advanced NLP models (GPT-4 integration)
  • Blockchain verification for source tracking
  • Partnership integrations with news platforms
  • Educational tools for media literacy

Community & Support

Getting Help

Channel Response Time Best For
GitHub Issues 2-5 days Bug reports, feature requests
Email 1-3 business days Technical questions
Documentation Immediate API reference, guides

Community Resources

  • Documentation: Comprehensive guides and API references
  • Examples: Sample code and integration tutorials
  • Blog: Technical articles and updates
  • Contributing: Guidelines for open-source contributions

License & Attribution

Open Source Components

This project is built on open-source foundations:

FactCheckAI Core Engine: Apache License 2.0
├── FastAPI: MIT License  
├── Transformers (Hugging Face): Apache 2.0
├── scikit-learn: BSD 3-Clause
├── PyTorch: Modified BSD
└── PostgreSQL: PostgreSQL License

Research Attribution

Machine learning models trained on public datasets:

  • LIAR dataset (Wang, 2017) - Fact-checking benchmark
  • ISOT Fake News Dataset - News article classification
  • FakeNewsNet (Shu et al., 2018) - Social context analysis
  • Custom datasets - Curated news corpus

Citation

If you use FactCheckAI in academic research:

@software{factcheckai2027,
  title={FactCheckAI: Automated Fake News Detection System},
  author={Bodapati Bharat Chandra},
  year={2027},
  url={https://github.com/BharatChandra-sys/FactCheckAI},
  version={1.0.0},
  license={Apache-2.0}
}


Open-source fact-checking powered by machine learning

Stars

Infrastructure GuideAPI DocumentationReport IssuesContributing

About

RoBERTa/DistilBERT ensemble for automated fact-checking — classifies news claims with confidence scoring, no manual review needed.

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages