NLP-Lecture 5 Context Free Grammar and Parsing
Learning Objective
- Context-Free Grammar(上下文无关语法)
- Structural Ambiguity 结构歧义
- Constituency Parsing 选取解析
- CYK Parsing Algorithm
- Statistical Parsing
- Dependency Parsing
- Syntactic Dependency
Syntactic Analysis语法分析
Syntax句法
It is the study of how sentences are put together out of words.
The word “syntax” comes from Greek, meaning “setting out together or arrangement”, and refers to the way words are arranges together.
- Constitutes: i.e., the group of words that act as a single unit or phrase, e.g., noun phrase, verb phrase and propositional phrase, etc.
- Grammatical Relationships: i.e., certain kinds of relations between words and phrases, for example, subjects, predicates, and objects.
Context-Free Grammar (CFG)上下文无关语法
Context-Free Grammar is the most widely used formal system for modeling constituent structure in natural languages (aka. Phrase-Structure Grammar).
Context-free grammars are the backbone of many formal models of the syntax of natural language. They are powerful enough to express sophisticated relations among the words in a sentence.
A context-free grammar consists of a set of rules, each of which expresses the ways that symbols of the language can be grouped and ordered to express the ways that symbols of the language can be grouped and ordered together, and a lexicon of words and symbols.
- Lexicon: Words and Symbols
- Rules (or Productions): Each expresses the ways that symbols of the language can be grouped and ordered.
For example, the following productions express that an NP (or noun phrase) can be composed of either a ProperNoun or a determiner (Det) followed by a Nominal; a Nominal in turn can consist of one or more Nouns.
- A CFG can be thought of in two ways.
- As a device for generating sentences, and
- As a device for assigning a structure to a given sentence.
- The term syntax is also used to refer to the structure (e.g., tree structure) of sentences.
- Bracketed Representation: A More Compact Representation
- There are other grammar formulations.
- Head-Driven Phrase Structure Grammar (HPSG)
- Lexical-Functional Grammar (LFG)
- Tree-Adjoining Grammar (TAG)
- Combinatory Categorial Grammar (CCG)
The approach to grammar presented thus far emphasizes phrase-structure rules while minimizing the role of the lexicon. Numerous alternative approaches have been developed that all share the common theme of making better use of the lexicon. These approaches differ with respect to how