Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please label variables and function clearly to make it easier to follow. sentiment - Notepad File Edit Format View Help # Data sourced from: #
Please label variables and function clearly to make it easier to follow.
sentiment - Notepad File Edit Format View Help # Data sourced from: # https://github.com/aesuli/sentiwordnet abandon -0.125 abandoned 0.5 abandonment -0.5 abasia -0.5 abatable 0.625 abatic -0.25 abaxially 0.25 abbe 0.125 - o x test_negative - Notepad File Edit Format View Help Kyoto - Japan's Nintendo Co. has suspended domestic shipments of its popular Nintendo Switch video game console due to a production delay caused by the Nintendo has yet to decide when to resume shipments. The company will continue Nintendo Switch shipments for customers who had placed orders and European and U.S. markets, where sufficient inventories are i test_neutral - Notepad File Edit Format View Help This is a known knockoff. test_positive - Notepad File Edit Format View Help The ESA/JAXA BepiColombo mission completed its first flyby on April 10, as the spacecraft came less than 12,700 km from Earth's surface at 06:25 CEST, st Launched in 2018, BepiColombo is on a seven-year journey to the smallest and innermost planet orbiting the Sun, which holds important clues about the for 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 Create a new function called score_sentence which takes in two arguments: a string representing a sentence, and a dictionary containing the scores. It should then take the unique words in the sentence and output a score for the sentence by summing the corresponding score from the dictionary for each word. If the word is not in the dictionary, the corresponding value should be 0. Example: my_sentence - "Welcome, welcome to my house!" scores {'welcome': 0.5, 'house': -0.25) final_score = score_sentence (my_sentence, scores) # Should output 0.25Step 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