Skip to content

Consistos/Wikipedia-verifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wikipedia Verifier

A Python tool that verifies claims made in Wikipedia articles by checking if the cited sources support those claims using AI language models.

Features

  • Extracts claims and their corresponding sources from Wikipedia articles
  • Fetches content from cited sources (HTML, PDF support)
  • Uses AI models to verify if sources support the claims
  • Supports both local execution and Google Colab

Setup

Requirements

Install the required dependencies:

pip install -r requirements.txt

API Configuration

This project can use Google's Generative AI API. To use it:

  1. Get a Google API key from Google AI Studio
  2. Set it as an environment variable:
    export GOOGLE_API_KEY="your-api-key-here"
  3. Or modify the code to use your preferred method of API key management

Important: Never commit API keys to version control. Always use environment variables or secure configuration files.

Usage

Command Line

python main.py

By default, it will analyze the "Albert Einstein" Wikipedia article. You can modify the wikipedia_article_title variable in the main.py file to analyze different articles.

Jupyter Notebook

Open wikipedia_verifier.ipynb in Jupyter or Google Colab and follow the instructions in the notebook.

How It Works

  1. Article Fetching: Downloads the HTML content of a Wikipedia article
  2. Claim Extraction: Identifies sentences with citations and extracts the corresponding source URLs
  3. Source Fetching: Downloads content from the cited sources
  4. AI Verification: Uses language models to determine if the source content supports the claim
  5. Results: Provides a summary of verified vs unverified claims

Models Supported

  • HallOumi-8B (default in main.py)
  • Google Generative AI (used in notebook version)
  • Can be extended to support other language models

Limitations

  • Some sources may be behind paywalls or require authentication
  • PDF extraction may not be perfect for all document formats
  • AI verification accuracy depends on the model used
  • Rate limiting may apply to external APIs

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Ensure no sensitive information is committed
  5. Submit a pull request

License

This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.

Security

  • Never commit API keys, passwords, or other sensitive information
  • Use environment variables for configuration
  • Review all changes before committing to ensure no secrets are exposed

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published