[Part 1] Create a class called ReviewEntry which has the following elements: (i) a variable to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
[Part 1] Create a class called ReviewEntry which has the following elements: (i) a variable to track the sentence ID, (ii) a variable to track the total score (which is the sum of all scores assigned to the sentence) and (iii) a variable to track the number of phrases in the sentence. Create an array of object instances of this class to account for each sentence in the file. You will have a total 8544 elements in the array. [Part 2] Use FileIO operations in JAVA to read each entry in the movieReviews.tsv file and update the corresponding entry for the sentence. For example, you should update the object for sentenceID 1 with each corresponding entry in movieReviews.tsv [Part 3] Once you finish loading the entries in the file, ask the user for a sentence ID as input and print the statistics of the corresponding sentence in the following format: Sentence ID 1 has 15 phrases with an average rating of 3.5. The overall sentiment is positive. Sentiment Analysis is a Big Data problem used to get the attitude or sentiment of the writer based on their written text. For instance, when analyzing movie reviews, "The film was a breath of fresh air" has a positive statement while It made me want to poke out my eye balls is negative. One algorithm that we can use for this is to assign a numeric value to any given word based on how positive or negative that word is and then score the statement based on the values of the words. But, how do we come up with our word scores in the first place? That's the problem that we'll solve in this assignment. In the attachments, you will see a data file movieReviews.tsv which contains movie reviews from the Rotten Tomatoes website which have both a numeric score as well as text. The data file has four columns - phraseID, sentenceID, the phrase and a sentiment score. Your goal is to write a JAVA program that reads the given data file and aggregate the review score per sentence. You will need to create an instance of a class named ReviewEntry for each word in the file and track the total score assigned to the sentence. You will need to write a function that computes the average score for each sentence and assigns the following meaning to a word based on the average score: 0-2: negative 2-3: neutral 3-4: positive [Part 1] Create a class called ReviewEntry which has the following elements: (i) a variable to track the sentence ID, (ii) a variable to track the total score (which is the sum of all scores assigned to the sentence) and (iii) a variable to track the number of phrases in the sentence. Create an array of object instances of this class to account for each sentence in the file. You will have a total 8544 elements in the array. [Part 2] Use FileIO operations in JAVA to read each entry in the movieReviews.tsv file and update the corresponding entry for the sentence. For example, you should update the object for sentenceID 1 with each corresponding entry in movieReviews.tsv [Part 3] Once you finish loading the entries in the file, ask the user for a sentence ID as input and print the statistics of the corresponding sentence in the following format: Sentence ID 1 has 15 phrases with an average rating of 3.5. The overall sentiment is positive. Sentiment Analysis is a Big Data problem used to get the attitude or sentiment of the writer based on their written text. For instance, when analyzing movie reviews, "The film was a breath of fresh air" has a positive statement while It made me want to poke out my eye balls is negative. One algorithm that we can use for this is to assign a numeric value to any given word based on how positive or negative that word is and then score the statement based on the values of the words. But, how do we come up with our word scores in the first place? That's the problem that we'll solve in this assignment. In the attachments, you will see a data file movieReviews.tsv which contains movie reviews from the Rotten Tomatoes website which have both a numeric score as well as text. The data file has four columns - phraseID, sentenceID, the phrase and a sentiment score. Your goal is to write a JAVA program that reads the given data file and aggregate the review score per sentence. You will need to create an instance of a class named ReviewEntry for each word in the file and track the total score assigned to the sentence. You will need to write a function that computes the average score for each sentence and assigns the following meaning to a word based on the average score: 0-2: negative 2-3: neutral 3-4: positive
Expert Answer:
Answer rating: 100% (QA)
Heres the code that addresses all three parts of your request import javaioBufferedReader import javaioFileReader import javaioIOException class Revie... View the full answer
Related Book For
An Introduction To Statistical Methods And Data Analysis
ISBN: 9781305465527
7th Edition
Authors: R. Lyman Ott, Micheal T. Longnecker
Posted Date:
Students also viewed these programming questions
-
What options would you have when you communicate with the other nearby villages so that your estimate of per-mile costs will be consistent and comparable for your manager? Explain
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
E-max sold Dishwashers on credit, worth OMR 55,000 to customers, out of these Dishwashers customers return damaged Dishwashers for OMR 6,000. Record the entry for the Dishwashers returned? a. Debit...
-
Perform the following conversions: (a) 0.912 atm to torr, (b) 0.685 bar to kilopascals, (c) 655 mm Hg to atmospheres, (d) 1.323 x 105 to atmospheres, (e) 2.50 atm to psi.
-
Arundel is writing a quick lookup system for the SuperMall's touchscreen directory which helps shoppers locate stores within the mall. The stores in the mall very rarely change because every store...
-
Which conditions for the binomial distribution, if any, fail to hold in the following situations? (a) The number of persons having a cold at a family reunion attended by 30 persons. (b) Among 8...
-
Ann is a recent engineering graduate with two years experience in her current role and is currently looking at getting a Masters degree. She is currently paid $60,000 per year, which she expects to...
-
Jessica Lange owns her own high-end hair salon and employs several hair stylists. Customers usually pay using either a debit card or a credit card, but they sometimes write checks or pay with cash....
-
According to Kohls, the dominant American cultural patterns include personal control over the environment, change, time and its control, equality, individual-ism/privacy, self-help, competition,...
-
How might a formal career development program be consistent with an organizations affirmative action program?
-
Contrast intrinsic and extrinsic rewards.
-
A job advertisement that generates a thousand responses is always better than one that gets twenty responses. Build an argument supporting this statement and an argument against this statement.
-
How can a socialization process benefit an organization?
-
What is broad-banding and how does it work?
-
A FedEx sorting machine that cost $10,000 with a useful lift of five years and a residual value of $20,000 was purchased on January 1. What is the DDB depreciation for each year? (Enter "0" for any...
-
When is the indirect pattern appropriate, and what are the benefits of using it?
-
Suppose that the range of the strong interaction were suddenly increased by 20 orders of magnitude, with all other interactions unchanged. Describe the changes that might occur in the structure of...
-
Explain why friction is not considered a fundamental interaction.
-
Two children on ice skates pull toward each other on a rope held taut between them. The inertia of one child is \(30 \mathrm{~kg}\), and the inertia of the other is \(25 \mathrm{~kg}\). (a) If at one...
Study smarter with the SolutionInn App