Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based...
-
Upload
saige-leavey -
Category
Documents
-
view
224 -
download
0
Transcript of Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based...
![Page 1: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/1.jpg)
Computational language: week 10 Lexical Knowledge Representation
concluded Syntax-based computational
language Sentence structure: syntax Context free grammars Phrase Structure rules Parsing with phrase structure grammars
![Page 2: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/2.jpg)
Lexical Knowledge Representation concluded
![Page 3: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/3.jpg)
Modelling verbs in DATR
ThinkPresent
1st person singular think (I think)2nd person singular think (you think)3rd person singular thinks (she thinks)1st person plural think (we think)2nd person plural think (you two think)3rd person plural think (they think)
![Page 4: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/4.jpg)
Lexical knowledge representation continued
Summary
Inheritance Inference rules Formalism Computable
![Page 5: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/5.jpg)
Syntax-based computational language
![Page 6: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/6.jpg)
Sentence structure
Units of the sentence are constituents Constituent: a group of words treated as a
single unit Minimum constituent is the word Structure of the sentence: syntax
![Page 7: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/7.jpg)
Structure of sentences: syntax
what is syntax?“characteriz[ing] the relation between
semantic predicate-argument relations and the superficial word and phrase configurations by which a language expresses them” (Kaplan 2003)
![Page 8: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/8.jpg)
Structure of sentences: syntax
(a) John saw Mary syntactic level
(b) saw (John1, Mary2) semantic level
(c) Mary was seen by John syntactic level(d) Mary sent John books syntactic level(e) sent (Mary1, John2, books3) semantic level
(f) saw: 1 = agent, 2 = patient(g) sent: 1 = agent, 2 = goal, 3 = patient
![Page 9: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/9.jpg)
Structure of sentences: syntax
Max met Jane
Max gave Jane bananas
![Page 10: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/10.jpg)
Structure of sentences: syntax N V N Max met Jane
N V N N Max gave Jane bananas
![Page 11: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/11.jpg)
Structure of sentences: syntax The boys watched the game
![Page 12: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/12.jpg)
Structure of sentences: syntax [The boys] watched [the game]
![Page 13: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/13.jpg)
Structure of sentences: syntax [The boys] watched [the game]
The boys from Brazil watched an interesting game on TV
![Page 14: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/14.jpg)
Structure of sentences: syntax [The boys] watched [the game]
[The boys from Brazil] watched [an interesting
game on TV]
![Page 15: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/15.jpg)
Structure of sentences: syntax [The boys] watched [the game]
[The boys from Brazil]l watched [an interesting
game on TV] My mother sent Mary a recipe
![Page 16: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/16.jpg)
Structure of sentences: syntax [The boys] watched [the game]
[The boys from Brazil]l watched [an interesting
game on TV] [My mother] sent Mary [a recipe]
![Page 17: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/17.jpg)
Structure of sentences: syntax [The boys] watched [the game]
[The boys from Brazil]l watched [an interesting
game on TV] [My mother] sent [a recipe] to Mary My mother in London sent my sister the wrong
recipe
![Page 18: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/18.jpg)
Structure of sentences: syntax NP V NP [The boys] watched [the game]
NP V NP [The boys from Brazil] watched [an interesting game on TV]
NP V NP NP [My mother] sent Mary [a recipe]
NP V NP NP [My mother in London] sent [my sister] [the wrong recipe]
![Page 19: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/19.jpg)
Context Free Grammars
Taking linear strings as input Producing non-linear hierarchical
data structures (graphs) as outputs Assumption: sentences have a
constituent structure
![Page 20: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/20.jpg)
Hierarchical structure1. My mother likes her cats
S
[my mother likes her cats]
![Page 21: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/21.jpg)
Hierarchical structure1. My mother likes her cats
S
[my mother likes her cats]
NP [my mother]
VP [likes her cats]
![Page 22: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/22.jpg)
Hierarchical structure1. My mother likes her cats
S
[my mother likes her cats]
NP [my mother]
VP [likes her cats]
Det N [my]
[mother]
![Page 23: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/23.jpg)
Hierarchical structure1. My mother likes her cats
S
[my mother likes her cats]
NP [my mother]
VP [likes her cats]
Det N [my]
[mother]
V NP
[her cats]
[likes]
![Page 24: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/24.jpg)
Hierarchical structure1. My mother likes her cats
S
[my mother likes her cats]
NP [my mother]
VP [likes her cats]
Det N [my]
[mother]
V NP
[her cats]
[likes]
Det N [her] [cats]
![Page 25: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/25.jpg)
Context Free Grammars Phrase structure rules
Item(s) to right of arrow is an ordered list of symbols
Item to left is a generalization over this list
Start symbol Rules unordered
![Page 26: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/26.jpg)
Context Free Grammars Phrase structure rules
The student enjoys maths The birds sang The relatives of my husband live in
Chicago The student drove his car into the
tree
![Page 27: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/27.jpg)
Context Free Grammars Formal language
Set of strings derivable from designated start symbol S
Strings are ‘grammatical’ sentences
![Page 28: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/28.jpg)
Context Free Grammars Four parameters
Set of non-terminal symbols or variables
Set of terminal symbols (found in lexicon)
Set of phrase structure rules Designated start symbol
![Page 29: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/29.jpg)
Computable grammars The evaluation of a grammar:
Its ability to capture significant generalizations within the specific grammar of a given language, and across the grammars of different languages
![Page 30: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/30.jpg)
Context Free Grammars / Phrase Structure Grammars (PSG)
Historical note Popularised by Chomsky Chomsky’s Transformational
Grammar Famous computable example:
Generalised Phrase Structure Grammar (Gazdar et al.)
![Page 31: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/31.jpg)
Sentence parsing recognize / accept a sentence generate sentences
![Page 32: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/32.jpg)
Sentence parsing recognize / accept a sentence generate sentences parsing: assign correct structure to
a sentence i.e. match a sentence to the correct
parse tree of the number of parse trees generated by a grammar
![Page 33: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/33.jpg)
Sentence parsingmy mother likes her cats
S
NP VP
Det N V NP
Det N
S
NP VP
Det N V
![Page 34: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/34.jpg)
Sentence parsing the set of possible trees generated by
the grammar is the search space parsing is searching through the space
to find correct tree for the given sentence
goal: find all trees which: 1. have their root in S 2. cover no more or less the words in the
input
![Page 35: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/35.jpg)
Sentence parsing Two methods 1. top-down parsing
The tree must have S as its root Deduction reasoning Rule-driven
![Page 36: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/36.jpg)
Sentence parsing Two methods 1. top-down parsing 2. bottom-up parsing
The tree must have n number of leaves, and the following terminal symbols: x, y, z
Induction reasoning Data-driven
![Page 37: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/37.jpg)
Sentence parsing Two methods 1. top-down parsing
trees grown downward to syntactic category nodes
trees rejected if leaf nodes do not line up with all words in input
![Page 38: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/38.jpg)
Sentence parsing Two methods 2. bottom-up parsing
trees grown upwards from the input sentence, using the grammar
![Page 39: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/39.jpg)
Sentence parsing Two methods
Top-down
Bottom-up
advantages disadvantages No search on trees that are not rooted in S Search space will include trees that are
not rooted in S
disadvantages advantages Generates trees which are not at all consistent with the input data
Any candidate tree will at the very least be consistent with the input data
![Page 40: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/40.jpg)
Sentence parsing Top-down
Parallel Depth-first, left-to-right:
fully expand each partial tree beginning at the left-most node
![Page 41: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/41.jpg)
Sentence parsing Top-down
Bottom-up filtering Left-corner table
![Page 42: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/42.jpg)
Sentence parsing Top-down
Bottom-up filtering Left-corner table
Category Left corners (Part of Speech) S
Noun or Determiner
NP Noun or Determiner VP Verb PP Preposition
![Page 43: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/43.jpg)
Sentence parsing Problems
Left recursionGrammar has a non-terminal symbol that
has a expansion that includes itself ANDit is the left-most symbol in the expansion
e.g. NP -> NP PP
![Page 44: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/44.jpg)
Sentence parsing Problems
Structural ambiguityA given input sentence fits more than one
candidate parse treee.g. my friend saw the man with the telescope
…NP -> NP PPVP -> V NP PP…
![Page 45: Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551ae6c5550346f70d8b48f6/html5/thumbnails/45.jpg)
Sentence parsing Applications
Grammar checker Semantic analysis