1 Background
What is Semantic Parsing?
将自然语言的句子映射为一种完全的形式化语言,这种语言:拥有丰富的类型、属性和关系本体;支持自动化推理和执行。
2 Predicate Logical Query Language
谓词逻辑查询语言是语义分析中表示的一种方式,该语言基于谓词逻辑。
Challenges
- 词义的多样性。
given a book和give a code - 难以捕捉角色间的相似性:
givers,takers,holders
Solutions
- 细化谓词语义:Give_transfer_Possession , Gice_infect
- 泛化角色: Giver, Takers 都是 Agent
3 Semantic Role Labeling
语义角色是一种浅层的语义表示,以谓词为核心,分析其他成分和谓词之间的关系。简而言之,就是用5W1H去分解一个自然语言句子。
3.1 Semantic Role
- Agent: Subject
- Patient: Direct Object
- Instrument:Object of “with“ PP
- Beneficiary:Object of ”for“ PP
- Source:Object of ”from“ PP
- Destination:Object of ”to“ PP
Note:句法位置和语义角色的对应关系只是一种偏好,而不是规则。例如:given to 不是 Destination ; go with 不是Instrument
3.2 Selectional Restrictions
例如:
Agent should be animate。
Instruments should be tools
Patients of “eat” should be edible
这些先验知识对语义规则添加了限制,帮助我们进行语义角色标注
本体泛化后进行规则判断,可以使用WordNet来辅助泛化,再利用规则进行判断
Selectional Restrictions and Syntactic Ambiguity
Example:
- John hit the man with a dog
- Jhon hit the man with a hammer
Selectional Restrictions and Word Sense Disambiguation
Ambiguous nouns
- John wrote it with a pen
- Instruments of “write” should be WritingImplements
- John wrote it with a pen
Ambiguous verbs
- “John fired the secreatary”
- “John fired the rifle”
- Patients of DischargeWeapon should be Weapons
- Patients of CeaseEmploment should be Human
4 SRL Datasets
4.1 FrameNet
基本概念:FrameNet基于“框架”的概念,每个框架描述了一种特定语境中的事件或情景。咋框架中,标注了与该事件相关的语义角色,强调了时间的预警依赖性
应用领域:FrameNet由于强调预警,对于涉及事件、语境和实体之间关系的任务更加适用
覆盖范围:通常涵盖更加广泛的语义现象。
- 工作方式: 定义数百个特定的“场景”(如“商业交易”、“刑事判决”)。
- 角色命名: 角色名称非常具体,直接描述该场景下的实体。
- 例子: 在 “JUDGEMENT”(判决/评价) 这个框架中,动词 blame, praise, admire 都会触发这个框架。
- 角色: JUDGE (评价者), EVALUEE (被评价者), REASON (原因)。
- 覆盖范围: 不仅包含动词,还包含名词(如 fault, admiration)形容词等。
4.1.1 数据库构建
- 确定框架:选定特定的语义框架
- 选择目标词:确定哪些词可以唤起该框架
- 语料库筛选:从语料库中筛选出包含这些目标词的句子
- 人工标注:语言学家对这些句子进行语义角色标注
4.1.2 SRL 过程
- 框架识别
- 候选填充语分析
- 角色填充
- 处理关联关系
4.1.3 Relations between FrameNet
FrameNet 可以组成一个框架关系图谱,框架之间存在着层级和逻辑关联。
- 继承关系 (Inheritance relation)。子框架继承父框架的所有属性。
- 致使关系 (Causative_of relation)。一个动作导致了另一个状态/事件的发生。
4.2 PropBank
基本概念:PropBank则着眼于动词,并通过标注动词的论元结构来进行语义角色标注。它基于树库(Treebank)的信息,提供了关于动词的论元结构的详细标注。
应用领域:PropBank主要关注动词的论元结构,因此更适合涉及动作和动作执行者的任务。
覆盖范围:PropBank的关注点主要在于动词和与动词相关的论元。
- 核心理念: 它是 Penn Treebank(宾州树库,著名的句法库)的语义扩充版。它的目的是给树库中的每一个动词节点加上语义标签。
- 工作方式: 针对每一个具体的动词,定义其论元结构。
- 角色命名: 为了避免像 FrameNet 那样定义成千上万个具体角色名,它采用了抽象编号 (Arg0 - ArgN)。
- 核心定义(基于 Proto-Roles):
- Arg0: 原型施事者 (Proto-Agent),通常是动作的主动发起者。
- Arg1: 原型受事者 (Proto-Patient),通常是动作的影响承受者。
- Arg2 - Arg5: 根据具体动词不同而不同(含义不固定)。
- 核心定义(基于 Proto-Roles):
These roles are specific to each verb frame (Verb-Specific), but Arg0 and Arg1 follow a consistent “Proto-Role” definition across most verbs.
| Role Label | Prototype / General Category | Detailed Definition (Based on Dowty 1991) | Consistency |
|---|---|---|---|
| Arg0 | Proto-Agent | • Volitional involvement in event or state. • Sentience (and/or perception). • Causes an event or change of state in another participant. • Movement (relative to position of another participant). |
High (Consistent across verbs) |
| Arg1 | Proto-Patient | • Undergoes change of state. • Causally affected by another participant. • Stationary relative to movement of another participant. |
High (Consistent across verbs) |
| Arg2 | Instrument / Beneficiary / Attribute | Often used for: Instrument, Benefactive, Attribute, or End State. | Low (Varies by verb sense) |
| Arg3 | Start Point / Attribute | Often used for: Start Point, Benefactive, Instrument, or Attribute. | Low (Varies by verb sense) |
| Arg4 | End Point | Often used for: The end point. | Low (Varies by verb sense) |
| Arg5 | Modifier | (Used less frequently, definition depends entirely on the verb frame). | Low (Varies by verb sense) |
4.2.1 Example:
- 动词:Agree (同意)
(1) 角色定义 (Frame Roles)
| 标签 | 含义 (Description) |
|---|---|
| Arg0 | Agreer (同意者,主动发出动作的人) |
| Arg1 | Proposition (被同意的主张/提议) |
| Arg2 | Other entity agreeing (共同同意的另一方) |
(2) 标注案例 (Examples)
案例 A:
“The group agreed it wouldn’t make an offer.”
- [Arg0 The group] agreed [Arg1 it wouldn’t make an offer].
案例 B:
“Usually John agrees with Mary on everything.”
- [ArgM-TMP Usually] [Arg0 John] agrees [Arg2 with Mary] [Arg1 on everything].
- 动词:Fall (下跌/落下)
这个例子非常特殊,课件特意强调了它没有 Arg0。
(1) 角色定义 (Frame Roles)
| 标签 | 含义 (Description) |
|---|---|
| Arg1 | Logical subject, patient, thing falling (下跌物,逻辑主语) |
| Arg2 | Extent, amount fallen (下跌的幅度/量) |
| Arg3 | Start point (起点) |
| Arg4 | End point, end state of arg1 (终点/最终状态) |
关键问题: 为什么
fall没有 Arg0?
答案: 因为 “fall” 通常被视为非自主的动作(Unaccusative),没有原型施事者 (No Proto-Agent) 导致这个动作发生。与之相对的是 “push” 或 “drop”(有人让它掉)。
(2) 标注案例 (Examples)
案例 A:
“Sales fell to $25 million from $27 million.”
- [Arg1 Sales] fell [Arg4 to $25 million] [Arg3 from $27 million].
案例 B:
“The average junk bond fell by 4.2%.”
- [Arg1 The average junk bond] fell [Arg2 by 4.2%].
5 Empirical Methods for SRL
5.1 Pipeline:多阶段分类
以FrameNet为例,我们需要先做Frame识别,再抽取Role
最重要的是 特征工程
决定一个词的词性:由词意和上下文决定
5.2 End to End:序列标注问题
我们可以在语法树上进行标注
Features for SRL
- Phrase type
- Phrase tree path
- Position (在谓词的左边还是右边)
- Voice (active or passive verb)
- Head Word
6 Hard Problem
- 语法交替 (Syntactic Alternation):同一个谓词在不同的句式中,其语义角色分布会发生剧变。
- 介词短语挂接 (PP Attachment) 歧义: 介词短语既可以修饰动词(表示方式或工具),也可以修饰名词
- 远距离依赖 (Long-range Dependencies): 在复杂长句中,论元可能距离谓词非常远,识别这种跨度较大的语义关系非常困难