determining similarity and inferring relations in a lexical knowledge base

40
Determining Similarity and Inferring Relations in a Lexical Knowledge Base Dissertação de Doutoramento de Stephen D. Richardson City University of New York 1997 Apresentado por: Nuno Seco

Upload: whilemina-lewis

Post on 03-Jan-2016

44 views

Category:

Documents


2 download

DESCRIPTION

Dissertação de Doutoramento de Stephen D. Richardson City University of New York 1997. Determining Similarity and Inferring Relations in a Lexical Knowledge Base. Apresentado por: Nuno Seco. Estrutura da Tese. Introdução Extracção de Relações Semânticas Atribuição de Pesos às Relações - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Determining Similarity and Inferring

Relations in a Lexical Knowledge Base

Dissertação de Doutoramento de Stephen D. Richardson

City University of New York1997

Apresentado por:

Nuno Seco

Page 2: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Estrutura da Tese

● Introdução

● Extracção de Relações Semânticas

● Atribuição de Pesos às Relações

● Quantificação de Semelhanças Semânticas

● Inferência de Novas Relações

● Conclusões

Page 3: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Objectivos e Motivação

● Criação de uma Base de Conhecimento Lexical (Ontologia Lexical, Rede Lexical, ...).

Porquê?? Para que Serve??

Page 4: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Objectivos e Motivação

● Aplicações:

– Ferramentas de auxílio à escrita

– Desambiguação

– Sumarização

– Recolha de Informação

Page 5: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Abordagens

● Duas estratégias seguidas na obtenção da Ontologia Lexical:

● Manualmente: WordNet, Cyc, HowNet…

● (Semi -) Automáticamente: MindNet

Page 6: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Extracção de Relações Semânticas

● Conversão de dicionários (LDOCE) para um formato mais formal.

– MIND – MIcrosoft Natural Language Dictionary

● Porquê dicionários?

– Vocabulário fechado

– Linguagem simples

Page 7: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Extracção de Relações Semânticas

● Exemplo:– fruit --- “an object that grows on a tree or bush,

contains seeds, is used for food, but is not

usually eaten with meat or with salt“.

Page 8: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Extracção de Relações Semânticas(1 - Árvores Sintácticas)

fruit:"an object that grows on a tree or bush, contains seeds, is used

NP1 DETP1 ADJ1* "an" NOUN1* "object" RELCL1 NP2 PRON1* "that" VP1 VERB1* "grows" PP1 PP2 PREP1* "on" DETP2 ADJ2* "a" NP3 NOUN2* "tree" CONJ1* "or" NP4 NOUN3* "bush" CONJP1 CONJ2* "," VP2 VERB2* "contains" NP5 NOUN4* "seeds" CONJP2 CONJ3* "," VP3 AUXP1 VERB3* "is" VERB4* "used" PP3 PP4 PREP2* "for" NOUN5* "food" CHAR1 "," CONJ4* "but" VP4 AUXP2 VERB5* "is" AVP1 AVP2 ADV1* "not" ADV2* "usu." VERB6* "eaten" PP5 PP6 PP7 PREP3* "with" NOUN6* "meat" CONJ5* "or" PP8 PP9 PREP4* "with" NOUN7* "salt"

for food, but is not usu. eaten with meat or with salt"

Page 9: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Extracção de Relações Semânticas(2 - Forma Lógica)

fruit:"an object that grows on a tree or bush, contains seeds, is used for food, but is not usu. eaten with meat or with salt"

object1 Prop but1 Crds grow1 Ptcl on1 Dsub object1 Dobj or1 Crds tree1 bush1 contain1 Dsub object1 Dobj seed1 use1 Dsub x1 Dobj object1 for food1 eat1 Dsub x2 Dobj object1 Mods usu.1 or2 with meat1 with salt1

Tenta-se normalizar o texto, tratando de questões como:

• Voz Passiva

• ex: “eaten”

• Anáfora

Page 10: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Extracção de Relações Semânticas

● Utilização de heurísticas:– “If the head verb of phrase is use and it is post-

modified by a prepositional phrase containing the

preposition for, then create a Purpose relation

between the word being defined and the object

of for.”

Fruit Purp Food

Page 11: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Extracção de Relações Semânticas(3 – Forma Semântica Relacional )

fruit:"an object that grows on a tree or bush, contains seeds, is used for food, but is not usu. eaten with meat or with salt"

fruit Hyp> object Part> seed Purp> food <Tsub grow Locn> tree bush <Tobj eat

Page 12: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Extracção de Relações Semânticas

● São identificadas 16 tipos de relações a extrair, alguns exemplos são:

– Causalidade

– Hyperonímia

– Sinonímia

– Meronímia

– Objecto_Típico_de

– Sujeito_Típico_de

Page 13: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Extracção de Relações Semânticas

● Ponto da Situação:– Deriva-se as árvores sintácticas das definições.– Efectua-se um conjunto de transformações e

obtém-se as representações lógicas.– Efectuam-se mais transformações e obtém-se a

forma semântica relacional.● Permite a extracção de triplos (“SEMRELS”):

– x1R x

2

● Será que não se pode fazer mais?

Page 14: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Extracção de Relações Semânticas

● Serão estas as únicas relações que se conseguem extrair para “car” ?

car:"a vehicle with 3 or usu. 4 wheels and driven by a motor, esp. one for carrying people"

car Hyp> vehicle Part> wheel <Tobj drive Means> motor Purp> carry Tobj> people

Page 15: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Extracção de Relações Semânticas

● E as definições que contêm a palavra “car”?hood :"the bonnet covering the engine of a car"

hood Hyp > bonnet < Tsub cover Tobj > engine < Part car

demist :"to clean steam from (the windows of a car)"

demist Hyp > clean Tobj > steam Tobj > window < Part car

peep :"the sound of a car's horn"

peep Hyp > sound < Part horn < Part car

Page 16: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Extracção de Relações Semânticas

● Através de um processo de inversão obtemos:hood:"the bonnet covering the engine of a car"inversion paraphrase:"a car has an engine, which is covered by a hood, which is a bonnet"

car Part> engine <Tobj cover Tsub> hood Hyp> bonnet

demist:"to clean steam from (the windows of a car)"inversion paraphrase:"a car has a window, which is demisted, which is cleaning steam (from)"

car Part> window <Tobj demist Hyp> clean Tobj> steam

peep:"the sound of a car's horn"inversion paraphrase:"a car has a horn, which has a peep, which is a sound"

car Part> horn Part> peep Hyp> sound

Page 17: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Extracção de Relações Semânticas

● LDOCE contém:– 33,000 entradas de substantivos

– 12,000 entradas de verbos

● Processo de extracção obteve:– 147,000 semrels (x

1 R x

2)

● Processo de inversão produz:– 180,000 semrels

● 78% das relações (com um erro de -/+ 5%) estão correctas

Page 18: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos às Relações

● É importante quantificar a importância dos SEMRELS ou um “caminho” de SEMRELS entre duas palavras.

car --- Poss ---> peopleSemrel:

Caminho de Semrels:

car --- Purp ---> carry --- Tobj ---> people

Page 19: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos às Relações

● Formalizando um pouco mais:– SEMREL

● w1Rw2 (car --- Purp ---> carry)

– Caminho de SEMRELS

● w1R1w2R2w3 (car --- Purp ---> carry --- Tobj ---> people)

● w1R1w2…wnRn+1wn+1

– Partes do SEMREL

● w1R1

● R1w2

Page 20: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos Utilizando tf.idf

• Adaptação de métricas utilizadas em RI.

kikik

n

Ntfw 2log.

• wik - peso do termo Tk do documento Di

• tfik – frequencia Tk no documento Di

• N – nº total de documentos (colecção)

• nk – nº de documentos com Tk

Nº de entradas na BCL

Frequência de _Rw2 na entrada w1

Peso de w1Rw2 para entrada w1

Nº de entradas na BCL com _Rw2

Page 21: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos Utilizando tf.idf

Quais são as partes mais importantes/salientes de um carro?

Relações Semânticas Frequência Frequência tf.idf

(SemRels) (SemRels) (2ª parte)  

carPartengine 3 8 34.511

carPartwheel 3 28 29.089

carPartwindow 2 4 25.007

carParttop 2 50 17.720

carPartclutch 1 1 14.504

carPartdicky 1 1 14.504

carPartfender 1 1 14.504

carPartscoop 1 1 14.504

carParttrunk 1 4 12.504

carParthorn 1 11 11.044

Page 22: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos Utilizando tf.idf

● Alguns problemas com o tf.idf.

– As palavras mais discriminatórias (w2) não

representam a maior saliência cognitiva.

– Não é uma métrica simétrica:

● sc(w1Rw2) != sc(w2Rw1)

Page 23: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos Utilizando Informação Mútua

● Informação Mútua (“Mutual Information”)

yPxP

yxPyxIM

.

,log),( 2

P(x) – probabilidade de x ocorrer

P(y) – probabilidade de y ocorrer

P(x,y) – probabilidade de x e y co-ocorrerem

Page 24: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos Utilizando Informação Mútua

● Fazendo a correspondência para o domínio do problema --- MI(w1Rw2):

P(x)

P(y)

P(x,y)

P(w1R)

P(Rw2)

P(w1Rw2)

Page 25: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos Utilizando Informação Mútua

Quais são as partes mais importantes/salientes de um carro?

Relações Semânticas Frequência Frequência MI

(SemRels) (SemRels) (2ª parte)  

carPartdicky 1 1 9,201

carPartfender 1 1 9,201

carPartscoop 1 1 9,201

carPartunderside 1 1 9,201

carPartwindow 2 5 7,879

carPartboot 1 3 7,616

carPartcockpit 1 3 7,616

carPartengine 3 11 7,327

carParttrunk 1 6 6,616

carPartwheel 3 32 5,786

Page 26: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos Utilizando Informação Mútua

● As frequências muito baixas dos SEMRELS podem ser a causa do problema.

● Foram testadas algumas variações ao IM standard,

mas sem sucesso.

Page 27: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos às Relações

● Lei de Zipf:

– Ordenando as palavras por ordem de frequência descendente (“rank”) e traçando a curva em relação à frequência da palavra obtém-se uma curva hiperbólica.

– A posição classificativa (“rank”) de uma palavra vezes a sua frequência aproxima uma constante K.

Page 28: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos às Relações

Curva de Zipf

Classificação

Fre

quência

ia

Page 29: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos às Relações

Curva de Zipf e Curva de Luhn

Classificação

Fre

quência

ia

Page 30: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos às Relações

● Será a Lei de Zipf válida para as relações semânticas (SEMRELS)?

– Existem muitos mais SEMRELS distintos do que palavras.

– As frequências de cada SEMREL são bastante baixas.● Frequência de 90 é o máximo

– Não existem palavras de função.

Page 31: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos às Relações

● Para obter uma curva equivalente à de Zipf

pode-se traçar uma curva que relaciona o

número de SEMRELS com uma determinada

frequência em relação à frequência.

Page 32: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos às Relações

vertex

0

20

40

60

80

100

0 20 40 60 80 100

Frequência

Núm

ero d

e SEM

RELS c

om

um

a Fre

q F

req ..

Page 33: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos às Relações

● Já sabemos como obter uma curva parecida com a de Zipf.

● Mas o que interessa saber é quais as palavras que estão relacionadas por relações perto de vértice.

● Para isso temos que traçar um gráfico para cada relação.

Page 34: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos às Relações

0

10

20

30

40

50

0 10 20 30 40 50

Frequency of semrels containing Tobj relation

Fre

quen

cy

Exemplo:

Curva representando a frequência de SEMRELS do tipo TOBJ em relação ao número de SEMRELS com uma dada frequência.

Page 35: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Função de Frequência “Verticial”

0

10

20

30

40

50

0 10 20 30 40 50

F w R w F w R w a F w R wV RRb

1 1 2 1 1 2 1 1 211

1

min ,

Page 36: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Probabilidades “Verticiais”

kjikji

VV wRwF

wRwFwRwP

,, all

211211

● Probabilidade de um SEMREL:

P w RF w R

F w R

P R w RF R w

F R w

VV

i ji j

VV

kk

1 11 1

1 2 11 2

1

all

all

,

● Probabilidade das partes do SEMREL:

Page 37: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Probabilidade Estimada

● Como as frequências de SEMRELS é baixa a validade das estatísticas pode estar comprometida.

● Pode-se utilizar probabilidades estimadas (“Averaged Probabilities”).

12111211211211211 RwRPRwPwRwAwRwPwRwAwRwP VVVV

Page 38: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Probabilidade Estimada

A w R wF w R w

F w R w

A w R wF w R w

1 1 21 1 2

1 1 2

1 1 21 1 2

1

1

1

● Factores de Estimação:

Page 39: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Atribuição de Pesos utilizando Probabilidades Estimadas

Relações Semânticas Frequência Frequência Probabilidade

(SemRels) (SemRels) (2ª parte) Estimada

carPartengine 3 11 .0000163706

carPartwheel 3 32 .0000163627

carPartwindow 2 5 .0000097012

carParttop 2 61 .0000096967

carParthorn 1 11 .0000036557

carParttrunk 1 6 .0000036466

carPartboot 1 3 .0000036411

carPartcockpit 1 3 .0000036411

carPartbody 1 43 .0000036387

carPartfront 1 48 .0000036384

Page 40: Determining Similarity and Inferring Relations in a Lexical Knowledge Base

Determining Similarity and Inferring

Relations in a Lexical Knowledge Base

Dissertação de Doutoramento de Stephen D. Richardson

City University of New York1997

Apresentado por:

Nuno Seco