Module-5
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
SPARK
Text Mining
Text mining is the art and science of discovering knowledge, insights and patterns from an organized collection of textual databases. Textual mining can help with frequency analysis of important terms, and their semantic relationships.
Text is an important part of the growing data in the world. Social media technologies have enabled users to become producers of text and images and other kinds of information. Text mining can be applied to large-scale social media data for gathering preferences, and measuring emotional sentiments. It can also be applied to societal, organizational and individual scales.
Text Mining
Text mining is the art and science of discovering knowledge, insights and patterns from an organized collection of textual databases. Textual mining can help with frequency analysis of important terms, and their semantic relationships.
Text is an important part of the growing data in the world. Social media technologies have enabled users to become producers of text and images and other kinds of information. Text mining can be applied to large-scale social media data for gathering preferences, and measuring emotional sentiments. It can also be applied to societal, organizational and individual scales.
2.The customer call center conversations and records can be analyzed for patterns of customer complaints. Decision trees can organize this data to create decision choices that could help with product management activities and to become proactive in avoiding those complaints.
3.Business operations: Many aspects of business functioning can be accurately gauged from analyzing text.
4. Legal: In legal applications, lawyers and paralegals can more easily search case histories and laws for relevant documents in a particular case to improve their chances of winning.
5. Governance and Politics: Governments can be overturned based on a tweet originating from a self-immolating fruit-vendor in Tunisia.
Text Mining Process
Text Mining is a rapidly evolving area of research. As the amount of social media and other text data grows, there is need for efficient abstraction and categorization of meaningful information from the text.
The five phases for processing text are as follows:
Phase 1: Text pre-processing enables Syntactic/Semantic text-analysis and does the followings:
The five phases for processing text are as follows:
Phase 1: Text pre-processing enables Syntactic/Semantic text-analysis and does the followings:
Phase 2: Features Generation is a process which first defines features (variables, predictors). Some of the ways of feature generations are:
Stemming reduces the word to its most basic element. For
example, impurification -+ pure.
3..Removing stop words from the feature space-they are the common words, unlikely to help text mining. The search program tries to ignore stop words. For example, ignores a, at, for, it, in and are.
4. Vector Space Model (VSM)-is an algebraic model for representing text documents as vector of identifiers, word frequencies or terms in the document index. VSM uses the method of term frequency-inverse document frequency (TF-IDF) and evaluates how important is a word in a document.
When used in document classification, VSM also refers to the bag-of-words model. This bag of words is required to be converted into a term-vector in VSM. The term vector provides the numeric values corresponding to each term appearing in a document. The term vector is very helpful in feature generation and selection.
Term frequency and inverse document frequency (IDF) are important metrics in text analysis. TF-IDF weighting is most common- Instead of the simple TF, IDF is used to weight the importance of word in the document.
Phase 3: Features Selection is the process that selects a subset of features by rejecting irrelevant and/or redundant features (variables, predictors or dimension) according to defined criteria. Feature selection process does the following:
The feature selection algorithm reduces dimensionality that not only improves the performance of learning algorithm but also reduces the storage requirement for a dataset. The process enhances data understanding and its visualization.
Phase 4: Data mining techniques enable insights about the structured database that resulted from the previous phases. Examples of techniques are:
(ii) Establish the existence of groups or clusters in the data
Good clustering methods use high intra-cluster similarity and low inter-cluster similarity. Examples of uses - biogs, pattern and trends.
2. Supervised learning (for example, classification)
(i) The training data is labeled indicating the class
(ii) New data is classified based on the training set
Classification is correct when the known label of test sample is identical with the resulting class computed from the classification model.
Examples of uses are news filtering application, where it is required to automatically assign incoming documents to pre-defined categories; email spam filtering, where it is identified whether incoming email messages are spam or not.
Example of text classification methods are Naive Bayes Classifier and SVMs.
3. Identifying evolutionary patterns in temporal text streams-the method is useful in a wide range of applications, such as summarizing of events in news articles and extracting the research trends in the scientific literature.
Phase 5: Analysing results
Text Mining Challenges
The challenges in the area of text mining can be classified on the basis of documents area- characteristics. Some of the classifications are as follows:
1. NLP issues:
2. Mining techniques:
(i)Identification of the suitable algorithm(s)
(ii)Massive amount of data and annotated corpora
(iii) Concepts and semantic relations extraction
(iv) When no training data is available
3. Variety of data:
(i)Different data sources require different approaches and different areas of expertise
(ii)Unstructured and language independency
4. Information visualization
5. Efficiency when processing real-time text stream
6. Scalability
Term Document Matrix
This is the heart of the structuring process. Free flowing text can be transformed into numeric data in a TDM, which can then be mined using regular data mining techniques.
Table 1.1: Term-Document Matrix
Here are some considerations in creating a TDM.
Mining the TDM
The TDM can be mined to extract patterns/knowledge. A variety of techniques could be applied to the TDM to extract new knowledge.
Predictors of desirable terms could be discovered through predictive techniques, such as regression analysis. Suppose the word profit is a desirable word in a document. The number of occurrences of the word profit in a document could be regressed against many other terms in the TDM. The relative strengths of the coefficients of various predictor variables would show the relative impact of those terms on creating a profit discussion.
Predicting the chances of a document being liked is another form of analysis. For example, important speeches made by the CEO or the CFO to investors could be evaluated for quality. If the classification of those documents (such as good or poor speeches) was available, then the terms of TDM could be used to predict the speech class. A decision tree could be constructed that makes a simple tree with a few decision points that predicts the success of a speech 80 percent of the time. This tree could be trained with more data to become better over time.
Clustering techniques can help categorize documents by common profile. For example, documents containing the words investment and profit more often could be bundled together. Similarly, documents containing the words, customer orders and marketing, more often could be bundled together. Thus, a few strongly demarcated bundles could capture the essence of the entire TDM. These bundles could thus help with further processing, such as handing over select documents to others for legal discovery.
Association rule analysis could show relationships of coexistence. Thus, one could say that the words, tasty and sweet, occur together often (say 5 percent of the time); and further, when these two words are present, 70 percent of the time, the word happy, is also present in the document.
Comparing Text Mining and Data Mining
Text Mining is a form of data mining. There are many common elements between Text and Data Mining. However, there are some key differences (Table 1.2). The key difference is that text mining requires conversion of text data into frequency data, before data mining techniques can beapplied.
Dimension |
Text Mining |
Data Mining |
Nature of data |
Unstructured data: Words, phrases, sentences |
Numbers; alphabetical and logical values |
Language used |
Many languages and dialects used in the world; many languages are extinct, new documents are discovered |
Similar numerical systems across the world |
Clarity and precision |
Sentences can be ambiguous; sentiment may contradict the words |
Numbers are precise. |
Table 1.2: Comparing Text Mining and Data Mining
Dimension |
Text Mining |
Data Mining |
Nature of data |
Unstructured data: Words, phrases, sentences |
Numbers; alphabetical and logical values |
Language used |
Many languages and dialects used in the world; many languages are extinct, new documents are discovered |
Similar numerical systems across the world |
Clarity and precision |
Sentences can be ambiguous; sentiment may contradict the words |
Numbers are precise. |
Consistency |
Different parts of the text can contradict each other |
Different parts of data can be inconsistent, thus, requiring statistical significance analysis |
Dimension |
Text Mining |
Data Mining |
Sentiment |
Text may present a clear and consistent or mixed sentiment, across a continuum. Spokenwords adds further sentiment |
Not applicable |
Quality |
Spelling errors. Differing values of proper nouns such as names. Varying quality of language translation |
Issues with missing values, outliers, etc |
Nature of Analysis |
Keyword based search; co- existence of themes; Sentiment Mining |
A full wide range of statistical and machine learning analysis for relationship and differences |
Text Mining Best Practices
Many of the best practices that apply to the use of data mining techniques will also apply to text mining.
Web Mining
Web mining is the art and science of discovering patterns and insights from the World-wide web so as to improve it. The world-wide web is at the heart of the digital revolution. More data is posted on the web every day than was there on the whole web just 20 years ago. Billions of users are using it every day for a variety of purposes. The web is used for electronic commerce, business communication, and many other applications. Web mining analyzes data from the web and helps find insights that could optimize the web content and improve the user experience. Data for web mining is collected via Web crawlers, web logs, and other means.
Here are some characteristics of optimized websites:
This type of content and its structure is of interest to ensure the web is easy to use. The analysis of web usage provides feedback on the web content, and also the consumer’s browsing habits. This data can be of immense use for commercial advertising, and even for social engineering.
The web could be analyzed for its structure as well as content. The usage pattern of web pages could also be analyzed. Depending upon objectives, web mining can be divided into three different types: Web usage mining, Web content mining and Web structure mining (Figure 2.1).
Figure: 2.1 Web Mining structure
Web content mining
A website is designed in the form of pages with a distinct URL (universal resource locator). A large website may contain thousands of pages. These pages and their content is managed using specialized software systems called Content Management Systems. Every page can have text, graphics, audio, video, forms, applications, and more kinds of content including user generated content.
The websites keep a record of all requests received for its page/URLs, including the requester information using ‘cookies’. The log of these requests could be analyzed to gauge the popularity of those pages among different segments of the population. The text and application content on the pages could be analyzed for its usage by visit counts. The pages on a website themselves could be analyzed for quality of content that attracts most users. Thus the unwanted or unpopular pages could be weeded out, or they can be transformed with different content and style. Similarly, more resources could be assigned to keep the more popular pages more fresh and inviting.
Web structure mining
The Web works through a system of hyperlinks using the hypertext protocol (http). Any page can create a hyperlink to any other page, it can be linked to by another page. The intertwined or self-referral nature of web lends itself to some unique network analytical algorithms. The structure of Web pages could also be analyzed to examine the pattern of hyperlinks among pages. There are two basic strategic models for successful websites: Hubs and Authorities.
Hubs: These are pages with a large number of interesting links. They serve as a hub, or a gathering point, where people visit to access a variety of information. Media sites like Yahoo.com, or government sites would serve that purpose. More focused sites like Traveladvisor.com and yelp.com could aspire to becoming hubs for new emergingareas.
Authorities: Ultimately, people would gravitate towards pages that provide the most complete and authoritative information on a particular subject. This could be factual information, news, advice, user reviews etc. These websites would have the most number of inbound links from other websites. Thus Mayoclinic.com would serve as an authoritative page for expert medical opinion. NYtimes.com would serve as an authoritative page for daily news.
Web usage mining
As a user clicks anywhere on a webpage or application, the action is recorded by many entities in many locations. The browser at the client machine will record the click, and the web server providing the content would also make a record of the pages served and the user activity on those pages. The entities between the client and the server, such as the router, proxy server, or ad server, too would record that click.
The goal of web usage mining is to extract useful information and patterns from data generated through Web page visits and transactions. The activity data comes from data stored.
in server access logs, referrer logs, agent logs, and client-side cookies. The user characteristics and usage profiles are also gathered directly, or indirectly, through syndicated data. Further, metadata, such as page attributes, content attributes, and usage data are also gathered.
The web content could be analyzed at multiple levels (Figure 2.2).
Figure: 2.2 Web Usage Mining architecture
Web usage mining has many business applications. It can help predict user behavior based on previously learned rules and users' profiles, and can help determine lifetime value of clients. It can also help design cross-marketing strategies across products, by observing association rules among the pages on the website.
Web usage can help evaluate promotional campaigns and see if the users were attracted to the website and used the pages relevant to the campaign. Web usage mining could be used to present dynamic information to users based on their interests and profiles. This includes targeted online ads and coupons at user groups based on user access patterns.
Web Mining Algorithms
Hyperlink-Induced Topic Search (HITS) is a link analysis algorithm that rates web pages as being hubs or authorities. Many other HITS-based algorithms have also been published. The most famous and powerful of these algorithms is the PageRank algorithm.
Invented by Google co-founder Larry Page, this algorithm is used by Google to organize the results of its search function. This algorithm helps determine the relative importance of any particular web page by counting the number and quality of links to a page.
The websites with more number of links, and/or more links from higher-quality websites, will be ranked higher. It works in a similar way as determining the status of a person in a society of people. Those with relations to more people and/or relations to people of higher status will be accorded a higher status.
PageRank is the algorithm that helps determine the order of pages listed upon a Google Search query. The original PageRank algorithm formuation has been updated in many ways and the latest algorithm is kept a secret so other websites cannot take advantage of the algorithm and manipulate their website according to it. However, there are many standard elements that remain unchanged. These elements lead to the principles for a good website. This process is also called Search Engine Optimization (SEO).
In technical jargon, the left-hand-side (LHS) of the equation is understood as the posterior probability or simply the posterior.
THANK YOU
ALL THE BEST FOR YOUR EXAMS