Skip to main content

A powerful Wikipedia QA system with LLM integration

Project description

🎯 WikiQA

A powerful Wikipedia Question Answering system with LLM integration. WikiQA allows you to extract information from Wikipedia articles using natural language questions and various extraction methods.

✨ Features

  • 🤖 Direct question answering about Wikipedia content
  • 🔍 Entity extraction from articles
  • 📝 Article summarization with customizable length and focus
  • ⏳ Timeline extraction from articles
  • 🔌 Support for multiple LLM providers (OpenAI, Anthropic, Together)

🚀 Installation

pip install wikiqa

🎮 Quick Start

from wikiqa import WikiQA

# Initialize with your preferred LLM provider
qa = WikiQA(
    llm_provider="together",  # or "openai" or "anthropic"
    api_key="your_api_key",
    model="your_model_name"  # optional, defaults to provider's best model
)

# Ask a question about a Wikipedia article
answer, page_url, revision_id = qa.ask(
    "What is the capital of France?",
    article="France"
)
print(f"Answer: {answer}")
print(f"Source: {page_url}")

# Extract specific information
birth_date, page_url, revision_id = qa.extract_entity(
    "Albert Einstein",
    "date of birth"
)
print(f"Birth date: {birth_date}")

# Get a summary
summary, page_url, revision_id = qa.summarize(
    article="Python (programming language)",
    length="paragraph"
)
print(f"Summary: {summary}")

# Extract a timeline
timeline, page_url, revision_id = qa.extract_timeline("World War II")
print(f"Timeline: {timeline.events}")

🤝 Supported LLM Providers

  • 🎨 OpenAI (GPT models)
  • 🧠 Anthropic (Claude models)
  • 🌟 Together (various open-source models)

📋 Requirements

  • 🐍 Python 3.8 or higher
  • 🌐 Internet connection for Wikipedia access
  • 🔑 API key for your chosen LLM provider

📄 License

MIT License

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

⭐ Star History

Star History Chart

📊 Stats

GitHub stars GitHub forks GitHub issues GitHub license Python Version

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wikiqa-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wikiqa-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file wikiqa-0.1.0.tar.gz.

File metadata

  • Download URL: wikiqa-0.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for wikiqa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1c9568f6bef4ee8650012b75328493bfc4baaefdc68c2e6bf470bc1b6c000f48
MD5 3cc64f9ce8dadbedd33acab49391c58f
BLAKE2b-256 df3005cab7b11af292976ddfa275cbcddee26727baafd3a21df9dcd6f80c097d

See more details on using hashes here.

File details

Details for the file wikiqa-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wikiqa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for wikiqa-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43ed0ac6175b9a0028eafc2cefc6e6360700dd36a29f2a07574c59f32651a9ed
MD5 a12ae91c749f0da0d762b2a2571e9894
BLAKE2b-256 88fab970b23b7f6d9ab3e65c82983d4266769432357e21f96a0d5e7c8fc89636

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page