Claim Extractor
Extract LinkedClaims from text using LLMs.
Quick Start
from claim_extractor import ClaimExtractor
# Initialize
extractor = ClaimExtractor()
# Extract claims from text
text = "John Smith was the CEO of TechCorp from 2020 to 2023 and increased revenue by 40%."
claims = extractor.extract_claims(text)
# Returns:
# [
# {
# "subject": "https://example.com/entity/John_Smith",
# "claim": "performed",
# "object": "https://example.com/entity/TechCorp",
# "howKnown": "DOCUMENT",
# "confidence": 0.95
# },
# {
# "subject": "https://example.com/entity/John_Smith",
# "claim": "impact",
# "object": "https://example.com/metric/revenue_increase_40%",
# "confidence": 0.9
# }
# ]
Installation
From PyPI
pip install linked-claims-extractor
Development Setup
# Clone the repository
git clone https://github.com/Cooperation-org/linked-claims-extractor.git
cd linked-claims-extractor
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e .
# Install build tools (optional, for publishing)
pip install build twine
For publishing instructions, see PUBLISH.md.
Configuration
Set environment variable:
export ANTHROPIC_API_KEY=your-key
Or create a .env file:
ANTHROPIC_API_KEY=your-key
Usage
from claim_extractor import ClaimExtractor
# Basic usage
extractor = ClaimExtractor()
claims = extractor.extract_claims("Your text here...")
# Extract from URL
claims = extractor.extract_claims_from_url("https://example.com/article")
Related Projects
- linked-claims-extraction-service: Web service for publishing claims to LinkedTrust
Metadata
Release files for linked-claims-extractor 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| linked_claims_extractor-0.2.2.tar.gz | 11.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| linked_claims_extractor-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.5 kB
Release files / linked_claims_extractor-0.2.2.tar.gz
| Download URL | linked_claims_extractor-0.2.2.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9510d1c15a10bfc1bacb82e17dba42c33d9c3006261add2ebbfa0b5428a36564
|
|
BLAKE2b-256 checksum How to use checksums |
67d458e1f5e99e9a282f6b4f63be18728cbeb5bacdbde89cb3b784ec45014c73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / linked_claims_extractor-0.2.2-py3-none-any.whl
| Download URL | linked_claims_extractor-0.2.2-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a61634749f7654dbd7fecb33f6dd87f4ccf9bbd878fcf733947b07e23341dc0
|
|
BLAKE2b-256 checksum How to use checksums |
2e36a54a760d690cb41558021eae050081fe13355c11547b5001949d8954bbb6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|