Lecture 15: Entity Linking

56
Harvard AC295/CS287r/CSCI E-115B Chris Tanner Discourse, Pragmatics, and Knowledge Graphs Lecture 15: Entity Linking

Transcript of Lecture 15: Entity Linking

Page 1: Lecture 15: Entity Linking

HarvardAC295/CS287r/CSCI E-115BChris Tanner

Discourse, Pragmatics, and Knowledge Graphs

Lecture 15: Entity Linking

Page 2: Lecture 15: Entity Linking

ENTITY

Page 3: Lecture 15: Entity Linking

3

ANNOUNCEMENTS• HW4 has been released!

• HW2 and Phase 2 and Quiz 5 are being graded

• Research Project Phase 3 due Oct 28 (Thurs) @ 11:59pm

• I was able to get $100 AWS credit for each student

(it must be used exclusively for research or HW in this course)

Some of today’s slides are inspired from, based on, or directly from:• Laura Dietz (UNH)• Alan Black & David Mortensen (CMU)

Page 4: Lecture 15: Entity Linking

What is entity linking?

Data and metrics

Workshop time

Modern approaches

Outline

4

Page 5: Lecture 15: Entity Linking

What is entity linking?

Data and metrics

Workshop time

Modern approaches

Outline

5

Page 6: Lecture 15: Entity Linking

6

Discourse & Pragmatics

Regarding language, we have mostly learned about:

• Individual words (representation and modelling)

• Large chunks of text (representation and modelling)

Yet, there’s tons of nuanced, interconnected

elements we wish to capture and model

Page 7: Lecture 15: Entity Linking

Multiple levels* to language

speechtext

phonetics

phonology orthography

Discourse

Pragmatics

Semantics

Syntax

Lexemes

Morphology

*

7

Flashback to Lecture 2

Understands how context affects meaning

Understands structures and effects of interweaving dialog

Page 8: Lecture 15: Entity Linking

8

Discourse & Pragmatics

Pragmatics is a branch of linguistics dealing with

language use in context (non-local meaning phenomena)

Ex 1:

Ex 2:

Ex 3:

Ex 4:

Can you pass the salt?

“Is he 21?” “Yea, he’s 25”

“Are we still going out tonight?” “If I can get off by 5”

Key and Peele – Text Message Confusion (skit)Too explicit for me to show in class

Page 9: Lecture 15: Entity Linking

9

Discourse & Pragmatics

What does ”context” mean?

Social context:

• Social identities, relationships, and setting

Physical context:

• Where? What objects are present? What actions?

Linguistic context:

• Conversation history, discourse context

Other:

• Shared knowledge, common knowledge

Page 10: Lecture 15: Entity Linking

10

Discourse & Pragmatics

Discourse concerns the structures and effects in related sequences

of sentences. Essential for dialogues, multi-party conversations.

Ex 1:

Ex 2:

“I said the blue shoes.” “Oh, blue!”

“Can we discuss this later today?”

“When did you have in mind?”

“Does the afternoon work?”

“Well, I’m free after lunch”

“Shall we plan for 2pm?”

“That works”

Page 11: Lecture 15: Entity Linking

11

Discourse & Pragmatics

Types of referring expressions

Indefinite noun phrases:

• I saw an incredible oak tree today

Definite noun phrases:

• I read about it in the New York Times

Pronominal mentions:

• Emily aced the quiz, as she expected

Nominal mentions and names:

• The amazing marathoner, Des Linden, is a true inspiration

Demonstratives:

• These pretzels are making me thirsty.

This, that, these, those

Page 12: Lecture 15: Entity Linking

12

Discourse & Pragmatics

Types of referring expressions

Indefinite noun phrases:

• I saw an incredible oak tree today

Definite noun phrases:

• I read about it in the New York Times

Pronominal mentions:

• Emily aced the quiz, as she expected

Nominal mentions and names:

• The amazing marathoner, Des Linden, is a true inspiration

Demonstratives:

• These pretzels are making me thirsty.

Remember, in NLP, we devise feasible tasks to approximate

the phenomenon (e.g., understanding discourse and

pragmatics) we hope to eventually capture

Page 13: Lecture 15: Entity Linking

13

Discourse & Pragmatics

Types of referring expressions

Indefinite noun phrases:

• I saw an incredible oak tree today

Definite noun phrases:

• I read about it in the New York Times

Pronominal mentions:

• Emily aced the quiz, as she expected

Nominal mentions and names:

• The amazing marathoner, Des Linden, is a true inspiration

Demonstratives:

• These pretzels are making me thirsty.

Page 14: Lecture 15: Entity Linking

14

Entity Linking

Page 15: Lecture 15: Entity Linking

15

Entity Linking

Page 16: Lecture 15: Entity Linking

16

Entity Linking

Identify all named mentions (not nominal mentions) and

disambiguate them by linking each of them to an external

knowledge graph (KG) (e.g., Wikipedia’s KG)

Page 17: Lecture 15: Entity Linking

17

Entity Linking

Identify all named mentions (not nominal mentions) and

disambiguate them by linking each of them to an external

knowledge graph (KG) (e.g., Wikipedia’s KG)

Entity Linking is also called Named Entity Disambiguation

Page 18: Lecture 15: Entity Linking

18

Entity Linking

Task Definition:

Determine which named

mentions refer to which

underlying real-world entities

(within a knowledge graph). Steve Jobs

Apple

SteveWozniak

San Jose

partners_with

cofou

nder_

of

born_

in

located_in

manufactu

rer_of

cofoun

der_of

marrie

d_to

alumnus_of

settled_iniPhone

city_in

Page 19: Lecture 15: Entity Linking

19

Michael Jordan, born in

1956, spoke with the

Associated Press today

after he announced a

new $10M college

scholarship fund

Entity Linking

Document #271

Page 20: Lecture 15: Entity Linking

20

Michael Jordan, born in

1956, spoke with the

Associated Press today

after he announced a

new $10M college

scholarship fund

Entity Linking

Document #271

Page 21: Lecture 15: Entity Linking

21

Entity Linking

Page 22: Lecture 15: Entity Linking

22

“Entity Linking” is a two-stage process!

1. Mention detection (some people work on this exclusively)

2. Entity Linking

Entity Linking

Page 23: Lecture 15: Entity Linking

What is entity linking?

Data and metrics

Workshop time

Modern approaches

Outline

23

Page 24: Lecture 15: Entity Linking

Outline

24

What is entity linking?

Data and metrics

Workshop time

Modern approaches

Page 25: Lecture 15: Entity Linking

25

Q1: What if our document only had “Michael”, not “Michael

Jordan”?

Q2: What if our document mentions his name 10 times in the

same doc?

Q3: What if our document contains an unpopular name, like

Chris Tanner?

Annotations

Page 26: Lecture 15: Entity Linking

26

Annotations

Q1: What if our document only had “Michael”, not “Michael

Jordan”?

A1: Only annotate the mentions that have sufficient context to

make the task meaningful

Page 27: Lecture 15: Entity Linking

27

Annotations

Q2: What if our document mentions his name 10 times in the

same doc?

A2: Only annotate the first occurrence

Page 28: Lecture 15: Entity Linking

28

Annotations

Q3: What if our document contains an unpopular name, like

Chris Tanner?

A3: Can only annotate mentions that are present in the KG

Page 29: Lecture 15: Entity Linking

29

Annotations

Page 30: Lecture 15: Entity Linking

30

Datasets

AIDA/CoNLLTAC KBP 2010

Page 31: Lecture 15: Entity Linking

31

Metrics

• Accuracy• Recall @ N• Micro F1• Macro F1

Page 32: Lecture 15: Entity Linking

Outline

32

What is entity linking?

Data and metrics

Workshop time

Modern approaches

Page 33: Lecture 15: Entity Linking

Outline

33

What is entity linking?

Data and metrics

Workshop time

Modern approaches

Page 34: Lecture 15: Entity Linking

34

Workshop time

How would you attempt entity linking?

Create a baseline system

Page 35: Lecture 15: Entity Linking

35

Workshop time

Page 36: Lecture 15: Entity Linking

36

Page 37: Lecture 15: Entity Linking

37

Page 38: Lecture 15: Entity Linking

38

Page 39: Lecture 15: Entity Linking

39

Page 40: Lecture 15: Entity Linking

40

Page 41: Lecture 15: Entity Linking

41

Page 42: Lecture 15: Entity Linking

42

Page 43: Lecture 15: Entity Linking

43

Page 44: Lecture 15: Entity Linking

44

Page 45: Lecture 15: Entity Linking

45

Page 46: Lecture 15: Entity Linking

46

Page 47: Lecture 15: Entity Linking

47

Page 48: Lecture 15: Entity Linking

48

Workshop time

These approaches seem kind of manual and kludgy.

How can we use Deep Learning?

Page 49: Lecture 15: Entity Linking

Outline

49

What is entity linking?

Data and metrics

Workshop time

Modern approaches

Page 50: Lecture 15: Entity Linking

Outline

50

What is entity linking?

Data and metrics

Workshop time

Modern approaches

Page 51: Lecture 15: Entity Linking

Outline

51

What is entity linking?

Data and metrics

Workshop time

Modern approaches

Page 52: Lecture 15: Entity Linking

52

Modern approach

Motivation:

Page 53: Lecture 15: Entity Linking

53

Page 54: Lecture 15: Entity Linking

54

Page 55: Lecture 15: Entity Linking

55

Modern approach

Page 56: Lecture 15: Entity Linking

56