Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The program need to print top 25 frequently words in the file and top 5 negative words and positive words in the file. Better use

The program need to print top 25 frequently words in the file and top 5 negative words and positive words in the file. Better use the second picture for example. Thank you.
image text in transcribed
image text in transcribed
For this assignment, you'll determine whether teacher reviews are positive or negative, using real reviews from Rate my Professor Modify this wordfrea.Rye program to evaluate whether a particular review is positive, negative, or neutral. Your modified program should: exclude stop words from your word counts, using the the below list (and any you'd like to add) a, an, and, as, at, be,but, etc, for, if, in, it,its, is,of,or, so, such, the, this, to, with print the remaining top 25 words, along with their frequency, calculate the frequency of positive and negative words in the reviews, and print the 5 most frequent words in each category Use these positiveand negative words (in files folder of Canvas). Note use this code to read each file into a list of words: negliords-open('negative-words.txt','r', encoding-.utf-8", poswords-open('positive-words . txt','r', encoding-utf-8", errors-'ignore').reado.splitlines[35 ] errors-'ignore').reado.splitlines[35:] calculate and display a sentiment score, where the score is incremented (+1) for each positive word in the review and decremented (-1) for each negative word Hints Use these real-life teacher reviews Each source file should be saved into the same directory as your progam, be sure you understand the original wordFreq.py program before making changes, refer back to class notes on Lists for ways to check if a word is a stop word, 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_2

Step: 3

blur-text-image_3

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

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions

Question

How many gibibytes is 0.32 Tib? show work

Answered: 1 week ago

Question

How does selection differ from recruitment ?

Answered: 1 week ago