Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.

Similar presentations


Presentation on theme: "Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free."— Presentation transcript:

1 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

2 Lexical Knowledge Representation concluded

3 Modelling verbs in DATR Think Present 1 st person singular think (I think) 2 nd person singular think (you think) 3 rd person singular thinks (she thinks) 1 st person plural think (we think) 2 nd person plural think (you two think) 3 rd person plural think (they think)

4 Lexical knowledge representation continued Summary Inheritance Inference rules Formalism Computable

5 Syntax-based computational language

6 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

7 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)

8 Structure of sentences: syntax (a)John saw Marysyntactic level (b)saw (John 1, Mary 2 )semantic level (c)Mary was seen by Johnsyntactic level (d)Mary sent John bookssyntactic level (e)sent (Mary 1, John 2, books 3 )semantic level (f)saw: 1 = agent, 2 = patient (g)sent: 1 = agent, 2 = goal, 3 = patient

9 Structure of sentences: syntax MaxmetJane Max gave Jane bananas

10 Structure of sentences: syntax N VN MaxmetJane NVN N Max gave Jane bananas

11 Structure of sentences: syntax The boys watched the game

12 Structure of sentences: syntax [The boys] watched [the game]

13 Structure of sentences: syntax [The boys] watched [the game] The boys from Brazil watched an interesting game on TV

14 Structure of sentences: syntax [The boys] watched [the game] [The boys from Brazil] watched [an interesting game on TV]

15 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

16 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]

17 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

18 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]

19 Context Free Grammars Taking linear strings as input Producing non-linear hierarchical data structures (graphs) as outputs Assumption: sentences have a constituent structure

20 Hierarchical structure 1. My mother likes her cats

21 Hierarchical structure 1. My mother likes her cats

22 Hierarchical structure 1. My mother likes her cats

23 Hierarchical structure 1. My mother likes her cats

24 Hierarchical structure 1. My mother likes her cats

25 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

26 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

27 Context Free Grammars Formal language Set of strings derivable from designated start symbol S Strings are ‘grammatical’ sentences

28 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

29 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

30 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.)

31 Sentence parsing recognize / accept a sentence generate sentences

32 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

33 Sentence parsing my mother likes her cats

34 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

35 Sentence parsing Two methods 1. top-down parsing The tree must have S as its root Deduction reasoning Rule-driven

36 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

37 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

38 Sentence parsing Two methods 2. bottom-up parsing trees grown upwards from the input sentence, using the grammar

39 Sentence parsing Two methods

40 Sentence parsing Top-down Parallel Depth-first, left-to-right: fully expand each partial tree beginning at the left-most node

41 Sentence parsing Top-down Bottom-up filtering Left-corner table

42 Sentence parsing Top-down Bottom-up filtering Left-corner table

43 Sentence parsing Problems Left recursion Grammar has a non-terminal symbol that has a expansion that includes itself AND it is the left-most symbol in the expansion e.g. NP -> NP PP

44 Sentence parsing Problems Structural ambiguity A given input sentence fits more than one candidate parse tree e.g. my friend saw the man with the telescope … NP -> NP PP VP -> V NP PP …

45 Sentence parsing Applications Grammar checker Semantic analysis


Download ppt "Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free."

Similar presentations


Ads by Google