1 / 22

CSA2050: Definite Clause Grammars IV

CSA2050: Definite Clause Grammars IV. Handling Gaps II Semantic Issues. Resum é. Relative clauses such as the book that Bertrand wrote are derived from a corresponding sentence Bertrand wrote the book [that] Bertrand wrote the book. Deriving the DCG.

Download Presentation

CSA2050: Definite Clause Grammars IV

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSA2050:Definite Clause GrammarsIV Handling Gaps II Semantic Issues CSA2050: DCG IV

  2. Resumé • Relative clauses such asthe book that Bertrand wroteare derived from a corresponding sentenceBertrand wrote the book • [that] Bertrand wrote the book CSA2050: DCG IV

  3. Deriving the DCG • We can write down the parts of speechThe book [that] Bertrand wrote D N RELPRON N V np(gap) • … and try to build the grammar rules. A naïve approach is to derive DCG rule directlyNP --> D N RELPRON N V np(gap) • A better approach isNP --> D N optrel np(gap) CSA2050: DCG IV

  4. Rules for optrel(optional relative clause) • optrel --> [ ].An optrel is optional. • optrel --> relpron, s(gap(np)).An optrel can be "that" followed by a sentence with a missing np object • Next we look at rule for producing s with and without gaps, i.e. s(nogap) and s(gap(np)). CSA2050: DCG IV

  5. Rules for S • s --> s(nogap)A sentence can either have no gap • s --> s(gap(np))or it can have a gap(np) feature. Where does S get the gap feature from? • s(G) --> np(nogap), vp(G).It comes from the VP. Note that the subject NP cannot have a gap (i.e. be empty). CSA2050: DCG IV

  6. Rules for VP • vp(G) --> v, np(G).In the case of a transitive verb the gap feature is inherited from the object NP. • vp(nogap) --> v.In the case of an intransitive verb, the VP has no gap. CSA2050: DCG IV

  7. Rules for NP • np(nogap) --> det, n, optrel.Normal NP case • np(nogap) --> n.This covers case of plurals or proper nouns. • np(gap(np)) --> [ ].The gap case – no lexical material appears on the surface CSA2050: DCG IV

  8. % grammar s --> s(nogap). s --> s(gap(np)). s(G) --> np(nogap), vp(G). np(nogap) --> det,n,optrel np(nogap) --> n. np(gap(np)) --> [ ]. optrel --> [ ]. optrel --> rel, s(gap(np)). optrel --> rel, vp(nogap). vp(G) --> v, np(G). vp(nogap) --> v. % lexicon n --> [john]. n --> [bertrand]. n --> [program]. rel --> [that]. det --> [the]. v --> [halts]. v --> [wrote]. Grammar and Lexicon CSA2050: DCG IV

  9. Call: (6) s(_G395, [john, wrote], []) ? creep Call: (7) np(nogap, [john, wrote], _G459) ? creep Call: (8) det([john, wrote], _G458) ? creep Fail: (8) det([john, wrote], _G458) ? creep Redo: (7) np(nogap, [john, wrote], _G459) ? creep Call: (8) n([john, wrote], _G458) ? creep Exit: (8) n([john, wrote], [wrote]) ? creep Exit: (7) np(nogap, [john, wrote], [wrote]) ? creep Call: (7) vp(_G395, [wrote], []) ? creep Call: (8) v([wrote], _G458) ? creep Exit: (8) v([wrote], []) ? creep Call: (8) np(_G395, [], []) ? creep Call: (9) det([], _G458) ? creep Fail: (9) det([], _G458) ? creep Redo: (8) np(_G395, [], []) ? creep Call: (9) n([], []) ? creep Fail: (9) n([], []) ? creep Redo: (8) np(_G395, [], []) ? creep Exit: (8) np(gap(np), [], []) ? creep Exit: (7) vp(gap(np), [wrote], []) ? creep Exit: (6) s(gap(np), [john, wrote], []) ? creep X=gap(np) CSA2050: DCG IV

  10. Handling NLP Semantics • In order handle semantics of NL sentences we have to do at least the following: • Decide what is meant by semantics. • Create a suitable representation to encode the semantics. • Figure out how to compute the semantic representation of sentences • Link this computation to the to the grammar and lexicon. CSA2050: DCG IV

  11. Remarks on DCGs • Simple tool for encoding CFG • Arguments, variables and arbitrary progams take it beyond CF power, but can get clumsy and yield unreadable grammars • Reasonable for linguistic applications, but cannot handle left recursion. • Compared to standard PLs, you get quite far quite fast. CSA2050: DCG IV

  12. Semantics: • Semantics is the study of the meaning of words, phrases, and sentences in language. • Semantics explores the minimum of knowledge about a linguistic sign or combinations of signs such that the expression can convey a specific communicative content. [Olsen et. Al http://www2.rz.hu-berlin.de/angl/ling_pages/semantics.html] CSA2050: DCG IV

  13. Semantic Theories • Cognitive Semantics (Rosch 1973) • word/concept oriented • prototype theory: meanings are identified, often pictorially, by characteristic instances of whatever class of objects, etc. a word denotes • Truth Conditional Semantics (Hume, Russell, Carnap, Frege…) CSA2050: DCG IV

  14. Truth Conditional Semantics • Basic idea behind TCS is that to know the meaning of a sentence is know exactly the conditions under which it is true. • So for example you know the meaning of "Gianni ate fish yesterday" if you know exactly how to apply it to the real world and decide whether it is true or false. • On this view, the task of semantic theory is to define the truth conditions of sentences. CSA2050: DCG IV

  15. Expressing Truth Conditions • If semantics identifies truth conditions, how can they be expressed: i.e, how are they written down? • Logical form (LF) is the notation we use formalism we use to write down the truth conditions. • One example of logical form is first order logic (FOL) CSA2050: DCG IV

  16. CSA2050: DCG IV

  17. Logical Forms of Sentences • John kicked Fido:kick(john,fido) • Every student wrote a programall(x,student(x) => exist(y, program(y)& write(x,y))).exist(y, program(y) all(x,student(x) => write(x,y))). • Ambiguity • Relation between semantics of sentence and subphrases CSA2050: DCG IV

  18. Compositional Semantics Frege's Principle of Compositionality • The semantics of the whole sentence can be computed from the semantics of the subphrases, i.e. • Given the syntactic rule X  Y Z. • Suppose [Y], [Z] are the LFs of Y, and Z respectively. • Then [X] = ([Y],[Z]) where  is some function for semantic combination CSA2050: DCG IV

  19. Richard Montague:Rule to Rule Hypothesis • Each context free syntax rules is associated with a semantic rule that describes how the LF of the LHS category is composed from the LF of its subconstituents • 1:1 corrspondence between syntax and semantics. Can and does lead to difficulties. • Functional composition proposed as the mechanism for descibing the composition. • Lambda calculus. CSA2050: DCG IV

  20. Sentence Rule • Syntactic Rule:S  NP VP • Semantic Rule:[S] = [VP]([NP])i.e. the LF of S is obtained by "applying" the LF of VP to the LF of NP. • For this to be possible [VP] must be a function, and [NP] the argument to the function. CSA2050: DCG IV

  21. S write(bertrand,principia) VP y.write(y,principia) NP bertand bertrand V x.y.write(y,x) NP principia writes principia Parse Tree with Logical Forms CSA2050: DCG IV

  22. Problems • Truth Conditional Semantics problems: not all sentences have a truth value.questions; orders; speech acts. • Determiners and Quantification: exact truth conditions are hard to formulateyou can fool most of the people most of the time. • Lambda calculus is too powerful. CSA2050: DCG IV

More Related