BIA660 – 4grams (Solution)

$ 24.99
Category:

Description

Available until Oct 3 at 3:40pm

This assignment was locked Oct 3 at 3:40pm.
Create script called getngrams.py.
Your script should define the following functions:
processSentence(sentence,posLex,negLex,tagger): The parameters of this function are a sentence (a string), a set positive words, a set of negative words, and a POS tagger. The function should return a list with all the 4-grams in the sentence that have the following structure:
not <any word> <pos/neg word> <noun>.
For example: not a good idea
———————————————————————————————
getTop3(D): The only parameter of this function is a dictionary D. All the values in the dictionary are integers.
The function returns a list of the keys with the 3 largest values in the dictionary.
Notes:
Don’t change the names or the parameters of any of the functions
Make sure that your script imports all the libraries needed by the two functions
https://sit.instructure.com/courses/20207/assignments/91518 1/1

Reviews

There are no reviews yet.

Be the first to review “BIA660 – 4grams (Solution)”

Your email address will not be published. Required fields are marked *