Sentiment Analysis is a problem within the field of Artificial Intelligence which seeks to determine the...
Fantastic news! We've Found the answer you've been seeking!
Question:
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/65018d320f479_1694600496773.jpg)
Transcribed Image Text:
Sentiment Analysis is a problem within the field of Artificial Intelligence which seeks to determine the general attitude of a writer given some text they have written. For instance, we would like the program to recognize that the text "My favourite film all year" is a positive statement while "A giant waste of time" is negative. One algorithm that we can use for this is to assign a number to each 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 what we will do in this assignment. You are going to search through a file containing movie reviews from the Rotten Tomatoes website which have both a numeric score as well as text. Your program will use this to learn which words are positive and which are negative. The file is called movieReviews.txt and is available on UM Learn. Notice that each review starts with a number 0 through 4 with the following meaning: 0: negative 1: somewhat negative 2: neutral • 4: positive You are going to write a program that determines the score for each word in this file, and then uses those word scores to decide if an unlabelled movie review is positive, negative, or neutral. Part A: Learning from Labelled Movie Reviews To begin, your program must compute the average sentiment score for each of the words in the movieReviews.txt file. Download the text file and save it in the same folder where your program will be. Then write a program to do the following: . Set up a new, empty dictionary. Iterate over every review in the text file (there is one review per line). Examine every word in every review within the file. If the word is not yet in your dictionary: Add a new entry into your dictionary for that word. The word itself is the key, and the value to store at this key is a list that contains two items: the sentiment score and the number 1 (meaning that you've seen this word 1 time). Otherwise (if the word is already in your dictionary): Add the new sentiment score to the score that is already stored in the list, and • Increase the number of times that you have seen this word. . 3: somewhat positive . . Sentiment Analysis is a problem within the field of Artificial Intelligence which seeks to determine the general attitude of a writer given some text they have written. For instance, we would like the program to recognize that the text "My favourite film all year" is a positive statement while "A giant waste of time" is negative. One algorithm that we can use for this is to assign a number to each 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 what we will do in this assignment. You are going to search through a file containing movie reviews from the Rotten Tomatoes website which have both a numeric score as well as text. Your program will use this to learn which words are positive and which are negative. The file is called movieReviews.txt and is available on UM Learn. Notice that each review starts with a number 0 through 4 with the following meaning: 0: negative 1: somewhat negative 2: neutral • 4: positive You are going to write a program that determines the score for each word in this file, and then uses those word scores to decide if an unlabelled movie review is positive, negative, or neutral. Part A: Learning from Labelled Movie Reviews To begin, your program must compute the average sentiment score for each of the words in the movieReviews.txt file. Download the text file and save it in the same folder where your program will be. Then write a program to do the following: . Set up a new, empty dictionary. Iterate over every review in the text file (there is one review per line). Examine every word in every review within the file. If the word is not yet in your dictionary: Add a new entry into your dictionary for that word. The word itself is the key, and the value to store at this key is a list that contains two items: the sentiment score and the number 1 (meaning that you've seen this word 1 time). Otherwise (if the word is already in your dictionary): Add the new sentiment score to the score that is already stored in the list, and • Increase the number of times that you have seen this word. . 3: somewhat positive . .
Expert Answer:
Answer rating: 100% (QA)
Part A Learning from Labelled Movie Reviews In this part of the assignment you will read movie reviews from the movieReviewstxt file calculate the sen... View the full answer
Related Book For
Analytics Data Science And Artificial Intelligence Systems For Decision Support
ISBN: 9781292341552
11th Global Edition
Authors: Ramesh Sharda, Dursun Delen, Efraim Turban
Posted Date:
Students also viewed these organizational behavior questions
-
What precautions do you take to guarantee that machines perform properly?
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Read the case study "Southwest Airlines," found in Part 2 of your textbook. Review the "Guide to Case Analysis" found on pp. CA1 - CA11 of your textbook. (This guide follows the last case in the...
-
A survey of recent masters of business administration (MBAs) reveals that their starting salaries follow a normal distribution with mean $48,000 and standard deviation $9,000. Find the probability...
-
List seven important criteria for selecting the best file organization.
-
Every infinite geometric series converges. Determine whether each statement is true or false, and explain why.
-
Weekly earnings for workers. The table in the next column lists the median weekly earnings (in dollars) for full-time wage and salary workers over the years 20102019, categorized by gender. a....
-
Selected accounts from Keystone Furnitures adjusted trial balance as of August 31, 2014, the end of the fiscal year, follow. Required 1. Prepare a multistep income statement for Keystone. Store...
-
Homework: Cha... Question 13, P5-59 (simil... HW Score: 46.15%, 6 of 13 points Points: 0 of 1 Save Part 1 of 4 Time to accumulate a given sum Personal Finance Problem Manuel Rios wishes to determine...
-
Using the predictions made by the model on the "Prediction data (this year, active donors)" data set, if the Gabriel Hansen Foundation did not change its direct marketing strategy at all, and sent...
-
(1) Given the following on 5 independent projects: Project IRR Beta RADR Accept/ Reject A 7.01% 0.2 B 11.90% 1 C 14.50% 1.2 D 11.00% 0.8 E 18.00% 2 Calculate the risk adjusted discount rate for each...
-
Assume an organic compound has a partition coefficient between water and ethyl acetate equal to 8.12. If there are initially 7.10 grams of the compound dissolved in 75.0 mL of water, how many grams...
-
Berger Paint Pakistan limited produces three types of joint products, S ilver paint, G olden paint and D iamond paint. During March, 2020, the following information was recorded : Particulars Silver...
-
Choose an industry in which you are interested in working. How is that industry trending? What internal and external factors may affect the direction of the organization? For your initial post,...
-
show all work and Computations and if favorable or unfavorable. Standard Cost Data per 1 Unit Quantity Price Direct Labor 2 hrs $4.00/hr Actual Data: Units produced 20 20 Direct Labor 30 hrs; total...
-
4. A petroleum company is considering the expansion of its one unloading facility at its Australian refinery. Due to random variations in weather, loading delays, and other factors, ships arriving at...
-
QUESTION 4 If you believe the value of a foreign currency will depreciate relative to your domestic currency, you can speculate by O selling a futures contract on that foreign currency. purchasing a...
-
Define cultural intelligence. Cite the books or journal articles you found in Capella's library. Explain why cultural intelligence is important for HR practitioners and other organizational managers.
-
How may intelligent systems change jobs?
-
What is the Turing Test and what are its limitations?
-
What is time series? What are the main forecasting techniques for time-series data?
-
E19.4. Z-Scoring (Easy) Below are ratios for some of the firms that have appeared in this book, for their 1998 fiscal year. Working Retained Capital Earnings Earnings before Interest and Taxes Market...
-
Fruit of the Loom Ltd. fared poorly from 1997 to 1999. Between April 1997 and October. 1999, its stock price dropped from $38 to $3, a 92 percent loss in market value. Fruit of the Loom manufactures...
-
CI9.9. What is a default strategy?
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App