Skip to main content

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")

Metadata

Release files for linked-claims-extractor 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for linked-claims-extractor 0.2.1
File Size Uploaded
linked_claims_extractor-0.2.1.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for linked-claims-extractor 0.2.1
File Interpreter ABI Platform
linked_claims_extractor-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.9 kB

Release files / linked_claims_extractor-0.2.1.tar.gz

Download URL linked_claims_extractor-0.2.1.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1c437fd89195d90cc46df4ff77423896fb70f9ab3cdb5e5b4bb57b32bb6402ec
BLAKE2b-256 checksum
How to use checksums
5e5adef45e8b8f31cb8fbd17319cdcf555faf7d242afb8611af16bcbada10cf6
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.1-py3-none-any.whl

Download URL linked_claims_extractor-0.2.1-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d472573bf4ef8015ab55b6bc54343dcc00d566d5ec5580a6ac992d133dea207
BLAKE2b-256 checksum
How to use checksums
839a6d62496d591d0577c9c05c154571e95e155f7511241126dd8fff72524618
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page