Question: So the task is to fulfill the POS_tag (sentence) method. I got stuck with tokenisation and the steps onward. pip3 install nltk You may also

 So the task is to fulfill the POS_tag (sentence) method. I

So the task is to fulfill the POS_tag (sentence) method.

I got stuck with tokenisation and the steps onward.

pip3 install nltk You may also need to download some extra data: >>> import nltk >>> nltk.download ('stopwords') >>> nltk.download ('punkt') >>> nltk.download ('averaged_perceptron_tagger') Implement the POS_tag (sentence) function which takes in a string and return the Part-of-Speech(POS) tag of each word in the sentence. To complete this task, you need to fulfill the requirements shown below: 1) Convert all the characters in the sentence to lower case. 2) Tokenize the sentence. 3) Remove the stop words and punctuation. 4) Conduct the pos tagging and return a list of tuples. Here is a test case: >>> import nltk >>> sentence = 'The Force will be with you. Always.' >>> POS_tag(sentence) [('force', 'NN'), ('always', 'RB')]

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!