Question
-Write in java -Link to movieReviews.txt: https://uploadfiles.io/3j31e The purpose of this assignment is to be able to input the text of a movie review and
-Write in java
-Link to movieReviews.txt: https://uploadfiles.io/3j31e
The purpose of this assignment is to be able to input the text of a movie review and determine if it 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 program that could look at the text The film was a breath of fresh air and realize that it was a positive statement while It made me want to poke out my eye balls is negative.1 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.
COMP163 Movie Review Evaluation he purpose of this assignment is to be able to input the text of a movie review and determine if it is a positive or negative review, that is, does the reviewer like or dislike the movie. Sentiment Analysis isa 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 program that could look at the text "The film was a breath of fresh air" and realize that it was a positive statement while "It made me want to poke out my eye balls" is negative.1 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 a 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. HashtableStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started