google/langextract
A Python library for extracting structured information from unstructured text using LLMs with precise source grounding and interactive visualization.
What it solves
LangExtract는 비구조화 텍스트 문서에서 구조화된 정보를 추출하도록 설계된 Python 라이브러리입니다. 임상 노트나 보고서와 같은 자유 형식의 텍스트를 정돈된 데이터로 변환하면서, 추출된 모든 정보가 원본 텍스트에 근거하도록 하여 손쉽게 검증할 수 있게 합니다.
How it works
이 라이브러리는 대형 언어 모델(LLM)과 few‑shot 프롬프트 전략을 사용합니다. 사용자는 프롬프트와 텍스트를 구조화된 엔터티로 매핑하는 고품질 예시 몇 개를 제공하여 추출 작업을 정의합니다. 긴 문서를 처리하기 위해 텍스트 청킹, 병렬 처리, 다중 추출 패스를 활용해 리콜을 높입니다.
Who it’s for
모델을 파인튜닝하지 않고 비구조화 텍스트를 구조화된 데이터셋으로 변환해야 하는 개발자와 연구자를 위해 만들어졌습니다. 특히 의료 보고서나 문학 분석처럼 도메인 특화 문서에서 추적 가능성과 정밀도가 요구되는 경우에 유용합니다.
Highlights
- Precise Source Grounding: Maps extractions to exact character intervals in the source text for visual traceability.
- Reliable Structured Outputs: Uses controlled generation (in supported models) and few-shot examples to enforce consistent schemas.
- Long Document Optimization: Uses parallel processing and multiple passes to overcome the "needle-in-a-haystack" problem.
- Interactive Visualization: Generates self-contained HTML files to visualize extracted entities within their original context.
- Flexible LLM Support: Compatible with cloud models (Gemini, OpenAI) and local models via Ollama.
- Extensible Provider System: Allows users to add custom LLM providers via a plugin system.