Complete the code to tokenize the sentence into words.
words = sentence.[1]()The split() method breaks a sentence into words by spaces, which is the basic step in NLP called tokenization.
Complete the code to convert all words to lowercase for uniformity.
lower_words = [word.[1]() for word in words]
Using lower() converts all letters to lowercase, helping NLP models treat words like 'Apple' and 'apple' the same.
Fix the error in the code to remove punctuation from each word.
import string clean_words = [word.strip(string.[1]) for word in lower_words]
The string.punctuation constant contains all punctuation characters, which strip() removes from the start and end of each word.
Fill both blanks to create a dictionary counting word frequencies.
word_counts = {word: words.[1](word) for word in [2]Using count counts how many times each word appears. Using set gets unique words to avoid repeated counting.
Fill all three blanks to filter words longer than 3 letters and create a frequency dictionary.
filtered_counts = {word: words.[1](word) for word in [2] if len(word) [3] 3}This code counts words using count, iterates over unique words with set, and filters words longer than 3 letters using >.