Question: Please label variables and functions clearly to make it easier to follow Before you begin Make a new project for this lab Create sentiment.py Grab

Please label variables and functions clearly to make it easier to follow

Please label variables and functions clearly to make it easier to followBefore you begin Make a new project for this lab Create sentiment.pyGrab the four text files available on Canvas: sentiment.txt A file with

Before you begin Make a new project for this lab Create sentiment.py Grab the four text files available on Canvas: sentiment.txt A file with a bunch of words and their positivity score test-positive.txt - A file which should be evaluated as positive test-negative.txt - A file which should be evaluated as negative test-neutral.txt - A file which should be evaluated as neutral Look up the following string functions: split, join, strip String functions page in Python - Types page in Python - Dealing with punctuation and white space . Go through the command line and systems arguments page - [2 points) get_words returns the correct set of words * - [1 points) get_words return has punctuation stripped from it. - [1 points) get_words returns lowercase. Write a function called get_words which takes in a single argument, a string representing a sentence. It should return an iterable of the unique words in the string. Words must be lowercase and contain at least 1 alphanumeric character (i.e. the empty string is not a word). Words should have all punctuation characters stripped. A punctuation character is any one defined by punctuation in Python's string module. Punctuation should be completely removed (i.e. not replaced by spaces). Note that because of this, you may get some "words which don't look like English words; this is OK. You may assume that the sentence contains only a mix of alphanumeric characters, spaces, tabs, and newlines as defined by string-punctuation. Hint: Python has a built-in data structure for unique sets of words, which you may find useful. Example: my_sentence - "Grocery list: 3 boxes Land-o-Lakes butter, Aunt Jemima's butter pancake mix" words = get_words (my_sentence) # Should output something like: ['grocery', 'list', '3', 'boxes', 'Landolakes', 'butter', 'aunt', 'jemimas # Can be any appropriate iterable, notice butter only appears onces * Indicates that the autograder will tell you if this problem is correct on our set of test cases and assign you credit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!