Presentation is loading. Please wait.

Presentation is loading. Please wait.

LING/C SC/PSYC 438/538 Lecture 14 Sandiway Fong. Administrivia Midterm – This Wednesday – A bit like doing a homework in real time – Bring your laptop.

Similar presentations


Presentation on theme: "LING/C SC/PSYC 438/538 Lecture 14 Sandiway Fong. Administrivia Midterm – This Wednesday – A bit like doing a homework in real time – Bring your laptop."— Presentation transcript:

1 LING/C SC/PSYC 438/538 Lecture 14 Sandiway Fong

2 Administrivia Midterm – This Wednesday – A bit like doing a homework in real time – Bring your laptop – Exam slides available at class time – Answer as many questions as you can and email me your answers at 7pm – Tested on material covered up to and including today – If you are unable to attend class, you must make alternative arrangements with me Next week (2 nd half of the course begins) – Morphology: reading Chapter 3

3 Administrivia Guest Lectures – Dr. Jerry Ball, Army Research Lab, Mesa AZ – October 25 th and November 1 st – Abstract on next slide…

4 Administrivia A Pseudo-Deterministic Model of Human Language Processing with a Computational Implementation A cognitively plausible and functional model of human language processing (HLP) will be presented which combines an incremental, serial, pseudo-deterministic processing mechanism and a non- monotonic mechanism of context accommodation, with an interactive, probabilistic mechanism that uses all available information in parallel to select the best choice at each choice point. The results of processing are linguistic representations that combine structural and functional information that is largely consistent with the “Simpler Syntax” of Culicover & Jackendoff, as well as Huddleston & Pullum’s comprehensive grammar of English. The first lecture will focus on the theoretical underpinnings of the system of linguistic representation and the pseudo-deterministic processing mechanism. The second lecture will focus on the computational implementation and will go into more detail on the linguistic representations that are generated by the model. The second lecture will include a demo of the model. References Ball, J., Freiman, M., Rodgers, S. & Myers, C. (2010). Toward a Functional Model of Human Language Processing. Proceedings of the 32 nd Annual Meeting of the Cognitive Science Society. Culicover, P. (2009) Natural Language Syntax. Oxford. Culicover, P. & Jackendoff, J. (2005). Simpler Syntax. Oxford. Huddleston, R. & Pullum, G. (2002). The Cambridge Grammar of the English Language. Cambridge.

5 Extra Argument: Parse Tree Recovering a parse tree – when want Prolog to return more than just Yes/No answers – in case of Yes, we can compute a syntax tree representation of the parse – by adding an extra argument to nonterminals – applies to all grammar rules (not just regular grammars) Example sheeptalk again DCG (non-regular, context-free): s --> [b], [a], a, [!]. a --> [a]. (base case) a --> [a], a. (recursive case) s a! a a a a b

6 Extra Argument: Parse Tree Tree: Prolog data structure: – term – hierarchical – allows sequencing of arguments – functor(arg 1,..,arg n ) – each arg i could be another term or simple atom s a! a a a a b s(b,a,a(a,a(a)),!)

7 Extra Arguments: Parse Tree DCG – s --> [b],[a], a, [!]. – a --> [a]. (base case) – a --> [a], a. (right recursive case) base case –a --> [a]. –a(subtree) --> [a]. –a(a(a)) --> [a]. recursive case –a --> [a], a. –a(subtree) --> [a], a(subtree). –a(a(a,A)) --> [a], a(A). s a! a a a a b s(b,a,a(a,a(a)),!) Idea: for each nonterminal, add an argument to store its subtree

8 Extra Arguments: Parse Tree Prolog grammar – s --> [b], [a], a, [!]. – a --> [a]. (base case) – a --> [a], a. (right recursive case) base and recursive cases –a(a(a)) --> [a]. –a(a(a,A)) --> [a], a(A). start symbol case –s --> [b], [a], a, [!]. –s(tree) --> [b], a(subtree), [!]. –s(s(b,a,A,!) ) --> [b], [a], a(A), [!]. s a! a a a a b s(b,a,a(a,a(a)),!)

9 Extra Arguments: Parse Tree Prolog grammar – s --> [b], [a], a, [!]. – a --> [a]. (base case) – a --> [a], a. (right recursive case) Equivalent Prolog grammar computing a parse –s(s(b,a,A,!)) --> [b], [a], a(A), [!]. –a(a(a)) --> [a]. –a(a(a,A)) --> [a], a(A).

10 Extra Arguments: Agreement Idea: – We can also use an extra argument to impose constraints between constituents within a DCG rule – (in fact, we can have multiple extra arguments) Example: – English determiner-noun number agreement – Data: the man the men a man *a men – Lexical Features: man singular men plural

11 Extra Arguments: Agreement Context-Free Grammar of English: s(s(Y,Z)) --> np(Y), vp(Z). np(np(Y)) --> pronoun(Y). pronoun(i) --> [i]. pronoun(we) --> [we]. np(np(D,N)) --> det(D), common_noun(N). det(det(the)) --> [the]. det(det(a)) --> [a]. common_noun(n(ball)) --> [ball]. common_noun(n(man)) --> [man]. common_noun(n(men)) --> [men]. vp(vp(Y)) --> unergative(Y). vp(vp(Y,Z)) --> transitive(Y), np(Z). unergative(v(ran)) --> [ran]. transitive(v(hit)) --> [hit]. Example sentences – We ran – The men hit the ball – etc. – *A men hit a ball Example sentences – We ran – The men hit the ball – etc. – *A men hit a ball

12 Extra Arguments: Agreement Let’s test and modify this grammar in Prolog Test: ?- s(Tree,Sentence,[]). Sentence is a Prolog list to be supplied by user Tree a variable

13 Extra Arguments: Agreement Data: – the man/men – a man/*a men Grammar: (NP section) – np(np(Y)) --> pronoun(Y). – np(np(D,N)) --> det(D), common_noun(N,Number). – det(det(the)) --> [the]. – det(det(a)) --> [a]. – common_noun(n(ball),sg) --> [ball]. – common_noun(n(man),sg) --> [man]. – common_noun(n(men),pl) --> [men]. – pronoun(i) --> [i]. – pronoun(we) --> [we]. –Idea: specify singular ( sg ) and plural ( pl ) for common nouns using an extra argument Rules the can combine with singular or plural nouns a can combine only with singular nouns

14 Extra Arguments: Agreement Data: – the man/men – a man/*a men Grammar: (NP section) np(np(Y)) --> pronoun(Y). np(np(D,N)) --> det(D,Number), common_noun(N,Number). det(det(the),sg) --> [the]. det(det(the),pl) --> [the]. det(det(a),sg) --> [a]. common_noun(n(ball),sg) --> [ball]. common_noun(n(man),sg) --> [man]. common_noun(n(men),pl) --> [men]. pronoun(i) --> [i]. pronoun(we) --> [we]. –Idea: give determiners a number feature as well and make it agree with the noun Rules the can combine with singular or plural nouns a can combine only with singular nouns

15 Extra Arguments: Agreement Simplifying the grammar: det(det(the),sg) --> [the]. det(det(the),pl) --> [the]. det(det(a),sg) --> [a]. Grammar is ambiguous: – two rules for determiner the Agreement Rule (revisited): the can combine with singular or plural nouns i.e. the doesn’t care about the number of the noun DCG Rule: np(np(D,N)) --> det(D,Number), common_noun(N,Number). det(det(the),_) --> [the]. Note: _ is a variable used underscore character because we don’t care about the name of the variable

16 Extra Arguments: Agreement Note: Use of the extra argument for agreement here is basically “syntactic sugar” and lends no more extra expressive power to the grammar rule system i.e. we can enforce the agreement without the use of the extra argument at the cost of more rules Note: Use of the extra argument for agreement here is basically “syntactic sugar” and lends no more extra expressive power to the grammar rule system i.e. we can enforce the agreement without the use of the extra argument at the cost of more rules Instead of np(np(D,N)) --> det(D,Number), common_noun(N,Number). we could have written: np(np(D,N)) --> detsg(D), common_nounsg(N). np(np(D,N)) --> detpl(D), common_nounpl(N). detsg(det(a)) --> [a]. detsg(det(the)) --> [the]. detpl(det(the)) --> [the]. common_nounsg(n(ball)) --> [ball]. common_nounsg(n(man)) -->[man]. common_nounpl(n(men)) --> [men].

17 Extra Arguments: Expressive Power General Question: – Does the extra argument change the system? – i.e. does it offer the grammar more expressive power ? Answer: – Yes Example: – We can write an otherwise regular-looking DCG for the non-regular language L ab = { a n b n | n ≥ 1 } (which cannot be encoded by any regular grammar)

18 Extra Arguments: Expressive Power s(X) --> [a],b(a(X)). b(X) --> [a],b(a(X)). b(a(X)) --> [b],c(X). b(a(0)) --> [b]. c(a(X)) --> [b],c(X). c(a(0)) --> [b]. Query: ?- s(0,L,[]). s --> [a],b. b --> [a],b. b --> [b],c. b --> [b]. c --> [b],c. c --> [b].  a+b+a+b+ a regular grammar regular grammar + extra argument

19 Extra Arguments: Expressive Power Computation tree: – ?- s(0,[a,a,b,b],[]). – ?- b(a(0),[a,b,b],[]). – ?- b(a(a(0)),[b,b],[]). – ?- c(a(0),[b],[]). – Yes s(X) --> [a],b(a(X)). b(X) --> [a],b(a(X)). b(a(X)) --> [b],c(X). b(a(0)) --> [b]. c(a(X)) --> [b],c(X). c(a(0)) --> [b].


Download ppt "LING/C SC/PSYC 438/538 Lecture 14 Sandiway Fong. Administrivia Midterm – This Wednesday – A bit like doing a homework in real time – Bring your laptop."

Similar presentations


Ads by Google