![Page 1: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/1.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
FLST
Grammars and Parsing
Hans Uszkoreit
![Page 2: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/2.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
WHAT HAPPENS IN BETWEEN?
![Page 3: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/3.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
WHAT HAPPENS IN BETWEEN?
sound waves activation of concepts
![Page 4: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/4.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
WHAT HAPPENS IN BETWEEN?
sound waves activation of concepts
GrammarGrammar
![Page 5: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/5.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
WHAT HAPPENS IN BETWEEN?
GrammarGrammarsound waves activation of concepts
![Page 6: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/6.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
WHAT HAPPENS IN BETWEEN?
sound waves activation of concepts
GrammarGrammar
![Page 7: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/7.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
WHAT HAPPENS IN BETWEEN?
N
NP
A
NDetV
VP
NP
S
Sue gave Paul an old penny.
NP
sound waves activation of concepts
GrammarGrammar
![Page 8: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/8.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
WHAT HAPPENS IN BETWEEN?
phonology/morphology
semantic interpretation
N
NP
A
NDetV
VP
NP
S
Sue gave Paul an old penny.
NP
sound waves activation of concepts
GrammarGrammar
![Page 9: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/9.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
THREE TRADITIONS
N
NP
A
NDetV
VP
NP
S
Sue gave Paul an old penny.
NP
N
NP
A
NDetV
VP
NP
S
Sue gave Paul an old penny.
NP
phrase structure grammar
Sue
give
Paul
old
penny
Act ObjGoal
Obj
dependencygrammar
NP N/NNP/N N((S\NP)/NP)/NPSue gave Paul old penny
NPan
(S\NP)/NPN
NP
S\NP
S categorialgrammar
![Page 10: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/10.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
Grammatik
N
NP
A
NDetV
VP
NP
S
Sue gave Paul an old penny.
NP
phrase structure grammar
S NP VP
![Page 11: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/11.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
Grammatik
N
NP
A
NDetV
VP
NP
S
Sue gave Paul an old penny.
NP
phrase structure grammar
S NP VP
![Page 12: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/12.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
Grammatik
N
NP
A
NDetV
VP
NP
S
Sue gave Paul an old penny.
NP
phrase structure grammar
S NP VPVP V NP NP
![Page 13: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/13.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
Grammar
N
NP
A
NDetV
VP
NP
S
Sue gave Paul an old penny.
NP
phrase structure grammar
S NP VPVP V NP NP
V gave
![Page 14: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/14.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
Why Syntax
Einen Hund hat dieser Mann gebissen.
Ein Hund hat diesen Mann gebissen.
This man has bitten a dog.
A dog this man has bitten.
A dog has bitten this man.
Peter promised Paul, to process the files.
Peter persuaded Paul, to process the files.
![Page 15: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/15.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
N
NP
A
NDetV
VP
NP
S
Sue gave Paul an old penny.
NP
![Page 16: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/16.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
Formal Grammar
A language over an alphabet (vocabulary) is a subset of *.
A formal grammar GL for a language L is a
quadruple (VN, VT, {S}, P).
VN - non-terminal vocabulary (auxiliary vocabulary)
VT - terminal vocabulary
(VT VN = Ø, L VT*, V= VT VN)
{S} - singleton with the start symbol (set of axioms)
P - set of productions, rule set
set of rules of the form
usually written as
![Page 17: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/17.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
derivation
relation “follows":
If G = (VN, VT, {S}, P), then follows from according to G iff there are strings 1, 2, , , so that 1, 2 und 1, 2 und P.
Notation:
derivation:
A sequence of strings 1, 1, ..., n is a derivation according to G iff for all i, 1 i n.
If there is derivable according to G from to we can write this:
The relation derivable is transitive and is moreover defined to be reflexive.
φ ψ⇒
G
φi
φi + 1
⇒
G
φ ψ⇒
G
*
![Page 18: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/18.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
The generated language
The language L: A string is in L according to GL iff the following three conditions are fulfilled:
1. VT*
2.
3. There is no , so that and
We say that GL generates the language L. The language L generated by G is also written as L(G).
Weak Equivalence: Two grammar G1 and G2 are weakly equivalent, if they generate the same language.
S ⇒
G
*
χ⇒
G
*
![Page 19: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/19.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
Types of Grammars
Type 0 (unrestricted rewriting systems):
Every formal grammar according to the definition is of type 0.
Type 1 (context sensitive grammars):
Every production is of the form A , where A VN, .
Type 2 (context free grammars):
Every production is of the form A , where .
Type 3 (regular grammars):
Every production is of the form A x B or A x, where x
![Page 20: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/20.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
context-free derivations
SNP VP
DET ADJ N VPDET ADJ N V NP
DET ADJ N V DET ADJ N...
ein kleines Mädchen sucht ein kleines Mädchen
![Page 21: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/21.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
Trees
the notion of syntactic constituent tree
coded information
1. the hierarchic organisation of a sentence in terms of constituents
2. the assignment of each constituent to a linguistic class (category)
3. the linear sequence of the constituents
N
NP
A
NDetV
VP
NP
S
Sue gave Paul an old penny.
NP
![Page 22: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/22.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
Trees II
relations: immediate dominance - dominance immediate precedence - precedence
constituent structure tree: quintuple(N, Q, D, P, L)
N - finite set of nodesQ - finite set of labelsD - weak partial order in N x N, the dominance relation
(reflexive, transitive und antisymmetric)P - strong partial order in N x N, the precedence relation
(irreflexive, transitive und asymmetric)L - function from N into Q, the labelling function
conditions:
(single) root conditionexclusivity conditionno crossing condition / no tangling condition
![Page 23: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/23.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
Conditions
root condition
There is exactly one node that dominates all other nodes of the tree.
exclusivity condition
For any two nodes x and y holds either D(x,y) or D(y,x) or P(x,y) or P(y,x) but never both.
no-tangling condition
If P(x,y) then for all x‘ dominated by x [D(x,x')] and for all y‘ dominated by y [D(y, y')] that x' precedes y' [P(x', y')]
![Page 24: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/24.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
Parsing
The syntactic analysis of strings according to a grammar we call parsing
input: terminal stringoutput: structure of the sentence, i.e. all constituents usually a tree
parsing algorithms:top-down vs bottom-upleft-right vs right left vs birectional or island parsingdeterministic vs. non-deterministic
![Page 25: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/25.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
Grammar
N
NP
A
NDetV
VP
NP
S
Sue gave Paul an old penny.
NP
transformationalgrammar
what did Sue give Paul ____ ?
NP
V
VP
NP
S
NP
AuxNP-Q
IPS
![Page 26: © 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit](https://reader035.vdocuments.site/reader035/viewer/2022062315/5697bfb51a28abf838c9dbe3/html5/thumbnails/26.jpg)
© 2005 Hans Uszkoreit FLST WS 05/06
Grammar
N
NP
A
NDetV
VP
NP
S
Sue gave Paul an old penny.
NP
PHON/anoldpenny/
SYN
CATNP
HEADCASEobjectiveNUMBERsingPERSONthird
VALENCEvstruc
SEM
QUANTexistVARX1
RESTR
RELold'VARX1
ARGpenny'
Unification grammar