Skip to main content

vigie-claims-extract: Extract Claims from Youtube Shorts

Extract checkable claims from a video-to-context record (record.json or record.md). Part of Vigie's fact-checking pipeline: this step finds claims; it never decides whether they are true.

Install

You need Python 3.12–3.14. uv is the easiest way:

uv tool install --python 3.12 vigie-claims-extract            # claims from record files
uv tool install --python 3.12 "vigie-claims-extract[video]"   # also from YouTube links (needs ffmpeg)

Or with pip, inside a Python 3.12+ environment:

pip install vigie-claims-extract
pip install "vigie-claims-extract[video]"

The video extra brings in video-to-context, which needs ffmpeg (brew install ffmpeg on macOS) and about 5 GB of disk for Whisper and the video tools.

Choose a model

Download the settings template and pick one option in it: Claude, Gemini, OpenAI, Mistral, OpenRouter, or Ollama on your own machine.

mkdir -p ~/.vigie-claims-extract
curl -o ~/.vigie-claims-extract/.env https://raw.githubusercontent.com/wani-ham/youtube-shorts-to-claims/main/.env.example

Settings are read from ./.env first, then ~/.vigie-claims-extract/.env. Real environment variables always win.

Usage

# A YouTube video or Short (with the video extra)
vigie-claims-extract "https://www.youtube.com/shorts/VIDEO_ID"

# A record you already have from video-to-context
vigie-claims-extract store/<media_id>/record.json

# Segmentation only, no model call
vigie-claims-extract record.md --units-only

# Keep records somewhere else, or process a link again
vigie-claims-extract "https://youtu.be/VIDEO_ID" --store records --force

From a link, the video record is saved in store/<media_id>/ and reused next time. claims.json and claim_list.md are written next to the record. Vision settings (VISION_*) for the video step are read from ./.env or ~/.video-to-context/.env, as in video-to-context itself. Model settings are checked before any download starts.

The command exits with 0 when every step succeeded, 1 when a model step failed but a partial result was written, and 2 for bad settings or input.

How it works

Step Code or LLM What it does
1. Load code Reads JSON or MD into one shape.
2. Segment code Re-cuts speech into sentences (Whisper segments break at pauses). Drops burned-in captions that repeat the speech, keeps headlines and other on-screen text, keeps the lead of the post caption and sets channel boilerplate aside. Logos are context; VISUAL lines are never quotable.
3. Select and type LLM, low effort Labels every unit: factual_claim, mixed, opinion, call_to_action, other.
4. Decompose LLM For selected units only: resolves references, splits into atomic claims, writes each in the source language and English, with an exact quote, claim type, entities and claimant. Ambiguous units are returned as cannot_disambiguate instead of guessed.
5. Implicit claims LLM What the video presents through framing: outlet branding, endorsements, setting. Each needs an observed basis (a unit, a logo, the uploader or sponsor); claims resting only on the vision model's interpretation are rejected.
6. Validate code Rejects any claim whose quote is not in its source text, repairs wrong unit ids, flags entities not found in the record, merges duplicates (speech and caption saying the same thing), ranks by claim type and caps at 10.

A failed LLM step is recorded in errors and the rest of the result is kept.

Output: claims.json

units (what can be quoted), dropped_text (what was set aside and why), unit_labels, claims, rejected (with reasons) and errors. Each claim has text, text_en, quote, unit_ids, source, start/end, explicit, claim_type, entities, claimant, checkable, priority, notes and warnings. claim_type routes the claim to a verification method later.

A readable claim_list.md is written next to it, with each claim, its quote, type, claimant and time, then the rejected claims and errors.

Model

Default claude-haiku-5-5 through the Anthropic SDK, with structured outputs and the server-side refusal fallback enabled. Set CLAIMS_BASE_URL and CLAIMS_MODEL (and CLAIMS_API_KEY if needed) for any OpenAI-compatible server: Gemini, OpenAI, Mistral, OpenRouter, or Ollama on your own machine. .env.example has a preset for each. CLAIMS_TIMEOUT_S (default 180) sets how long to wait for each call, and CLAIMS_REASONING_EFFORT is passed through to OpenAI-compatible servers; slow local models usually need both.

Development

git clone https://github.com/wani-ham/youtube-shorts-to-claims.git && cd youtube-shorts-to-claims
uv sync --extra dev --extra video
uv run pytest

To release: raise __version__ in vigie_claims_extract/__init__.py, then uv build and uv publish.

Tests run on a real record (tests/samples/fox_canon_law.*) with a fake model, so they need no API key.

Metadata

Release files for vigie-claims-extract 0.1.0

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

Source distribution (sdist)

Source distribution for vigie-claims-extract 0.1.0
File Size Uploaded Provenance Actions
vigie_claims_extract-0.1.0.tar.gz 33.3 kB Without provenance Details for vigie_claims_extract-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vigie-claims-extract 0.1.0
File Interpreter ABI Platform Actions
vigie_claims_extract-0.1.0-py3-none-any.whl Python 3 none any Details for vigie_claims_extract-0.1.0-py3-none-any.whl

Total release size: 63.2 kB

Release files / vigie_claims_extract-0.1.0.tar.gz

Download URL vigie_claims_extract-0.1.0.tar.gz
Size 33.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3d062ef57ecfc2f04e4c5cb2d637c3c8f582557607946a78b8d7177b73b9beef
BLAKE2b-256 checksum
How to use checksums
87d2c4fd4d962e427e5d3c9bca851dea82961474f76143b1224ffdab643054c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / vigie_claims_extract-0.1.0-py3-none-any.whl

Download URL vigie_claims_extract-0.1.0-py3-none-any.whl
Size 30.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c89a33290d5d831a06a8d34382650424c81f6b02b48c2e8f52e28e20653b35e
BLAKE2b-256 checksum
How to use checksums
bad8ceeaf1f6bdc7915faadd602c77532544b8eca8ef15c5bb23db6cfa2dd3c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for vigie-claims-extract 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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