Question: In Java complete the following Java program The purpose of this assignment is to be able to input the text of a movie review and

In Java complete the following Java program
 In Java complete the following Java program The purpose of this
assignment is to be able to input the text of a movie
review and determine f is a positive or negative review, that is,

The purpose of this assignment is to be able to input the text of a movie review and determine f is a positive or negative review, that is, does the reviewer like or dislike the movie. Sentiment Analysis is a Big Data problem which seeks to determine the general attitude of a writer given some text they have written. For instance, we would like to have a of fresh air" and realize that it was a positive statement while "It made me want to poke out my eye balls" is negative program that could look at the text The film was a breath One simple (but, regretfully, not very effective) algorithm that we can use for this is to assign a numeric value to words based on how positive or negative that word is and then score the statement based on the average value of the words. To create numerical values for words, the program will read a file of over 8,000 movie reviews that have a rating number from 0 to 4 along with the text of a review. For each word in the reviews, the program will keep the sum of the ratings and the number of times the word occurred. The average "goodness" of the word can be calculated by dividing the sum of the ratings where that word appears by the number of times the word appeared. Information about a word should be kept in the class WordValue. The WordValue class needs to keep two class instance variables to hold: The number of times the word has been used. . The sum of the review ratings where the word was used A constructor method should be written to set the use count to one and initialize the sum to a parameter Two additional methods are needed public void addRating (int rating) which increments the use count by one and adds the rating to the sum. public double avgRating ) which returns the average rating (sum divided by the use count) In a separate class (and therefore a separate file) the main program has two major parts. The first reads the file moviereviews.txt and builds a dictionary of WordValue objects. The second part reads a review from the keyboard and determines if it is a positive or negative review The dictionary of words is best kept in a hash table. The hash table can be created in Java by: java.util.Hashtablestring, WordValue> dict new java.util.Hashtable

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!