• No results found

Sentimental Analysis of Flipkart reviews using Naïve Bayes and Decision Tree algorithm

N/A
N/A
Protected

Academic year: 2020

Share "Sentimental Analysis of Flipkart reviews using Naïve Bayes and Decision Tree algorithm"

Copied!
6
0
0

Loading.... (view fulltext now)

Full text

(1)

Abstract— The e-commerce is developing rapidly these years, buying products on-line has become more and more fashionable owing to its variety of options, low cost value (high discounts) and quick supply systems, so abundant folks intend to do online shopping. In the meantime the standard and delivery of merchandise is uneven, fake branded products are delivered. So users’ comments become the vital data to evaluate the product’s quality and merchandise. However, for many products, the amount of reviews is too large to be processed manually and their quality varies largely. The star ratings are given to the whole product and shoppers/product makers do not have a mean to analyze the feedback for the single features. We use product users review comments about product and review about retailers from Flipkart as data set and classify review text by subjectivity/objectivity and negative/positive attitude of buyer. Such reviews are helpful to some extent, promising both the shoppers and products makers. This paper presents an empirical study of efficacy of classifying product review by semantic meaning. In the present study, we tend to analyze the fundamentals of opinion mining, pros and cons of past opinion mining systems and supply some direction for the future analysis work. The authors hereby propose completely different approaches including spelling correction in review text, and then classifying comments employing hybrid algorithm combining Decision Trees and Naive Bayes algorithm

Index Terms— Decision tree, Facts, Naïve Bayes, opinion mining, sentiment analysis, and user reviews.

I. INTRODUCTION

Introduction Smart phones, Laptops and internet have made online shopping very easy. India’s internet user base 354 million, registers 17% growth in first 6 months of 2015: IAMAI (Internet and Mobile Association of India.) report. The base had grown to 302 million by the end of 2014 after clocking its fastest rise of 32% in a year, as per IAMAI, which includes members such as Google, Microsoft, Facebook, eBay, IBM, Flipkart, Ola and LinkedIn [11].

While it took more than a decade for the user base to increase from 10 million to 100 million, and three years to cross the 200 million mark, it took only a year for the user base to swell to 300 million from 200 million [11]. As the e-commerce is developing rapidly these years, online shopping has become more and more popular because of its variety of types, cheap price (high discounts) and fast logistic systems. More people intend to do online shopping these days. Meanwhile the quality and delivery of products is uneven, thus users’ comments become the important

Manuscript received Jan, 2016.

Gurneet Kaur, Research Scholar, Department of computer science and engineering Bhai Gurdas Institute of Engg. & Tech Sangrur, India 9779322988.

Abhinash Singla, Assistant Professor, Bhai Gurdas Institute of Engg. & Tech Sangrur, India.

information to judge the product’s quality and delivery time. At the same time, the product manufacturers can obtain the current main viewpoints from the users in order to improve the products [1].

Confronting to the massive data in the websites, analyzing and concluding the information manually is impossible. So how to extract useful information and build objective products’ quality test system automatically to deal with the massive textual information is emerging in the related research field. Opinion Mining is a new technology based on the technology of text mining and natural language processing. It provides the approach to cope with the problem. So generating summary of the products has been attracting many researchers during these years. [1]

Emotional orientation of each review is focused with Document-level sentiment analysis. It recognizes the opinion of the contents which authors express, mainly discusses the sentence-level opinion mining and treats the statements of the product’ features for each viewpoint as analysis objects, then we can find authors’ opinion inclinations. Therefore sentence-level sentiment analysis is the main task on opinion mining. The approach can find the specific details of the comments and has a high confidential degree, but the operation is very complex. For example, if we take a type of laptop into consideration, we can divide the laptop’s features into performance, price, appearance, endurance time, brand and so on. We consider each feature or attribute which each author expresses for each comment respectively, then do a comprehensive evaluation in order to avoid the overgeneralization. [9]

Feature-specific opinion mining attracts much attention. An object is an entity. It can be a product, person, event, organization, topic or something else. It is associated with a hierarchy or taxonomy of components or a set of attributes. Meanwhile, each component also can have its own set of subcomponents or attributes. A feature is defined to show both components and attributes and it is the subject of a review.

In fact, people obey the grammatical rules to organize sentences while writing articles. But under informal circumstance, people usually neglect it and there are so many spelling mistakes. This phenomenon is especially prominent when people make comments after online shopping. [1] The sentences have some different features comparing with the formal ones.

1) Products have a set of definite attributes and related opinion phrases. Thus we can use a small fixed set of keywords to recognize frequent feature and opinion words.

2) The opinionated sentences contain opinion operators which can be used to find positions of opinion expressions.

3) Many comment sentences are of free style, sometimes

Sentimental Analysis of Flipkart reviews using

Naïve Bayes and Decision Tree algorithm

(2)

there are no opinion words in the comment sentences. If a feature is showed in the form of a noun or a noun phrase, then it is defined as the explicit feature. Meanwhile, the sentence which contains the explicit feature is recognized as the explicit sentence. According to the variety of the expression, we can divide the customer reviews into explicit sentence reviews and the ones without the explicit opinion feature are called implicit sentence reviews. The phenomenon that there is no explicit opinion feature in the sentence is very common in many comments. In our database which we extracted from the e-commerce website, the sentences without explicit opinion target make up to 30% approximately. For example:

It is very cheap.

We can deduce from the word “cheap” that the user may indicate the product’s price. But the word “price” has not been directly mentioned but implied by the use of the word “cheap” which we can call feature indicator.

II. WEBMINING

Data mining is to extract information and knowledge which is not known by people and potentially useful from a large number of incomplete and vague random data of practical application. Web mining is the application of data mining technology, which is to extract interesting and potentially useful patterns and hidden information from web documents and web activities [1]. Web Mining is broadly categorized into Web content mining (WCM), Web structure mining (WSM), and Web usage mining (WUM) [1]. Web content mining is related to the uncovering of useful information from web contents, including text, image, audio, video, etc. Research in web content mining encompasses resource discovery from the web, document categorization and clustering, and information extraction from web pages.

Web structure mining studies the web's hyperlink structure.

It usually involves analysis of the in-links and out-links of a web page, and it has been used for search engine result ranking [1]. Web usage mining focuses on analyzing search logs or other activity logs to find interesting patterns.

A. Web mining process

The process of Web mining is divided into four stages: source data collection, data preprocessing, pattern discovery and pattern analysis. The process is explained in fig 1. In mining of Web data, Web log files on the Web server are the main source of data [2]. Web log files contain the history of the visitor's browsing behavior. Web log files include the server log, agent log and client log. The actual data collected have certain features such as redundancy, ambiguity and incomplete. In order to mine the knowledge more effectively, pre-processing the data collected is essential. Preprocessing can provide accurate, concise data for data mining. Data preprocessing, includes data cleaning, user identification, user session identification, access path supplement and transaction identification.

Web log file

Data Warehouse

Web Log File

base

File after Pre-Processor

Pattern Type

Knowledge

Data Mining

Pattern Analysis Data

[image:2.595.307.549.50.173.2]

Preparation

Fig 1: Process of web data mining

III. SENTIMENT ANALYSIS

Sentiment analysis of natural language texts is a large and growing field. Sentiment analysis or Opinion Mining is the computational treatment of opinions and subjectivity of text. Sentiment analysis is an Information Extraction task that intends to acquire writer’s feelings expressed in positive or negative comments, after analyzing his documents. The term ‘Presence’ is more important to sentiment analysis then term ‘Frequency’ which was earlier used for traditional information retrieval. It has also been reported that unigrams surpass bigrams for classifying movie reviews by sentiment polarity. Hatzivassiloglou and McKeown theorize that adjectives separated by “and" have the same polarity, while those separated by “but” have opposite polarity. Sentiment classification is a recent sub discipline of text classification which is concerned with opinion expressed by reviews. Opinion mining mean to determine whether a term that carries opinionated content has a positive or a negative implication. Sentiment classification can be divided into several specific subtasks: determining subjectivity, determining orientation and the strength of orientation. The term SENTIWORDNET [4], is a lexical resource in which each WordNet synset is associated with three numerical scores, i.e., Obj(s), Pos(s), and Neg(s), thus describing how objective, positive, and negative the terms contained in the synset.

Sentiment classification can be regarded as a binary-classification task. Structured reviews are used for testing and training, identifying appropriate features and scoring methods from information retrieval for analyzing negative and positive annotations. Then the classifier is used to identify and classify review sentences from the web. Various supervised or data-driven techniques to Sentiment analysis like Naïve Byes, Maximum Entropy and SVM are used. Maximum Entropy and Support Vector Machines in Sentiment analysis on different features like considering only unigrams, bigrams, combination of both, incorporating parts of speech and position information, taking only adjectives etc.

IV. BACKGROUND STUDY

(3)

range and product line. Traditional approach always focuses on clear or detailed featured as compared to implicit ones [1]. Yadav, M. P., et al in their paper title “Mining the customer behavior using web usage mining in e-commerce” they explained customer behavior for E-commerce companies using K Mean. With the drastic growth of WWW users can easily find, extract, filter and evaluated whatever they want. With the advancement in technology servers are now able to collect and store a lot of data which can help them to know about customers perceptions. Hence, to determine the relationship between web mining data and ecommerce. Consumers mostly prefer to choose among millions of ones in an online store to satisfy their demands instead to choose from a superstore. It shows that consumers have taken interest on e-commerce site to engage in international trade [2].

Prashast Kumar Singh et al in their research paper [3] title “An approach towards feature specific opinion mining and sentimental analysis across e-commerce websites” there research focus to collect information about what users think about that product and on the basis of it analysis has been done. On the basis of it geographical data can be collected and reviews can be fetched from various sources. In this approach internet slang language and phrases which has helped to gather millions of reviews on social networking

sites. . And finally, providing the end user

(business/manufacturer) summarized data about the expressed sentiments in way of intuitive and easy to understand graphs, charts and other visualization.

Ahmad Tasnim Siddiqui et. al. in their paper title “Web Mining Techniques in E-Commerce Applications” explained today web is the best medium of communication in modern business. Now day’s online purchase has been increased as compared to window shopping as it provides millions of ranges. As, companies are able to attract most of the customers because ecommerce is not just buying and selling over internet but it also act as to get advantage on big giants of market. For this purpose data mining sometimes called as knowledge discovery is used. As vast information has been provided on internet, it helps to improve e-commerce applications After that they explained the proposed architecture which contains mainly four components business data, data obtained from consumer’s interaction, data warehouse and data analysis. After finishing the task by data analysis module it’ll produce report which can be utilized by the consumers as well as the e-commerce application owners [4].

Songbo Tan et al. in their paper title “Adapting Naive Bayes to Domain Adaptation for Sentiment Analysis” explained in the community of sentiment analysis this is so-called domain-transfer problem. In their work, they attempt to attack this problem by making the maximum use of both the old-domain data and the unlabeled new-domain data. To gain knowledge from the new domain data, we proposed Adapted Naïve Bayes (ANB), a weighted transfer version of Naive Bayes Classifier. The experimental results indicate that proposed approach could improve the performance of base classifier dramatically, and even provide much better performance than the transfer-learning baseline, i.e. the Naïve Bayes Transfer Classifier (NTBC). They proposed a novel approach for domain adaptation in the context of sentiment analysis. First, in order to make the maximum use of the old-domain data, we proposed an effective method, i.e., Frequently Co-occurring Entropy (FCE). First, in order to

make the maximum use of the old-domain data, we proposed an effective method, i.e., Frequently Co-occurring Entropy (FCE). Thirdly, they conducted extensive experiments on six domain adaptation tasks. They believe that their work provides an effective machine learning and data mining algorithm especially when a ranking are more desirable. A potential problem with IGCNB is that IGCNB has relatively [12].

V. NAIVEBAYESCLASSIFICATION

It is an approach to text classification that assigns the class , to a given document d. A naive Bayes classifier is a simple probabilistic classifier based on Bayes' theorem and is particularly suited when the dimensionality of the inputs are high [9]. Its underlying probability model can be described as an "independent feature model". The Naive Bayes (NB) classifier uses the Bayes’ rule Eq. (1),

(1)

Where, P (d) plays no role in selecting c*. To estimate the term P (d | c), Naive Bayes decomposes it by assuming the fi’s

are conditionally independent given d’s class as in Eq. (2),

(2)

Where, m is the no of features and fi is the feature vector. Consider a training method consisting of a relative-frequency estimation P(c) and P (fi | c). Despite its simplicity and the fact that its conditional independence assumption clearly does not hold in real-world situations, Naive Bayes-based text categorization still tends to perform surprisingly well; indeed, Naive Bayes is optimal for certain problem classes with highly dependent features.

VI. PARAMETERS FOR EVALUATION

[image:3.595.301.556.626.727.2]

In the context of classification, True Positives (TP), True Negatives (TN), False Negatives (FN) and False Positives (FP) are used to compare the class labels assigned to documents by a classifier with the classes the items actually belongs to. True positive means, which are truly classified as the positive terms. True Negative means, which are truly classified as the Negative terms. Other evaluation measures like precision, recall, F-measure, specificity and accuracy can easily be calculated from these four variables.

Table 1.Contegency table

Correct labels

Positive Negative

Classified labels

Positive True

Positive

False Positive

Negative False

negative

True Negative

A. Accuracy

(4)

careful to use only accuracy when one is using skewed data. This is because when one class occurs significantly more than the other, the classifier might get higher accuracy by just labelling all examples as the dominant class then what it gets when it tries to classify some with the other class.

B. Precision and recall

Precision and recall are two widely used metrics for evaluating performance in text mining, and in other text analysis field like information retrieval. They can be seen as extended versions of accuracy, and by using a combination of these measures the problem with skewed data for classifiers dissipates. Precision is used to measure exactness, whereas recall is a measure of completeness. Precision is the number of examples correctly labeled as positive divided on the total number that are classified as positive, while recall is the number of examples correctly labeled as positive divided on the total number of examples that truly are positive. This is shown in the following formulas.

C. F measure

F-Measure is the harmonic mean of precision and recall. This gives a score that is a balance between precision and recall. F-Measure combines them into one score for easier usage. This is important because it might be better to optimize the system to favors either the precision or the recall if one of these has a more positive influence on the final result of the trading simulation than the other.

F1 measure is used as the evaluation metric for aspect

identification and aspect sentiment classification. It is a combination of precision and recall, as

to evaluate the performance decision tree algorithm is used.

VII. EVALUATIONSETUP

A. Text Preprocessing

Text pre-processing techniques are divided into two subcategories.

1. Tokenization: Textual review data comprises block of characters called tokens. The review comments are separated as tokens and used for further processing.

2. Removal of Stop Words: A stop-list is the name commonly given to a set or list of stop words. It is typically language specific, although it may contain words. Some of the more frequently used stop words for English include "a", "of", "the", "I", "it", "you", and ”and” these are generally regarded as 'functional words' which do not carry meaning. When assessing the contents of natural language, the meaning can be conveyed more clearly by ignoring the functional words.

[image:4.595.366.489.47.259.2]

Hence it is practical to remove those words which appear too often that support no information for the task. If the stop word removal is applied, all the stop words in the particular text file will not be loaded. If the stop word removal is not applied, the stop word removal algorithm will be disabled when the dataset is loaded.

Fig. 2. Steps used in sentiment classification.

B. Text Transformation

The score of each sentence in the source document is calculated by sum of weight of each term in the corresponding sentences [6].

C. Feature Selection

Many statistical feature selection methods for document level classification can also be used for sentiment analysis [6]. The simplest statistical approach for feature selection is to use the most frequently occurring words in the corpus as polarity indicators. The majority of the approaches for sentiment analysis involve a two-step process:

• Identify the parts of the document to contribute the positive or negative sentiments.

• Join these parts of the document in ways that increase the odds of the document falling into one of these two polar categories.

VIII. ALGORITHMS USED

Algorithm 1

Algorithm for extracting Sentiment of Review Comment

Require:Product Review Document

Ensure: Sentiment of User comment. 1. Fetch the comment.

2. Convert the unstructured comment data to structured document.

3. Tokenize the sentences into keywords.

4. Eliminate Stop words and tag the tokens using POS tagger.

5. If term is not in the dictionary check for the correct word. 6. Apply Nave Bayes classifier.

7. Calculate Precision Recall and F measure. 8. Apply decision tree algorithm.

9. Compute sentiments using algorithm 2

10. Return sentiment and sentiment score of review

Algorithm 2

Algorithm to calculate the review orientation

(5)

2. begin

3. for each review sentence si 4. begin

5. sense = 0;

6. For each review word rw in si 7. sense + = Word Sense (rw, si); 8. /* Positive =1 , Negative =-1*/ 9. if (sense >0) si’s sense = Positive;

10. else if (sense<0) si’s sense = Negative

11. endfor; 12. end

1. Procedure Word Sense (word, sentence) 2. begin

3. sense = orientation of word in bag of keywords; 4. If(there is NEGATIVE_WORD appears closely around word in sentence)

5. sense = opposite(sense); End

IX. RESULTS AND DISCUSSION

[image:5.595.302.543.50.497.2]

MOTO X Play phone is the most searched item on Flipkart. The top 10 reviews of MOTO X Play Mobile phone are in more than 4300 words. Fig 3 show the classification of fetched comments using Naïve Bayes classifier with star rating and total negative and positive words. There are millions of products and millions of users reviews about products.

Fig. 3 Top 10 reviews of Mobile phone MOTO X Play

There are more than 100 spelling mistakes and slang words used in top 10 reviews that effect the performance of any sentiment analysis algorithm. In order to evaluate the effectiveness of the proposed feature extraction approach, we manually read every review and chose the major quality features mentioned in the reviews as the ground truth. We use recall @K as the measure to evaluate the accuracy of feature extraction result. That is, given a threshold K, the top K features are extracted and compared to the ground truth feature set. Recall is calculated as the ratio of the number of collect features in the extraction result (NE) to the size of the ground truth feature set.

Precision recall and F measure is calculated of Moto phones shown in Fig. 4 the overall polarity of products is calculated and results are shown in Fig 5. The products review sentiment analysis is calculated and from results the Moto X Play (16 GB) is the best phone then Moto E and Moto G.

Fig. 4 Products for analysis

Fig. 5 Graphical representation of Precision recall and F-measure.

X. CONCLUSION

Instead of some thousand products in a superstore, consumers may choose among millions of products in an online store to satisfy the personalization demands. It is clear that target customers marketing can be effective when an e-commerce company is able to collect rich information about buyer's behavior on e-commerce site. In this paper, we use Naïve Bayes algorithm and semantic decision tree to classify the polarity of comments given on e-commerce websites.

First, we use a web crawler to fetch comment on a particular web page. The spelling correction is done to make the most sensible comment for knowing the polarity of words using Word Net dictionary. Then stemming is performed to remove the stop words. After classifying the positive and negative words using Naïve Bayes algorithm, the overall polarity is calculated using decision tree.

[image:5.595.55.278.383.527.2]
(6)

REFERENCES

[1] Song, H., Chu, J., Hu, Y., & Liu, X. (2013, December). Semantic Analysis and Implicit Target Extraction of Comments from E-Commerce Websites. In Software Engineering (WCSE), 2013 Fourth World Congress on(pp. 331-335). IEEE.

[2] Yadav, M. P., Feeroz, M., & Yadav, V. K. (2012, July). Mining the customer behavior using web usage mining in e-commerce. In Computing Communication & Networking Technologies (ICCCNT), 2012 Third International Conference on(pp. 1-5). IEEE.

[3] Kumar Singh, P., Sachdeva, A., Mahajan, D., Pande, N., & Sharma, A. (2014, September). An approach towards feature specific opinion mining and sentimental analysis across e-commerce websites. In Confluence The Next Generation Information Technology Summit (Confluence), 2014 5th International Conference- (pp. 329-335). IEEE.

[4] Yu, C., & Ying, X. (2009, December). Application of Data Mining Technology in E-Commerce. In Computer Science-Technology and Applications, 2009. IFCSTA'09. International Forum on(Vol. 1, pp. 291-293). IEEE.

[5] Sellam, T. (2010). Embedding Naive Bayes classification in a Functional and Object Oriented DBMS.

[6] Mouthami, K., Devi, K. N., & Bhaskaran, V. M. (2013, February). Sentiment analysis and classification based on textual reviews. In Information Communication and Embedded Systems (ICICES), 2013 International Conference on(pp. 271-276). IEEE.

[7] Zha, Z. J., Yu, J., Tang, J., Wang, M., & Chua, T. S. (2014). Product aspect ranking and its applications.Knowledge and Data Engineering, IEEE Transactions on,26(5), 1211-1224.

[8] Sudhakaran, P., Hariharan, S., & Lu, J. (2013). Research Directions, Challenges and Issues in Opinion Mining. International Journal of Advanced Science and Technology,60, 1-8.

[9] Pang, B., Lee, L., & Vaithyanathan, S. (2002, July). Thumbs up?: sentiment classification using machine learning techniques. In Proceedings of the ACL-02 conference on Empirical methods in natural language processing-Volume 10(pp. 79-86). Association for Computational Linguistics.

[10] Anitha, N., Anitha, B., & Pradeepa, S. (2013). Sentiment Classification Approaches–A Review. International Journal of Innovations in Engineering and Technology (IJIET),3(1), 22-31.

[11] http://articles.economictimes.indiatimes.com/2015-09-03/news/66178 659_1_user-base-iamai-internet-and-mobile-association.

[12] Tan, S., Cheng, X., Wang, Y., & Xu, H. (2009). Adapting naive bayes to domain adaptation for sentiment analysis. In Advances in Information Retrieval(pp. 337-349). Springer Berlin Heidelberg.

Gurneet Kaurreceived her B.Tech. Degree from PTU. She is Lecturer in Baba Hira Singh Bhattal Institute of Engineering and Technology Lehragaga, Sangrur, Punjab. She is Research Scholar in Bhar Gurdas institute of engineering and technology Sangrur, Punjab. Her research interests include natural language processing, sentiment analysis and machine learning.

References

Related documents

The aim of the study was to measure behavioral data (such as eye and head movements) and to assess how the two age groups differ in terms of number of safe street crossings,

Elias National Park • Copper mining town of Kennicott • Root Glacier hike • Alaska Wildlife Conservation Center tour • Kenai Fjords National Park cruise • Anchorage

(STEVENS-JOHNSON SYNDROME): Resulting in Blindness in a Patient Treated SEVERE ERYTHEMA MULTIFORME OF THE PLURIORIFICIAL

Network analysis and scientific methodology consti - tute the evaluation and recognition of practical relations among the study issues and their structures. These nodes

Most faculty are technology advantaged in the area of online courses, and the addition of E-textbooks could prove to be an easy switch from the traditional printed textbook,

UPnP Control Point (DLNA) Device Discovery HTTP Server (DLNA, Chormecast, AirPlay Photo/Video) RTSP Server (AirPlay Audio) Streaming Server.. Figure 11: Simplified

By expressing indi- vidual DNMT3A isoforms in Dnmt-TKO cells lacking DNA methyla- tion and 5-hmC, we furthermore confirm that recruitment of the DNMT3A1 isoform is sufficient

In this study we review effects of mesenchymal stem cell conditioned medium in different central nervous system (CNS) disease associated with neuroinflammation..