Lecture 4 Flashcards
Grammar and Parsing
Syntactic Level Analysis
To analyze how words are put together
to make valid sentences
Grammar:
Grammar: the kind of implicit
knowledge of your native language that
you had mastered by the time you were
3 or 4 years old without explicit
instruction
Chomsky:
syntactic structure can be independent on the meaning of the sentence
Grammars (and parsing) are key
components in many applications:
- Grammar checkers
- Dialogue management
- Question answering
- Information extraction
- Machine translation
Two types of Grammars
*Context Free Grammar (CFG), also known
as Phrase Structure Grammar
* Dependency Grammar
Context Free Grammar (CFG)
a set of recursive rewriting rules (or productions) used to generate patterns of strings.
CFGs describe the structure of language by capturing
constituency and ordering
Constituency
How we group words into units and what we say about how the various kinds of units behave
Ordering
Rules that govern the ordering of words and bigger units in the language
Notations of CFG
Non-terminal
symbols represent the phrases, the categories of phrases, or the constituents,
e.g., NP, VP, etc.
Notations of CFG
Terminals
symbols are the words,
e.g., car. They
often come from words in a lexicon
Notations of CFG
Rewrite rules / productions
rules for replacing nonterminal symbols (on the left
side) with other nonterminal or terminal symbols (on the right side)
Notations of CFG
Start symbol:
a special nonterminal symbol that appears in the initial string generated by the grammar: S [NP VP] | VP
derivation
a sequence of rules applied to a string that accounts for that string
* Covers all the elements in the string
* Covers only the elements in the string
Parsing
is the process of finding a derivation (i. e. sequence of productions) leading from the START symbol to a
TERMINAL symbol (or TERMINALS to START symbol)
Challenges for CFG
Agreement
In English, subjects and verbs have to agree in person and number; Determiners and nouns have to agree in
number. S - NP VP
Challenges for CFG
Subcategorization
expresses the constraints that a particular verb (sometimes called the predicate) places on the number and
syntactic types of arguments it wants to take (occur with)
Dependency Grammar
- Dependency grammars offer a different
way to represent syntactic structure - CFGs represent constituents in a parse
tree that can derive the words of a
sentence - Dependency grammars represent
syntactic dependency relations between
words that show the syntactic structure - Syntactic structure is the set of relations
between a word (aka the head word) and
its dependents.