API介绍
来自Google的开源项目LangExtract:https://github.com/google/langextract
LangExtract 是 Google 出品的一个 Python 库,专注于「使用大语言模型(LLMs)从非结构化文本里提取结构化信息」。它的核心功能包括:
可以根据你的自定义规则和示例,从文本(如医疗报告、文学著作等)中提取实体、属性和关系等结构化数据。
能将结果与原始文本进行精准定位,可以很方便地实现高亮、可视化等检查或溯源。
特别适合长文本,比如一次性解析整本小说/医疗长报告,用分块并行和多次迭代提升召回率。
内置互动式 HTML 可视化,可以把抽取结果在网页里生动展示。
价格:根据模型调用的价格来计算
API调试台
登录后,探索更多精彩功能! 点击登录
API列表 (2)
| API描述 | 接口地址 | 请求方法 | 稳定性 | 参数说明 |
|---|---|---|---|---|
创建信息提取任务 | POST | 稳定 | 查看详情 | |
文档详情 来自Google的开源项目LangExtract:https://github.com/google/langextract LangExtract 是 Google 出品的一个 Python 库,专注于「使用大语言模型(LLMs)从非结构化文本里提取结构化信息」。它的核心功能包括: 价格:根据模型调用的价格来计算 请求参数 Header参数Authorizationstring必需 示例值: Bearer {{YOUR_API_KEY}}Body参数 application/jsonmodel_idanyOf可选 Multimodal Model ID 示例值: gemini-2.5-flash默认值: gemini-2.5-flashtext_or_documentsstring必需 Text or document link to extract 示例值: Lady Juliet gazed longingly at the stars, her heart aching for RomeopromptanyOf可选 Define the prompt and extraction rules 示例值:
Extract characters, emotions, and relationships in order of appearance.
Use exact text for extractions. Do not paraphrase or overlap entities.
Provide meaningful attributes for each entity to add context.
示例值:
Extract characters, emotions, and relationships in order of appearance.
Use exact text for extractions. Do not paraphrase or overlap entities.
Provide meaningful attributes for each entity to add context.
examplesanyOf可选 Provide a high-quality example to guide the model 示例值: [
{
"extractions": [
{
"attributes": {
"emotional_state": "wonder"
},
"extraction_class": "character",
"extraction_text": "ROMEO"
},
{
"attributes": {
"feeling": "gentle awe"
},
"extraction_class": "emotion",
"extraction_text": "But soft!"
},
{
"attributes": {
"type": "metaphor"
},
"extraction_class": "relationship",
"extraction_text": "Juliet is the sun"
}
],
"text": "\n\t\t\t\t\tROMEO. But soft! What light through yonder window breaks? It is the east, and Juliet is the sun.\n\t\t\t\t\t"
}
]示例值: [
{
"extractions": [
{
"attributes": {
"emotional_state": "wonder"
},
"extraction_class": "character",
"extraction_text": "ROMEO"
},
{
"attributes": {
"feeling": "gentle awe"
},
"extraction_class": "emotion",
"extraction_text": "But soft!"
},
{
"attributes": {
"type": "metaphor"
},
"extraction_class": "relationship",
"extraction_text": "Juliet is the sun"
}
],
"text": "\n\t\t\t\t\tROMEO. But soft! What light through yonder window breaks? It is the east, and Juliet is the sun.\n\t\t\t\t\t"
}
] | ||||
查看信息提取任务 | GET | 稳定 | 查看详情 | |
文档详情 查看信息提取任务 价格:免费 请求参数 Header参数Authorizationstring必需 示例值: Bearer {{YOUR_API_KEY}}Query参数task_idstring必需 任务ID | ||||
API价格表
| 模型 | 说明 | 302.AI价格 |
|---|
创建信息提取任务 | - |
|
查看信息提取任务 | - |
|
