An AI-powered fact-checking application that automatically transcribes, analyzes, and verifies claims from videos, Instagram content, and text. Using OpenAI's GPT-4o and Whisper models, this tool helps combat misinformation by providing evidence-based verification with accurate source references.
- 🎬 Multi-Source Verification: Process videos, Instagram posts, and free text input
- 🔊 AI Transcription: Convert speech to text using OpenAI's Whisper model
- ✅ Advanced Fact Checking: Verify claims using OpenAI's GPT-4o with web search capabilities
- 🔍 Claim Detection: Automatically extract and analyze factual statements
- 📱 User-Friendly Interface: Intuitive tabbed design for different input methods
- 📊 Detailed Verification Reports: Comprehensive fact-check results with reliability scores and sources
- 🌐 Multilingual Support: Automatically detects input language and responds accordingly
- 📑 Web Search Integration: Cross-references claims with online information sources
- 🎬 Video Upload: Support for various video formats (mp4, mov, avi)
- 🔊 Automatic Transcription: Convert speech to text using OpenAI's Whisper model
- ✅ AI Fact Checking: Verify claims using OpenAI's GPT-4o
- 🔍 Image Analysis: Extract and analyze visual content from videos
- 📱 Responsive UI: User-friendly interface for uploading and reviewing results
- 📊 Detailed Reports: Get comprehensive fact-check reports with sources
- 🌐 Multilingual Support: Automatically detects input language and responds in the same language for transcription, fact-checking, and image analysis
- Python with FastAPI
- OpenAI API integration
- MoviePy for video processing
- Instagram API integration (optional)
- React-based web interface
- Tailwind CSS for styling
- Framer Motion for animations
- File system storage for uploads
- Environment-based configuration
- CORS support for secure API access
- Python 3.9+
- Node.js and npm
- OpenAI API key
- FFmpeg (for video processing)
- Docker and Docker Compose (optional, for containerized setup)
-
Clone the repository
git clone https://github.com/yourusername/fact-check.git cd fact-check
-
Copy
env.example
to.env
and fill in your credentialscp env.example .env
-
Install backend dependencies
pip install -r requirements.txt
or with conda:
conda env create -f environment.yml
-
Install frontend dependencies
cd video-transcription-frontend npm install
-
Clone the repository
git clone https://github.com/yourusername/fact-check.git cd fact-check
-
Copy
env.example
to.env
and fill in your credentialscp env.example .env
-
Build and start the Docker containers
docker-compose up -d
This will:
- Build the backend container with Python and FastAPI
- Build the frontend container with Node.js and React
- Configure Nginx for serving the frontend and proxying API requests
- Set up volume mapping for uploads and environment variables
-
Access the application at http://localhost
# Start the services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the services
docker-compose down
# Rebuild and start the services (after making changes)
docker-compose up -d --build
# Debug Docker issues
./docker-debug.sh
If you encounter issues with the Docker setup:
- Run the debugging script:
./docker-debug.sh
- Check container logs:
docker-compose logs
- Verify file permissions in containers
- Ensure your
.env
file is correctly set up - If necessary, rebuild containers:
docker-compose up -d --build
- Error: No such file or directory: Ensure all paths in docker-compose.yml are correct and that you've created any required directories.
- Backend can't connect to OpenAI API: Verify your API key in the .env file is correct and that you have sufficient credits.
- Frontend not connecting to backend: Check the REACT_APP_API_URL in your environment variables and ensure the backend service is running.
The Instagram integration uses third-party libraries to download content from Instagram for fact-checking. Due to Instagram's measures against automated access, you may encounter the following issues:
-
401 Unauthorized Error: Instagram is actively blocking the connection.
- Solution: Try using different Instagram credentials in your .env file.
- Alternative: Download the video manually and upload it directly.
-
"Could not find window._sharedData" Error: Instagram has changed their page structure.
- Solution: Wait for a library update or use the manual upload option.
-
No media found after download: The content might be private or not accessible.
- Solution: Ensure you're using credentials that have access to the content.
- Increase
INSTAGRAM_MAX_RETRIES
andINSTAGRAM_RETRY_DELAY
in your .env file - Use an Instagram account with fewer restrictions
- If Instagram integration is critical, consider implementing a browser automation solution (like Selenium)
Instagram actively works to prevent automated access to their platform. The application's ability to download content may be affected by:
- Instagram's frequent API and website changes
- Rate limiting and blocking of automated requests
- Login challenges and captchas when using automated tools
cd video-upload-app
uvicorn app:app --reload
cd video-transcription-frontend
npm start
cd video-transcription-frontend
npm run build
Set the following environment variables in your .env
file:
Variable | Description | Default |
---|---|---|
OPENAI_API_KEY |
Your OpenAI API key | required |
GOOGLE_API_KEY |
Your Google API key (if applicable) | optional |
INSTAGRAM_USERNAME |
Instagram username for downloading content | optional |
INSTAGRAM_PASSWORD |
Instagram password for downloading content | optional |
INSTAGRAM_MAX_RETRIES |
Maximum number of retry attempts for Instagram | 3 |
INSTAGRAM_RETRY_DELAY |
Delay between retry attempts in seconds | 2 |
ALLOWED_ORIGINS |
Comma-separated list of allowed origins for CORS | * |
FACT_CHECK_MODEL |
OpenAI model for fact checking | chatgpt-4o-latest |
IMAGE_ANALYSIS_MODEL |
OpenAI model for image analysis | gpt-4o-mini |
TRANSCRIPTION_MODEL |
OpenAI model for transcription | whisper-1 |
REACT_APP_MAX_UPLOAD_SIZE |
Maximum upload size in MB | 2500 |
ALLOWED_FILE_TYPES |
Comma-separated list of allowed file extensions | mp4,mov,avi |
Endpoint | Method | Description |
---|---|---|
/upload |
POST | Upload a video for processing |
/transcribe |
POST | Transcribe an already uploaded video |
/fact-check |
POST | Perform fact-checking on a transcription |
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for providing the AI models
- All contributors who have helped with the project
- Uygar Duzgun - uygarduzgun.com
- GitHub: owgit
- Support: Buy me a coffee