Question
Use Java language, please. /** * For a review sentence, estimate the movie rating based on the words * in the review. * For each
Use Java language, please.
/**
* For a review sentence, estimate the movie rating based on the words
* in the review.
* For each word, find its index in the words list, then compute
* its average score (scores[index]/wordCount[index]) and add it to a
* cumulative review score.
* Count up the number of words in the review and use the count
* and the cumulative review score to get an averaged movie score.
* @param review: The text of the review.
* @param words: The array of words found in all reviews.
* @param scores: The cumulative score for each word in words.
* @param wordCount: The number of times each word in words appears in all the reviews.
* @param numberOfWordsSoFar: The number of elements in the arrays to be used.
* @return the average score for the words in review.
*/
public static double scoreReview(String review, String[] words, double[] scores, int[] wordCount, int numberOfWordsSoFar) {
return 0.0; // Change this
}
Thank you so much!
Step 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