TEORIE E TECNICHE DEL RICONOSCIMENTO

Slides:



Advertisements
Presentazioni simili
Primary Italian Saying How You Are.
Advertisements

Termodinamica Chimica
The mole.
1 Quale spazio per uneducazione plurilingue nella scuola di oggi? Firenze, 30 settembre 2011 Silvia Minardi.
P. Oorts Paolo sees Giulia. Paolo = subject sees = verb Giulia = direct object He sees her. he = a subject pronoun (replaces a noun) her = a direct.
REALIZING CONSTRUCTIVIST OBJECTIVES THROUGH COLLABORATIVE TECHNOLOGIES: THREADED DISCUSSIONS Donald Weasenforth Sigrum Biesenbach- Lucas Christine Meloni.
Apprendimento Automatico: Elaborazione del Linguaggio Naturale
Apprendimento Non Supervisionato
Apprendimento Bayesiano
Digressione: il linguaggio di query CQP
BRISCOLA GO ON AVANTI. Storia I giochi di carte hanno le origini più disparate e vengono collocati in differenti epoche, la Briscola risale al La.
Queuing or Waiting Line Models
Elementi di Informatica
REGIONE AUTONOMA FRIULI VENEZIA GIULIA PROTEZIONE CIVILE DELLA REGIONE
Motor Sizing.
Come nella stampa tradizionale, un giornale online può essere di informazione informazione o un periodico dedicato a una disciplina specifica.
Metodi Quantitativi per Economia, Finanza e Management Lezione n°8.
Distribuzione del numero di alleli condivisi da coppie di fratelli e di non-parenti tipizzati rispettivamente per 5, 9 e 13 markers.
Frequency Domain Processing
LINGUISTICA GENERALE E COMPUTAZIONALE CLASSIFICAZIONE DI TESTI.
Giovanni Biondi ICT e trasformazione della Scuola.
TEORIE E TECNICHE DEL RICONOSCIMENTO
PINK FLOYD DOGS You gotta be crazy, you gotta have a real need. You gotta sleep on your toes. And when you're on the street. You gotta be able to pick.
Demonstrating Possession
Ontologia AA F. Orilia. Lez. 16 Discussione dell'approccio controfattualista di lewis condotta da Antonio De Grandis.
4/20/20151 Metodi formali dello sviluppo software a.a.2013/2014 Prof. Anna Labella.
Love, Love, Love. Love, Love, Love. Love, Love, Love. There's nothing you can do that can't be done. Nothing you can sing that can't be sung. Nothing.
By The Beatles. Yesterday, all my troubles seemed so far away, Now it looks as though they're here to stay, Oh I believe in yesterday. Suddenly, I'm not.
Università degli Studi di Cassino e del Lazio Meridionale Dipartimento di Scienze Umane, Sociali, e della Salute Lingua Inglese a.a (Dott. Saverio.
Metodi Quantitativi per Economia, Finanza e Management Lezioni n° 7-8.
Taccani1 7.4 Identification ANALISI DEI PERICOLI Hazard Analysis Identificazione Valutazione Misure di Controllo Control Measures Assessment.
Successione degli Stati nei trattati Successione di Stati = mutamento di sovranità territoriale. Conseguenze di tale mutamento sui diritti ed obblighi.
The Starry Night – Vincent Van Gogh
ALL YOU NEED IS LOVE Love, Love, Love. There's nothing you can do that can't be done. Nothing you can sing that can't be sung. Nothing you can say but.
Capitolo 14 Il presente del congiuntivo (the present subjunctive)
Un problema multi impianto Un’azienda dispone di due fabbriche A e B. Ciascuna fabbrica produce due prodotti: standard e deluxe Ogni fabbrica, A e B, gestisce.
TEORIE E TECNICHE DEL RICONOSCIMENTO
Futuro, Condizionale, Dovere, Potere e volere
Come capire quando le prove funzionali non sono attendibili Riccardo Pistelli Università Cattolica - Roma.
SUMMARY Time domain and frequency domain RIEPILOGO Dominio del tempo e della frequenza RIEPILOGO Dominio del tempo e della frequenza.
SUMMARY Quadripoles and equivalent circuits RIEPILOGO Quadripoli e circuiti equivalenti RIEPILOGO Quadripoli e circuiti equivalenti.
TEORIE E TECNICHE DEL RICONOSCIMENTO
John Winston Ono Lennon was an English musician. From 1962 to 1970 he was a composer and singer (soloist) of the musical group the Beatles. Along with.
L A R OUTINE D EL M ATTINO Ellie B.. Io mi sono svegliata alle cinque del mattino.
SUMMARY Dinamic analysis RIEPILOGO Analisi dinamica RIEPILOGO Analisi dinamica.
What are relative pronouns? Pronouns that stand in for an aunt or uncle?
Geothermal energy Geothermal energy is a renewable energy and can be obtained by tapping into The heat of the earth's hydrothermal sites. The water that.
SUMMARY Different classes and distortions RIEPILOGO Le diverse classi e le distorsioni RIEPILOGO Le diverse classi e le distorsioni.
SUMMARY A/D converters RIEPILOGO Convertitori A/D RIEPILOGO Convertitori A/D.
Filtri del secondo ordine e diagrammi di Bode
SUMMARY Real operational amplifiers RIEPILOGO Amplificatori operazionali reali RIEPILOGO Amplificatori operazionali reali.
SUMMARY Interconnection of quadripoles RIEPILOGO Interconnessione di quadripoli RIEPILOGO Interconnessione di quadripoli.
 Complete the following conjugations:  Dire   Viviere   Fare   Dare   What type of verbs are these ??
Language of Algebra.
Language of Algebra. Basic concepts Key words Practice exercises Basic concepts Key words Practice exercises.
Polygons, Quadrilaterals, Trapezes and Parallelogramms
Polygons, Quadrilaterals, Trapezes and Parallelogramms
LE PREPOSIZIONI. Le Preposizioni semplici (Simple prepositions) A preposition describes a relationship between other words in a sentence. In itself, a.
1 Università di Milano-Bicocca Laurea Magistrale in Informatica Corso di APPRENDIMENTO AUTOMATICO Prof. Giancarlo Mauri Lezione – Apprendimento statistico.
Prof. Giacomo Dalseno USARE MOODLE Differenti forme di interazione.
Università degli Studi di Cassino e del Lazio Meridionale Dipartimento di Scienze Umane, Sociali e della Salute Lingua Inglese a.a (Dott. Saverio.
Buon giorno, ragazzi oggi è il quattro aprile duemilasedici.
ETWINNING XMAS C’era una volta Ed esiste ancora.
PROGETTO COMENIUS Partenariato Scolastico Multilaterale Anno 2012/2013 CIRCOLO DIDATTICO S.G. BOSCO- BIANCAVILLA- CT.
A Tiny Voice Inside Una piccola Voce interiore By Carole Smith Gaetano Lastilla.
1. ELASTICITA’ DELLA DOMANDA potere di mercato (FISSARE IL PREZZO) ≠ da potere contrattuale (TAKE OR LEAVE OFFER CAP 3 e 4) e da potere nell’impresa (CAPACITA’
STMan Advanced Graphics Controller. What is STMan  STMan is an advanced graphic controller for Etere automation  STMan is able to control multiple graphics.
MSc in Communication Sciences Program in Technologies for Human Communication Davide Eynard Facoltà di scienze della comunicazione Università della.
PROGETTO SOCRATES Dante Alighieri Primary School Classes 2A-B-C GENERAL OBJECTIVES: -To increase the motivation and the pleasure for reading -To pass.
Il condizionale.
Transcript della presentazione:

TEORIE E TECNICHE DEL RICONOSCIMENTO CLASSIFICAZIONE AUTOMATICA CLASSIFICAZIONE DI PDD CLASSIFICAZIONE DI TESTI

CLASSIFICAZIONE Un CLASSIFICATORE e’ una FUNZIONE da oggetti che si vogliono classificare a etichette Determinate la parte del discorso di un token Assegnare valore SPAM/NO SPAM a email Positivo / negativo La disambiguazione delle parti del discorso e molti altri problemi in LC possono essere visti come problemi di classificazione

DISAMBIGUAZIONE DELLE PARTI DEL DISCORSO COME CLASSIFICAZIONE La disambiguazione delle parti del discorso (POS tagging) puo’ essere vista come un classificatore che determina l’interpretazione piu’ probabile di ogni parola (nome, verbo, etc)

SECONDO ESEMPIO: DISAMBIGUAZIONE DEI SIGNIFICATI

SENSES OF “line” Product: “While he wouldn’t estimate the sale price, analysts have estimated that it would exceed $1 billion. Kraft also told analysts it plans to develop and test a line of refrigerated entrees and desserts, under the Chillery brand name.” Formation: “C-LD-R L-V-S V-NNA reads a sign in Caldor’s book department. The 1,000 or so people fighting for a place in line have no trouble filling in the blanks.” Text: “Newspaper editor Francis P. Church became famous for a 1897 editorial, addressed to a child, that included the line “Yes, Virginia, there is a Santa Clause.” Cord: “It is known as an aggressive, tenacious litigator. Richard D. Parsons, a partner at Patterson, Belknap, Webb and Tyler, likes the experience of opposing Sullivan & Cromwell to “having a thousand-pound tuna on the line.” Division: “Today, it is more vital than ever. In 1983, the act was entrenched in a new constitution, which established a tricameral parliament along racial lines, with separate chambers for whites, coloreds and Asians but none for blacks.” Phone: “On the tape recording of Mrs. Guba's call to the 911 emergency line, played at the trial, the baby sitter is heard begging for an ambulance.”

UNA VISIONE GEOMETRICA DELLA CLASSIFICAZIONE SPAM NON-SPAM

UNA VISIONE GEOMETRICA DELLA CLASSIFICAZIONE VERBI NOMI

ESEMPIO DI CLASSIFICATORE: REGRESSIONE LOGISTICA x2 3 2 1 1 2 3 x1 Predici “ “ if

ESEMPIO DI CLASSIFICATORE: DECISION TREE

IL RUOLO DELL’APPRENDIMENTO AUTOMATICO Un decision tree come quello appena visto potrebbe essere scritto a mano Ma nella linguistica computazionale moderna, questi classificatori non vengono specificati a mano, ma vengono APPRESI AUTOMATICAMENTE a partire da esempi.

METODI PER L’APPRENDIMENTO SUPERVISIONATI (SUPERVISED) Imparano da esempi etichettati Modellano l’apprendimento tramite insegnanti NON SUPERVISIONATI (UNSUPERVISED) Scoprono da soli la struttura del problema Modellano l’apprendimento del linguaggio SEMI-SUPERVISED Ricevono come input pochi esempi poi procedono per somiglianza

SUPERVISED CLASSIFICATION FOR POS TAGGING L’algoritmo di apprendimento riceve come input un corpus di TRAINING classificato con POS tags La/Art gatta/N fece/V un/Art salto/N ./. Giuseppe/PN e’/V matto/Adj ./. Si estrae le features / calcola le probabilita’ Costruisce un MODELLO che puo’ poi essere usato per classificare ALTRI testi

TRAIN/TEST

CLASSIFICAZIONE PROBABILISTICA Ad ogni etichetta e’ associata una PROBABILITA’ Il classificatore puo’ essere sviluppato a mano o APPRESO da (grandi quantita’ di) ESEMPI usando metodi di APPRENDIMENTO AUTOMATICO

POS TAGGER BASATI SU N-GRAMS Un POS TAGGER BASATO SU N-GRAMS e’ un classificatore che riceve come input informazioni sulla parola e le parole che la precedono UNIGRAM PROBABILITY: P(N|salto), P(V|salto) BI-GRAM PROBABILITY: P(NN|un salto) …. Produce in output una probabilita’ P(N|Uprob, 2Prob, ….) = … P(V|UProb, 2Prob, …) = … Sceglie la PDD con probabilita’ maggiore

POS-TAGGING A N-GRAMS Scelta della soluzione con la probabilita’ maggiore:

Classificazione di PDD usando n-grammi CONTESTO FREQUENZA

Stima delle probabilita’ Can be done using Maximum Likelihood Estimation as usual, for BOTH probabilities:

Esempio Secretariat/NNP is/VBZ expected/VBN to/TO race/VB tomorrow/NN People/NNS continue/VBP to/TO inquire/VB the/DT reason/NN for/IN the/DT race/NN for/IN outer/JJ space/NN Problem: assign a tag to race given the subsequences to/TO race/??? the/DT race/??? Solution: we choose the tag that has the greater of these probabilities: P(VB|TO) P(race|VB) P(NN|TO)P(race|NN)

Tagging with MMs (2) Actual estimates from the Switchboard corpus: LEXICAL FREQUENCIES: P(race|NN) = .00041 P(race|VB) = .00003 CONTEXT: P(NN|TO) = .021 P(VB|TO) = .34 The probabilities: P(VB|TO) P(race|VB) = .00001 P(NN|TO)P(race|NN) = .000007

N-GRAM POS TAGGER IN NLTK Addestramento di unigrammi Addestramento di bigrammi

ALTRI METODI PER L’APPRENDIMENTO NAÏVE BAYES DECISION TREES

NAÏVE BAYES Metodi Bayesiani: decisione su classificazione basata su un modello PROBABILISTICO che coniuga uso di informazioni A PRIORI ed A POSTERIORI come nella regola di Bayes Metodi NAÏVE BAYES: si fanno assunzioni che semplificano molto il calcolo delle probabilità

Legge di Bayes

Bayes applicata alla classificazione P(Classe|Proprietà) = P(Proprietà|Classe)*P(Classe) / P(Proprietà)

Maximum a posteriori Hypothesis

Naive Bayes Classifiers Task: Classify a new instance based on a tuple of attribute values

Naïve Bayes Classifier: Assumptions P(cj) Can be estimated from the frequency of classes in the training examples. P(x1,x2,…,xn|cj) O(|X|n•|C|) Could only be estimated if a very, very large number of training examples was available. Conditional Independence Assumption:  Assume that the probability of observing the conjunction of attributes is equal to the product of the individual probabilities.

The Naïve Bayes Classifier Flu X1 X2 X5 X3 X4 fever sinus cough runnynose muscle-ache Conditional Independence Assumption: features are independent of each other given the class:

Learning the Model Common practice:maximum likelihood simply use the frequencies in the data

Problem with Max Likelihood Flu X1 X2 X5 X3 X4 fever sinus cough runnynose muscle-ache What if we have seen no training cases where patient had no flu and muscle aches? Zero probabilities cannot be conditioned away, no matter the other evidence!

Smoothing to Avoid Overfitting # of values of Xi overall fraction in data where Xi=xi,k Somewhat more subtle version extent of “smoothing”

Using Naive Bayes Classifiers to Classify Text: Basic method Attributes are text positions, values are words. Naive Bayes assumption is clearly violated. Example? Still too many possibilities Assume that classification is independent of the positions of the words Use same parameters for each position

ESEMPIO DI CLASSIFICAZIONE: DOCUMENT CLASSIFICATION (NLTK book, p. 227-228)

VALUTAZIONE ACCURACY: percentuale di risposte corrette Nel caso di problemi in cui la classe di interesse rappresenta una percentuale minima del totale: PRECISION e RECALL

PRECISION E RECALL

ESEMPIO DI CLASSIFICAZIONE: GENDER IDENTIFICATION (NLTK book, p. 222-227)

APPRENDERE DECISION TREES Top-down: dato un certo insieme di esempi, trovare la proprieta’ che permette di dividerli in sottogruppi piu’ COERENTI Poi si procede ricorsivamente Scelta della proprieta’: INFORMATION GAIN

DECISION TREE PER IL NAME GENDER TASK

Top-down DT induction Partition training examples into good “splits”, based on values of a single “good” feature: (1) Sat, hot, no, casual, keys -> + (2) Mon, cold, snow, casual, no-keys -> - (3) Tue, hot, no, casual, no-keys -> - (4) Tue, cold, rain, casual, no-keys -> - (5) Wed, hot, rain, casual, keys -> +

Top-down DT induction keys? yes no Drive: 1,5 Walk: 2,3,4

Top-down DT induction Partition training examples into good “splits”, based on values of a single “good” feature (1) Sat, hot, no, casual -> + (2) Mon, cold, snow, casual -> - (3) Tue, hot, no, casual -> - (4) Tue, cold, rain, casual -> - (5) Wed, hot, rain, casual -> + No acceptable classification: proceed recursively

Top-down DT induction t? cold hot Walk: 2,4 Drive: 1,5 Walk: 3

Top-down DT induction t? cold hot Walk: 2,4 day? Sat Wed Tue Drive: 1

Top-down DT induction t? cold hot Walk: 2,4 day? Mo, Thu, Fr, Su Sat Wed Tue Drive: 1 Walk: 3 Drive: 5 ? Drive

Selezione della proprieta’ La scelta della proprieta’ da usare per dividere l’insieme corrente in sottinsiemi piu’ coerenti si basa su un criterio di RIDUZIONE DEL DISORDINE basato sulla nozione di ENTROPIA

ENTROPIA

Entropia di decision trees Entropia del DT per gender identification: vedi NLTK, 6.4

Entropy and Decision Trees keys? E(S)=-0.6*lg(0.6)-0.4*lg(0.4)= 0.97 no yes Walk: 2,4 Drive: 1,3,5 E(Sno)=0 E(Skeys)=0

Entropy and Decision Trees E(S)=-0.6*lg(0.6)-0.4*lg(0.4)= 0.97 cold hot Walk: 2,4 Drive: 1,5 Walk: 3 E(Scold)=0 E(Shot)=-0.33*lg(0.33)-0.66*lg(0.66)= 0.92

INFORMATION GAIN

Information gain For each feature f, compute the reduction in entropy on the split: Gain(S,f)=E(S)-∑(Entropy(Si)*|Si|/|S|) f=keys? : Gain(S,f)=0.97 f=t?: Gain(S,f)=0.97-0*2/5-0.92*3/5=0.42 f=clothing?: Gain(S,f)= ?

TEXT CATEGORIZATION WITH DT Build a separate decision tree for each category Use WORDS COUNTS as features

Reuters Data Set (21578 - ModApte split) 9603 training, 3299 test articles; ave. 200 words 118 categories An article can be in more than one category Learn 118 binary category distinctions Common categories (#train, #test) Earn (2877, 1087) Acquisitions (1650, 179) Money-fx (538, 179) Grain (433, 149) Crude (389, 189) Trade (369,119) Interest (347, 131) Ship (197, 89) Wheat (212, 71) Corn (182, 56)

AN EXAMPLE OF REUTERS TEXT Foundations of Statistical Natural Language Processing, Manning and Schuetze

Decision Tree for Reuter classification Foundations of Statistical Natural Language Processing, Manning and Schuetze

Information gain & text classification