Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This week, you'll apply your knowledge of data collections for sentiment analysis, a common technique applied to movie, product, and business reviews, as well as

This week, you'll apply your knowledge of data collections for sentiment analysis, a common technique applied to movie, product, and business reviews, as well as social media posts.

For this assignment, you'll determine whether movie reviews are positive or negative.

Modify the wordfreq.py program described in the textbook (available here - http://mcsp.wartburg.edu/zelle/python/ppics2/code/chapter11/ (Links to an external site.) ) to evaluate whether a particular review is positive, negative, or neutral.

You can use these collections of positiveimage text in transcribedimage text in transcribed and negativeimage text in transcribedimage text in transcribed words. Note the file contain comments and encoding that you'll need to accommodate by reading in like this:

negWords = open('negative-words.txt','r', encoding='utf-8', errors='ignore').read().splitlines()[35:] 

Your modified program should:

exclude 'stop' words from your word counts, using the the below list;

a, an, and, as, at, be, but, etc, for, in, it, its, is, of, or, so, such, the, this, to, with

print the remaining top 25 words, along with their frequency,

print the top 5 positive and top 5 negative words, along with their frequency,

calculate and display a sentiment score for the review, where the score is incremented (+1) for each positive word in the review and decremented (-1) for each negative word,

Hint

- You can use this sample movie reviewimage text in transcribedimage text in transcribed to test your program

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions