Bringing machine learning & compositional semantics together: central concepts https://githubcom/cgpotts/annualreview-complearning Chris Potts Stanford Linguistics CS 244U: Natural language understanding 1 / 8
Linguistic objects u, t, r, d u: the utterance t: the syntactic structure r: the semantic representation d: the denotation (sequence of strings/words) (tree structure) (aka logical form) (meaning) 2 / 8
Interpreted grammar Syntax Logical form Denotation N one 1 1 N 2 2 R plus + the R such that R(x, y) = x + y R minus the R such that R(x, y) = x y R times the R such that R(x, y) = x y S minus the f such that f(x) = x N S N S N S ( N ) N N L R N R ( R N L N R ) R ( N L, N R ) 3 / 8
Interpreted grammar Syntax Logical form Denotation N one 1 1 N 2 2 R plus + the R such that R(x, y) = x + y R minus the R such that R(x, y) = x y R times the R such that R(x, y) = x y S minus the f such that f(x) = x N S N S N S ( N ) N N L R N R ( R N L N R ) R ( N L, N R ) u is the translation of syntactic expression u r is the denotation of semantic representation r 3 / 8
Examples Utterance Logical form Denotation A seven minus five ( 7 5) 2 B minus three plus one (+ 3 1) 2 C minus times ( ( 2 2) 2) 0 D plus three plus four (+ 2 (+ 3 4)) 9 4 / 8
Examples N ( 7 5) 2 N seven R minus N five 7 5 7 the R such that R(x, y) = x y 5 4 / 8
Examples N : ( 7 5) 2 N : 7 seven R : minus N : 5 five 7 the R such that R(x, y) = x y 5 4 / 8
Examples N : ( 7 5) 2 N : 7 seven R : minus N : 5 five 7 the R such that R(x, y) = x y 5 N : (+ 3 1) 2 N : 3 R : + U : N : 3 plus minus three N : 1 one 3 the f such that f(x) = x 3 the R such that R(x, y) = x + y 1 4 / 8
Ambiguity N : ( ( 2 2) 2) = 0 ( 2 2) R : R : times Gen( minus times ) = minus N : ( 2 ( 2 2)) = 2 R : ( 2 2) minus R : times 5 / 8
Analogies with full natural language 6 / 8
Analogies with full natural language N : ( ( 2 2) 2) = 0 ( 2 2) R : R : times minus N : ( 2 ( 2 2)) = 2 R : ( 2 2) minus R : times 6 / 8
Analogies with full natural language N : ( ( 2 2) 2) = 0 NP ( 2 2) R : NP and N R : times A N engineers minus intelligent linguists N : ( 2 ( 2 2)) = 2 NP R : minus ( 2 2) R : times A intelligent N linguists NP and N engineers 6 / 8
Analogies with full natural language Syntax Logical form Denotation R minus the R such that R(x, y) = x y S minus the f such that f(x) = x 6 / 8
Analogies with full natural language Syntax Logical form Denotation R minus the R such that R(x, y) = x y S minus the f such that f(x) = x tell crane mean (a tell; tell the time; tell the distance to shore) (as in a bird ; as in a piece of equipment ) (as in average ; as in unpleasant ; as in excellent ) 6 / 8
Analogies with full natural language every tallest arg max 6 / 8
Compositionality Compositionality The meaning of a phrase is a function of the meanings of its immediate syntactic constituents and the way they are combined 7 / 8
Compositionality Compositionality The meaning of a phrase is a function of the meanings of its immediate syntactic constituents and the way they are combined N (+ 3 1) 2 N : 3 U : N : 3 minus three R : + plus N : 1 one 3 the f such that f(x) = x 3 the R such that R(x, y) = x + y 1 7 / 8
Compositionality Compositionality The meaning of a phrase is a function of the meanings of its immediate syntactic constituents and the way they are combined N (+ 3 1) 2 N : 3 U : N : 3 minus three R : + plus N : 1 one 3 the f such that f(x) = x 3 the R such that R(x, y) = x + y 1 Bringing machine learning and compositional semantics together the claim of compositionality is that being a semantic interpreter for a language L amounts to mastering the syntax of L, the lexical meanings of L, and the modes of semantic combination for L This also suggests the outlines of a learning task 7 / 8
Learning tasks The grammar frames the task; different parts of it can be learned Syntax Logical form Denotation N one 1 1 N 2 2 R plus + the R such that R(x, y) = x + y R minus the R such that R(x, y) = x y R times the R such that R(x, y) = x y S minus the f such that f(x) = x N S N S N S ( N ) N N L R N R ( R N L N R ) R ( N L, N R ) Parsing Semantic parsing Interpretive 8 / 8
Learning tasks The grammar frames the task; different parts of it can be learned Syntax Logical form Denotation N one 1 1 N 2 2 R plus + the R such that R(x, y) = x + y R minus the R such that R(x, y) = x y R times the R such that R(x, y) = x y S minus the f such that f(x) = x N S N S N S ( N ) N N L R N R ( R N L N R ) R ( N L, N R ) Parsing Semantic parsing Interpretive 8 / 8
Learning tasks The grammar frames the task; different parts of it can be learned Syntax Logical form Denotation N one 1 1 N 2 2 R plus + the R such that R(x, y) = x + y R minus the R such that R(x, y) = x y R times the R such that R(x, y) = x y S minus the f such that f(x) = x N S N S N S ( N ) N N L R N R ( R N L N R ) R ( N L, N R ) Parsing Semantic parsing Interpretive 8 / 8
Learning tasks The grammar frames the task; different parts of it can be learned Syntax Logical form Denotation N one 1 1 N 2 2 R plus + the R such that R(x, y) = x + y R minus the R such that R(x, y) = x y R times the R such that R(x, y) = x y S minus the f such that f(x) = x N S N S N S ( N ) N N L R N R ( R N L N R ) R ( N L, N R ) Parsing Semantic parsing Interpretive 8 / 8
Learning tasks The grammar frames the task; different parts of it can be learned Syntax Logical form Denotation N one 1 1 N 2 2 R plus + the R such that R(x, y) = x + y R minus the R such that R(x, y) = x y R times the R such that R(x, y) = x y S minus the f such that f(x) = x N S N S N S ( N ) N N L R N R ( R N L N R ) R ( N L, N R ) Parsing Semantic parsing Interpretive 8 / 8
Learning tasks The grammar frames the task; different parts of it can be learned Syntax Logical form Denotation N one 1 1 N 2 2 R plus + the R such that R(x, y) = x + y R minus the R such that R(x, y) = x y R times the R such that R(x, y) = x y S minus the f such that f(x) = x N S N S N S ( N ) N N L R N R ( R N L N R ) R ( N L, N R ) Parsing Semantic parsing Interpretive 8 / 8