TextMiningIntro.ppt

605 views
541 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
605
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
34
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • Next, state the action step. Make your action step specific, clear and brief. Be sure you can visualize your audience taking the action. If you can’t, they can’t either. Be confident when you state the action step, and you will be more likely to motivate the audience to action.
  • TextMiningIntro.ppt

    1. 1. An Introduction to Text Mining <ul><ul><li>Ravindra Jaju </li></ul></ul>
    2. 2. Outline of the presentation <ul><li>Initiation/Introduction ... </li></ul><ul><li>What makes text stand apart from other kinds of data? </li></ul><ul><li>Classification </li></ul><ul><li>Clustering </li></ul><ul><li>Mining on “The Web” </li></ul>
    3. 3. Data Mining <ul><li>What: Looking for information from usually large amounts of data </li></ul><ul><li>Mainly two kinds of activities – Descriptive and Predictive </li></ul><ul><li>Example of a descriptive activity – Clustering </li></ul><ul><li>Example of a predictive activity - Classification </li></ul>
    4. 4. What kind of data is this? <ul><li><1, 1, 0, 0, 1, 0> </li></ul><ul><li><0, 0, 1, 1, 0, 1> </li></ul><ul><li>It could be two customers' baskets, containing (milk, bread, butter) and (shaving cream, razor, after-shave lotion) respectively. </li></ul><ul><li>Or, it could be two documents - “Java programming language” and “India beat Pakistan” </li></ul>
    5. 5. And what kind of data is this? <ul><li><550000, 155> </li></ul><ul><li><750000, 115> </li></ul><ul><li><120000, 165> </li></ul><ul><li>Data about people, <income, IQ> pairs! </li></ul>
    6. 6. Data representation <ul><li>Humans understand data in various forms </li></ul><ul><ul><li>Text </li></ul></ul><ul><ul><li>Sales figures </li></ul></ul><ul><ul><li>Images </li></ul></ul><ul><li>Computers understand only numbers </li></ul>
    7. 7. Working with data <ul><li>Most of the mining algorithms work only with numeric data </li></ul><ul><li>All data, hence, are represented as numbers so that they can lend themselves to the algorithms </li></ul><ul><li>Whether it is sales figures, crime rates, text, or images – one has to find a suitable way to transform data into numbers. </li></ul>
    8. 8. Text mining – Working with numbers <ul><li>“ Java Programming Language” </li></ul><ul><li>“ India beat Pakistan” </li></ul><ul><li>OR </li></ul><ul><li><1, 1, 0, 0, 1, 0> </li></ul><ul><li><0, 0, 1, 1, 0, 1> </li></ul><ul><li>The transformation to 1's and 0's hides all relationship between Java and Language, and India and Pakistan, which humans can make out (How?) </li></ul>
    9. 9. Text mining – Working with numbers (contd.) <ul><li>As we have seen, data transformation (from text/word to some index number in this case) means that there is some information loss </li></ul><ul><li>One big challenge in this field today is to find a good data representation for input to the mining algorithms </li></ul>
    10. 10. Text Representation Issues <ul><li>Each word has a dictionary meaning, or meanings </li></ul><ul><ul><li>Run – (1) the verb. (2) the noun, in cricket </li></ul></ul><ul><ul><li>Cricket – (1) The game. (2) The insect. </li></ul></ul><ul><li>Each word is used in various “senses” </li></ul><ul><ul><li>Tendulkar made 100 runs </li></ul></ul><ul><ul><li>Because of an injury, Tendulkar can not run and will need a runner between the wickets </li></ul></ul><ul><li>Capturing the “meaning” of sentences is an important issue as well. Grammar, parts of speech, time sense could be easy! </li></ul><ul><li>Finding out automatically who the “ he ” in “He is the President” given a document is hard. And “president of?” Well ... </li></ul>
    11. 11. Text Representation Issues (contd.) <ul><li>In general, it is hard to capture these features from a text document </li></ul><ul><ul><li>One, it is difficult to extract this automatically </li></ul></ul><ul><ul><li>Two, even if we did it, it won't scale! </li></ul></ul><ul><li>One simplification is to represent documents as a vector of words </li></ul><ul><ul><li>We have already seen examples </li></ul></ul><ul><ul><li>Each document is represented as a vector, and each component of the vector represents some “ quantity ” related to a single word. </li></ul></ul>
    12. 12. The Document Vector <ul><li>“ Java Programming Language” </li></ul><ul><ul><li><1, 1, 0, 0, 1, 0, 0> (document A) </li></ul></ul><ul><li>“ India beat Pakistan” </li></ul><ul><ul><li><0, 0, 1, 1, 0, 1, 0> (document B) </li></ul></ul><ul><li>“ India beat Australia” </li></ul><ul><ul><li><0, 0, 1, 1, 0, 0, 1> (document C) </li></ul></ul><ul><li>What vector operation can you think of to find two similar documents ? </li></ul><ul><ul><li>How about the dot product? </li></ul></ul><ul><ul><li>As we can easily verify, documents B and C will have a higher dot product than any other combination </li></ul></ul>
    13. 13. More on document similarity <ul><li>The dot product or cosine between two vectors is a measure of similarity. </li></ul><ul><ul><li>Documents about related topics should have higher similarity </li></ul></ul>Indonesia Java Language 0, 0, 0
    14. 14. Document Similarity (contd.) <ul><li>How about distance measures? </li></ul><ul><ul><li>Cosine similarity measure will not capture the inter-cluster distances! </li></ul></ul>
    15. 15. Further refinements to the DV representation <ul><li>Not all words are equally important </li></ul><ul><ul><li>the, is, and, to, he, she, it ( Why? ) </li></ul></ul><ul><ul><li>Of course, these words could be important in certain contexts </li></ul></ul><ul><li>We have the option of scaling the components of these words, or completely removing them from the corpus </li></ul><ul><li>In general, we prefer to remove the stopwords and scale the remaining words </li></ul><ul><ul><li>Important words should be scaled upwards, and vice versa </li></ul></ul><ul><ul><li>One widely used scaling factor – TF-IDF </li></ul></ul><ul><ul><li>TF-IDF stands for Term Frequency and Inverse Document Frequency product, for a word . </li></ul></ul>
    16. 16. Text Mining – Moving Further <ul><li>Document/Term Clustering </li></ul><ul><ul><li>Given a large set, group similar entities </li></ul></ul><ul><li>Text Classification </li></ul><ul><ul><li>Given a document, find what topic does it talk about </li></ul></ul><ul><li>Information Retrieval </li></ul><ul><ul><li>Search engines </li></ul></ul><ul><li>Information Extraction </li></ul><ul><ul><li>Question Answering </li></ul></ul>
    17. 17. Clustering (Descriptive Activity) <ul><li>Activity: Group together similar documents </li></ul><ul><li>Techniques used </li></ul><ul><ul><li>Partitioning </li></ul></ul><ul><ul><li>Hierarchical </li></ul></ul><ul><ul><ul><li>Agglomerative </li></ul></ul></ul><ul><ul><ul><li>Divisive </li></ul></ul></ul><ul><ul><li>Grid based </li></ul></ul><ul><ul><li>Model based </li></ul></ul>
    18. 18. Clustering (contd.) <ul><li>Partitioning </li></ul><ul><ul><li>Divide the input data into k partitions </li></ul></ul><ul><ul><ul><li>K -means, K -medoids </li></ul></ul></ul><ul><li>Hierarchical clustering </li></ul><ul><ul><li>Agglomerative </li></ul></ul><ul><ul><ul><li>Each data point is assumed to be a cluster representative </li></ul></ul></ul><ul><ul><ul><li>Keep merging similar clusters till we get a single cluster </li></ul></ul></ul><ul><ul><li>Divisive </li></ul></ul><ul><ul><ul><li>The opposite of agglomerative </li></ul></ul></ul>
    19. 19. “ Frequent term-based text clustering” <ul><li>Idea </li></ul><ul><ul><li>Frequent terms carry more information about the “cluster” they might belong to </li></ul></ul><ul><ul><li>Highly co-related frequent terms probably belong to the same cluster </li></ul></ul><ul><li>D = {D 1 , …, D n } – the set of documents </li></ul><ul><ul><li>D j subsetOf T, the set of all terms </li></ul></ul><ul><li>Then candidate clusters are generated from F = {F 1 , … , F k }, where each F i is a set of all frequent terms which occur together . </li></ul>
    20. 20. Classification <ul><li>The problem statement </li></ul><ul><ul><li>Given a set of documents, each with a label called the class label for that document </li></ul></ul><ul><ul><li>Given, a classifier which learns from the above data set </li></ul></ul><ul><ul><li>For a new, unseen document, the classifier should be able to “predict” with a high degree of accuracy the correct class to which the new document belongs </li></ul></ul>
    21. 21. Decision Tree Classifier <ul><li>A tree </li></ul><ul><ul><li>Each node represents some kind of an “evaluation” for an attribute of the data </li></ul></ul><ul><ul><li>Each edge, the decision taken </li></ul></ul><ul><li>The evaluation at each node is some kind of an information gain measure </li></ul><ul><ul><li>Reduction in entropy – more information gained </li></ul></ul><ul><ul><li>Entropy E(x) = -  p i log 2 (p i ) </li></ul></ul><ul><ul><ul><li>p i represents the probability that the data corresponds to sample i </li></ul></ul></ul><ul><ul><li>Each edge represents a choice for the value of the attribute the node represents </li></ul></ul><ul><li>Good for text mining. But doesn’t scale </li></ul>
    22. 22. Statistical (Bayesian) Classification <ul><li>For a document-class data, we calculate the probabilities of occurrence of events </li></ul><ul><ul><li>Bayes’ Theorem </li></ul></ul><ul><ul><ul><li>P(c|d) = P(c) . P(d|c) / P(d) </li></ul></ul></ul><ul><ul><ul><li>Given a document d , the probability that it belongs to a class c is given by the above formula. </li></ul></ul></ul><ul><ul><li>In practice, the exact values of the probabilities of each event are unknown, and are estimated from the samples </li></ul></ul>
    23. 23. Naïve Bayes Classification <ul><li>Probability of the document event d </li></ul><ul><ul><li>P(d) = P(w 1 , …, w n ) – w i are the words </li></ul></ul><ul><ul><li>The RHS is generally a headache. We have to consider the inter-dependence of each of the w j events </li></ul></ul><ul><li>Naïve Bayes – Assume all the w j events are independent. The RHS expands to </li></ul><ul><ul><li> p(w j ) </li></ul></ul><ul><li>Most of the Bayesian text classifiers work with this simplification </li></ul>
    24. 24. Bayesian Belief Networks <ul><li>This is an intermediate approach </li></ul><ul><li>Not all words are independent </li></ul><ul><ul><li>“ If java and program occur together, then boost the probability value of class computer programming ” </li></ul></ul><ul><ul><li>“ If java and indonesia occur together, then the document is more likely about some-other-class ” </li></ul></ul><ul><li>Problem? </li></ul><ul><ul><li>How do we come up with co-relations like above? </li></ul></ul>
    25. 25. Other classification techniques <ul><li>Support Vector Machines </li></ul><ul><ul><li>Find the best discriminant plane between two classes </li></ul></ul><ul><li>k Nearest Neighbour </li></ul><ul><li>Association Rule Mining </li></ul><ul><li>Neural Networks </li></ul><ul><li>Case-based reasoning </li></ul>
    26. 26. An example – “Text Classification from labeled and unlabeled documents with Expectation Maximization” <ul><li>Problem setting </li></ul><ul><ul><li>Labeling documents is a manual process </li></ul></ul><ul><ul><li>A lot more unlabeled documents are available as compared to labeled documents </li></ul></ul><ul><ul><li>Unlabeled documents contain information which could help in the classification activity </li></ul></ul>
    27. 27. An example (contd.) <ul><li>Train a classifier with the labeled documents </li></ul><ul><ul><li>Say, a Naïve Bayes classifier </li></ul></ul><ul><ul><li>This classifier estimates the model parameters (the prior probabilities of the various events) </li></ul></ul><ul><li>Now, classify the unlabeled documents. </li></ul><ul><ul><li>Assuming the applied labels to be correct, re-estimate the model parameters </li></ul></ul><ul><li>Repeat the above step till convergence </li></ul>
    28. 28. Expectation Maximization <ul><li>A useful technique for estimating hidden parameters </li></ul><ul><li>In the previous example, the class labels were missing from some documents </li></ul><ul><li>Consists of two steps </li></ul><ul><ul><li>E -step: Set z (k+1) = E [ z | D;  (k) ] </li></ul></ul><ul><ul><li>M -step: Set  (k+1) = arg max  P(  | D; z (k+1) ) </li></ul></ul><ul><li>The above steps are repeated till convergence, and convergence does occur </li></ul>
    29. 29. Another example – “Fast and accurate Text Classification via Multiple Linear Discriminant Projections”
    30. 30. Contd. <ul><li>Idea </li></ul><ul><ul><li>Find a direction  which maximizes the separation between classes. </li></ul></ul><ul><ul><li>Why? </li></ul></ul><ul><ul><ul><li>Reduce “noise”, or rather </li></ul></ul></ul><ul><ul><ul><li>Enhance the differences between classes </li></ul></ul></ul><ul><ul><li>The vector corresponding to this direction is the Fisher ’s discriminant </li></ul></ul><ul><li>Project the data-points onto this  </li></ul><ul><li>For all data-points not separated by this vector, choose another  ’ </li></ul>
    31. 31. Contd. <ul><li>Repeat till all data are now separable </li></ul><ul><ul><li>Note, we are looking at a 2-class case. This easily extends to multiple classes </li></ul></ul><ul><li>Project all the document vectors into the space represented by the  vectors as the basis vectors </li></ul><ul><li>Now, induce a decision tree on this projected representation </li></ul><ul><ul><li>The number of attributes is highly reduced </li></ul></ul><ul><li>Since this representation nicely “separates” the data points (documents), accuracy increases </li></ul>
    32. 32. Web Text Mining <ul><li>The WWW is a huge, directed graph, with documents as nodes and hyperlinks as the directed edges </li></ul><ul><li>Apart from the text itself, this graph structure carries a lot of information about the “usefulness” of the “nodes” </li></ul><ul><li>For example </li></ul><ul><ul><li>10 random, average people on the streets say Mr. T. Ache is a good dentist </li></ul></ul><ul><ul><li>5 reputed doctors, including dentists, recommend Mr. P. Killer as a better dentist </li></ul></ul><ul><ul><li>Who would you choose? </li></ul></ul>
    33. 33. Kleinberg’s HITS <ul><li>HITS – Hypertext Induced Topic Selection </li></ul><ul><li>Nodes on the web can be categorized into two types – hubs and authorities </li></ul><ul><li>Authorities are nodes which one refers to for definitive information about a topic </li></ul><ul><li>Hubs point to authorities </li></ul><ul><li>HITS computes the hub and authority scores on a sub-universe of the web </li></ul><ul><ul><li>How does one collect this ‘sub-universe’? </li></ul></ul>
    34. 34. HITS (contd.) <ul><li>The basic steps </li></ul><ul><ul><li>A u =  H v for all v pointing to u </li></ul></ul><ul><ul><li>H u =  A v for all v pointed to by u </li></ul></ul><ul><li>Repeat the above till convergence </li></ul><ul><li>Nodes with high A scores are “relevant” </li></ul><ul><ul><li>Relevant to what? </li></ul></ul><ul><ul><li>Can we use this for efficient retrieval for a query? </li></ul></ul>
    35. 35. PageRank <ul><li>Similar to HITS , but all pages have only one score – a Rank </li></ul><ul><li>R(u) = c  (R(v)/N v ) </li></ul><ul><ul><li>v is the set of pages linking to u, and N v is the number of links in v. c is a scaling factor (< 1) </li></ul></ul><ul><li>The higher the rank of pages linking to a page, the higher is its own rank! </li></ul><ul><li>To handle rank sinks (documents which do not link outside a set of pages), the formula is modified as </li></ul><ul><ul><li>R’(u) = c  (R’(v)/N v ) + cE(u) </li></ul></ul><ul><ul><li>E(u) is a set of some pages, and acts as a rank source (what kind of pages?) </li></ul></ul>
    36. 36. Some more topics which we haven’t touched <ul><li>Using external dictionaries </li></ul><ul><ul><li>WordNet </li></ul></ul><ul><li>Using language specific techniques </li></ul><ul><ul><li>Computational linguistics </li></ul></ul><ul><ul><li>Use grammar for judging the “sense” of a query in the “information retrieval” scenario </li></ul></ul><ul><li>Other interesting techniques </li></ul><ul><ul><li>Latent Semantic Indexing </li></ul></ul><ul><ul><ul><li>Finding the latent information in documents using Linear Algebra Techniques </li></ul></ul></ul>
    37. 37. Some more comments <ul><li>Some “purists” do not consider most of the current activities in the text mining field as real text mining </li></ul><ul><li>For example, see Marti Hearst ’s write-up at Untangling Text Data Mining </li></ul>
    38. 38. Some more comments (contd.) <ul><li>One example that he mentions </li></ul><ul><ul><li>stress is associated with migraines </li></ul></ul><ul><ul><li>stress can lead to loss of magnesium </li></ul></ul><ul><ul><li>calcium channel blockers prevent some migraines </li></ul></ul><ul><ul><li>magnesium is a natural calcium channel blocker </li></ul></ul><ul><ul><li>spreading cortical depression (SCD) is implicated in some migraines </li></ul></ul><ul><ul><li>high levels of magnesium inhibit SCD </li></ul></ul><ul><ul><li>migraine patients have high platelet aggregability </li></ul></ul><ul><ul><li>magnesium can suppress platelet aggregability </li></ul></ul><ul><li>The above was inferred from a set of documents, with some human help </li></ul>
    39. 39. References <ul><li>Data Mining – Concepts and Techniques , by Jiawei Han and Micheline Kamber </li></ul><ul><li>Principle of Data Mining , by David J. Hand et al </li></ul><ul><li>Text Classification from Labeled and Unlabeled Documents using EM , Kamal Nigam et al </li></ul><ul><li>Fast and accurate text classification via multiple linear discriminant projections , S. Chakrabarti et al </li></ul><ul><li>Frequent Term-Based Text Clustering , Florian Beil et al </li></ul><ul><li>The PageRank Citation Ranking: Bringing Order to the Web , Lawrence Page and Sergey Brin </li></ul><ul><li>Untangling Text Data Mining , by Marti. A. Hearst, http://www.sims.berkeley.edu/~hearst/papers/acl99/acl99-tdm.html </li></ul><ul><ul><li>And others … </li></ul></ul>

    ×