Logical Forms Prof. Sameer Singh CS 295: STATISTICAL NLP WINTER - - PowerPoint PPT Presentation

logical forms
SMART_READER_LITE
LIVE PREVIEW

Logical Forms Prof. Sameer Singh CS 295: STATISTICAL NLP WINTER - - PowerPoint PPT Presentation

Logical Forms Prof. Sameer Singh CS 295: STATISTICAL NLP WINTER 2017 February 16, 2017 Based on slides from Noah Smith, Dan Klein, Tom Kwiatkowski, and everyone else they copied from. Outline Logical Semantics Combinatory Categorical Grammar


slide-1
SLIDE 1

Logical Forms

  • Prof. Sameer Singh

CS 295: STATISTICAL NLP WINTER 2017

February 16, 2017

Based on slides from Noah Smith, Dan Klein, Tom Kwiatkowski, and everyone else they copied from.

slide-2
SLIDE 2

Outline

CS 295: STATISTICAL NLP (WINTER 2017) 2

Logical Semantics Combinatory Categorical Grammar

slide-3
SLIDE 3

Outline

CS 295: STATISTICAL NLP (WINTER 2017) 3

Logical Semantics Combinatory Categorical Grammar

slide-4
SLIDE 4

So far….

CS 295: STATISTICAL NLP (WINTER 2017) 4

Meaning of Words

  • Word Vectors
  • Parts of Speech
  • Named Entities
  • Word senses
  • ….

Meaning of Verbs

  • Context-free grammars
  • Thematic Roles
  • Semantic Roles
  • Dependency Relations

Still a gap between language and actionable representations

slide-5
SLIDE 5

Language “World”

CS 295: STATISTICAL NLP (WINTER 2017) 5

What is a good Korean restaurant near UCI campus? Meaning Representation

slide-6
SLIDE 6

A (Tiny) World Model

CS 295: STATISTICAL NLP (WINTER 2017) 6

Domain Amir, Brook, Chen, … Gogi Grill, Eureka, Cha Tea, UCI, … Korean, American, Beverages, .. Properties Amir, Brook, Chen, … are humans Gogi Grill is good, Cha Tea has a long wait, Eureka is noisy, They are restaurants.. Relations Gogi serves Korean, Eureka serves American, Cha Tea serves Beverages, Amir likes Gogi, Chen likes Korean, … a, b, c, … gg, er, ct, uci, .. ko, am, be, … Humans = {a, b, c, …} Good = {gg} Noisy={er} Restaurant={gg,er,ct} … Serves = {(gg,ko),(er,am), (ct,be), …} Likes={(a,gg),(c,ko),..} … Is Eureka noisy? Does Cha Tea serve beverages? What does Amir like? er in Noisy? (ct,be) in Serves? list (a,?) in Likes

slide-7
SLIDE 7

First-Order Logic

CS 295: STATISTICAL NLP (WINTER 2017) 7

Relations

  • Unary: Serves(x)
  • Binary: Likes(x,y)
  • n-ary: R(a1,..,an)

Terms

  • Constant: a,b,c,gg,ct
  • Variables: x,y,z

Formula

  • n-ary relation, R, and n terms (t1,..,tn),

then R(t1,..,tn) is a formula

  • If F is a formula, then so is ┐F
  • Boolean operators: F˅F, F˄F, F→F
  • Quantifiers:
slide-8
SLIDE 8

Translating b/w FoL and NL

CS 295: STATISTICAL NLP (WINTER 2017) 8

  • Gogi is not loud
  • Some humans like American
  • If a person likes Eureka, they aren’t friends with Brook
  • Every restaurant has a long wait or is disliked by Amir
  • Everybody has something they don’t like
  • There exists something that nobody likes
slide-9
SLIDE 9

Logical Semantics

CS 295: STATISTICAL NLP (WINTER 2017) 9

Montague, 1970

The denotation of a natural language sentence is the set of conditions that must hold in the (model) world for the sentence to be true. This is called the logical form of the sentence. Everybody has something they don’t like.

  • Less ambiguous
  • Can check truth value by querying a database
  • If you know it’s true, you can update database
  • Questions become queries on the database
  • Comprehending a document is same as chaining
slide-10
SLIDE 10

λ-Calculus

CS 295: STATISTICAL NLP (WINTER 2017) 10

Montague, 1970

Abstraction Application

slide-11
SLIDE 11

Example of λ-applications

CS 295: STATISTICAL NLP (WINTER 2017) 11

Montague, 1970

slide-12
SLIDE 12

Semantic Attachments to CFG

CS 295: STATISTICAL NLP (WINTER 2017) 12

Montague, 1970

slide-13
SLIDE 13

CFG to λ-Calculus

CS 295: STATISTICAL NLP (WINTER 2017) 13

slide-14
SLIDE 14

CFG to λ-Calculus

CS 295: STATISTICAL NLP (WINTER 2017) 14

slide-15
SLIDE 15

CFG to λ-Calculus

CS 295: STATISTICAL NLP (WINTER 2017) 15

slide-16
SLIDE 16

CFG to λ-Calculus

CS 295: STATISTICAL NLP (WINTER 2017) 16

slide-17
SLIDE 17

Tricky Cases: Transitive Verbs

CS 295: STATISTICAL NLP (WINTER 2017) 17

Steedman, 2000

slide-18
SLIDE 18

Tricky Cases: Indefinites

CS 295: STATISTICAL NLP (WINTER 2017) 18

Steedman, 2000

Bob ate a waffle. Amy ate a waffle.

slide-19
SLIDE 19

Tricky Cases: Tenses and Events

CS 295: STATISTICAL NLP (WINTER 2017) 19

Steedman, 2000

Alice danced. Alice had been dancing when Bob sneezed.

slide-20
SLIDE 20

Tricky Cases: Adverbs

CS 295: STATISTICAL NLP (WINTER 2017) 20

Steedman, 2000

Bob sings terribly.

slide-21
SLIDE 21

Outline

CS 295: STATISTICAL NLP (WINTER 2017) 21

Logical Semantics Combinatory Categorical Grammar

slide-22
SLIDE 22

Combinatory Categorical Grammar

CS 295: STATISTICAL NLP (WINTER 2017) 22

Steedman, 2000

Syntax λ-Calculus

slide-23
SLIDE 23

CCG Types

CS 295: STATISTICAL NLP (WINTER 2017) 23

Steedman, 2000

Instead of non-terminals, it has infinitely large set of categories or types Primitive Complex

slide-24
SLIDE 24

CCG Combinators

CS 295: STATISTICAL NLP (WINTER 2017) 24

Steedman, 2000

Instead of rules, we have a small set of generic combinators.

slide-25
SLIDE 25

Application Combinator

CS 295: STATISTICAL NLP (WINTER 2017) 25

Steedman, 2000

Forward Backward

slide-26
SLIDE 26

Conjunction Combinator

CS 295: STATISTICAL NLP (WINTER 2017) 26

Steedman, 2000

slide-27
SLIDE 27

Conjunction Combinator

CS 295: STATISTICAL NLP (WINTER 2017) 27

Steedman, 2000

slide-28
SLIDE 28

Composition Combinator

CS 295: STATISTICAL NLP (WINTER 2017) 28

Steedman, 2000

Forward Backward

slide-29
SLIDE 29

Type-Raising Combinator

CS 295: STATISTICAL NLP (WINTER 2017) 29

Steedman, 2000

Forward Backward

slide-30
SLIDE 30

Upcoming…

CS 295: STATISTICAL NLP (WINTER 2017) 30

  • Homework 3 is due on February 27
  • Write-up and data has been released.

Homework

  • Status report due in 2 weeks: March 2, 2017
  • Instructions coming soon
  • Only 5 pages

Project

  • Paper summaries: February 17, February 28, March 14
  • Only 1 page each

Summaries