Question: (a) (4 marks) Complete the subsequent Python code that does the following, in this order: 1. (1 mark) Use NLTK to split the text into

(a) (4 marks) Complete the subsequent Python code that does the following, in this order: 1. (1 mark) Use NLTK to split the text into sentences. 2. (1 mark) Use NLTK to split each sentence into words 3. (1 mark) Use NLTK to find the parts of speech of each word. 4. (1 mark) Use the counter Python package to find and print the most common part of speech. Your code does not need to convert the words to lowercase or uppercase. Do not use gutenberg.words() or gutenberg.sents() in your solution. import nltk emma = n1tk. corpus. gutenberg. raw('austen-emma. txt') # Use NLTK to split the text into sentences (1 mark) # Use NLTK to split each sentence into words (1 mark) # Use NLTK to find the parts of speech (1 mark) # Print the most frequent part of speech (1 mark)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
