一.句法结构(syntactic structure)
主要有两种方式:
1)Constituency Parsing
2)Dependency Parsing
二.Constituency Parsing
Constituency =phrase structure grammar(短语语法) = context-free grammars (CFGs,无上下文语法)
其主要步骤:首先将每个词做词性分析(POS分析),然后将单个词组成短语,最后将短语递归构成更大的短语
例:
首先,对 the cuddly cat by the door做POS分析,the是限定词,用Det(Determiner)表示; cuddly是形容词,用Adj(Adjective)代表; cat和door是名词,用N(Noun)表示;by是介词,用P(Preposition)表示。
然后,the cuddly cat构成名词短语NP(Noun Phrase),这里由Det(the)+Adj(cuddly)+N(cat)构成;by the door构成介词短语PP(Preposition Phrase), 这里由P(by)+NP(the door)构成。
最后,整个短语the cuddly cat by the door 是NP,由NP(the cuddly cat)+ PP(by the door)构成。
Why do we need sentence structure?
- 为了能够正确地解释语言,我们需要理解句子结构
- 人类通过将单词组合成更大的单元来传达复杂的意思,从而交流复杂的思想
- 我们需要知道什么与什么相关( 除非我们知道哪些词是其他词的参数或修饰词,否则我们无法弄清楚句子是什么意思)
三.Dependency Parsing
3.1 概念
Dependency Structure展示了词语之前的依赖关系,通常用箭头表示其依存关系,有时也会在箭头上标出其具体的语法关系,如是主语还是宾语关系等。
Dependency Structure有两种表现形式
- 一种是直接在句子上标出依存关系箭头及语法关系