DeepTruth is a powerful backend service that leverages artificial intelligence to verify news articles and claims, helping users distinguish between factual and false information.
- False News Detection: Analyzes news articles for potential misinformation
- Claim Verification: Verifies specific claims using AI and fact-checking
- MongoDB Integration: Efficient data storage and retrieval
- RESTful API: Well-structured endpoints for easy integration
- Docker Support: Containerized deployment for consistent environments
- AI-Powered Analysis: Uses Google Generative AI and Transformers for content analysis
- Backend Framework: Django
- API Framework: Django REST Framework 3.12.4
- Database: MongoDB with Djongo 1.3.6
- AI/ML:
- Google Generative AI 0.1.0rc1
- Transformers 4.44.0
- Scikit-learn 1.3.2
- PyTorch 2.4.0
- Containerization: Docker & Docker Compose
- Other Tools:
- BeautifulSoup4 4.12.3 for web scraping
- Python-dotenv 1.0.1 for environment management
- Requests 2.32.3 for HTTP operations
- Gunicorn 20.1.0 for production server
- Docker and Docker Compose
- Python 3.10 or higher (if running locally)
- MongoDB Atlas account (for cloud database)
- sckit-learn libarary
- Clone the repository:
git clone https://github.com/yourusername/deeptruth-backend.git
cd deeptruth-backend- Create a
.envfile in the root directory with the following variables:
# Google Gemini AI Configuration
GEMINI_API_KEY=your_gemini_api_key
BRAVE_API_KEY=your_brave_api_key
# MongoDB Configuration
MONGODB_NAME=deeptruth_db
MONGODB_URI=your_mongodb_uri
MONGODB_USERNAME=your_username
MONGODB_PASSWORD=your_password
# Django Configuration
DEBUG=True
SECRET_KEY=your_secret_key
ALLOWED_HOSTS=localhost,127.0.0.1- Build and start the Docker containers:
docker-compose up --buildarticle_title: Title of the news articleveracity: Boolean indicating if the news is falseconfidence_score: AI model's confidence in the verificationexplanation: Detailed explanation of the verificationcategory: News categorykey_findings: JSON field containing key findingsimpact_level: Verification status (VERIFIED/MISLEADING/PARTIAL)sources: List of source URLscreated_at: Creation timestampupdated_at: Last update timestamp
- Similar structure to FalseNews but with
veracitydefaulting to True - Additional fields for storing verified true information
POST /api/false-news/
Request Body:
{
"url": "https://example.com/news-article",
"title": "Example News Title",
"content": "Article content...",
"source": "News Source",
"published_date": "2024-03-21T12:00:00Z"
}POST /api/true-news/
Request Body:
{
"claim": "The claim to verify",
"context": "Additional context",
"source": "Source of the claim",
"language": "en"
}Run the test suite:
docker-compose exec web python manage.py testFor detailed API documentation, visit:
http://localhost:8000/api/docs/
- All API endpoints are protected with authentication
- Environment variables for sensitive data
- Secure MongoDB connection with authentication
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Google Gemini AI for natural language processing capabilities
- MongoDB Atlas for database hosting
- Django and DRF communities for excellent frameworks