Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici...

52
Information Extraction

Transcript of Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici...

Page 1: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Information Extraction

Page 2: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Information Extraction (IE)

• Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati (es. testo puro).

• Trasforma l’informazione estratta in un database strutturato.

• Si applica ai domini più diversi:– Articoli di giornale– Pagine Web– Letteratura scientifica– Messaggi di Newsgroup– Annunci economici o di lavoro – Cartelle cliniche

Page 3: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Esempio: un nuovo prodotto viene annunciato

Page 4: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Cosa interessa in sintesi in un “new product announcement” ?

•Quale prodotto

•Quale categoria di prodotto

•Quale ditta

•Quando

•Caratteristiche principali

Page 5: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Template: uno “schema” dell’informazione di interesse

Source

Company

New ProductType

Features

When

attributi

I “filler” degli attributisono i frammenti rilevantiestratti dal testo

Page 6: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Il task di IE è un task di “template filling”

Source

Company

New ProductType

Features

When

http://www.semtech.com/press/products/semtech_adds

Semtech Corp (SMTC)

SC4525A, SC4524A, SC454B

Three new step-down (buck) regulators

February 26, 2008

High input voltage and programmable frequency

Page 7: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Un altro esempio: IE da articoli di ricerca

Page 8: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Per riassumere:

• 1. Definire un dominio di applicazione (es. nuovi medicinali per la cura di tumori)

• 2. Definire quali categorie di informazioni interessano riguardo al dominio (es. Nome del prodotto, Quale tipo di tumore, quale casa farmaceutica, quale istituto di ricerca, effetti collaterali..)

• 3. Le categorie vengono modellate come attributi di un template (NOME, TIPO,..COLLAT)

• 4. Il compito di IE è trovare nei testi stringhe che rappresentano istanze di categorie (es.: transtuzumab è un istanza di NOME)

• 5. Questo si traduice nel “riempire” gli slot di un template con delle stringhe o slot fillers, che sono i VALORI degli ATTRIBUTI (NOME=transtuzumab)

• 6. Gli slot fillers possono essere più o meno strutturati (espressione logica, oppure una stringa in linguaggio naturale, ad esempio:

COLLAT = “dolori articolari”

Page 9: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Definizione di sub-tasks e valutazione di sistemi di IE:

Message Understanding Conference

• DARPA (Defense Advanced Research Projects Agency) ha finanziato ricerche in IE dal 1990.

• Message Understanding Conference (MUC) è la conferenza-gara del settore.

• Dal 2000 sostituita (inglobata) dalle TREC conferences

• Generalmente le gare hanno come tema l’estrazione di notizie da giornali:– Eventi terroristici– Joint venture– Cambi di management

Page 10: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Applicazioni

• Job postings

• Annunci di lavoro

• Annunci di Seminari

• Notizie societarie sul web

• Corsi sul web (continuing education)

• Informazioni e annunci universitari sul web

• Annunci di affitto appartamenti

• Informazioni di biologia molecolare su MEDLINE

Page 11: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Subject: US-TN-SOFTWARE PROGRAMMERDate: 17 Nov 1996 17:37:29 GMTOrganization: Reference.Com Posting ServiceMessage-ID: <[email protected]>

SOFTWARE PROGRAMMER

Position available for Software Programmer experienced in generating software for PC-Based Voice Mail systems. Experienced in C Programming. Must be familiar with communicating with and controlling voice cards; preferable Dialogic, however, experience with others such as Rhetorix and Natural Microsystems is okay. Prefer 5 years or more experience with PC Based Voice Mail, but will consider as little as 2 years. Need to find a Senior level person who can come on board and pick up code with very little training. Present Operating System is DOS. May go to OS-2 or UNIX in future.

Please reply to:Kim AndersonAdNET(901) 458-2888 [email protected]

Subject: US-TN-SOFTWARE PROGRAMMERDate: 17 Nov 1996 17:37:29 GMTOrganization: Reference.Com Posting ServiceMessage-ID: <[email protected]>

SOFTWARE PROGRAMMER

Position available for Software Programmer experienced in generating software for PC-Based Voice Mail systems. Experienced in C Programming. Must be familiar with communicating with and controlling voice cards; preferable Dialogic, however, experience with others such as Rhetorix and Natural Microsystems is okay. Prefer 5 years or more experience with PC Based Voice Mail, but will consider as little as 2 years. Need to find a Senior level person who can come on board and pick up code with very little training. Present Operating System is DOS. May go to OS-2 or UNIX in future.

Please reply to:Kim AndersonAdNET(901) 458-2888 [email protected]

Esempio “Offerte di lavoro”

Page 12: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Struttura estratta (template)

computer_science_jobid: [email protected]: SOFTWARE PROGRAMMERsalary:company:recruiter:state: TNcity:country: USlanguage: Cplatform: PC \ DOS \ OS-2 \ UNIXapplication:area: Voice Mailreq_years_experience: 2desired_years_experience: 5req_degree:desired_degree:post_date: 17 Nov 1996

Page 13: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

IE vs. IR

• Sono operazioni complementari

• Data una base documentale:– L’IR restituisce il sottoinsieme di

documenti rilevanti per una certa interrogazione in input. L’informazione di interesse sarà quindi cercata dall’utente

– L’IE estrae in modo strutturato le informazioni rilevanti per l’utente

Page 14: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

IE vs. web-IE

•I sistemi di IE non-web analizzano documenti non strutturati (che tuttavia possono anche essere sul web) , utilizzando prevalentemente metodi di analisi del linguaggio naturale NLP e tecniche di machine learning o reasoning (AI)

•I sistemi web analizzano documenti semi-strutturati (offerte di lavoro, avvisi commerciali, …in html, xml, rdf..) e utilizzano prevalentemente pattern matching o espressioni regolari, comunque in generale metodi più semplici che sfruttano le informazioni sulla struttura del testo fornite dal linguaggio di annotazione (es. XML/RDF template)

Page 15: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

WEB IE: Wrappers•Sul web ci sono molte sorgenti di informazione strutturata, ad es:

elenchi telefonici (pagine gialle), cataloghi di prodotti (es. cataloghi di libri, come AMAZON), previsioni del tempo, stock quotes..

•Queste risorse sono formattate per persone, non per la manipolazione da parte di computer

•Un “Wrapper” è una procedura per estrarre uno specifico contenuto (ad es. un template filler)

•Un wrapper identifica l’informazione (es. tag xml) che precede o incornicia l’informazione principale ricercata

•I Wrapper possono essere codificati a mano, o usando tecniche di apprendimento automatico

•Essendo i sorgenti parzialmente strutturati, questo compito è per certi versi più semplice che non estrarre template fillers da testi liberi.

Page 16: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Web IE: Wrappers

Page 17: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Wrappers su pagine web•Se il testo ha una struttura ripetitiva, ad esempio

tag html o xml che siano informative, questo facilita l’analisi, esempio:

<h2>Key Features of the SC4525A and SC4524A/B</h2>

<ul> <li>Wide input range of 8V to 28V (SC4525A); from 3V to 28V (SC4524A); and from 3V to 16V (SC4524B)</li> <li>3A output current&nbsp; (SC4525A)</li> <li>2A output current&nbsp; (SC4524A/B)</li> <li>200kHz to 2MHz programmable frequency</li>

<li>Peak current-mode control</li> <li>Cycle-by-cycle current limiting</li> <li>Hiccup overload protection with frequency foldback</li> <li>Programmable soft-start and enable</li> <li>Thermal shutdown</li></ul>

Page 18: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Es 2: Descrizione di libri Amazon….</td></tr></table><b class="sans">The Age of Spiritual Machines : When Computers Exceed Human Intelligence</b><br><font face=verdana,arial,helvetica size=-1>by <a href="/exec/obidos/search-handle-url/index=books&field-author= Kurzweil%2C%20Ray/002-6235079-4593641">Ray Kurzweil</a><br></font><br><a href="http://images.amazon.com/images/P/0140282025.01.LZZZZZZZ.jpg"><img src="http://images.amazon.com/images/P/0140282025.01.MZZZZZZZ.gif" width=90 height=140 align=left border=0></a><font face=verdana,arial,helvetica size=-1><span class="small"><span class="small"><b>List Price:</b> <span class=listprice>$14.95</span><br><b>Our Price: <font color=#990000>$11.96</font></b><br><b>You Save:</b> <font color=#990000><b>$2.99 </b>(20%)</font><br></span><p> <br>

….</td></tr></table><b class="sans">The Age of Spiritual Machines : When Computers Exceed Human Intelligence</b><br><font face=verdana,arial,helvetica size=-1>by <a href="/exec/obidos/search-handle-url/index=books&field-author= Kurzweil%2C%20Ray/002-6235079-4593641">Ray Kurzweil</a><br></font><br><a href="http://images.amazon.com/images/P/0140282025.01.LZZZZZZZ.jpg"><img src="http://images.amazon.com/images/P/0140282025.01.MZZZZZZZ.gif" width=90 height=140 align=left border=0></a><font face=verdana,arial,helvetica size=-1><span class="small"><span class="small"><b>List Price:</b> <span class=listprice>$14.95</span><br><b>Our Price: <font color=#990000>$11.96</font></b><br><b>You Save:</b> <font color=#990000><b>$2.99 </b>(20%)</font><br></span><p> <br>…

Page 19: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Template estratto

Title: The Age of Spiritual Machines : When Computers Exceed Human IntelligenceAuthor: Ray KurzweilList-Price: $14.95Price: $11.96::

Page 20: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

WEB IE: altri problemi

•I sistemi web-IE devono analizzare la struttura html delle pagine per identificare le porzioni rilevanti

•Il contenuto è spesso “immerso” nella pagina, assieme a immagini, altre informazioni non rilevanti rispetto al contenuto..

•La struttura a frames può aiutare a selezionare i contenuti utili

Page 21: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Selezionare i frame “utili”

Page 22: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Per riassumere

•IE ha a che vedere con l’analisi dei contenuti in un documento

•Se un documento è sul web, possono esserci problemi aggiuntivi o facilitazioni:– (+) Se il documento è in html, xml, rdf.. informazioni

sulla struttura del documento, che è esplicita nel linguaggio di annotazione, può aiutare a recuperare i contenuti utili (wrappers)

– (-) Se il contenuto è “immerso” in altre informazioni (immagini, logo, advertisements..) occore fare un “parsing” della pagina web per identificare il contenuto di intreresse

Page 23: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Architettura generale dei sistemi di IE non strutturati

•In generale, tutti i sistemi di IE hanno la seguente struttura:– Definizione dello schema dei templates

(manuale o automatica)– Analisi del testo (se web, la cosa è più

complicata per la presenza di figure, frames.., ma se il testo è semi-strutturato, ad es xml, può anche essere più semplice)

– Estrazione dei “fillers”, con metodi di ML o pattern matching

– Riempimento dei templates

Page 24: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Architettura di un sistema di IE

Riempimento dei templates

Definizionetemplate

Templates(unfilled)

Analisi dei testi: POS, NE recognition, ??

Estrazione/matching deipatterns patterns

Analisi del discorso, inferenze

Definizione/apprendimento

patterns

Page 25: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Definizione di Template

• “Record” di coppie attributo (slot) valore (filler) . Valori sono parti del testo con cui riempire lo slot.

• Gli slot vanno riempiti con stringhe la cui natura (lessicale, sintattica, semantica) è in genere predeterminata in modo più o meno specifico– Terrorist act: threatened, attempted, accomplished.– Job type: clerical, service, custodial, etc.

– Company type: codice SEC

• Alcuni slot possono accettare elementi di una classe, es:.– Programming language (JAVA, Prolog, C, ecc.) – Company names (IBM, ACE Inc, ...)

• In alcuni domini si devono estrarre più template da uno stesso documento.Una lista di appartamenti in vendita, in un unico avviso

Page 26: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Template Slot filling

•Due classi di metodi–Machine learning: imparare ad assegnare stringhe di testo ai vari slot (cioè classificarle come, ad es, purchaser, seller, location, ... ).

–Pattern matching: costruire espressioni regolari più o meno generalizzate che catturino la regolarità di certe stringhe.

Page 27: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Identificazione dei “fillers” basata su pattern matching

• Generalmente si usano espressioni regolari:– Pattern che identifica un prezzo in Amazon Book: “\$\d+

(\.\d{2})?”

<b>List Price:</b> <span class=listprice>$14.95</span><br><b>Our Price: <font color=#990000>$11.96</font></b><br>

• L’espressione regolare in genere consente di identificare il “filler” ma impone condizioni anche sui pre-filler e post-filler (il contesto di un filler).– Listino prezzi Amazon:

• Pre-filler pattern: “<b>List Price:</b> <span class=listprice>”• Filler pattern: “.+”• Post-filler pattern: “</span>”

Page 28: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

In testi non strutturati Pattern Matching funziona bene per certi tipi di filler, ad esempio, Named Entities•Es. nome di persona:

– personTitle personFirstname PersonFamily Name (ex. Mr John Smith) name-title+ capitalised words

• Es. nome di azienda: – (Jhon Whiley Inc) capitalized-word +company-tag

Page 29: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Natural Language Processing

• Come abbiamo visto, per alcuni tipi di informazion (named entities) e documenti (semi-strutturati) scrivere espressioni regolari è relativamente facile.

• In caso contrario, occorre utilizzare alcune tecniche di NLP.– Part-of-speech (POS) tagging– Syntactic parsing– Categorie semantiche (es da WordNet)

• KILL: kill, murder, assassinate, strangle, suffocate

• I pattern possono usare categorie lessicali, sintattiche, semantiche.– Crime victim:

• Prefiller: [POS: V, Hypernym: KILL]• Filler: [Phrase: NP]

Page 30: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Apprendimento automatico di pattern per IE

•L’aspetto più critico in IE è la scrittura di pattern specifici per ogni dominio e template

•Scrivere delle regex accurate richiede tempo ed è una attività domain-dependent (non ri-usabile).

•L’alternativa è usare tecniche di machine learning:– Si parte da un set di apprendimento in cui esperti

umani evidenziano i pattern di interesse (es. si sottolineano i filler degli slots).

– Impara un modello generalizzato degli slot-fillers (cioè un pattern) usando algoritmi di ML.

Page 31: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Automatic Pattern-Learning Systems

• Vantaggi:– Portabile a vari dominii– I pattern hanno una copertura più ampia– Non serve rivolgersi a knowledge engineers

• Svantaggi:– Bisogna annotare un campione ampio di documenti.– Non funziona sicuramente meglio di un sistema in cui

i pattern siano scritti a mano

• Esempi: ELIE (Ucd) , Riloff et al., AutoSlog (UMass); Soderland WHISK (UMass); Mooney et al. Rapier (Utexas)

Trainer

Decoder

Model

LanguageInput

Answers

AnswersLanguageInput

Page 32: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Un esempio: ELIE

• ELIE è un sistema “freeware” di IE, basato su tecniche di apprendimento automatico.

• ELIE lavora con un set di documenti da usare per l’ apprendimento (learning set), in cui l’utente marca le porzioni di testo che costituiscono i “valori” con cui riempire gli attributi o campi del template.

MINNEAPOLIS, April 3 - <seller>Soo Line Corp</seller> said it <status>agreed to sell</status>its <acquired>Lake States Transportation Division</acquired> to the newly formed<purchaser>Wisconsin Central Ltd</purchaser>. The division conducts <acqbus>rail operations</acqbus> over about 2,000 miles of railroad in <acqloc>Minnesota, Wisconsin, Michigan and Illinois</acqloc>. <sellerabr>Soo Line</sellerabr> said in January it was seeking bids for the property.

• ELIE, osservando il LS, impara ad identificare e marcare i vari campi su documenti non inclusi nel LS.

Page 33: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

ELIE: fasi

•Come in ogni sistema di apprendimento automatico, ci sono due fasi:– La fase di apprendimento o training, in cui,

dato un campione di testi annotati manualmente, ELIE impara un “modello” di annotazione automatica, cioè impara a identificare delle porzioni di testo come “filler” di certi attributi o tag (purchaser, seller..)

– La fase di estrazione, in cui l’apprendista, utilizzando il modello di etichettatura del testo appreso, classifica testi non manualmente annotati, individuando le porzioni che sono “filler” dei vari attributi del template.

Page 34: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

ELIE: caratterizzazione del testo

• Il problema affrontato da ELIE consiste nell’identificare, in un testo, stringhe specifiche, e classificarle in una delle categorie rappresentate dagli attributi di un template (nell’esempio precedente, “acquisizioni di società”, le “classi” sono: venditore (seller) acquirente (purchaser), società/gruppo acquisito (acquired), stato della transazione (status), luogo (loc), ecc.)

• Per fare ciò, il primo problema è caratterizzare nel modo più generale possibile il testo. La caratterizzazione del testo come”bag-of-words” produrrebbe uno spazio delle ipotesi troppo ampio

• Pertanto, il testo deve essere caratterizzato anche mediante “features” con un numero di valori minori della feature “token” (i cui valori sono l’intero vocabolario di una lingua e la punteggiatura)

Page 35: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

ELIE: caratterizzazione del testo

•Features utilizzate:– Token: una singola parola o punteggiatura– POS: il part-of-speech di quel token– Gaz: la categoria di nome proprio cui (eventualmente)

un token appartiene, zero se non è un nome proprio. Gaz assume come valori PERSONA (John, Mario Rossi), LUOGO (Minnesota, Lazio), TEMPO (m, pm, 12:30), TITOLO (Mr Mrs Dr..), address (street, boulevard..) ecc. Si basa su gazzetteers (database di nomi di entità, titoli, ecc.)

– Orthographic: se il token è maiuscolo, grassetto..

Page 36: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Esempio

{'token': 'honeywell', 'suffix': 'l', 'annotations': ['<seller>'], 'erc': [], 'chunks': ['NP_s'], 'stem': 'honeywel', 'pos': 'NNP', 'types': ['WORD', 'LONG', 'CAPITALIZED'], 'gaz': []}{'token': 'inc', 'suffix': '', 'annotations': ['</seller>'], 'erc': [], 'chunks': ['NP_e'], 'stem': 'inc', 'pos': 'NNP', 'types': ['WORD', 'CAPITALIZED'], 'gaz': ['stopword']}{'token': 'said', 'suffix': '', 'annotations': [], 'erc': [], 'chunks': [], 'stem': 'said', 'pos': 'VBD', 'types': ['WORD', 'ALL_LOWER'], 'gaz': ['stopword']}{'token': 'it', 'suffix': '', 'annotations': [], 'erc': [], 'chunks': [], 'stem': 'it', 'pos': 'PRP', 'types': ['WORD', 'ALL_LOWER'], 'gaz': ['stopword']}{'token': 'has', 'suffix': 's', 'annotations': [], 'erc': [], 'chunks': [], 'stem': 'ha', 'pos': 'VBZ', 'types': ['WORD', 'ALL_LOWER'], 'gaz': ['stopword']}

<seller>Honeywell Inc.</seller> said it has...

Nota: se il testo è stato annotato, le annotazioni sono associate al primo e all’ultimo token della stringa!

Page 37: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

ELIE: apprendisti L1 e L2

• La fase di apprendimento del modello avviene in due fasi: – L1 training phase: In questa fase, ELIE impara a identificare

i token di inizio e fine sequenza (L1-start/L1-end). Ogni token è rappresentato da un vettore di features (vedi esempio precedente) e L1 impara a classificarlo o come “start” di un certo attributo (es. purchaser) , o come “end”, oppure né start né end (negative).

– L2 boundary learning: nella fase due, L2-start prende un token classificato da L1-end come end, e cerca il rispettivo start solo fra i k precedenti token. L2-end prende un token classificato come start da L1-start, e cerca il rispettivo end solo fra i k successivi token.

– Tag matcher: genera un istogramma delle distanze, nel LS, fra start ed end di ogni attributo. Apprende dunque la probabilità che una end tag sia ad una certa distanza da una start tag, e queste probabilità sono usate in fase di estrazione.

Page 38: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Algortmo di apprendimento SMO

•L1 e L2 usano come metodo di apprendimento Sequential Minimal Optimization (SMO) , una ottimizzazione di Support Vector Machines (SVM, un metodo algebrico basato su iperpiani di separazione), che varia il modo con cui la SVM viene addestrata

•Su SMO: http://citeseer.ist.psu.edu/flake01efficient.html

•Su SVM: http://www.support-vector-machines.org/SVM_soft.html

Page 39: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

ELIE: fase di estrazione

•Nella fase di estrazione, ad ELIE vengono sottomessi testi non annotati ma preprocessati (ogni token è un vettore di features, ma fra le features non ci sono le tag di annotazione)

•Nella fase 1, i modelli L1-start e L1-end fanno le loro “predizioni” assegnando ad ogni token una classificazione (start, end, negative).

•Nella fase due, L2-end predice la fine di una stringa a partire da un token etichettato come L1-start, ed analogamente L2-start.

•Le predizioni “accoppiate” start-end del livello 2 vengono valutate dal Tag matcher.

Page 40: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Schema della fase di estrazione

Page 41: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.
Page 43: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Rapier [Califf & Mooney, AAAI-99]

• Rapier apprende da templates con relativi slots riempiti a mano

• Rapier impara tre tipi di fillers per ciascuno slot, in stile di :Pre-filler pattern Filler pattern Post-filler pattern

Esempio di regola imparata da RAPIER per estrarre il filler dello slot “transaction price”

“…paid $11M for the company…”“…sold to the bank for an undisclosed

amount…”“…paid Honeywell an undisclosed price…”

Page 44: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

esempio

“…sold to the bank for an undisclosed amount…”POS: vb pr det nn pr det jj nnSClass: price

“…paid Honeywell an undisclosed price…”POS: vb nnp det jj nnSClass: price

Page 45: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Rapier Rules: dettagli

• Rapier rule :=– pre-filler pattern– filler pattern– post-filler pattern

• pattern := subpattern +

• subpattern := constraint +

• constraint :=– Word - exact word that must be present– Tag - matched word must have given POS tag– Class - semantic class of matched word– Can specify disjunction with “{…}” – List length N - between 0 and N words satisfying other constraints

Page 46: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Algoritmo di apprendimento di Rapier

• Input: set of training examples (list of documents annotated with “extract this substring”)

• Output: set of rules

• Init: Rules = a rule that exactly matches each training example

• Repeat several times:– Seed: Select M examples randomly and generate the K

most-accurate maximally-general filler-only rules(prefiller = postfiller = “true”). Cioè la regola si applica solo al filler

– Grow:Repeat For N = 1, 2, 3, … Try to improve K best rules by adding N context words of prefiller or postfiller context Migliora la regola aggiungendo restrizioni sui pre e post fillers

– Keep:Rules = Rules the best of the K rules – subsumed rules

Page 47: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Esempio (una iterazione)

2 examples:‘… located in Atlanta, Georgia…”

‘… offices in Kansas City, Missouri…’

maximally general rules(low precision, high recall)

Seed

appropriately general rule (high precision, high recall)

Grow

maximally specific rules(high precision, low recall)

Init

Page 48: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Valutazione dell’accuratezza

• La valutazione va fatta su testi sui quali non sia stato fatto alcun apprendimento.

• Misura per ogni documento:– Numero totale di estrazioni corrette : N– Numero totale di coppie slot-valore estratte dal

sistema : E– Numero totale di coppie slot-valore estratte dal sistema

che sono corrette (rispetto al template-soluzione): C

• Misure di prestazione:– Recall = C/N– Precision = C/E– F-Measure = media armonica fra recall e precision

Page 49: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Estrazione di fatti su larga scala: KnowItAll [Etzioni et al. 2005]•Il primo sistema che estrae fatti da pagine Web

in modo:– Non supervisionato– Indipendente dal dominio

•Parte da un piccolo insieme di pattern indipendenti dal dominio– Quando istanziati per una particolare relazione,

forniscono regole di estrazione specifiche per la relazione

– Es: NP such as NPcong per estrarre relazioni di categoria (hotel facilities such as swimming pools, gym, sauna; pets such as cats, dogs..)

Page 50: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Pattern utilizzati in KnowItAll

Vengono utilizzati i seguenti pattern generali da istanziare sul dominio di interesse:

•NP1 ,? “such as” NP2

•NP1 ,? “and other” NP2

•NP1 “is a” NP2

•NP1 “is the” NP2 of NP3

•“the” NP1 “of” NP2 “is” NP3

Page 51: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

KnowItAll

1) Extractor• Si parte da un pattern generico, es. “<Class> such as <Member>” • Si istanzia <Class> con la classe di dominio, es. “cities”

2) Search Engine• Si interroga Google con la stringa “cities such as”• I frammenti restituiti sono analizzati per identificare i membri

delle classi: We provide tours to cities such as Paris, Nice and Montecarlo

3) Assessor• Problema: rumore “second-tier cities such as this to take

advantage of ample land supplies”• Data una lista di candidati, si utilizzano i conteggi ottenuti da

Google come features per determinare la rilevanza dei candidati• Le feature sono combinate in un modello Naive Bayes per

produrre un ordinamento dei fatti estratti con la regola istanziata sul dominio

4) Creazione del database

Page 52: Information Extraction. Information Extraction (IE) Identifica frammenti di informazione specifici in testi parzialmente strutturati (es. XML) o non strutturati.

Conclusioni e tools

•IE= template creation + filling

•Il problema principale è la dipendenza dal dominio

•Sviluppi di ricerca: patterns domain-independent (KnowItAll) o strumenti di acquisizione automatica “minimally trained”

•Tools: GATE un toolkit di IE open-source http://gate.ac.uk/ie/