langextract

Extract structured data from unstructured text with source grounding.

Updated Dec 14, 2025
One-click install
npx skills add https://github.com/aeonbridge/ab-anthropic-claude-skills --skill langextract
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: langextract
Source: https://github.com/aeonbridge/ab-anthropic-claude-skills/tree/main/output/langextract
Command: npx skills add https://github.com/aeonbridge/ab-anthropic-claude-skills --skill langextract

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

LangExtract enables precise, source-grounded extraction of structured data from unstructured text using large language models, with support for long documents and interactive visualization.

Core Features & Use Cases

  • Source grounding for exact text locations in documents
  • Long-document processing with intelligent chunking and multi-pass extraction
  • Interactive HTML visualization for review and validation
  • Flexible model support: Gemini, OpenAI, and local Ollama
  • Domain coverage including clinical notes, radiology reports, and literary analysis

Quick Start

Install LangExtract via pip, then craft a note, a prompt, and run lx.extract with a chosen model_id (e.g., gemini-2.0-flash-exp). Visualize results with lx.visualize to inspect extractions.

Frequently Asked Questions about langextract

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract structured data from unstructured text with source grounding?

You can extract structured data from unstructured text with source grounding by using LLMs to process documents like clinical notes and academic papers, ensuring schema-compliant outputs that trace back to exact text locations.

Can I process long documents for structured data extraction without losing context?

Yes, you can process long documents by applying intelligent chunking and multi-pass extraction, which segments the text to maintain context and ensures accurate data extraction across the entire document.

Does structured data extraction work with both OpenAI and local LLMs?

Structured data extraction supports flexible model configuration, allowing you to use OpenAI, Gemini, or local Ollama models via Python APIs to generate schema-compliant outputs.

What is the best way to validate extracted data from radiology reports?

The best way to validate extracted data from radiology reports is to use an interactive HTML visualization, which allows you to review the extracted structured data and inspect the exact source text locations.

How do I extract schema-compliant data from clinical notes using Python?

You can extract schema-compliant data from clinical notes by installing the library via pip, defining a prompt, and running the extraction function with your chosen model ID to process the notes into structured formats.

Why use multi-pass reasoning for extracting structured data from academic papers?

Multi-pass reasoning is used for extracting structured data from academic papers to handle complex text structures, ensuring the LLM accurately captures and grounds data across multiple iterations of the source document.