Generation

generate functionMon, 27 Mar 2023

This code removes stopwords in lists incorrectly: without_sw = [[word for word in text if word not in stopwords_set] for text in only_words_text] It turns out like this: [[g], [u, n, l], [j, u, r, n, g], [p, n, ] It should be like this: [go, until, jurong, point Correct it.

stopwords_set = set(stopwords.words('english')) only_words_text = [[word for word in word_tokenize(text.lower()) if word not in stopwords_set] for text in df_message["text"]]

Questions about programming?Chat with your personal AI assistant