Skip to main content

vigie-claims-extract: Extract Claims from Youtube Shorts

Extract claims from a video-to-context record (record.json or record.md). This repo is part of Vigie's fact-checking pipeline: this step finds claims from the text context of a youtube shorts.

Contents

Example Output

A real Short posted by the channel "The Democrats": youtube.com/shorts/erbY3vW7xtI. Part of its record from video-to-context:

[AUDIO 00:00–00:03] The question ultimately is do you want to drive on good roads or would you rather have a billionaire
[ON-SCREEN:HEADLINE 00:00–00:47] EL-SAYED EMBARRASSES FOX NEWS HOST OVER MIKE ROGERS DEBATE
[AUDIO 00:03–00:06] make a second billion? That's what Mike Rogers wants. That's what Donald Trump wants. Apparently
[ON-SCREEN 00:05–00:05] Mike Rogers wants.
[AUDIO 00:06–00:09] that's what you want. I think the people in Michigan want something different. They want
[AUDIO 00:09–00:15] good roads and good schools. So you're saying Beyonce who just became a billionaire. She has to
...

Part of the claim_list.md that claude-haiku-5-5 produced from it (10 claims in all):

### c1. El-Sayed appeared in a debate on Fox News against Mike Rogers' side.

- **Quote:** “EL-SAYED EMBARRASSES FOX NEWS HOST OVER MIKE ROGERS DEBATE”
- **Type:** `event`, explicit
- **Claimant:** The Democrats
- **Where:** on_screen:headline, 00:00–00:47 (units h1)
- **Entities:** El-Sayed (person), Fox News (organization), Mike Rogers (person)
- **Notes:** Claimant is the uploader, The Democrats, as the headline is on their video. ... Loaded word EMBARRASSES is left out of the claim.

### c2. Mike Rogers wants a billionaire to make a second billion.

- **Quote:** “That's what Mike Rogers wants”
- **Type:** `other`, explicit
- **Claimant:** unidentified speaker
- **Where:** audio, 00:04–00:05 (units a2)
- **Entities:** Mike Rogers (person)
- **Notes:** 'That's' resolved from a1: the billionaire making a second billion.

### c3. Donald Trump wants a billionaire to make a second billion.

- **Quote:** “That's what Donald Trump wants”
- **Where:** audio, 00:05–00:06 (units a3)
...

### c4. Beyonce has just become a billionaire.

- **Quote:** “Beyonce who just became a billionaire”
- **Type:** `event`, explicit
- **Claimant:** unidentified speaker
- **Where:** audio, 00:11–00:15 (units a7)
- **Entities:** Beyonce (person)

### c8. The speaker thinks Beyonce would be happy to contribute back to the public schools she attended.

- **Quote:** “Beyonce I think would be happy to be able to contribute back”
- **Type:** `other`, explicit, not checkable
- **Notes:** Expressed as the speaker's opinion ('I think') about another person's feelings; no evidence could settle her private happiness.
...

What the example shows:

  • References are resolved. "That's what Mike Rogers wants" only makes sense with the sentence before it, so the claim spells out what "that" means.
  • Similar sentences stay separate. c2 and c3 differ only in who is named, so they are kept as two claims, each with its own quote.
  • Framing is left out. The headline's "EMBARRASSES" is a characterisation, not a fact, so the claim keeps only the event.
  • The claimant follows the source. The headline is the uploader's, and the speakers are "unidentified speaker" because the record never names them on screen. Nobody is identified from how they look.
  • Opinions are marked. c8 is kept but flagged as not checkable.
  • Repeated captions are dropped. The on-screen "Mike Rogers wants." repeats the speech, so it gives no claim of its own.

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. (Result from here)
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.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 vigie-claims-extract 0.1.1
File Size Uploaded Provenance Actions
vigie_claims_extract-0.1.1.tar.gz 34.7 kB Without provenance Details for vigie_claims_extract-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 66.1 kB

Release files / vigie_claims_extract-0.1.1.tar.gz

Download URL vigie_claims_extract-0.1.1.tar.gz
Size 34.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f3cd0357bcb5cfa4b1f4bc14b03104f76078c7b8eda6d4842a8c5b0ac2406e65
BLAKE2b-256 checksum
How to use checksums
741df1c09d263c795645f41c32bf61b4803eb2dba40459a4a5b0e671a15b2de2
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.1-py3-none-any.whl

Download URL vigie_claims_extract-0.1.1-py3-none-any.whl
Size 31.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f291b85071be0c5675beec92a5fa93d9ca7c904e96e7ef33092e3e9a65bdb5d
BLAKE2b-256 checksum
How to use checksums
be317ec477f62a765f69c48ba079508ff4ef0d346aa188fa7c5e1a5f658b8cb4
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.1

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.1 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