Veridata verifies advertisement claims using Google's Gemini API and performs sentiment analysis to help users identify potentially misleading or false advertising statements.
Demo: https://www.youtube.com/watch?v=m1WHTsHwf1E
- AI-Powered Fact Checking: Uses Google Gemini API to analyze and verify advertisement claims
- Sentiment Analysis: Provides detailed sentiment analysis including polarity, subjectivity, and objectivity
- Text & File Input: Support for both direct text input and file uploads
- Credibility Scoring: Assigns credibility scores from 0-100% based on AI analysis
- Detailed Analysis: Provides comprehensive breakdown of claims and potential issues
- Recommendations: Offers suggestions for improving transparency and accuracy
- FastAPI: Modern, fast web framework for building APIs
- Google Gemini AI: Advanced language model for fact-checking and analysis
- TextBlob: Natural language processing library for sentiment analysis
- Python Magic: File type detection and content extraction
- Pydantic: Data validation and settings management
- HTML5: Semantic markup with modern web standards
- CSS3: Modern styling with animations and responsive design
- JavaScript: Interactive functionality and API integration
- Font Awesome: Beautiful icons and UI elements
- Google Fonts: Professional typography
- Python 3.8 or higher
- pip package manager
- Modern web browser
-
Clone or download the project
cd /path/to/your/project/directory -
Install Python dependencies
pip install -r requirements.txt
-
Set up environment variables
Create a
.envfile in the project root directory and add your Gemini API key:cp .env.example .env
Then edit the
.envfile and replaceyour_gemini_api_key_herewith your actual Google Gemini API key:GEMINI_API_KEY=your_actual_api_key_hereTo get a Gemini API key:
- Visit Google AI Studio
- Sign in with your Google account
- Go to "API Keys" section
- Create a new API key
- Copy the key to your
.envfile
-
Set up the directory structure
Veridata/ ├── backend/ │ └── main.py ├── frontend/ │ ├── index.html │ ├── styles.css │ └── script.js ├── .env # Your API key (not tracked in git) ├── .env.example # Template for API key setup ├── .gitignore # Excludes .env from version control ├── requirements.txt └── README.md
-
Navigate to the project directory
-
Run the FastAPI server:
python backend/main.py
Or alternatively:
uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000
-
The backend will be available at
http://localhost:8000 -
API documentation will be available at
http://localhost:8000/docs
-
Open your web browser
-
Navigate to the
frontenddirectory -
Open
index.htmlin your browser, or serve it using a local server:# Using Python's built-in server cd frontend python -m http.server 3000
Then visit
http://localhost:3000
- Click on "Text Input" tab
- Paste your advertisement text or claim into the textarea
- Click "Verify Claim" button
- Wait for the AI analysis to complete
- Review the detailed results
- Click on "File Upload" tab
- Either drag and drop a file or click to browse
- Select a text file containing advertisement content
- Click "Verify File" button
- Wait for processing and review results
Verification Status:
- Verified: Claims appear to be factually accurate
- Partially Verified: Some claims may need additional verification
- Unverified: Claims lack sufficient supporting evidence
- Misleading: Claims appear to be false or misleading
Credibility Score:
- 80-100%: High credibility - Well-supported claims
- 60-79%: Moderate credibility - Some verification needed
- 40-59%: Low credibility - Several questionable claims
- 0-39%: Very low credibility - Mostly misleading content
Sentiment Analysis:
- Polarity: Emotional tone (-1 to +1, negative to positive)
- Subjectivity: Opinion vs. fact (0 to 1, objective to subjective)
- Objectivity: Factual vs. opinion-based content
- Confidence: How certain the sentiment analysis is
- Returns welcome message
- Verifies text content
- Body:
{"text": "your advertisement text"} - Returns: Verification results with credibility score and analysis
- Verifies uploaded file content
- Body: Form data with file upload
- Returns: Same verification results as text endpoint
- Returns API health status
- Edit
frontend/styles.cssto change colors, fonts, or layout - Modify
frontend/script.jsto add new features or change behavior - Update
frontend/index.htmlto add new sections or modify structure
- Update
backend/main.pyto modify API endpoints or add new features - Adjust the Gemini API prompt to change analysis focus
- Add new verification models or data sources
- API Key Security: The Gemini API key is stored in a
.envfile that is excluded from version control - Important: Never commit your
.envfile to version control - Production Setup: For production deployment, use proper environment variable configuration
- Additional Security: Consider adding rate limiting and user authentication for production use
- Input Validation: All user inputs are validated and sanitized
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
Backend won't start:
- Ensure all dependencies are installed:
pip install -r requirements.txt - Check Python version compatibility (3.8+)
- Verify port 8000 is not in use by another application
Frontend can't connect to backend:
- Ensure backend is running on
http://localhost:8000 - Check browser console for CORS errors
- Verify API endpoints are accessible
Gemini API errors:
- Check API key validity
- Verify internet connection
- Check API usage limits and quotas
File upload issues:
- Ensure files are text-based or readable
- Check file size limits
- Verify file permissions
- Check the FastAPI documentation at
http://localhost:8000/docs - Review browser console for JavaScript errors
- Check backend logs for Python errors
- Support for more file formats (PDF, Word documents)
- Batch processing for multiple advertisements
- Historical analysis and reporting
- User accounts and saved analyses
- API rate limiting and caching
- Multi-language support