3.1.2 文本块 → 实体与关系
4 / 8In this step, the LLM is prompted to extract instances of important entities and the relationships between the entities from a given chunk. Additionally, the LLM generates short descriptions for the entities and relationships. To illustrate, suppose a chunk contained the following text:
在这一步,通过提示让大语言模型从给定文本块中提取重要实体的实例及实体之间的关系。同时,模型还会为实体与关系生成简短描述。举例来说,假设一个文本块包含下面的内容:
NeoChip’s (NC) shares surged in their first week of trading on the NewTech Exchange. However, market analysts caution that the chipmaker’s public debut may not reflect trends for other technology IPOs. NeoChip, previously a private entity, was acquired by Quantum Systems in 2016. The innovative semiconductor firm specializes in low-power processors for wearables and IoT devices.
NeoChip(NC)的股票在 NewTech 交易所上市交易的第一周大幅上涨。不过,市场分析师提醒,这家芯片制造商的上市表现可能并不能反映其他科技公司首次公开募股的趋势。NeoChip 此前是一家非上市实体,于 2016 年被 Quantum Systems 收购。这家创新半导体公司专门为可穿戴设备与物联网设备开发低功耗处理器。
The entity NeoChip , with description “NeoChip is a publicly traded company specializing in low-power processors for wearables and IoT devices.”
实体 NeoChip,描述为:“NeoChip 是一家上市公司,专门为可穿戴设备与物联网设备开发低功耗处理器。”
The entity Quantum Systems , with description “Quantum Systems is a firm that previously owned NeoChip.”
实体 Quantum Systems,描述为:“Quantum Systems 是一家此前拥有 NeoChip 的公司。”
A relationship between NeoChip and Quantum Systems , with description “Quantum Systems owned NeoChip from 2016 until NeoChip became publicly traded.”
NeoChip 与 Quantum Systems 之间的关系,描述为:“Quantum Systems 从 2016 年起拥有 NeoChip,直至 NeoChip 上市。”
These prompts can be tailored to the domain of the document corpus by choosing domain appropriate few-shot exemplars for in-context learning ( Brown et al.,, 2020 ) . For example, while our default prompt extracts the broad class of “named entities” like people, places, and organizations and is generally applicable, domains with specialized knowledge (e.g., science, medicine, law) will benefit from few-shot exemplars specialized to those domains.
可以为上下文学习选择适合领域的少样本示例,从而使这些提示适应文档语料所在的领域(Brown 等,2020)。例如,默认提示提取的是人、地点、组织等广义“命名实体”,具有通用性;而科学、医学、法律等具有专门知识的领域,则会受益于针对该领域定制的少样本示例。
The LLM can also be prompted to extract claims about detected entities. Claims are important factual statements about entities, such as dates, events, and interactions with other entities. As with entities and relationships, in-context learning exemplars can provide domain-specific guidance. Claim descriptions extracted from the example tetx chunk are as follows:
还可以提示大语言模型提取关于已识别实体的断言。断言是关于实体的重要事实陈述,例如日期、事件以及与其他实体的交互。与实体和关系的抽取一样,上下文学习示例可以提供领域特定的指导。从上述示例文本块中抽取的断言描述如下:
NeoChip’s shares surged during their first week of trading on the NewTech Exchange.
NeoChip 的股票在 NewTech 交易所开始交易的第一周大幅上涨。
NeoChip debuted as a publicly listed company on the NewTech Exchange.
NeoChip 在 NewTech 交易所首次以公开上市公司的身份交易。
Quantum Systems acquired NeoChip in 2016 and held ownership until NeoChip went public.
Quantum Systems 于 2016 年收购 NeoChip,并一直持有其所有权,直至 NeoChip 上市。
See Appendix A for prompts and details on our implementation of entity and claim extraction.
实体和断言抽取的提示词及实现细节,见附录 A。
本节正文与示例对照,图表及其他章节请查阅原文。译文尚未经人工专业审校。
原始示例中哪句话证明股权在上市时终止?如果没有,应该怎样标记这个断言?
划选正文也可以保存重点。笔记默认仅自己可见,确认公开后才进入共学社区。
留意示例里的推断:上市并不必然意味着原股东退出。抽取结果中的“持有至上市”需要额外证据;别把模型补出的解释当作已经核实的事实。