CS 460449 Speech Natural Language Processing and the

  • Slides: 32
Download presentation
CS 460/449 : Speech, Natural Language Processing and the Web/Topics in AI Programming (Lecture

CS 460/449 : Speech, Natural Language Processing and the Web/Topics in AI Programming (Lecture 3: Argmax Computation) Pushpak Bhattacharyya CSE Dept. , IIT Bombay

Knowledge Based NLP and Statistical NLP Each has its place Knowledge Based NLP Linguist

Knowledge Based NLP and Statistical NLP Each has its place Knowledge Based NLP Linguist rules Computer rules/probabilities corpus Statistical NLP

Science without religion is blind; Region without science is lame: Einstein NLP=Computation+Linguistics NLP without

Science without religion is blind; Region without science is lame: Einstein NLP=Computation+Linguistics NLP without Linguistics is blind And NLP without Computation is lame

Key difference between Statistical/MLbased NLP and Knowledgebased/linguistics-based NLP n n n Stat NLP: speed

Key difference between Statistical/MLbased NLP and Knowledgebased/linguistics-based NLP n n n Stat NLP: speed and robustness are the main concerns KB NLP: Phenomena based Example: n n n Boys, Toes To get the root remove “s” How about foxes, boxes, ladies Understand phenomena: go deeper Slower processing

Noisy Channel Model w Noisy Channel (wn, wn-1, … , w 1) t (tm,

Noisy Channel Model w Noisy Channel (wn, wn-1, … , w 1) t (tm, tm-1, … , t 1) Sequence w is transformed into sequence t.

Bayesian Decision Theory and Noisy Channel Model are close to each other n Bayes

Bayesian Decision Theory and Noisy Channel Model are close to each other n Bayes Theorem : Given the random variables A and B, Posterior probability Prior probability Likelihood

Discriminative vs. Generative Model W* = argmax (P(W|SS)) W Discriminative Model Compute directly from

Discriminative vs. Generative Model W* = argmax (P(W|SS)) W Discriminative Model Compute directly from P(W|SS) Generative Model Compute from P(W). P(SS|W)

Corpus n n n A collection of text called corpus, is used for collecting

Corpus n n n A collection of text called corpus, is used for collecting various language data With annotation: more information, but manual labor intensive Practice: label automatically; correct manually The famous Brown Corpus contains 1 million tagged words. Switchboard: very famous corpora 2400 conversations, 543 speakers, many US dialects, annotated with orthography and phonetics

Example-1 of Application of Noisy Channel Model: Probabilistic Speech Recognition (Isolated Word)[8] n n

Example-1 of Application of Noisy Channel Model: Probabilistic Speech Recognition (Isolated Word)[8] n n n Problem Definition : Given a sequence of speech signals, identify the words. 2 steps : n Segmentation (Word Boundary Detection) n Identify the word Isolated Word Recognition : n Identify W given SS (speech signal)

Identifying the word n P(SS|W) = likelihood called “phonological model “ n intuitively more

Identifying the word n P(SS|W) = likelihood called “phonological model “ n intuitively more tractable! P(W) = prior probability called “language model”

Pronunciation Dictionary Pronunciation Automaton s 4 Word Tomato t 1. 0 s 1 n

Pronunciation Dictionary Pronunciation Automaton s 4 Word Tomato t 1. 0 s 1 n n o s 2 1. 0 0. 73 m s 3 0. 27 ae aa s 5 1. 0 t s 6 1. 0 o 1. 0 s 7 P(SS|W) is maintained in this way. P(t o m ae t o |Word is “tomato”) = Product of arc probabilities end

Example Problem-2 n n n Analyse sentiment of the text Positive or Negative Polarity

Example Problem-2 n n n Analyse sentiment of the text Positive or Negative Polarity Challenges: n Unclean corpora n Thwarted Expression: The movie has n everything: cast, drama, scene, photography, story; the director has managed to make a mess of all this Sarcasm: The movie has everything: cast, drama, scene, photography, story; see at your own risk.

Post-1 n POST----5 TITLE: "Want to invest in IPO? Think again" | <br />Hereâ

Post-1 n POST----5 TITLE: "Want to invest in IPO? Think again" | <br />Hereâ € ™ s a sobering thought for those who believe in investing in IPOs. Listing gains â € ” the return on the IPO scrip at the close of listing day over the allotment price â € ” have been falling substantially in the past two years. Average listing gains have fallen from 38% in 2005 to as low as 2% in the first half of 2007. Of the 159 book-built initial public offerings (IPOs) in India between 2000 and 2007, two-thirds saw listing gains. However, these gains have eroded sharply in recent years. Experts say this trend can be attributed to the aggressive pricing strategy that investment bankers adopt before an IPO. â € œ While the drop in average listing gains is not a good sign, it could be due to the fact that IPO issue managers are getting aggressive with pricing of the issues, â € says Anand Rathi, chief economist, Sujan Hajra. While the listing gain was 38% in 2005 over 34 issues, it fell to 30% in 2006 over 61 issues and to 2% in 2007 till mid-April over 34 issues. The overall listing gain for 159 issues listed since 2000 has been 23%, according to an analysis by Anand Rathi Securities. Aggressive pricing means the scrip has often been priced at the high end of the pricing range, which would restrict the upward movement of the stock, leading to reduced listing gains for the investor. It also tends to suggest investors should not indiscriminately pump in money into IPOs. But some market experts point out that India fares better than other countries. â € œ Internationally, there have been periods of negative returns and low positive returns in India should not be considered a bad thing.

Post-2 n POST----7 TITLE: "[IIM-Jobs] ***** Bank: International Projects Group Manager"| Please send your

Post-2 n POST----7 TITLE: "[IIM-Jobs] ***** Bank: International Projects Group Manager"| Please send your CV & cover letter to anup. abraham@*****bank. com ***** Bank, through its International Banking Group (IBG), is expanding beyond the Indian market with an intent to become a significant player in the global marketplace. The exciting growth in the overseas markets is driven not only by India linked opportunities, but also by opportunities of impact that we see as a local player in these overseas markets and / or as a bank with global footprint. IBG comprises of Retail banking, Corporate banking & Treasury in 17 overseas markets we are present in. Technology is seen as key part of the business strategy, and critical to business innovation & capability scale up. The International Projects Group in IBG takes ownership of defining & delivering business critical IT projects, and directly impact business growth. Role: Manager  – International Projects Group Purpose of the role: Define IT initiatives and manage IT projects to achieve business goals. The project domain will be retail, corporate & treasury. The incumbent will work with teams across functions (including internal technology teams & IT vendors for development/implementation) and locations to deliver significant & measurable impact to the business. Location: Mumbai (Short travel to overseas locations may be needed) Key Deliverables: Conceptualize IT initiatives, define business requirements

Sentiment Classification Positive, negative, neutral – 3 class n Create a representation for the

Sentiment Classification Positive, negative, neutral – 3 class n Create a representation for the document n Classify the representation The most popular way of representing a document is feature vector (indicator sequence). n

Established Techniques n n n n Naïve Bayes Classifier (NBC) Support Vector Machines (SVM)

Established Techniques n n n n Naïve Bayes Classifier (NBC) Support Vector Machines (SVM) Neural Networks K nearest neighbor classifier Latent Semantic Indexing Decision Tree ID 3 Concept based indexing

Successful Approaches The following are successful approaches as reported in literature. n n NBC

Successful Approaches The following are successful approaches as reported in literature. n n NBC – simple to understand implement SVM – complex, requires foundations of perceptions

Mathematical Setting We have training set A: Positive Sentiment Docs B: Negative Sentiment Docs

Mathematical Setting We have training set A: Positive Sentiment Docs B: Negative Sentiment Docs Indicator/feature vectors to be formed Let the class of positive and negative documents be C+ and C- , respectively. Given a new document D label it positive if P(C+|D) > P(C-|D)

Priori Probability Docu ment Vector Classif ication D 1 V 1 + D 2

Priori Probability Docu ment Vector Classif ication D 1 V 1 + D 2 V 2 - D 3 V 3 + . . . D 4000 V 4000 - Let T = Total no of documents And let |+| = M So, |-| = T-M P(D being positive)=M/T Priori probability is calculated without considering any features of the new document.

Apply Bayes Theorem Steps followed for the NBC algorithm: n Calculate Prior Probability of

Apply Bayes Theorem Steps followed for the NBC algorithm: n Calculate Prior Probability of the classes. P(C + ) and P(C-) n Calculate feature probabilities of new document. P(D| C + ) and P(D| C-) n Probability of a document D belonging to a class C can be calculated by Baye’s Theorem as follows: P(C|D) = P(C) * P(D|C) P(D) • Document belongs to C+ , if P(C+ ) * P(D|C+) > P(C- ) * P(D|C-)

Calculating P(D|C+) is the probability of class C+ given D. This is calculated as

Calculating P(D|C+) is the probability of class C+ given D. This is calculated as follows: n Identify a set of features/indicators to evaluate a document and generate a feature vector (VD). VD = <x 1 , x 2 , x 3 … xn > n Hence, P(D|C+) = P(VD|C+) = P( <x 1 , x 2 , x 3 … xn > | C+) = |<x 1, x 2, x 3…. . xn>, C+ | | C+ | n Based on the assumption that all features are Independently Identically Distributed (IID) = P( <x 1 , x 2 , x 3 … xn > | C+ ) = P(x 1 |C+) * P(x 2 |C+) * P(x 3 |C+) *…. P(xn |C+) =∏ i=1 n P(xi |C+) can now be calculated as |xi |/|C+ |

Baseline Accuracy n n n Just on Tokens as features, 80% accuracy 20% probability

Baseline Accuracy n n n Just on Tokens as features, 80% accuracy 20% probability of a document being misclassified On large sets this is significant

To improve accuracy… Clean corpora n POS tag n Concentrate on critical POS tags

To improve accuracy… Clean corpora n POS tag n Concentrate on critical POS tags (e. g. adjective) n Remove ‘objective’ sentences ('of' ones) n Do aggregation Use minimal to sophisticated NLP n

Course details

Course details

Syllabus (1/5) n Sound: n Biology of Speech Processing; Place and Manner of Articulation;

Syllabus (1/5) n Sound: n Biology of Speech Processing; Place and Manner of Articulation; Peculiarities of Vowels and Consonants; Word Boundary Detection; Argmax based computations; HMM and Speech Recognition

Syllabus (2/5) n Words and Word Forms: n Morphology fundamentals; Isolating, Inflectional, Agglutinative morphology;

Syllabus (2/5) n Words and Word Forms: n Morphology fundamentals; Isolating, Inflectional, Agglutinative morphology; Infix, Prefix and Postfix Morphemes, Morphological Diversity of Indian Languages; Morphology Paradigms; Rule Based Morphological Analysis: Finite State Machine Based Morphology; Automatic Morphology Learning; Shallow Parsing; Named Entities; Maximum Entropy Models; Random Fields

Syllabus (3/5) n Structures: n Theories of Parsing, HPSG, LFG, X-Bar, Minimalism; Parsing Algorithms;

Syllabus (3/5) n Structures: n Theories of Parsing, HPSG, LFG, X-Bar, Minimalism; Parsing Algorithms; Robust and Scalable Parsing on Noisy Text as in Web documents; Hybrid of Rule Based and Probabilistic Parsing; Scope Ambiguity and Attachment Ambiguity resolution

Syllabus (4/5) n Meaning: n Lexical Knowledge Networks, Wordnet Theory; Indian Language Wordnets and

Syllabus (4/5) n Meaning: n Lexical Knowledge Networks, Wordnet Theory; Indian Language Wordnets and Multilingual Dictionaries; Semantic Roles; Word Sense Disambiguation; WSD and Multilinguality; Metaphors; Coreferences

Syllabus (5/5) n Web 2. 0 Applications: n Sentiment Analysis; Text Entailment; Robust and

Syllabus (5/5) n Web 2. 0 Applications: n Sentiment Analysis; Text Entailment; Robust and Scalable Machine Translation; Question Answering in Multilingual Setting; Anaytics and Social Networks, Cross Lingual Information Retrieval (CLIR)

Allied Disciplines Philosophy Semantics, Meaning of “meaning”, Logic (syllogism) Linguistics Study of Syntax, Lexicon,

Allied Disciplines Philosophy Semantics, Meaning of “meaning”, Logic (syllogism) Linguistics Study of Syntax, Lexicon, Lexical Semantics etc. Probability and Statistics Corpus Linguistics, Testing of Hypotheses, System Evaluation Cognitive Science Computational Models of Language Processing, Language Acquisition Psychology Behavioristic insights into Language Processing, Psychological Models Brain Science Language Processing Areas in Brain Physics Information Theory, Entropy, Random Fields Computer Sc. & Engg. Systems for NLP

Books etc. n Main Text(s): n n Other References: n n n NLP a

Books etc. n Main Text(s): n n Other References: n n n NLP a Paninian Perspective: Bharati, Chaitanya and Sangal Statistical NLP: Charniak Journals n n Natural Language Understanding: James Allan Speech and NLP: Jurafsky and Martin Foundations of Statistical NLP: Manning and Schutze Computational Linguistics, Natural Language Engineering, AI Magazine, IEEE SMC Conferences n ACL, EACL, COLING, MT Summit, EMNLP, IJCNLP, HLT, ICON, SIGIR, WWW, ICML, ECML

Grading n Based on n n Midsem Endsem Assignments Seminar Except the first two

Grading n Based on n n Midsem Endsem Assignments Seminar Except the first two everything else in groups