1 / 44

Interpretación semántica

Interpretación semántica. Interpretación semántica Semántica léxica Desambiguación de sentidos Word Sense Disambiguation (WSD). La Interpretación Semántica. semántica léxica "Pedro"  pedro. "rie"  (lambda(x), reir(x))) composición (lambda(x), reir(x)) pedro  reir(pedro).

nirav
Download Presentation

Interpretación semántica

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Interpretación semántica • Interpretación semántica • Semántica léxica • Desambiguación de sentidos • Word Sense Disambiguation (WSD)

  2. La Interpretación Semántica • semántica léxica • "Pedro"  pedro. • "rie"  (lambda(x), reir(x))) • composición • (lambda(x), reir(x)) pedro  reir(pedro). • ¿Cómo llevar a cabo la IS? • función (o funciones) de composición • momento de llevar a cabo la interpretación

  3. función de composición = lambda evaluación. ORACION  GN FV, (2 1) GN  np, (1) FV  vi, (1) FV  vt GN (1 2) Pedro  np, pedro María  np, maria ríe  vi, (lambda (x), reir(x)) ama a  vt, ((lambda (x), (lambda (y), ama(y,x))))

  4. ejemplo 1 "Pedro rie" FRASE | SEM = (2 1) = (FV:SEM GN:SEM) = | ((lambda(x) reir(x)) pedro) = reir(pedro) | |_______GN | | SEM = (1) = (np:SEM) = pedro | | | |_______np | | SEM = pedro | | | Pedro |_______FV | SEM = (1) = (vi:SEM) = (lambda(x) reir(x)) |_______vi | SEM = (lambda(x) reir(x)) | ríe

  5. ejemplo 2 "Pedro ama a María" FRASE | SEM = (2 1) = (FV:SEM GN:SEM) = | ((lambda(x) amar(x,maria)) pedro) = amar(pedro,maria) |_______GN | | SEM = (1) = (np:SEM) = pedro | |________np | | SEM = pedro | Pedro |_______FV SEM=(1 2) = (vt:SEM GN:SEM) = (((lambda(y) | (lambda(x) amar(x,y))) maria)=((lambda(x)amar(x,maria)) |_______vt | | SEM = ((lambda(y) (lambda(x) amar(x,y))) | ama a | |_______GN | SEM = (1) = (np:SEM) = maria |_______np | SEM = maria María

  6. Estrategias de la interpretacion semántica • proceso posterior al análisis sintáctico • se parte del arbol de análisis • unificacion del proceso sintáctico y semántico • existe un solo proceso de análisis. • las categorias gramaticales se unifican: gramáticas semánticas • proceso en paralelo sintaxis/semántica. • la semántica sirve para validar hipotesis de análisis sintáctico • las interpretaciones (parciales) semánticas se construyen a medida que se construye el arbol de análisis. • analizadores guiados por la semántica. • el papel de la sintaxis se reduce (si es que existe análisis sintáctico) a validar determinadas hipotesis semánticas (ej. patrones de subcategorización o restricciones de selección) o a categorizar partes del texto.

  7. Análisis semántico independiente y posterior al sintáctico (Allen) • aplicación de reglas de interpretación. • <esquema>  <descripcion parcial de la f.l.> • el esquema consiste en un conjunto de restricciones selectivas, producto del análisis sintáctico. • la representación semántica será una forma lógica. Las componentes de una construcción sintáctica darán lugar a formas lógicas parciales (con alguno de sus elementos aun no determinado). • notacion: • * objeto (identificación única) descrito por la forma lógica • t (<descritor>) tipo del constituyente • v (<descritor>) interpretación semántica del constituyente • ? elemento aún no determinado.

  8. Sintaxis de la forma lógica • (<OPERADOR> <NOMBRE> <TIPO> <MODIFICADORES>) • Los operadores dependen del tipo de estructura a representar: • Sintagmas nominales no cuantificados: • DEF/SING, DEF/PL, INDEF/SING, INDEF/PL • Sintagmas nominales cuantificados • EACH, SOME • Pronombres interrogativos • WH, WH/PL, WH/SING • Pronombres personales • PRO • Nombres propios • NAME • Oraciones • ASSERT, Y/N_QUERY, WH_QUERY, COMMAND • Sintagmas verbales • PAST, PRES, FUT, INF • Relaciones • OR, AND, BUT

  9. Ejemplos de reglas de interpretacion 1 a green apple (NP DET a ADJ (green) HEAD apple)  {(? A1 APPLE (COLOR C1 GR137)), (? A1 APPLE (UNRIPE C1))}

  10. Ejemplos de reglas de interpretacion 2 The man laughed (S SUBJ (NP DET the HEAD man NUM {3s} SEM (DEF/SING M1 MAN)) MAIN-V laugh TENSE past)  (? L1 LAUGH [AGENT (DEF/SING M1 MAN)])

  11. Algoritmo de interpretacion semántica 1 • Se asume que cada subconstituyente se interpreta automáticamente cuando se efectúa la primera verificación semántica sobre él • Se crea un nombre (reemplazando *) • Análisis del núcleo • aplicar todas las reglas de interpretación indexadas por el núcleo • mezclar las FLs parciales • Para cada interpretación del núcleo aplicar lo siguiente hasta que todos los modificadores hayan actuado • seleccionar un modificador (componente sintáctico aún no interpretado) • aplicar todas las reglas de interpretación indexadas por el head del modificador • mezclar las FLs • Producir las FLs mediante unificación

  12. Interpretacion de los constituyentes simples • en general, la interpretacion de un constituyente comienza interpretando el nucleo de dicho constituyente (lo cual da lugar a llamadas recursivas al mecanismo de interpretacion). • la interpretacion del nucleo suele obligar a la interpretacion de alguno de los modificadores. el resultado de esta fase (head analysis) es un conjunto de descripciones parciales correspondientes a la interpretacion del nucleo y una lista de modificadores ya utilizados). • la siguiente fase (modifiers analysis) consiste en la interpretacion de los modificadores aun no interpretados y la incorporacion del resultado a la forma logica (parcial) que interpreta al componente.

  13. Algoritmo de unificación 1 • Unificador • ? unifica con cualquier cosa. • dos objetos identicos unifican • dos objetos con modificadores unifican si son consistentes los modificadores correspondientes a los casos más internos. • la unificación con valores ambiguos se realiza mediante la intersección de los valores de cada una de las interpretaciones parciales.

  14. Algoritmo de unificación 2 • ejemplos • (? R1 RUN [THEME (NAME J1 PERSON "John"])) • (? R1 RUN [THEME (DEF/SING P1 PRINT-PRESS)]) • no son unificables • (? R1 RUN [AGENT (NAME J1 PERSON "John"])) • (? R1 RUN [THEME (DEF/SING P1 PRINT-PRESS)]) • si lo son, dando lugar a: • (? R1 RUN [AGENT (NAME J1 PERSON "John"])) [THEME (DEF/SING P1 PRINT-PRESS)])

  15. Algoritmo de interpretacion semántica 2 The dishwasher laughed (S SUBJ (NP DET the NUM {3s} HEAD diswasher) MAIN-V laugh TENSE past) (the.1) (NP DET the NUM {3s})  (DEF/SING * ? ?) (dishwasher.1) (NP HEAD dishwasher)  (? * {PERSON_TYPE_43, APPLIANCE_TYPE_3} ?) (laugh.1) (S SUBJ +animate MAIN_V laugh)  (? * LAUGH [AGENT V(SUBJ)]) (past.1) (S TENSE PAST)  (PAST ? ? ?)

  16. Algoritmo de interpretacion semántica 3 aplicacion de la regla laugh.1 ==> subj ha de tener la caracteristica +animate ==> hay que analizar subj ==> hay que analizar np ==> aplicacion de the.1 y diswasher.1 (DEF/SING D1 ? ?) (? D1 {PERSON-TYPE-3, APPLIANCE-TYPE-43} ?)

  17. Algoritmo de interpretacion semántica 4 se unifican las descripciones parciales el resultado rellena el descriptor sem del np y del subj. (S SUBJ (NP DET the NUM {3s} HEAD diswasher SEM (DEF/SING D1 {PERSON-TYPE-3, APPLIANCE-TYPE-43}) MAIN-V laugh TENSE past)

  18. Algoritmo de interpretacion semántica 5 ahora ya es posible la aplicacion de la regla laugh.1, dando lugar a (? L1 LAUGH [AGENT (DEF/SING D1 PERSON-TYPE-3)]) la interpretacion de TENSE, mediante la aplicacion de la regla past.1 da lugar a (PAST ? ? ?) y la posterior unificacion a (PAST L1 LAUGH [AGENT (DEF/SING D1 PERSON-TYPE-3)])

  19. action obj/action laugh to/action inst/action give break Jerarquía de reglas (give.1) (S SUBJ +animate MAIN_V give)  (? * GIVE1 [AGENT V(SUBJ)]) (give.2) (S OBJ +physobj MAIN_V give)  (? * GIVE1 [THEME V(OBJ)]) (give.3) (S IOBJ +org MAIN_V give)  (? * GIVE1 [TO_POSS V(IOBJ)]) (give.4) (S MAIN_V give MODS (PP PREP to POBJ +org))  (? * TO_POSS [AGENT V(POBJ)])

  20. Interpretacion de los componentes complejos 1 The man gave the company a car at the fairgrounds (S SUBJ (NP "the man") MAIN-V give TENSE past OBJ (NP "a car") IOBJ (NP "the company") MODS ([PP PREP at POBJ (NP "the fairgrounds")])) la aplicación del algoritmo sobre el núcleo da lugar a: (? G1 GIVE1 [AGENT (DEF/SING M1 MAN)] [THEME (INDEF/SING C1 AUTO)] [TO-POS (DEF/SING C2 COMPANY_ORG)]) de forma que sólo TENSE y MODS quedan sin interpretar

  21. Interpretacion de los componentes complejos 2 la interpretacion de tense, mediante la aplicacion de la regla past.1 da lugar a (PAST ? ? ?) la interpretacion de mods se realiza mediante la regla at.1. dando lugar a: (? G1 ? (AT-LOC G1 (DEF/SING F1 FAIRGROUND)))

  22. Interpretacion de los componentes complejos 3 La posterior unificacion de estas dos formas con la resultante del nucleo produce: (PAST G1 GIVE1 [AGENT (DEF/SING M1 MAN)] [THEME (INDEF/SING C1 AUTO)] [TO-POS (DEF/SING C2 COMPANY_ORG)] (AT-LOC G1 (DEF/SING F1 FAIRGROUND)))

  23. Gramáticas semánticas 1 • combinación de sintaxis y semántica en un único formalismo (normalmente gramáticas incontextuales) • en las gramáticas semánticas los símbolos terminales son categorías semánticas. • tamaño mayor (número de reglas). • número de palabras por categoría mucho menor. • mayor ambigüedad. • problema: generalidad • aplicación: sistemas robustos y eficientes en dominios restringidos. • la construcción de la forma lógica a partir de la gramática se hace directamente mediante simples extensiones.

  24. Gramáticas semánticas 2 RES_VP  RESERVING, RES_MODS DEP_VP  DEPARTING, DEP_MODS RESERVING  RESERVE_VERB, FLIGHT RES_MODS  for, PERSON RES_MODS  [] DEPARTING  DEPART_VERB DEPARTING  DEPART_VERB, SOURCE_LOC DEP_MODS  DEP_MOD, DEP_MODS DEP_MODS  [] DEP_MOD  to, DEST_LOC DEP_MOD  from, SOURCE_LOC

  25. Semántica léxica • Diccionarios semánticos • Ontologías • Tipología • Granularidad • Ámbito • Generalidad • Ejemplos • UMLS • WordNet • EuroWordnet • Otros recursos

  26. Ejemplo: UMLS • UMLS (Unified Medical Language System) • National Library of Medecine, USA Department of Health and Human Services • Conjunto de recursos • Metatesauro • 330.000 conceptos, 735.000 términos • Red Semántica • Conjunto de categorías semánticas básicas (135 tipos semánticos, 51 relaciones) • Enlaces con los Vocabularios fuente • 30 fuentes (multilingües) • Lexicón especializado • con información morfo-sintáctica

  27. Ejemplo: WordNet • WordNet • Universidad de Princeton (Fellbaum,1998) • Conceptos lexicalizados (palabras, lexías) • synsets: conjunto de sinónimos (sinonimia en contexto) • Cobertura en nombres, verbos, adjetivos y adverbios • Relacionados entre sí por relaciones semánticas • sinonimia • antonimia • hiperonimia-hiponimia • meronimia • implicación • causa • ... • Wn1.5, Wn1.6,Wn 1.7: 120.000 palabras, 100.000 synsets • Wn2.0, Extended WordNet http://www.cogsci.princeton.edu/~wn/

  28. Fragmento de WN1.5

  29. EuroWordNet • Proyecto LE-2 4003 Telematics Application Programme de la Unión Europea • Redes semánticas de diversas lenguas, integradas e interconectadas • Inglés Universidad de Sheffield • Holandés Univ. de Amsterdam • Italiano I.L.C. de Pisa • Español UB, UPC, U.N.E.D • Cobertura básicamente nominal y verbal (50.000 acepciones por lengua) • Gran riqueza en las relaciones semánticas • inter/intra linguales, inter/intra categoriales • EWN2 • Alemán, Checo, Estonio, Francés • Extensiones al catalán, gallego y vasco • Extensiones y mejoras http://www.hum.uva.nl/~ewn/ http://www.lsi.upc.es/~nlp/

  30. Levin classes (3100 verbs) • 47 top level classes, 193 second and third level • Basadas en pares de plantillas sintácticas. • John broke the jar. / Jars break easily. / The jar broke. • John cut the bread. / Bread cuts easily. / *The bread cut. • John hit the wall. / *Walls hit easily. / *The wall hit. • Reflejan implícitamente los componentes semánticos • contact, directed motion, • exertion of force, change of state • Sinonimia, plantillas sintácticas (patrones de subcategorización)

  31. Intersective Levin classes

  32. Regular Sense Extensions • John pushed the chair. +force, +contact • John pushed the chairs apart. +ch-state • John pushed the chairs across the room. +ch-loc • John pushed at the chair. -ch-loc • The train whistled into the station. +ch-loc • The truck roared past the weigh station. +ch-loc

  33. VerbNet 1 • Lexicón verbal computacional • Asociaciones entre sintaxis y semántica • Syntactic frames (patrones de subcategorización) y restricciones de selección. • Información semántica léxica – estructura predicado/argumentos • Componentes semánticos representados como predicados • Links a synsets de WordNet • Entradas basadas en refinamiento de las clases de Levin • Propiedades temporales inherentes representadas explícitamente • during(E), end(E), result(E)

  34. VerbNet 2 Hit Class <<MEMBERS>> [<hit1>, <kick1>,<slap1>…] <<THEMATIC ROLES>> Agent(A), Patient(P), Instrument(I) <<SELECT RESTRICTIONS>> Agent [+animate], Patient [+concrete], Instrument [+concrete,-animate] <<FRAMES and PREDICATES>>

  35. Penn Treebank • 1,3 millones de palabras, 40.000 oraciones • Wall Street Journal y otras fuentes • POS tagged • Syntactically Parsed

  36. VP have been VP expecting SBAR VP NP NP in NP NP an eventual 30% stake the US car maker the British company a GM-Jaguar pact WHNP-1 give that A TreeBanked Sentence (S (NP-SBJ Analysts) (VP have (VP been (VP expecting (NP (NP a GM-Jaguar pact) (SBAR (WHNP-1that) (S (NP-SBJ *T*-1) (VP would (VP give (NP the U.S. car maker) (NP (NP an eventual (ADJP 30 %) stake) (PP-LOC in (NP the British company)))))))))))) S VP NP-SBJ Analysts NP S VP NP-SBJ *T*-1 would NP PP-LOC Analysts have been expecting a GM-Jaguar pact that would give the U.S. car maker an eventual 30% stake in the British company.

  37. battle wrestle join debate Powell and Zhu Rongji met consult Powell met with Zhu Rongji Proposition:meet(Powell, Zhu Rongji) Powell and Zhu Rongji had a meeting . . . Proposition Bank (Propbank) Generalización de oraciones a proposiciones Powell met Zhu Rongji meet(Somebody1, Somebody2) When Powell met Zhu Rongji on Thursday they discussed the return of the spy plane. meet(Powell, Zhu) discuss([Powell, Zhu], return(X, plane))

  38. Arg0 that would give Arg1 *T*-1 an eventual 30% stake in the British company Arg2 a GM-Jaguar pact the US car maker The same sentence, PropBanked (S Arg0 (NP-SBJ Analysts) (VP have (VP been (VP expecting Arg1(NP (NP a GM-Jaguar pact) (SBAR (WHNP-1that) (S Arg0 (NP-SBJ *T*-1) (VP would (VP give Arg2 (NP the U.S. car maker) Arg1 (NP (NP an eventual (ADJP 30 %) stake) (PP-LOC in (NP the British company)))))))))))) have been expecting Arg1 Arg0 Analysts expect(Analysts, GM-J pact) give(GM-J pact, US car maker, 30% stake)

  39. Desambiguación de sentidos 1 • Sense (sentido, acepción) • distinción del significado de una palabra (word type) observable en diferentes usos (word tokens) • Word Sense Disambiguation (WSD) • dada una palabra (word token) en un contexto determinar cuál es su sentido correcto

  40. Desambiguación de sentidos 2 • Problemas • Homonimia: significados no relacionados • banco financiero, banco de pesca • Polisemia: significados relacionados • Polisemia regular (sistemática) • entré en (el edificio de) la universidad • Metáfora • Me bebí un vaso de vino • ¿Cuántos sentidos? ¿Cuáles? • ¿Realmente es posible?

  41. Desambiguación de sentidos 3 • Problema similar al POS tagging • Se pueden intentar aproximaciones similares • Pero es mucho más difícil • Restricciones habituales • Yarowsky (1995) • One sense per discourse • One sense per collocation

  42. Desambiguación de sentidos 4 • Una posible solución (Naive Bayes) • Sea w la palabra a desambiguar • Sean ck los posibles sentidos • Sea el vector de contexto (p.ej. ventana fija de 100 palabras). • Aplicando Bayes tenemos:

  43. Desambiguación de sentidos 5

More Related