Question Answering What is Ques+on Answering? Dan Jurafsky - - PowerPoint PPT Presentation

question answering
SMART_READER_LITE
LIVE PREVIEW

Question Answering What is Ques+on Answering? Dan Jurafsky - - PowerPoint PPT Presentation

Question Answering What is Ques+on Answering? Dan Jurafsky Ques%on Answering One of the oldest NLP tasks (punched card systems in 1961) Simmons, Klein,


slide-1
SLIDE 1

Question Answering

What ¡is ¡Ques+on ¡ Answering? ¡

slide-2
SLIDE 2

Dan ¡Jurafsky ¡

2 ¡

Ques%on ¡Answering ¡

What do worms eat? worms eat what worms eat grass Worms eat grass worms eat grass Grass is eaten by worms birds eat worms Birds eat worms horses eat grass Horses with worms eat grass with worms

Ques%on: Poten%al-Answers: One ¡of ¡the ¡oldest ¡NLP ¡tasks ¡(punched ¡card ¡systems ¡in ¡1961) ¡

Simmons, ¡Klein, ¡McConlogue. ¡1964. ¡Indexing ¡and ¡ Dependency ¡Logic ¡for ¡Answering ¡English ¡Ques+ons. ¡ American ¡Documenta+on ¡15:30, ¡196-­‑204 ¡

slide-3
SLIDE 3

Dan ¡Jurafsky ¡

Ques%on ¡Answering: ¡IBM’s ¡Watson ¡

  • Won ¡Jeopardy ¡on ¡February ¡16, ¡2011! ¡

3 ¡

WILLIAM WILKINSON’S “AN ACCOUNT OF THE PRINCIPALITIES OF WALLACHIA AND MOLDOVIA” INSPIRED THIS AUTHOR’S MOST FAMOUS NOVEL

Bram ¡Stoker ¡

slide-4
SLIDE 4

Dan ¡Jurafsky ¡

Apple’s ¡Siri ¡

4 ¡

slide-5
SLIDE 5

Dan ¡Jurafsky ¡

Wolfram ¡Alpha ¡

5 ¡

slide-6
SLIDE 6

Dan ¡Jurafsky ¡

6 ¡

Types ¡of ¡Ques%ons ¡in ¡Modern ¡Systems ¡

  • Factoid ¡ques+ons ¡
  • Who ¡wrote ¡“The ¡Universal ¡Declara4on ¡of ¡Human ¡Rights”? ¡
  • How ¡many ¡calories ¡are ¡there ¡in ¡two ¡slices ¡of ¡apple ¡pie? ¡
  • What ¡is ¡the ¡average ¡age ¡of ¡the ¡onset ¡of ¡au4sm? ¡
  • Where ¡is ¡Apple ¡Computer ¡based? ¡
  • Complex ¡(narra+ve) ¡ques+ons: ¡
  • In ¡children ¡with ¡an ¡acute ¡febrile ¡illness, ¡what ¡is ¡the ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

efficacy ¡of ¡acetaminophen ¡in ¡reducing ¡fever? ¡

  • What ¡do ¡scholars ¡think ¡about ¡Jefferson’s ¡posi4on ¡on ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

dealing ¡with ¡pirates? ¡

slide-7
SLIDE 7

Dan ¡Jurafsky ¡

Commercial ¡systems: ¡ ¡ mainly ¡factoid ¡ques%ons ¡

Where ¡is ¡the ¡Louvre ¡Museum ¡located? ¡ In ¡Paris, ¡France ¡ What’s ¡the ¡abbrevia+on ¡for ¡limited ¡ partnership? ¡ L.P. ¡ What ¡are ¡the ¡names ¡of ¡Odin’s ¡ravens? ¡ Huginn ¡and ¡Muninn ¡ What ¡currency ¡is ¡used ¡in ¡China? ¡ The ¡yuan ¡ What ¡kind ¡of ¡nuts ¡are ¡used ¡in ¡marzipan? ¡ almonds ¡ What ¡instrument ¡does ¡Max ¡Roach ¡play? ¡ drums ¡ What ¡is ¡the ¡telephone ¡number ¡for ¡Stanford ¡ University? ¡ 650-­‑723-­‑2300 ¡

slide-8
SLIDE 8

Dan ¡Jurafsky ¡

Paradigms ¡for ¡QA ¡

  • IR-­‑based ¡approaches ¡
  • TREC; ¡ ¡IBM ¡Watson; ¡Google ¡
  • Knowledge-­‑based ¡and ¡Hybrid ¡approaches ¡
  • IBM ¡Watson; ¡Apple ¡Siri; ¡Wolfram ¡Alpha; ¡True ¡

Knowledge ¡Evi ¡ ¡

8 ¡

slide-9
SLIDE 9

Dan ¡Jurafsky ¡

Many ¡ques%ons ¡can ¡already ¡be ¡answered ¡ by ¡web ¡search ¡

  • a ¡

9 ¡

slide-10
SLIDE 10

Dan ¡Jurafsky ¡

IR-­‑based ¡Ques%on ¡Answering ¡

  • a ¡

10 ¡

slide-11
SLIDE 11

Dan ¡Jurafsky ¡

11 ¡

IR-­‑based ¡Factoid ¡QA ¡

Document Document Document Docume nt Docume nt Docume nt Docume nt Docume nt

Question Processing Passage Retrieval

Query Formulation Answer Type Detection

Question Passage Retrieval Document Retrieval

Answer Processing

Answer

passages

Indexing

Relevant Docs

Document Document Document

slide-12
SLIDE 12

Dan ¡Jurafsky ¡

IR-­‑based ¡Factoid ¡QA ¡

  • QUESTION ¡PROCESSING ¡
  • Detect ¡ques+on ¡type, ¡answer ¡type, ¡focus, ¡rela+ons ¡
  • Formulate ¡queries ¡to ¡send ¡to ¡a ¡search ¡engine ¡
  • PASSAGE ¡RETRIEVAL ¡
  • Retrieve ¡ranked ¡documents ¡
  • Break ¡into ¡suitable ¡passages ¡and ¡rerank ¡
  • ANSWER ¡PROCESSING ¡
  • Extract ¡candidate ¡answers ¡
  • Rank ¡candidates ¡ ¡
  • using ¡evidence ¡from ¡the ¡text ¡and ¡external ¡sources ¡
slide-13
SLIDE 13

Dan ¡Jurafsky ¡

Knowledge-­‑based ¡approaches ¡(Siri) ¡

  • Build ¡a ¡seman+c ¡representa+on ¡of ¡the ¡query ¡
  • Times, ¡dates, ¡loca+ons, ¡en++es, ¡numeric ¡quan++es ¡
  • Map ¡from ¡this ¡seman+cs ¡to ¡query ¡structured ¡data ¡ ¡or ¡resources ¡
  • Geospa+al ¡databases ¡
  • Ontologies ¡(Wikipedia ¡infoboxes, ¡dbPedia, ¡WordNet, ¡Yago) ¡
  • Restaurant ¡review ¡sources ¡and ¡reserva+on ¡services ¡
  • Scien+fic ¡databases ¡

13 ¡

slide-14
SLIDE 14

Dan ¡Jurafsky ¡

Hybrid ¡approaches ¡(IBM ¡Watson) ¡

  • Build ¡a ¡shallow ¡seman+c ¡representa+on ¡of ¡the ¡query ¡
  • Generate ¡answer ¡candidates ¡using ¡IR ¡methods ¡
  • Augmented ¡with ¡ontologies ¡and ¡semi-­‑structured ¡data ¡
  • Score ¡each ¡candidate ¡using ¡richer ¡knowledge ¡sources ¡
  • Geospa+al ¡databases ¡
  • Temporal ¡reasoning ¡
  • Taxonomical ¡classifica+on ¡

14 ¡

slide-15
SLIDE 15

Question Answering

What ¡is ¡Ques+on ¡ Answering? ¡

slide-16
SLIDE 16

Question Answering

Answer ¡Types ¡and ¡ Query ¡Formula+on ¡

slide-17
SLIDE 17

Dan ¡Jurafsky ¡

Factoid ¡Q/A ¡

17 ¡

Document Document Document Docume nt Docume nt Docume nt Docume nt Docume nt

Question Processing Passage Retrieval

Query Formulation Answer Type Detection

Question Passage Retrieval Document Retrieval

Answer Processing

Answer

passages

Indexing

Relevant Docs

Document Document Document

slide-18
SLIDE 18

Dan ¡Jurafsky ¡

Ques%on ¡Processing ¡ Things ¡to ¡extract ¡from ¡the ¡ques%on ¡

  • Answer ¡Type ¡Detec+on ¡
  • Decide ¡the ¡named ¡en%ty ¡type ¡(person, ¡place) ¡of ¡the ¡answer ¡
  • Query ¡Formula+on ¡
  • Choose ¡query ¡keywords ¡for ¡the ¡IR ¡system ¡
  • Ques+on ¡Type ¡classifica+on ¡
  • Is ¡this ¡a ¡defini+on ¡ques+on, ¡a ¡math ¡ques+on, ¡a ¡list ¡ques+on? ¡
  • Focus ¡Detec+on ¡
  • Find ¡the ¡ques+on ¡words ¡that ¡are ¡replaced ¡by ¡the ¡answer ¡
  • Rela+on ¡Extrac+on ¡
  • Find ¡rela+ons ¡between ¡en++es ¡in ¡the ¡ques+on ¡

18 ¡

slide-19
SLIDE 19

Dan ¡Jurafsky ¡

Question Processing

They’re the two states you could be reentering if you’re crossing Florida’s northern border

  • Answer ¡Type: ¡ ¡US ¡state ¡
  • Query: ¡ ¡two ¡states, ¡border, ¡Florida, ¡north ¡
  • Focus: ¡the ¡two ¡states ¡
  • Rela+ons: ¡ ¡borders(Florida, ¡?x, ¡north) ¡

19 ¡

slide-20
SLIDE 20

Dan ¡Jurafsky ¡

Answer ¡Type ¡Detec%on: ¡Named ¡En%%es ¡

  • Who ¡founded ¡Virgin ¡Airlines? ¡
  • ¡PERSON ¡ ¡
  • What ¡Canadian ¡city ¡has ¡the ¡largest ¡popula4on? ¡
  • ¡CITY. ¡
slide-21
SLIDE 21

Dan ¡Jurafsky ¡

Answer ¡Type ¡Taxonomy ¡

  • 6 ¡coarse ¡classes ¡
  • ABBEVIATION, ¡ENTITY, ¡DESCRIPTION, ¡HUMAN, ¡LOCATION, ¡

NUMERIC ¡

  • 50 ¡finer ¡classes ¡
  • LOCATION: ¡city, ¡country, ¡mountain… ¡
  • HUMAN: ¡group, ¡individual, ¡+tle, ¡descrip+on ¡
  • ENTITY: ¡animal, ¡body, ¡color, ¡currency… ¡

21 ¡

Xin ¡Li, ¡Dan ¡Roth. ¡2002. ¡Learning ¡Ques+on ¡Classifiers. ¡COLING'02 ¡

slide-22
SLIDE 22

Dan ¡Jurafsky ¡

22 ¡

Part ¡of ¡Li ¡& ¡Roth’s ¡Answer ¡Type ¡Taxonomy ¡

LOCATION NUMERIC ENTITY HUMAN ABBREVIATION DESCRIPTION country city state date percent money size distance individual title group food currency animal definition reason expression abbreviation

slide-23
SLIDE 23

Dan ¡Jurafsky ¡

23 ¡

Answer ¡Types ¡

slide-24
SLIDE 24

Dan ¡Jurafsky ¡

24 ¡

More ¡Answer ¡Types ¡

slide-25
SLIDE 25

Dan ¡Jurafsky ¡

Answer ¡types ¡in ¡Jeopardy ¡

  • 2500 ¡answer ¡types ¡in ¡20,000 ¡Jeopardy ¡ques+on ¡sample ¡
  • The ¡most ¡frequent ¡200 ¡answer ¡types ¡cover ¡< ¡50% ¡of ¡data ¡
  • The ¡40 ¡most ¡frequent ¡Jeopardy ¡answer ¡types ¡

he, ¡country, ¡city, ¡man, ¡film, ¡state, ¡she, ¡author, ¡group, ¡here, ¡company, ¡ president, ¡capital, ¡star, ¡novel, ¡character, ¡woman, ¡river, ¡island, ¡king, ¡ song, ¡part, ¡series, ¡sport, ¡singer, ¡actor, ¡play, ¡team, ¡ ¡show, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ actress, ¡animal, ¡presiden+al, ¡composer, ¡musical, ¡na+on, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ book, ¡+tle, ¡leader, ¡game ¡

25 ¡

Ferrucci ¡et ¡al. ¡2010. ¡Building ¡Watson: ¡An ¡Overview ¡of ¡the ¡DeepQA ¡Project. ¡AI ¡Magazine. ¡Fall ¡2010. ¡59-­‑79. ¡

slide-26
SLIDE 26

Dan ¡Jurafsky ¡

Answer ¡Type ¡Detec%on ¡

  • Hand-­‑wrioen ¡rules ¡
  • Machine ¡Learning ¡
  • Hybrids ¡
slide-27
SLIDE 27

Dan ¡Jurafsky ¡

Answer ¡Type ¡Detec%on ¡

  • Regular ¡expression-­‑based ¡rules ¡ ¡can ¡get ¡some ¡cases: ¡
  • Who ¡{is|was|are|were} ¡PERSON ¡
  • PERSON ¡(YEAR ¡– ¡YEAR) ¡
  • Other ¡rules ¡use ¡the ¡ques%on ¡headword: ¡

¡(the ¡headword ¡of ¡the ¡first ¡noun ¡phrase ¡ater ¡the ¡wh-­‑word) ¡ ¡

  • Which ¡city ¡in ¡China ¡has ¡the ¡largest ¡number ¡of ¡

foreign ¡financial ¡companies? ¡

  • What ¡is ¡the ¡state ¡flower ¡of ¡California? ¡
slide-28
SLIDE 28

Dan ¡Jurafsky ¡

Answer ¡Type ¡Detec%on ¡

  • Most ¡oten, ¡we ¡treat ¡the ¡problem ¡as ¡machine ¡learning ¡

classifica+on ¡ ¡

  • Define ¡a ¡taxonomy ¡of ¡ques+on ¡types ¡
  • Annotate ¡training ¡data ¡for ¡each ¡ques+on ¡type ¡
  • Train ¡classifiers ¡for ¡each ¡ques+on ¡class ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

using ¡a ¡rich ¡set ¡of ¡features. ¡

  • features ¡include ¡those ¡hand-­‑wrioen ¡rules! ¡

28 ¡

slide-29
SLIDE 29

Dan ¡Jurafsky ¡

Features ¡for ¡Answer ¡Type ¡Detec%on ¡

  • Ques+on ¡words ¡and ¡phrases ¡
  • Part-­‑of-­‑speech ¡tags ¡
  • Parse ¡features ¡(headwords) ¡
  • Named ¡En++es ¡
  • Seman+cally ¡related ¡words ¡

¡

29 ¡

slide-30
SLIDE 30

Dan ¡Jurafsky ¡

Factoid ¡Q/A ¡

30 ¡

Document Document Document Docume nt Docume nt Docume nt Docume nt Docume nt

Question Processing Passage Retrieval

Query Formulation Answer Type Detection

Question Passage Retrieval Document Retrieval

Answer Processing

Answer

passages

Indexing

Relevant Docs

Document Document Document

slide-31
SLIDE 31

Dan ¡Jurafsky ¡

Keyword ¡Selec%on ¡Algorithm ¡

  • 1. ¡Select ¡all ¡non-­‑stop ¡words ¡in ¡quota+ons ¡
  • 2. ¡Select ¡all ¡NNP ¡words ¡in ¡recognized ¡named ¡en++es ¡
  • 3. ¡Select ¡all ¡complex ¡nominals ¡with ¡their ¡adjec+val ¡modifiers ¡
  • 4. ¡Select ¡all ¡other ¡complex ¡nominals ¡
  • 5. ¡Select ¡all ¡nouns ¡with ¡their ¡adjec+val ¡modifiers ¡
  • 6. ¡Select ¡all ¡other ¡nouns ¡
  • 7. ¡Select ¡all ¡verbs ¡ ¡
  • 8. ¡Select ¡all ¡adverbs ¡ ¡
  • 9. ¡Select ¡the ¡QFW ¡word ¡(skipped ¡in ¡all ¡previous ¡steps) ¡ ¡
  • 10. ¡Select ¡all ¡other ¡words ¡ ¡

Dan ¡Moldovan, ¡Sanda ¡Harabagiu, ¡Marius ¡Paca, ¡Rada ¡Mihalcea, ¡Richard ¡Goodrum, ¡ Roxana ¡Girju ¡and ¡Vasile ¡Rus. ¡1999. ¡Proceedings ¡of ¡TREC-­‑8. ¡

slide-32
SLIDE 32

Dan ¡Jurafsky ¡

Choosing keywords from the query

32

Who coined the term “cyberspace” in his novel “Neuromancer”?

1 1 4 4 7

cyberspace/1 Neuromancer/1 term/4 novel/4 coined/7

Slide ¡from ¡Mihai ¡Surdeanu ¡

slide-33
SLIDE 33

Question Answering

Answer ¡Types ¡and ¡ Query ¡Formula+on ¡

slide-34
SLIDE 34

Question Answering

Passage ¡Retrieval ¡and ¡ Answer ¡Extrac+on ¡

slide-35
SLIDE 35

Dan ¡Jurafsky ¡

Factoid ¡Q/A ¡

35 ¡

Document Document Document Docume nt Docume nt Docume nt Docume nt Docume nt

Question Processing Passage Retrieval

Query Formulation Answer Type Detection

Question Passage Retrieval Document Retrieval

Answer Processing

Answer

passages

Indexing

Relevant Docs

Document Document Document

slide-36
SLIDE 36

Dan ¡Jurafsky ¡

36 ¡

Passage ¡Retrieval ¡

  • Step ¡1: ¡IR ¡engine ¡retrieves ¡documents ¡using ¡query ¡terms ¡
  • Step ¡2: ¡Segment ¡the ¡documents ¡into ¡shorter ¡units ¡
  • something ¡like ¡paragraphs ¡
  • Step ¡3: ¡Passage ¡ranking ¡
  • Use ¡answer ¡type ¡to ¡help ¡rerank ¡passages ¡
slide-37
SLIDE 37

Dan ¡Jurafsky ¡

Features ¡for ¡Passage ¡Ranking ¡

  • Number ¡of ¡Named ¡En++es ¡of ¡the ¡right ¡type ¡in ¡passage ¡
  • Number ¡of ¡query ¡words ¡in ¡passage ¡
  • Number ¡of ¡ques+on ¡N-­‑grams ¡also ¡in ¡passage ¡
  • Proximity ¡of ¡query ¡keywords ¡to ¡each ¡other ¡in ¡passage ¡
  • Longest ¡sequence ¡of ¡ques+on ¡words ¡
  • Rank ¡of ¡the ¡document ¡containing ¡passage ¡

Either ¡in ¡rule-­‑based ¡classifiers ¡or ¡with ¡supervised ¡machine ¡learning ¡

slide-38
SLIDE 38

Dan ¡Jurafsky ¡

Factoid ¡Q/A ¡

38 ¡

Document Document Document Docume nt Docume nt Docume nt Docume nt Docume nt

Question Processing Passage Retrieval

Query Formulation Answer Type Detection

Question Passage Retrieval Document Retrieval

Answer Processing

Answer

passages

Indexing

Relevant Docs

Document Document Document

slide-39
SLIDE 39

Dan ¡Jurafsky ¡

Answer ¡Extrac%on ¡

  • Run ¡an ¡answer-­‑type ¡named-­‑en+ty ¡ ¡tagger ¡on ¡the ¡passages ¡
  • Each ¡answer ¡type ¡requires ¡a ¡named-­‑en+ty ¡tagger ¡that ¡detects ¡it ¡
  • If ¡answer ¡type ¡is ¡CITY, ¡tagger ¡has ¡to ¡tag ¡CITY ¡
  • Can ¡be ¡full ¡NER, ¡simple ¡regular ¡expressions, ¡or ¡hybrid ¡
  • Return ¡the ¡string ¡with ¡the ¡right ¡type: ¡
  • Who is the prime minister of India (PERSON) ¡

Manmohan Singh, Prime Minister of India, had told left leaders that the deal would not be renegotiated.

  • How tall is Mt. Everest? (LENGTH) ¡

The official height of Mount Everest is 29035 feet

slide-40
SLIDE 40

Dan ¡Jurafsky ¡

Ranking ¡Candidate ¡Answers ¡

  • But ¡what ¡if ¡there ¡are ¡mul+ple ¡candidate ¡answers! ¡

¡ ¡

¡Q: Who was Queen Victoria’s second son?

  • Answer ¡Type: ¡ ¡Person ¡
  • Passage: ¡

The ¡Marie ¡biscuit ¡is ¡named ¡ater ¡Marie ¡Alexandrovna, ¡ the ¡daughter ¡of ¡Czar ¡Alexander ¡II ¡of ¡Russia ¡and ¡wife ¡of ¡ Alfred, ¡the ¡second ¡son ¡of ¡Queen ¡Victoria ¡and ¡Prince ¡ Albert ¡

slide-41
SLIDE 41

Dan ¡Jurafsky ¡

Ranking ¡Candidate ¡Answers ¡

  • But ¡what ¡if ¡there ¡are ¡mul+ple ¡candidate ¡answers! ¡

¡ ¡

¡Q: Who was Queen Victoria’s second son?

  • Answer ¡Type: ¡ ¡Person ¡
  • Passage: ¡

The ¡Marie ¡biscuit ¡is ¡named ¡ater ¡Marie ¡Alexandrovna, ¡ the ¡daughter ¡of ¡Czar ¡Alexander ¡II ¡of ¡Russia ¡and ¡wife ¡of ¡ Alfred, ¡the ¡second ¡son ¡of ¡Queen ¡Victoria ¡and ¡Prince ¡ Albert ¡

slide-42
SLIDE 42

Dan ¡Jurafsky ¡

Use ¡machine ¡learning: ¡ Features ¡for ¡ranking ¡candidate ¡answers ¡

Answer ¡type ¡match: ¡ ¡Candidate ¡contains ¡a ¡phrase ¡with ¡the ¡correct ¡answer ¡type. ¡ PaZern ¡match: ¡Regular ¡expression ¡paoern ¡matches ¡the ¡candidate. ¡ Ques%on ¡keywords: ¡# ¡of ¡ques+on ¡keywords ¡in ¡the ¡candidate. ¡ Keyword ¡distance: ¡Distance ¡in ¡words ¡between ¡the ¡candidate ¡and ¡query ¡keywords ¡ ¡ Novelty ¡factor: ¡A ¡word ¡in ¡the ¡candidate ¡is ¡not ¡in ¡the ¡query. ¡ Apposi%on ¡features: ¡The ¡candidate ¡is ¡an ¡apposi+ve ¡to ¡ques+on ¡terms ¡ Punctua%on ¡loca%on: ¡The ¡candidate ¡is ¡immediately ¡followed ¡by ¡a ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ comma, ¡period, ¡quota+on ¡marks, ¡semicolon, ¡or ¡exclama+on ¡mark. ¡ Sequences ¡of ¡ques%on ¡terms: ¡The ¡length ¡of ¡the ¡longest ¡sequence ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

  • f ¡ques+on ¡terms ¡that ¡occurs ¡in ¡the ¡candidate ¡answer. ¡

¡

slide-43
SLIDE 43

Dan ¡Jurafsky ¡

Candidate ¡Answer ¡scoring ¡in ¡IBM ¡Watson ¡

  • Each ¡candidate ¡answer ¡gets ¡scores ¡from ¡>50 ¡components ¡
  • (from ¡unstructured ¡text, ¡semi-­‑structured ¡text, ¡triple ¡stores) ¡
  • logical ¡form ¡(parse) ¡match ¡between ¡ques+on ¡and ¡candidate ¡
  • passage ¡source ¡reliability ¡ ¡
  • geospa+al ¡loca+on ¡
  • California ¡ ¡is ¡ ¡”southwest ¡of ¡Montana” ¡
  • temporal ¡rela+onships ¡
  • taxonomic ¡classifica+on ¡

43 ¡

slide-44
SLIDE 44

Dan ¡Jurafsky ¡

44 ¡

Common ¡Evalua%on ¡Metrics ¡

  • 1. Accuracy ¡(does ¡answer ¡match ¡gold-­‑labeled ¡answer?) ¡
  • 2. Mean ¡Reciprocal ¡Rank ¡
  • For ¡each ¡query ¡return ¡a ¡ranked ¡list ¡of ¡M ¡candidate ¡answers. ¡
  • Query ¡score ¡is ¡1/Rank ¡of ¡the ¡first ¡correct ¡answer ¡ ¡
  • If ¡first ¡answer ¡is ¡correct: ¡1 ¡ ¡
  • else ¡if ¡second ¡answer ¡is ¡correct: ¡½ ¡
  • else ¡if ¡third ¡answer ¡is ¡correct: ¡ ¡⅓, ¡ ¡etc. ¡
  • Score ¡is ¡0 ¡if ¡none ¡of ¡the ¡M ¡answers ¡are ¡correct ¡
  • Take ¡the ¡mean ¡over ¡all ¡N ¡queries ¡

MRR =

1 ranki

i=1 N

N

slide-45
SLIDE 45

Question Answering

Passage ¡Retrieval ¡and ¡ Answer ¡Extrac+on ¡

slide-46
SLIDE 46

Question Answering

Using ¡Knowledge ¡in ¡QA ¡

slide-47
SLIDE 47

Dan ¡Jurafsky ¡

Rela%on ¡Extrac%on ¡

  • Answers: ¡Databases ¡of ¡Rela+ons ¡
  • born-­‑in(“Emma ¡Goldman”, ¡“June ¡27 ¡1869”) ¡
  • author-­‑of(“Cao ¡Xue ¡Qin”, ¡“Dream ¡of ¡the ¡Red ¡Chamber”) ¡
  • Draw ¡from ¡Wikipedia ¡infoboxes, ¡DBpedia, ¡FreeBase, ¡etc. ¡
  • Ques+ons: ¡Extrac+ng ¡Rela+ons ¡in ¡Ques+ons ¡

Whose ¡granddaughter ¡starred ¡in ¡E.T.? ¡

(acted-in ?x “E.T.”) (granddaughter-of ?x ?y)

47 ¡

slide-48
SLIDE 48

Dan ¡Jurafsky ¡

Temporal ¡Reasoning ¡

  • Rela+on ¡databases ¡
  • (and ¡obituaries, ¡biographical ¡dic+onaries, ¡etc.) ¡
  • IBM ¡Watson ¡

”In ¡1594 ¡he ¡took ¡a ¡job ¡as ¡a ¡tax ¡collector ¡in ¡Andalusia” ¡ Candidates: ¡

  • Thoreau ¡is ¡a ¡bad ¡answer ¡(born ¡in ¡1817) ¡
  • Cervantes ¡is ¡possible ¡(was ¡alive ¡in ¡1594) ¡

48 ¡

slide-49
SLIDE 49

Dan ¡Jurafsky ¡

Geospa%al ¡knowledge ¡ (containment, ¡direc%onality, ¡borders) ¡ ¡

  • Beijing ¡ ¡is ¡a ¡good ¡answer ¡for ¡ ¡”Asian ¡city” ¡
  • California ¡ ¡is ¡ ¡”southwest ¡of ¡Montana” ¡
  • geonames.org: ¡

49 ¡

slide-50
SLIDE 50

Dan ¡Jurafsky ¡

Context ¡and ¡Conversa%on ¡ ¡in ¡Virtual ¡Assistants ¡like ¡Siri ¡

  • Coreference ¡helps ¡resolve ¡ambigui+es ¡

U: ¡“Book ¡a ¡table ¡at ¡Il ¡Fornaio ¡at ¡7:00 ¡with ¡my ¡mom” ¡ U: ¡“Also ¡send ¡her ¡an ¡email ¡reminder” ¡

  • Clarifica+on ¡ques+ons: ¡

U: ¡“Chicago ¡pizza” ¡ S: ¡“Did ¡you ¡mean ¡pizza ¡restaurants ¡in ¡Chicago ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

  • r ¡Chicago-­‑style ¡pizza?” ¡

50 ¡

slide-51
SLIDE 51

Question Answering

Using ¡Knowledge ¡in ¡QA ¡

slide-52
SLIDE 52

Question Answering

Ques+on ¡Answering ¡in ¡ Watson ¡(Deep ¡QA) ¡

slide-53
SLIDE 53

Dan ¡Jurafsky ¡

Ques%on ¡Answering: ¡IBM’s ¡Watson ¡

  • Won ¡Jeopardy ¡on ¡February ¡16, ¡2011! ¡

53 ¡

WILLIAM WILKINSON’S “AN ACCOUNT OF THE PRINCIPALITIES OF WALLACHIA AND MOLDOVIA” INSPIRED THIS AUTHOR’S MOST FAMOUS NOVEL

Bram ¡Stoker ¡

slide-54
SLIDE 54

Dan ¡Jurafsky ¡

The ¡Architecture ¡of ¡Watson ¡

Document Document Document

(1) Question Processing From Text Resources

Focus Detection Lexical Answer Type Detection

Question Document and Passsage Retrieval

passages

Document Document Document

Question Classification Parsing Named Entity Tagging Relation Extraction Coreference

From Structured Data

Relation Retrieval

DBPedia Freebase

(2) Candidate Answer Generation

Candidate Answer Candidate Answer Candidate Answer Candidate Answer Candidate Answer Candidate Answer Candidate Answer Candidate Answer Candidate Answer Candidate Answer Candidate Answer Candidate Answer

(3) Candidate Answer Scoring

Evidence Retrieval and scoring

Answer Extraction

Document titles Anchor text

Text Evidence Sources

(4) Confidence Merging and Ranking

Text Evidence Sources

Time from DBPedia

Space from Facebook Answer Type

Answer and Confidence

Candidate Answer + Confidence Candidate Answer + Confidence Candidate Answer + Confidence Candidate Answer + Confidence Candidate Answer + Confidence

Logistic Regression Answer Ranker Merge Equivalent Answers

slide-55
SLIDE 55

Dan ¡Jurafsky ¡

Stage ¡1: ¡Ques%on ¡Processing ¡

  • Parsing ¡
  • Named ¡En+ty ¡Tagging ¡
  • Rela+on ¡Extrac+on ¡
  • Focus ¡
  • Answer ¡Type ¡
  • Ques+on ¡Classifica+on ¡

55 ¡

slide-56
SLIDE 56

Poets ¡and ¡Poetry: ¡He ¡was ¡a ¡bank ¡clerk ¡in ¡the ¡Yukon ¡before ¡ he ¡published ¡“Songs ¡of ¡a ¡Sourdough” ¡in ¡1907. ¡ ¡

¡

THEATRE: ¡A ¡new ¡play ¡based ¡on ¡this ¡Sir ¡Arthur ¡Conan ¡Doyle ¡ canine ¡classic ¡opened ¡on ¡the ¡London ¡stage ¡in ¡2007. ¡ ¡ ¡

authorof(focus,“Songs ¡of ¡a ¡sourdough”) ¡ ¡ publish ¡(e1, ¡he, ¡“Songs ¡of ¡a ¡sourdough”) ¡ ¡ in ¡(e2, ¡e1, ¡1907) ¡ ¡ temporallink(publish(...), ¡1907) ¡ ¡

GEO ¡ COMPOSITION ¡ PERSON ¡ YEAR ¡ YEAR ¡ Named ¡En)ty ¡and ¡Parse ¡ Focus ¡ Answer ¡Type ¡ Rela)on ¡Extrac)on ¡ GEO ¡

slide-57
SLIDE 57

Dan ¡Jurafsky ¡

Focus ¡extrac%on ¡

  • Focus: ¡the ¡part ¡of ¡the ¡ques+on ¡that ¡co-­‑refers ¡with ¡

the ¡answer ¡

  • Replace ¡it ¡with ¡answer ¡to ¡find ¡a ¡suppor+ng ¡
  • passage. ¡ ¡
  • Extracted ¡by ¡hand-­‑wrioen ¡rules ¡ ¡
  • "Extract ¡ ¡any ¡noun ¡phrase ¡with ¡determiner ¡this” ¡ ¡ ¡
  • “Extrac+ng ¡pronouns ¡she, ¡he, ¡hers, ¡him, ¡“

57 ¡

slide-58
SLIDE 58

Dan ¡Jurafsky ¡

Lexical ¡Answer ¡Type ¡

  • The ¡seman+c ¡class ¡of ¡the ¡answer ¡
  • But ¡for ¡Jeopardy ¡the ¡TREC ¡answer ¡

¡ ¡type ¡taxonomy ¡is ¡insufficient ¡

  • DeepQA ¡team ¡inves+gated ¡20,000 ¡ques+ons ¡
  • 100 ¡named ¡en++es ¡only ¡covered ¡<50% ¡of ¡the ¡ques+ons! ¡
  • Instead: ¡Extract ¡lots ¡of ¡words: ¡5,000 ¡for ¡those ¡20,000 ¡

ques+ons ¡

58 ¡

LOCATION NUMERIC ENTITY HUMAN ABBREVIATION DESCRIPTION country city state date percent money size distance individual title group food currency animal definition reason expression abbreviation

slide-59
SLIDE 59

Dan ¡Jurafsky ¡

Lexical ¡Answer ¡Type ¡

  • Answer ¡types ¡extracted ¡by ¡hand-­‑wrioen ¡rules ¡ ¡
  • Syntac+c ¡headword ¡of ¡the ¡focus. ¡
  • Words ¡that ¡are ¡coreferent ¡with ¡the ¡focus ¡
  • Jeopardy! ¡category, ¡if ¡refers ¡to ¡compa+ble ¡en+ty. ¡

¡

Poets ¡and ¡Poetry: ¡He ¡was ¡a ¡bank ¡clerk ¡in ¡the ¡Yukon ¡ before ¡he ¡published ¡“Songs ¡of ¡a ¡Sourdough” ¡in ¡1907. ¡ ¡

59 ¡

slide-60
SLIDE 60

Dan ¡Jurafsky ¡

Rela%on ¡Extrac%on ¡in ¡DeepQA ¡

  • For ¡the ¡most ¡frequent ¡30 ¡rela+ons: ¡
  • Hand-­‑wrioen ¡regular ¡expressions ¡
  • AuthorOf: ¡
  • Many ¡paoerns ¡such ¡as ¡one ¡to ¡deal ¡with: ¡
  • a ¡Mary ¡Shelley ¡tale, ¡the ¡Saroyan ¡novel, ¡Twain’s ¡travel ¡books, ¡a1984 ¡

Tom ¡Clancy ¡thriller ¡

  • [Author] ¡[Prose] ¡
  • For ¡the ¡rest: ¡distant ¡supervision ¡

60 ¡

slide-61
SLIDE 61

Dan ¡Jurafsky ¡

Stage ¡2: ¡Candidate ¡Answer ¡Genera%on ¡

61 ¡

slide-62
SLIDE 62

Dan ¡Jurafsky ¡

Extrac%ng ¡candidate ¡answers ¡from ¡triple ¡ stores ¡

  • If ¡we ¡extracted ¡a ¡rela+on ¡from ¡the ¡ques+on ¡

… ¡he ¡published ¡“Songs ¡of ¡a ¡sourdough” ¡

(author-of ?x “Songs of a sourdough”)

  • We ¡just ¡query ¡a ¡triple ¡store ¡
  • Wikipedia ¡infoboxes, ¡DBpedia, ¡FreeBase, ¡etc. ¡
  • born-­‑in(“Emma ¡Goldman”, ¡“June ¡27 ¡1869”) ¡
  • author-­‑of(“Cao ¡Xue ¡Qin”, ¡“Dream ¡of ¡the ¡Red ¡Chamber”) ¡
  • author-­‑of(“Songs ¡of ¡a ¡sourdough”, ¡“Robert ¡Service”) ¡

¡

62 ¡

slide-63
SLIDE 63

Dan ¡Jurafsky ¡

Extrac%ng ¡candidate ¡answers ¡from ¡text: ¡ get ¡documents/passages ¡

  • 1. Do ¡standard ¡IR-­‑based ¡QA ¡to ¡get ¡documents ¡

Robert ¡Redford ¡and ¡Paul ¡Newman ¡starred ¡in ¡this ¡ depression-­‑era ¡griter ¡flick. ¡ ¡ (2.0 ¡Robert ¡Redford) ¡(2.0 ¡Paul ¡Newman) ¡star ¡depression ¡era ¡ griter ¡(1.5 ¡flick) ¡ ¡

¡

  • 63 ¡
slide-64
SLIDE 64

Dan ¡Jurafsky ¡

Extrac%ng ¡answers ¡from ¡documents/ passages ¡

  • Useful ¡fact: ¡Jeopardy! ¡answers ¡are ¡mostly ¡the ¡+tle ¡
  • f ¡a ¡Wikipedia ¡document ¡ ¡
  • If ¡the ¡document ¡is ¡a ¡Wikipedia ¡ar+cle, ¡just ¡take ¡the ¡

+tle ¡

  • If ¡not, ¡extract ¡all ¡noun ¡phrases ¡in ¡the ¡passage ¡that ¡are ¡

Wikipedia ¡document ¡+tles ¡

  • Or ¡extract ¡all ¡anchor ¡text ¡ ¡<a>The Sting</a>

¡

64 ¡

slide-65
SLIDE 65

Dan ¡Jurafsky ¡

Stage ¡3: ¡Candidate ¡Answer ¡Scoring ¡

  • Use ¡lots ¡of ¡sources ¡of ¡evidence ¡to ¡score ¡an ¡answer ¡
  • more ¡than ¡50 ¡scorers ¡
  • Lexical ¡answer ¡type ¡is ¡a ¡big ¡one ¡
  • Different ¡in ¡DeepQA ¡than ¡in ¡pure ¡IR ¡factoid ¡QA ¡
  • In ¡pure ¡IR ¡factoid ¡QA, ¡answer ¡type ¡is ¡used ¡to ¡strictly ¡filter ¡

answers ¡

  • In ¡DeepQA, ¡answer ¡type ¡is ¡just ¡one ¡of ¡many ¡pieces ¡of ¡

evidence ¡

65 ¡

slide-66
SLIDE 66

Dan ¡Jurafsky ¡

Lexical ¡Answer ¡Type ¡(LAT) ¡for ¡Scoring ¡ Candidates ¡

  • Given: ¡
  • candidate ¡answer ¡ ¡ ¡& ¡ ¡ ¡ ¡lexical ¡answer ¡type ¡
  • Return ¡a ¡score: ¡can ¡answer ¡can ¡be ¡a ¡subclass ¡of ¡this ¡answer ¡type? ¡
  • Candidate: ¡“difficulty ¡swallowing” ¡& ¡LAT ¡“condi4on” ¡
  • 1. Check ¡DBPedia, ¡WordNet, ¡etc ¡
  • difficulty ¡swallowing ¡-­‑> ¡Dbpedia ¡Dysphagia ¡-­‑> ¡WordNet ¡Dysphagia ¡
  • condi4on-­‑> ¡WordNet ¡Condi4on ¡
  • 2. Check ¡if ¡“Dysphagia” ¡IS-­‑A ¡“Condi+on” ¡in ¡WordNet ¡
  • Wordnet ¡for ¡dysphagia ¡

66 ¡ ¡

slide-67
SLIDE 67

Dan ¡Jurafsky ¡

Rela%ons ¡for ¡scoring ¡

  • Q: ¡This ¡hockey ¡defenseman ¡ended ¡his ¡career ¡on ¡June ¡5, ¡2008 ¡
  • Passage: ¡On ¡June ¡5, ¡2008, ¡Wesley ¡announced ¡his ¡re+rement ¡

ater ¡his ¡20th ¡NHL ¡season ¡

  • Ques+on ¡and ¡passage ¡have ¡very ¡few ¡keywords ¡in ¡common ¡
  • But ¡both ¡have ¡the ¡Dbpedia ¡rela+on ¡ActiveYearsEndDate()

67 ¡

slide-68
SLIDE 68

Dan ¡Jurafsky ¡

Temporal ¡Reasoning ¡for ¡Scoring ¡ Candidates ¡

  • Rela+on ¡databases ¡
  • (and ¡obituaries, ¡biographical ¡dic+onaries, ¡etc.) ¡
  • IBM ¡Watson ¡

”In ¡1594 ¡he ¡took ¡a ¡job ¡as ¡a ¡tax ¡collector ¡in ¡Andalusia” ¡ Candidates: ¡

  • Thoreau ¡is ¡a ¡bad ¡answer ¡(born ¡in ¡1817) ¡
  • Cervantes ¡is ¡possible ¡(was ¡alive ¡in ¡1594) ¡

68 ¡

slide-69
SLIDE 69

Dan ¡Jurafsky ¡

Geospa%al ¡knowledge ¡ (containment, ¡direc%onality, ¡borders) ¡ ¡

  • Beijing ¡ ¡is ¡a ¡good ¡answer ¡for ¡ ¡”Asian ¡city” ¡
  • California ¡ ¡is ¡ ¡”southwest ¡of ¡Montana” ¡
  • geonames.org: ¡

69 ¡

slide-70
SLIDE 70

Dan ¡Jurafsky ¡

Text-­‑retrieval-­‑based ¡answer ¡scorer ¡

  • Generate ¡a ¡query ¡from ¡the ¡ques+on ¡and ¡retrieve ¡passages ¡
  • Replace ¡the ¡focus ¡in ¡the ¡ques+on ¡with ¡the ¡candidate ¡answer ¡
  • See ¡how ¡well ¡it ¡fits ¡the ¡passages. ¡ ¡
  • Robert ¡Redford ¡and ¡Paul ¡Newman ¡starred ¡in ¡this ¡depression-­‑era ¡

gri`er ¡flick ¡

  • Robert ¡Redford ¡and ¡Paul ¡Newman ¡starred ¡in ¡The ¡S+ng ¡

70 ¡

slide-71
SLIDE 71

Dan ¡Jurafsky ¡

Stage ¡4: ¡Answer ¡Merging ¡and ¡Scoring ¡

  • Now ¡we ¡have ¡a ¡list ¡candidate ¡answers ¡each ¡with ¡a ¡score ¡vector ¡
  • J.F.K [.5 .4 1.2 33 .35 … ]
  • John F. Kennedy [.2 .56 5.3 2 …]
  • Merge ¡equivalent ¡answers: ¡J.F.K. ¡and ¡John ¡F. ¡Kennedy ¡
  • Use ¡Wikipedia ¡dic+onaries ¡that ¡list ¡synonyms: ¡ ¡
  • JFK, ¡John ¡F. ¡Kennedy, ¡John ¡Fitzgerald ¡Kennedy, ¡Senator ¡John ¡F. ¡

Kennedy, ¡President ¡Kennedy, ¡Jack ¡Kennedy ¡

  • Use ¡stemming ¡and ¡other ¡morphology ¡

71 ¡

slide-72
SLIDE 72

Dan ¡Jurafsky ¡

Stage ¡4: ¡Answer ¡Scoring ¡

  • Build ¡a ¡classifier ¡to ¡take ¡answers ¡and ¡a ¡score ¡vector ¡and ¡assign ¡a ¡

probability ¡

  • Train ¡on ¡datasets ¡of ¡hand-­‑labeled ¡correct ¡and ¡incorrect ¡answers. ¡

72 ¡

slide-73
SLIDE 73

Question Answering

Ques+on ¡Answering ¡in ¡ Watson ¡(Deep ¡QA) ¡