CR - Reviews and Sentiment Value (Lesson)

APCompSci_LessonTopBanner.png

Reviews and Sentiment Value

Introduction

The persuasive power of words can be seen in a variety of places such as entertainment, news, social media, and even reviews and comments.

Before we get started with this lab, read an article on fake reviews. Do an internet search for “Fake Reviews” to get a list of recent news articles related to the ethical and social implications of fake reviews.

What motivation do people have for creating fake reviews or comments, and what should be done to prevent it, if anything? If technology can be used to create and post positive reviews for the company’s own products or negative reviews of the competition, what are the ethical implications of this?

For this lab you will need a series of files contained in the ReviewCode folder.  You will need to download, then extract the files, and save them to your computer.  Create a folder on your computer for this lab and keep all the lab files in the same folder. 

A word can have a positive or negative connotation based on the context with which it is often used. This can be quantified as the sentiment value of words.

Read through two or three online reviews of your choice. Some options include music reviews, game reviews, movie reviews, or restaurant reviews. What do you notice about the reviews that you read?

Words derive their sentiment value from the context in which they appear. Computer programs examine large amounts of text, calculating how often a word appears in relation to the words around it, and whether the context is positive or negative. The more often a word is used in a positive context, the higher the sentiment value. The overall pool of text being examined determines whether a word has a positive or negative sentiment value. For example, if sports articles make up the bulk of the text, a word may have a different sentiment value than if the text comes from historical biographies. Analysis of sentiment values is helpful when monitoring posts on social media to understand public opinion.

As you work through this activity, record your answers to any questions on a separate sheet of paper. You will need these answers to complete the Lab Check Quiz.

 

Lab Check

Record the answers to the following questions on a sheet of paper. You will need the answers to complete the Lab Check Quiz.

Determine whether each statement would compile. Briefly justify your answers.

a) double num = sentimentVal(“warm”);

b) String word = sentimentVal(0.5);

c) double x = sentimentVal(“good”, “bad”);

APCompSci_LessonBottomBanner.pngIMAGES CREATED BY GAVS