Spring 2012 Juyeon Kang qkang@fi.muni.cz B410, Faculty of Informatics, Masaryk University, Brno, Czech Rep. IA165 Combinatory Logic for Computational Semantics Application of the combinators to natural language analysis: basic example of the formal semantic analysis some structures: cooridination Summing up: last lecture ● How to apply the combinators to natural language analysis 1) using introduction and elimination rules by beta-reduction of combinators: control heurstic of combinatorial application and bracketing 2) using a syntactic tool for controlling the application of combinators : CCG assumes the preliminary steps to find a well-structured normal form, that is, a formal semantic structure Example: use the combinators as a logical tool of semantic analysis a. apply directly the β -reduction rules of combinators b. use the CCG types and rules by integrating the β -reduction rules of combinators into the CCG rules Remind 1....METHOD ● Goal: Formal semantic structure in term of operator and of operand : bracketed expression written by convention: (operator(operand)) ● Two methods of application of the combinators: both can be useful a. useful for defining some specific operators: passivisation, reflexivisation, quantification.. b. useful for general formal semantic analysis; can handle the analysis at the syntactic level and semantic level in one representation; informatic implementation more systemactic see the nexe slides ”Remind 2 & 3”→ Remind 2...TYPES ● CCG types primitive types: S for sentence, NP for noun phrase, N for noun derived types: S/NP, N/N, N\N, (S/NP)/NP, NP/N... ● Directionality: / (over) and \ (under) a/b: a applies to b, a\b: b is applied to a → direction of application of operator to operand x/y:e1    y:e2   ­­­­­­­­­­­­­­>(>)      x:(e1(e2)) Remind 3...RULES (S\NP)/NP:loves   NP:Anna  ­­­­­­­­­­­­­­­­­­­­­­­­­> (>) (S\NP):(loves (Anna)) (S\NP)/NP:loves   NP:Anna  ­­­­­­­­­­­­­­­­­­­­­­­­­> (>) (S\NP):(loves (Anna)) 1. Forward(>) and backward (<) functional application rules e1: (x/y) e2:(y/z) -------------------->(>B) (x/z): B e1 e2  (S\NP)/NP:likes  (NP/N):a                 ­­­­­­­­­­­­­­­­­­­­­­> (>B)                (S\NP)/N: (B likes a)  (S\NP)/NP:likes  (NP/N):a                 ­­­­­­­­­­­­­­­­­­­­­­> (>B)                (S\NP)/N: (B likes a) 2. Function composition (FC) rules with the combinator B e1:x ---------------> (>C*) S/(S\x): C*x For NP subj e1:John        ­­­­­­­­> (>C*) S/(S\NP):C*John For NP subj e1:John        ­­­­­­­­> (>C*) S/(S\NP):C*John 3. Type-raising rules with the combinator C* Some preliminary exercises to introduce the combinators: Finding a ccg type adequate to the given lexique 11 Adverbs Adverb of verb (S\NP)/(S\NP) (S\NP)/NP/ (S\NP)/NP Adverb of verb (S\NP)/(S\NP) (S\NP)/NP/ (S\NP)/NP Adverb of adverb (S\NP)/(S\NP)/(S\NP)/(S\NP) (S\NP)/NP/(S\NP)/NP/(S\NP)/NP/ (S\NP)/NP Adverb of adverb (S\NP)/(S\NP)/(S\NP)/(S\NP) (S\NP)/NP/(S\NP)/NP/(S\NP)/NP/ (S\NP)/NP Adverb of adjective (N/N)/(N/N) (N\N)/(N\N) Adverb of adjective (N/N)/(N/N) (N\N)/(N\N) Adverb of proposition S/S Adverb of proposition S/S 12 Preposition Prep. 1: constructor of adverbial phrase (S\NP)\(S\NP)/NP (S/S)/NP (S/S)/N Prep. 1: constructor of adverbial phrase (S\NP)\(S\NP)/NP (S/S)/NP (S/S)/N Prep. 2: constructor of adjectival phrase (N\N)/NP (N\N)/N Prep. 2: constructor of adjectival phrase (N\N)/NP (N\N)/N 13 Example: Dictionary of typed words Syntactic categories Syntactic types Lexical entries Nom. N Olivia, apple... Completed nom. NP an apple, the school Pron. NP She, he... Adj. (N/N), (N\N) pretty woman,... Adv. (N/N)/(N/N), (S\NP)\(S\NP)... very delicious,... Vb (S\NP), (S\NP)/NP... run, give... Prep. (S\NP)\(S\NP)/NP (NP\NP)/NP... run in the park, book of John,... Relative (S\NP)/S... I believe that... Some structures of natural language: coordination ➢ Cecila picks the pear. ➢ Cecilia eats the pear. ➢ Cecilia picks and eats the pear. ● Any logical form of this kind must of course express that the arguments appear in two predications. ((and (picks (the pears)) (eats (the pears))) Cecilia)((and (picks (the pears)) (eats (the pears))) Cecilia) 15 Coordination (Φ) X CONJ X⇒Φ X (Coordination )Φ x:e1  CONJ  x:e2 ­­­­­­­­­­­­­­­­­> (> )Φ x:   CONJ e1 e2 Φ e1 of type x coordinated with e2 of type x by the conjonction 'and'   (S\NP)/NP:pick    CONJ:'and'    (S\NP)/NP:eat        ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­> (>Φ) (S\NP)/NP:   Φ and pick eat e1 of type x coordinated with e2 of type x by the conjonction 'and'   (S\NP)/NP:pick    CONJ:'and'    (S\NP)/NP:eat        ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­> (>Φ) (S\NP)/NP:   Φ and pick eat 16 Follow the next steps. (1) Attribute first the CCG types to each linguistic expression (2) calculate theses types to obtain the syntactic analysis by applying  the CCG rules.  (3) eliminate the applied combinators with respect to each  b­reduction  of combinators (4)  check  if  your  semantic  representation  is  well­structured  normal  form. 17 ● Example : Cecilia picks and eats the pear. 1/[NP:Cecilia]­[(S\NP)/NP: picks]­[CONJ:and]­[(S\NP)/NP: eats]­[NP: the pear] 2/[(S/(S\NP):C*Cecilia]­[(S\NP)/NP: picks]­[CONJ:and]­[(S\NP)/NP: eats]­[NP: the  pear]   (>C*) 3/[(S/(S\NP):C*Cecilia]­[(S\NP)/NP: Φ and picks eats]­[NP: the pear]   (>Φ) 4/[(S/(S\NP):C*Cecilia]­[(S\NP)/NP: Φ and picks eats]­[NP: the pear]   (>B) 5/[(S/NP:B(C*Cecilia) (Φ and picks eats)]­[NP: the pear]   (>B) 6/[(S:(B(C*Cecilia) (Φ and picks eats))(the pear)]   (>) 18 7/(B(C*Cecilia) (Φ and picks eats))(the pear) 8/(C*Cecilia) ((Φ and picks eats))(the pear))  (elimination of B) 9/((Φ and picks eats))(the pear))(Cecilia)  (elimination of C*) 10/((and (picks(the pear)) (eats(the pear)))(Cecilia) ) (elimination of Φ) ●We get the well­formed semantic structure of the  sentence Cecila picks and eats the pear. ● ● ((and (picks(the pear)) (eats(the pear)))(Cecilia) ) ●We get the well­formed semantic structure of the  sentence Cecila picks and eats the pear. ● ● ((and (picks(the pear)) (eats(the pear)))(Cecilia) ) 19 Next week... ● Continue about the application of the combinators to natural language analysis: extraction asymmetries, subordinative structure and relative