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
📊 Stats
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wikiqa-0.1.2.tar.gz.
File metadata
- Download URL: wikiqa-0.1.2.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
199fde5d0e099574a171a336ba8812b7d03e66e2d32a3721066dedae215ad73e
|
|
| MD5 |
c65d0ab461ca8e843306f0a2d4795d15
|
|
| BLAKE2b-256 |
0a3b289d6e268c437dc4efe8214ee9352eb288ab414cb7b53b17f00362983edc
|
File details
Details for the file wikiqa-0.1.2-py3-none-any.whl.
File metadata
- Download URL: wikiqa-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b32db0ded26bf2181093bbbc9cf658db40517bdd49567f15697e01fe7eb648d6
|
|
| MD5 |
b0f72286c8d0ea54d8fa64130ae7aa07
|
|
| BLAKE2b-256 |
c25fe16460c4a44343d99034dc09b266bcf0f304407810128e2b882f5fd73703
|