Sentiment Classification for Product Review Analysis

DOI : 10.17577/IJERTV4IS070618

Download Full-Text PDF Cite this Publication

Text Only Version

Sentiment Classification for Product Review Analysis

Sonali D. Ingale

P.G Student Dept. of CS and IT

Dr. B. A. M. University, Aurangabad-431004, India

Dr. R. R Deshmukh Professor and Head Dept. of CS and IT

Dr. B. A. M. University,

Aurangabad-413004, India

Abstract In todays world many of people spend their most of time on internet for net surfing. Internet becomes a new media of education, communication, shopping etc.while dealing with websites users leave their feedback on plenty of sites. So large amount of user written electronic text is available which can be beneficial to retailers and customers for business intelligence as well as decision making. Sentiment mapping or opinion mining is a Natural Language processing and retrieval of information task which finds out customer opinion in the category of positive, negative and natural. Here sentence level sentiment classification divides document into number of sentence and classify opinion for each feature.

Keywords Business Intelligence, Sentiment Mapping, Natural Language Processing, Opinion Mining.


    Opinion mining is related with sentiment or attitude of the writers common method to use this technology is to find out what people think about particular thing[1].

    For example, do people on facebook think that street food in Aurangabad is good or bad?

    by processing the sentiments of the comments you will get answer of your question. Here one can also study why people think that food is bad or good by searching out exact word which denote why particular like or dislike the food.

    Example:"So oily."

    This is one of the types for the market research analysis [2].Now you can find out what pitfalls are there and try to minimize the problems and find out new ways. Sentiment mining can be use to find out opinions at different levels. It will score whole document into positive and negative, it can also score sentiment of each and every phrases or words in the whole document [3].

    For example, if someone writes in tweeter, I love winter season but hate summer."

    Individual score will show love winter" as positive and "hate summer" as negative. However sentiment for whole sentences as neutral, positive opinion for the word love will cancel negative opinion for word hate[4]. Opinion mining track particular topic, many firms use this technique to monitor their goods, services [5].

    Accuracy of sentiment mining can be measured in different number of ways, but one of the most common way is score accuracy with the comparison of human [6]. A research from University of Pittsburgh demonstrated that humans can only agree on whether a sentence has positive or negative sentiment, up to 80% of the time. Because of this any Natural Language Processing technique which scores up to 80% is working greatly with high accuracy [7]. Even human being is having problem as they can analyses up to 80% accuracy. Major problem occurs when one word has multiple definitions. Few engines are there which help to

    understand the context of text. For example, if someone is talking about apple then they are talking about mobile phone/they are talking about fruit [8].


    • Loading Pros and Cons: First of all we have to load the Pros and Cons dataset. The words usually provided with XML or TEXT version. Developer has to design a XML or a TEXT parser to read the statement serially. These statements should be loaded into arrays of string data type [9].

    • Train Naive Bayes: As we know the Pros and Cons statement provides the sentiment as positive and negative over an issue respectively. Here we train a Classifier i.e. Naive Bayes as a Sentiment Classifier. The string arrays are loaded as training instances[10]. Nave Bayes creates a trained model. This classifier based on applying Bayes theorem (from Bayesian statistics) with strong (naive) independence assumptions. A more descriptive term for the underlying probability model would be independent feature model. Depending on the precise nature of the probability model, naive Bayes classifiers can be trained very efficiently in a supervised learning setting [11]. In many practical applications, parameter estimation for naive Bayes models uses the method of maximum likelihood; in other words, one can

      work with the naive Bayes model without believing in Bayesian probability or using any Bayesian methods [12].

    • Part-Of-Speech Tagging (POST): A Part-Of-Speech Tagger (POS Tagger) is a piece of software that reads text in some language and assigns parts of speech to each word (and other token), such as noun, verb, adjective, etc., although generally computational applications use more fine-grained POS tags like noun-plural. We use open source Stanford NLP parser for POST. The parser is instantiated with English Model [13]. As it is free licensed with Java programming language, we use IKVMC to port Java class files into .NET library. By using these libraries we can POST a sentence with its grammatical tags [14].

    • Feature Identification: For the Pros and Cons opinions, we will identify the features by extracting the frequent noun terms in the reviews. For identifying features in the free text reviews, a solution is to employ an existing feature identification approach existing approach that first identifies the Nouns and Noun phrases in the reviews [15]. The occurrence frequencies of the nouns and noun phrases are counted, and only the frequent ones are kept as features. The most frequently occurred Nouns and Noun phrases usually refers to aspects or features in our consideration [16].

    • Sentiment Classification on Features: The Pros and Cons reviews can be categorized positive and negative opinions on the feature [17]. These reviews are valuable training samples for learning a sentiment classification. Thus the Pros and Cons reviews used to train a sentiment classifier, which is in turn used to determine consumer opinions (positive or negative) on the aspects in free text Reviews[18].


    Training and testing dataset is downloaded from

    Training Dataset consist of Total 6824 words in which Pros word count is 2012 and cons word count is 4812.

    Below snapshot shows result of part of speech tagging of sentence as well as classifier output. Classifier classify each sentence into 3 classes

    1. Positive

    2. Negative

    3. Neutral

    For positive and negative sentence we have training dataset, but for neutral sentence no dataset is available so for neutral classification stetted up two thresholds for positive and negative .In order for a sentence to be flagged as either its chance for that class must be equal or above the threshold set for that class. If it is not, the sentence is classified as neutral. Here total 300 sentences are picked up randomly from the data set from which 100 are positive, 100 are negative and 100 are neutral.

    Below table shows confusion matrix for sentence level sentiment classification.

    In which,

    Predicted_Pos=Predicted Positive Sentence Predicted_Neg= Predicted Negative Sentence Predicted_Neu=Predicted Neutral Sentence TotalPredPos=Total Positive Predicted Sentence TotalPredNeg= Total Negative Predicted Sentence TotalPredNeu= Total Neutral Predicted Sentence Total_Pos=Total Positive Sentence

    Total_Neg= Total Negative Sentence Total_Neu= Total Neutral Sentence

    Precision for positive sentnce Precision= TP_Positive /Total_Pos



    Recall for Positive sentence Recall=TP_Positive/TotalPredPos



    Here ,

    TP_Positive=True positive for positive sentence

    Table 3: Result of precision and recall for positive sentence





    Precision for Negative sentence Precision= TP_Negative /Total_Neg




    TP_Negative =True negative for negative sentence

    Table 4: Result of precision and recall for positive sentence





    Precision for Neutral sentence Precision= TP_ Neutral /Total_Neu



    Recall for Neutral sentence Recall=TP_ Neutral /TotalPredNeu



    Here ,

    TP_Neutral =True neutral for neutral sentence

    Table 5: Result of precision and recall for positive sentence





    Total Average Precision for sentence classifying

    =TP_Positive + TP_Negative_ TP_Neutral/ (Total_Pos+Total_Neg+Total_Neu)




    Below table shows graphical representation of precision and recall for sentiment classification









    Positive Negative Neutral

    Figure 1:Precision and Recall graph


Mobile, Camera, Printer ,TV are dominating product in now days so we have taken their reviews for sentiment mining . The Stanford parser is used for identify product features. Sentence level sentiment classification is used for identify sentiment of each sentence separately.


I am highly indebted to Dr. R.R.Deshmukh, Professor and Head of the Department, Computer Science and Information Technology,Dr.Babasaheb Ambedkar Marathwada University Aurangabad ,for his encouragement towards the completion of this project.


  1. Zheng-Jun Zha, Member, IEEE, Jianxing Yu, Jinhui Tang, Member, IEEE,Meng Wang, Member, IEEE, And Tat-Seng Chua,"Product Aspect Ranking And Its Applications",IEEE Transactions On Knowledge And Data Engineering, Vol. 26, No. 5, May 2014

  2. Singh and Vivek Kumar, A clustering and opinion mining approach to socio-political analysis of the blogosphere. Computational Intelligence and Computing Research (ICCIC), 2010 IEEE

  3. M Fan, G WU Opinion Summarization of Customer comments International conference on Applied Physics and Industrial Engineering in 2012.

  4. B. B. Khairullah Khan, Aurangzeb Khan, Sentence based sentiment classification from online customer reviews, ACM, 2010.

  5. Ayesha Rashid, Naveed Anwer, Dr. Muddaser Iqbal, Dr. Muhammad Sher, A Survey Paper: Areas, Techniques and Challenges of Opinion Mining, IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 6, No 2, November 2013

  6. Bing Liu,Mining Hu,Junsheng Cheng,"Opinion Observer: Analyzing and Comparing Opinions on the Web",WWW 2005, May 10-14, 2005, Chiba, Japan,ACM 1-59593-046-9/05/0005.

  7. Zhang, Z. and B. Varadarajan. Utility scoring of product reviews. In Proceedings of ACM International Conference on Information and Knowledge Management (CIKM-2006), 2006.

  8. Pang, B., Lee, L., Vaithyanathan, S.: Thumbs up? Sentiment classification using Machine Learning techniques. In: Proc. of CoRR (2002)

  9. Nasukawa, T. and Yi, J. 2003. Sentiment analysis: Capturing favorability using natural language processing. Proceedings of the 2nd Intl. Conf. on Knowledge Capture (K-CA2003).

  10. Camelin, N., Damnati, G., Béchet, F. and De Mori, R., Opinion Mining in a Telephone Survey Corpus, International Conference on Spoken Language Processing in 2006.

  11. Mohammad S, Dunne C, Dorr B. Generating high-coverage semantic orientation lexicons from overly marked words and a thesaurus. In: Proceedings of the conference on Empirical Methods in Natural Language Processing (EMNLP09);2009.

  12. Bing Liu, Sentiment Analysis and Opinion Mining, Morgan and Claypool Publishers, May 2012.p.18-19,27-28,44-45,47,90-101.

  13. cited on 10/04/2015

  14. Kim S, Hovy E. Determining the sentiment of opinions. In: Proceedings of interntional conference on Computational Linguistics (COLING04); 2004.

  15. Bing Xiang,Liang Zhou,"Improving Twitter Sentiment Analysis with Topic-Based Mixture Modeling and Semi-Supervised Training, Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Short Papers), pages 434439,Baltimore, Maryland, USA, June 23-25 2014.

  16. Dave K., Lawrence, S. & Pennock, D.M. (2003), Mining the Peanut Gallery: Opinion Extraction and Semantic Classification of Product Reviews. In Proceedings of the 12th International Conference on World Wide Web, p. 519- 528.

  17. Sowmya Kamath S, Anusha Bagalkotkar, Ashesh Khandelwal, Shivam Pandey, Kumari Poornima, Sentiment Analysis Based Approaches for Understanding User Context in Web Content, 978- 0-7695-4958-3/13, 2013 IEEE.

  18. Bing Liu,"Sentiment Analysis and Opinion Mining", Book available at

Leave a Reply