登录 注册

langextract

去点 Star
数据分析与数据处理AI 模型与开发框架
39,303
Stars
0
Forks
0
Watchers
0
Open Issues
未知
许可证
Python
语言
创建时间
最近更新

项目能做什么

基于 LLM 从非结构化文本中提取结构化信息的 Python 库,支持精确原文溯源与交互式可视化。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
<p align="center">
  <a href="https://github.com/google/langextract">
    <img src="https://raw.githubusercontent.com/google/langextract/main/docs/_static/logo.svg" alt="LangExtract Logo" width="128" />
  </a>
</p>

# LangExtract

[![PyPI version](https://img.shields.io/pypi/v/langextract.svg)](https://pypi.org/project/langextract/)
[![GitHub stars](https://img.shields.io/github/stars/google/langextract.svg?style=social&label=Star)](https://github.com/google/langextract)
![Tests](https://github.com/google/langextract/actions/workflows/ci.yaml/badge.svg)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17015089.svg)](https://doi.org/10.5281/zenodo.17015089)
[![Live demo](https://img.shields.io/badge/%F0%9F%A4%97%20demo-LangExtract-yellow)](https://google-langextract.hf.space/)

## Table of Contents

- [Introduction](#introduction)
- [Why LangExtract?](#why-langextract)
- [Quick Start](#quick-start)
- [Installation](#installation)
- [API Key Setup for Cloud Models](#api-key-setup-for-cloud-models)
- [Adding Custom Model Providers](#adding-custom-model-providers)
- [Using OpenAI Models](#using-openai-models)
- [Using Local LLMs with Ollama](#using-local-llms-with-ollama)
- [More Examples](#more-examples)
  - [*Romeo and Juliet* Full Text Extraction](#romeo-and-juliet-full-text-extraction)
  - [Medication Extraction](#medication-extraction)
  - [Radiology Report Structuring: RadExtract](#radiology-report-structuring-radextract)
- [Community Providers](#community-providers)
- [Contributing](#contributing)
- [Testing](#testing)
- [How to Cite](#how-to-cite)
- [Disclaimer](#disclaimer)

## Introduction

LangExtract is a Python library that uses LLMs to extract structured information from unstructured text documents based on user-defined instructions. It processes materials such as clinical notes or reports, identifying and organizing key details while ensuring the extracted data corresponds to the source text.

<p align="center">
  <picture>
    <source media="(prefers-reduced-motion: reduce)" srcset="https://raw.githubusercontent.com/google/langextract/main/docs/_static/langextract_concept_still.png" />
    <img src="https://raw.githubusercontent.com/google/langextract/main/docs/_static/langextract_concept.gif" alt="LangExtract end to end: unstructured text is chunked, extracted in parallel by an LLM, and every extracted value is grounded back to its exact character span in the source" width="880" />
  </picture>
</p>

<p align="center">
  <b><a href="https://google-langextract.hf.space/">Try the live demo &rarr;</a></b><br>
  <sub>Run grounded extraction on <i>Romeo and Juliet</i> in your browser, no install required.</sub>
</p>

## Why LangExtract?

1.  **Precise Source Grounding:** Maps every extraction to its exact location in the source text, enabling visual highlighting for easy traceability and verification.
2.  **Reliable Structured Outputs:** Enforces a consistent output schema based on your few-shot examples, leveraging controlled generati
阅读完整原文

商业机会分析 AI 生成

交互式文档结构化与溯源审计 Web 工具(SaaS)

产品构想将 langextract 的原文定位和交互可视化能力产品化,封装为面向非技术人员的端到端文档提取与校验工作台。
核心功能PDF/Word 文档上传与解析、可视化自定义 Schema 配置、双栏原文高亮溯源与人工核对修正、结构化数据导出(JSON/Excel)。
目标用户法务、合规审计师、投研分析师、采购人员(推测)。
难度/周期中等 · 4-6 周 · 成本:极低(LLM API 调用费 + 基础前端托管及云存储服务)。
收费模式免费额度 + 按提取页数/调用次数的月度订阅制(推测)。
竞争风险文档格式多样化(扫描件、复杂表格)导致的解析偏差;长文本 token 消耗成本不可控(推测)。
依据 基于仓库具备 'precise source grounding and interactive visualization' 事实的 AI 推测

开箱即用的高可信信息抽取 API 聚合服务

产品构想基于该项目构建面向开发者的托管式提取 API,封装底层 LLM(如 Gemini)调优、批处理调度与溯源数据格式化。
核心功能统一 RESTful API、预置常用行业提取模板、自动 JSON 校验与修复、带字符级原文定位索引的输出结果。
目标用户需要从非结构化内容中自动化提取数据但不想自行维护 Prompt/LLM 架构的中小开发团队(推测)。
难度/周期低至中等 · 2-3 周 · 成本:低(基础云函数/网关及 API 代理转发成本)。
收费模式按 API 请求量阶梯计费(Pay-as-you-go)。
竞争风险竞品模型服务商(如 OpenAI、Google 原生 Structured Outputs)原生能力的直接竞争冲击(推测)。
依据 已验证事实(仓库为 Python 库且标签含 gemini-api、structured-data)

垂直领域(如合同/研报)提取与差异比对桌面客户端

产品构想结合本地/自选 API 密钥运行的轻量级桌面客户端,满足对数据敏感度高的企业或个人的文档提取与溯源核对需求。
核心功能本地运行/支持配置私有 API Key、敏感文档本地解析、提取字段一键对比与差异高亮标记、报告导出。
目标用户对数据隐私有顾虑的律所从业者、中小企业主、独立研究员(推测)。
难度/周期中等 · 3-5 周 · 成本:极低(无后端存储成本,客户端分发)。
收费模式买断制 License 或年费更新授权(推测)。
竞争风险桌面端跨平台兼容性维护成本较高,依赖用户自行提供高质量 LLM API Key(推测)。
依据 AI推测
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
f/prompts.chat 中文介绍暂未生成
f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect
176,827 MDX
langchain-ai/langchain 中文介绍暂未生成
The agent engineering platform.
149,312 Python
Graphify-Labs/graphify 中文介绍暂未生成
Turn any codebase, with its docs, SQL schemas, configs, and
145,491 Python
thedotmack/claude-mem 中文介绍暂未生成
Persistent Context Across Sessions for Every Agent – Captur
115,716 TypeScript
google-gemini/gemini-cli 中文介绍暂未生成
An open-source AI agent that brings the power of Gemini dire
108,758 TypeScript
Egonex-AI/Understand-Anything 中文介绍暂未生成
Graphs that teach > graphs that impress. Turn any code into
91,857 TypeScript
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 ,最近推送 ,发布过 21 个 Release
社区活跃Star 39,303 / Fork 0 / Issue 0(数据支持,可自行核实)
许可证未检测到(需人工确认)
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/google/langextract.git
cd langextract
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。