Question? Leave a message!




Text Classification & Naive Bayes

Text Classification & Naive Bayes 13
WilliamsMcmahon Profile Pic
WilliamsMcmahon,United States,Professional
Published Date:20-07-2017
Website URL
Comment
Introduction to Information Retrieval Introduction to Information Retrieval Text Classification & Naive Bayes : 1Introduction to Information Retrieval Overview ❶ Recap ❷ Text classification ❸ Naive Bayes ❹ NB theory ❺ Evaluation of TC 2Introduction to Information Retrieval Overview ❶ Recap ❷ Text classification ❸ Naive Bayes ❹ NB theory ❺ Evaluation of TC 3Introduction to Information Retrieval Looking vs. Clicking 4 4Introduction to Information Retrieval Pivot normalization Source: Lillian Lee 5 5Introduction to Information Retrieval Use min heap for selecting top k out of N  Use a binary min heap  A binary min heap is a binary tree in which each node’s value is less than the values of its children.  It takes O(N log k) operations to construct the k-heap containing the k largest values (where N is the number of documents).  Essentially linear in N for small k and large N. 6Introduction to Information Retrieval Binary min heap 7Introduction to Information Retrieval Heuristics for finding the top k most relevant  Document-at-a-time processing  We complete computation of the query-document similarity score of document d before starting to compute the query- i document similarity score of d . i+1  Requires a consistent ordering of documents in the postings lists  Term-at-a-time processing  We complete processing the postings list of query term t i before starting to process the postings list of t . i+1  Requires an accumulator for each document “still in the running”  The most effective heuristics switch back and forth between term-at-a-time and document-at-a-time processing. 8Introduction to Information Retrieval Tiered index 9Introduction to Information Retrieval Complete search system 10Introduction to Information Retrieval Take-away today  Text classification: definition & relevance to information retrieval  Naive Bayes: simple baseline text classifier  Theory: derivation of Naive Bayes classification rule & analysis  Evaluation of text classification: how do we know it worked / didn’t work? 11 11Introduction to Information Retrieval Outline ❶ Recap ❷ Text classification ❸ Naive Bayes ❹ NB theory ❺ Evaluation of TC 12Introduction to Information Retrieval A text classification task: Email spam filtering From: ‘‘’’ takworlldhotmail.com Subject: real estate is the only way... gem oalvgkay Anyone can buy real estate with no money down Stop paying rent TODAY There is no need to spend hundreds or even thousands for similar courses I am 22 years old and I have already purchased 6 properties using the methods outlined in this truly INCREDIBLE ebook. Change your life NOW ================================================= Click Below to order: http://www.wholesaledaily.com/sales/nmd.htm ================================================= How would you write a program that would automatically detect and delete this type of message? 13 13Introduction to Information Retrieval Formal definition of TC: Training Given:  A document space X  Documents are represented in this space – typically some type of high-dimensional space.  A fixed set of classes C = c , c , . . . , c 1 2 J  The classes are human-defined for the needs of an application (e.g., relevant vs. nonrelevant).  A training set D of labeled documents with each labeled document d, c ∈ X × C Using a learning method or learning algorithm, we then wish to learn a classifier ϒ that maps documents to classes: ϒ : X → C 14 14Introduction to Information Retrieval Formal definition of TC: Application/Testing Given: a description d∈ X of a document Determine: ϒ (d) ∈ C, that is, the class that is most appropriate for d 15 15Introduction to Information Retrieval Topic classification 16 16Introduction to Information Retrieval Exercise  Find examples of uses of text classification in information retrieval 17 17Introduction to Information Retrieval Examples of how search engines use classification  Language identification (classes: English vs. French etc.)  The automatic detection of spam pages (spam vs. nonspam)  The automatic detection of sexually explicit content (sexually explicit vs. not)  Topic-specific or vertical search – restrict search to a “vertical” like “related to health” (relevant to vertical vs. not)  Standing queries (e.g., Google Alerts)  Sentiment detection: is a movie or product review positive or negative (positive vs. negative) 18 18Introduction to Information Retrieval Classification methods: 1. Manual  Manual classification was used by Yahoo in the beginning of the web. Also: ODP, PubMed  Very accurate if job is done by experts  Consistent when the problem size and team is small  Scaling manual classification is difficult and expensive.  → We need automatic methods for classification. 19 19Introduction to Information Retrieval Classification methods: 2. Rule-based  Our Google Alerts example was rule-based classification.  There are IDE-type development enviroments for writing very complex rules efficiently. (e.g., Verity)  Often: Boolean combinations (as in Google Alerts)  Accuracy is very high if a rule has been carefully refined over time by a subject expert.  Building and maintaining rule-based classification systems is cumbersome and expensive. 20 20