Tuesday, February 12, 2013

Sentiment Analysis with Rapidminer

Sentiment analysis or opinion mining is an application of Text Analytics to identify and extract subjective information in source materials.

A basic task in sentiment analysis is classifying an expressed opinion in a document, a sentence or an entity feature as positive or negative. This tutorial explains the usage of sentiment analysis in Rapidminer. The example presented here gives the list of movies and its review such as Positive or Negative. This program implements Precision and Recall method.  Precision is the probability that a (randomly selected) retrieved document is relevant. Recall is the probability that a (randomly selected) relevant document is retrieved in a search. Or high recall means that an algorithm returned most of the relevant results. High precision means that an algorithm returned more relevant results than irrelevant.

At first, both positive and negative reviews of a certain movie are taken. All of the words are stemmed into root words. Then the words are stored in different polarity(positive and negative). Both vector wordlist and model are created. Then, the required list of movies is given as an input.  Model compares each and every word from the given list of movies with that of words which come under different polarity stored earlier. The movie review is estimated based on the majority of number of words that occur under a polarity. For example, when you look at Django Unchained, the reviews are compared with the vector wordlist created at the beginning. The highest number of words comes under positive polarity. So the outcome is Positive.  Same happens for Negative outcome.
First step for implementing this analysis is Processing the document from data i.e. extracting the positive and negative reviews of a movie and storing it in different polarity. The model is shown in Figure 1.

Figure 1

Under Process document, click on the Edit List on the right. Load the positive and negative reviews under different class name "Positive" and "Negative" as shown in Figure 2.

Figure 2

Under Process Document operator, nested operation takes place such as Tokenizing the words, Filtering the Stop words, Stemming the words into root words and Filtering the tokens between 4 and 25  characters as shown in Figure 3.

Figure 3

Then two operators are used such as Store and Validation operator as shown in Figure 1. Store operator is used to output word vector to a file and directory of our choosing. Validation operator(Cross-validation) is a standard way to assess the accuracy and validity of a statistical model. Our data set is divided into two parts, a training set and a test set. The model is trained on the training set only and its accuracy is evaluated on the test set. This is repeated n number of times. Double click on validation operator. There will two panels- Training and Testing. Under Training panel, Linear Support Vector Machine(SVM) is used which is a popular set of classifier since the function is a linear combination of all the input variables. In order to test the model, we use the ‘Apply Model’ operator to apply the training set to our test set. To measure the model accuracy we use the ‘Performance’ operator. The operations under Validation is shown in Figure 4.

Figure 4

Then run the model. The result of Class Recall % and Precision % is shown in Figure 5. The model and vector wordlist are stored in a Repository.

Figure 5

Then retrieve both the model and vector wordlist from the Repository you have stored earlier. Then connect out from the retrieve wordlist to the process document operator shown in Figure 6. The operations under Process document is same shown in Figure 3.

Figure 6

Then click on Process Document operator and click edit list on the right. This time I have added the list of 5 movie reviews from Rottentomatoes website and stored it in a directory. Assign the class name as unlabeled shown in Figure 7.

Figure 7

The Apply Model operator takes a model from a Retrieve operator and unlabeled data from Process document as input and outputs the applied model to the ‘lab’ port, so connect that to the ‘res’ (results) port. The result is shown below. When you look at Les Miserables, there is 86.4% confidence that it is positive and 13.6% as negative because the match of the reviews with wordlist under positive polarity is higher compared to negative polarity.  

Figure 8


  1. Hi,

    I could not get the expected output. I took a dataset from cornell site.
    Can you please elaborate the above process with screenshots (diagrams) at each and every step, at each node creation. That would be really helpful. You can also e-mail me a word or pdf document at annaji.sankar at gmail.com


  2. I think this is an great blogs. Such a very informative and creative contents. These concept is good for these knowledge.I like it and help me to development very well.Thank you for this brief explanations.
    Analytics Training in Chennai

  3. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Android Training in Chennai
    Ios Training in Chennai

  4. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in RAPIDMINER kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on RAPIDMINER We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Saurabh Srivastava
    E-mail: saurabh@maxmunus.com
    Skype id: saurabhmaxmunus
    Ph:+91 8553576305 / 080 - 41103383

  5. nice blog has been shared by you. before i read this blog i didn't have any knowledge about this but now i got some knowledge so keep on sharing such kind of an interesting blogs.
    aws vpc interview questions

  6. I am a regular reader of your blog and being students it is great to read that your responsibilities have not prevented you from continuing your study and other activities. Love
    java training in annanagar | java training in chennai

    java training in marathahalli | java training in btm layout

    java training in rajaji nagar | java training in jayanagar

    java training in chennai

  7. Greetings. I know this is somewhat off-topic, but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform like yours, and I’m having difficulty finding one? Thanks a lot.

    AWS Training in Bangalore | Amazon Web Services Training in Bangalore

    Amazon Web Services Training in Pune | Best AWS Training in Pune

    AWS Online Training | Online AWS Certification Course - Gangboard

  8. Your story is truly inspirational and I have learned a lot from your blog. Much appreciated.
    Python training in marathahalli
    Python training institute in pune

  9. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
    Devops training in sholinganallur
    Devops training in velachery
    Devops training in annanagar
    Devops training in tambaram

  10. myTectra Placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance

  11. I simply want to tell you that I am just beginner to blogs and absolutely enjoyed you’re website. More than likely I’m planning to bookmark your blog . You really come with awesome stories.

    RPA Course in Chennai

    DevOps Training

  12. Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.thank you for sharing such a great blog with us. expecting for your.
    Blue prism training in bangalore
    Blue prism training bangalore
    Blue prism classes in bangalore
    Blue Prism Training Centers in Bangalore
    Blue Prism Institute in Bangalore


  13. Excellent post, great quality and most important all above mentioned point very useful actionable advice.
    Data Science training in Chennai | Data Science Training Institute in Chennai | Data Science Course in Chennai

  14. Thank you for sharing your article. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the same to other forums.

    best openstack training in chennai | openstack course fees in chennai | openstack certification in chennai | openstack training in chennai velachery

  15. Nice blog..! I really loved reading through this article. Thanks for sharing such a amazing post with us and keep blogging...Also Checkout: cryptocurrency training in chennai | blockchain coaching in chennai | blockchain certification training in chennai | blockchain certification course in chennai

  16. Nice Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
    Check out : hadoop training in chennai cost
    hadoop certification training in chennai
    big data hadoop course in chennai with placement
    big data certification in chennai

  17. Really Happy to say your post is very interesting. Keep sharing your information regularly for my future reference. Thanks Again.

    Check Out:
    big data training in chennai chennai tamil nadu
    big data training in velachery
    big data hadoop training in velachery


  18. karresults.nic.in 2019 The Examination Authorities is planning to declare the result on the official website. Students click on the given link here and find your result 2019.

  19. Tamilnadu Board of the Examination has been declared that they will reveal the result in some days on the official webiste of tnresults.nic.in 2019 . Studenst get ready to know your results.

  20. Maharashtra SSC Result 2019 is soon going to be available in the month of the June 2019. Students don't miss any updates and click on the link given here to know more information about the result 2019

  21. Maharashtra Hsc result is going to declare in the end of the May 2019 on the official website of mahresult.nic.in 2019. students get ready to know your results.

  22. CGBSE Result 2019 will be published in the month of the May. All the students who have been the part of the Examination process can check the result on the official website by clicking on the link given here.

  23. The Examination Board of the MP has been decided to announce the MP Result in the month of the May 2019 onthe official portal of mpresults.nic.in 2019 . Keep visiting the official webpage for more information.

  24. The Rajasthan Board is going to announce the result for all of the students who were appeared in the examination. The result is going to publish on the official website which is rajresults.nic.in 2019 . Students stay connected with the web portal to get all the latest and updated information.

  25. The results of the Madhyamik 2019 or Class 10 exams will be published by the West Bengal Secondary Education Board (WBBSE) on 21 May. On the official websites of wbresults.nic.in 2019 students can check their scores.

  26. RBSE 10th Result 2019 will be released in the month of the June. The Examination Authority has been declared that the RBSE 10TH Result will launch in the month of june on the official website. Students keep visiting the online portal to know all the recent and updated information.

  27. PSEB 12th Result 2019 will be declare in third of the week of the May 2019. Students who were the part of the Examination can check their result online in some days. Stay connected to the official website.

  28. Rajasthan Board is planning to declare the RBSE 12th Result 2019 on 15th May 2019. Students get ready to know your results on the official website.

  29. Maharashtra HSC Result 2019 is going to declare in the end of the Month of the May 2019. students who took the part in the Examination will soon going to be able to check their result on the official website. Click on the link given here to know more about the announcement of the Result.

  30. Gujrat Official Board will declare the Gujrat HSC Result 2019 on 9th May 2019 on the official web portal gseb.org 2019 . All the students are advised to visit the website and download the result.

  31. PSEB 10th Result 2019 will be declare in upcoming days. The wait is going to over now. Students can check the result on the official web portal very soon.

  32. HBSE Result 2019The HBSE 12th Result 2019 will be tentatively announced by the Board of School Education Haryana, BSEH in the 3rd week of May 2019. Students can check their respective HBSE 12th Result 2019 online on the Haryana School Board's official website.

  33. MP Board Result 2019 is finally going to be published by the Official Authority of the Examination. Students keep checking the website by clicking the link given here.

  34. The Kerala Secondary Education Board (KSEB), also known as the DHSE, announced today at 11 a.m. Kerala Class 12 Result 2019. On the official website of the Kerala Board KeralaResults.nic.in 2019. The DHSE released the Kerala Class 12 Result 2019.

  35. Kerala SSLC Result 2019 has been declared on the official website. The students who took the part in the examination can check the result from the link of the official website given here.

  36. DHSE or Higher Secondary Education Directorate, Kerala announced the results of Kerala DHSE for Class 12 students. Official websites announced the results. The results of the Plus 2 have been published. Students can check the Kerala Plus Two Result 2019 by visiting the official webiste

  37. Students can check the Result of all of the universities. Check the official portal of the timetablersult.co.in by clicking the link given here.

  38. If you have Natural Curls or Curly Hair, you are just blessed. You can experiment with many Hairstyles which will Look Stylish here we tell about top best and easy Curly Hairstyles and Curly Hair Tips of 2019


  39. I like your post very much. It is very much useful for my research. I hope you to share more info about this. Keep posting!!

    Best Devops Training Institute

  40. This comment has been removed by the author.

  41. Alleyaaircool is the one of the best home appliances repair canter in all over Delhi we deals in repairing window ac, Split ac , fridge , microwave, washing machine, water cooler, RO and more other home appliances in cheap rates

    Window AC Repair in vaishali
    Split AC Repair in indirapuram
    Fridge Repair in kaushambi
    Microwave Repair in patparganj
    Washing Machine Repair in vasundhara
    Water Cooler Repair in indirapuram
    RO Service AMC in vasundhara
    Any Cooling System in vaishali
    Window AC Repair in indirapuram

  42. Get the best nursing services baby care services medical equipment services and allso get the physiotherapist at home in Delhi NCR For more information visit our site

    nursing attendant services in Delhi NCR
    medical equipment services in Delhi NCR
    nursing services in Delhi NCR
    physiotherapist at home in Delhi NCR
    baby care services in Delhi NCR