texts_tokenized = [[‘writing’, ‘ii’, ‘rhetorical’, ‘composing’, ‘rhetorical’, ‘composing’],[‘engages’, ‘series’, ‘interactive’, ‘reading’],[‘research’, ‘composing’, ‘activities’, ‘along’, ‘assignments’, ‘designed’, ‘help’]]#用多行代码对texts_tokenized去停用词
text_filtered_stopwords = [[word for word in document if not word in english_stopwords] for document in texts_tokenized]
text_filtered_stopwords
[[‘writing’, ‘ii’, ‘rhetorical’, ‘composing’, ‘rhetorical’, ‘composing’], [‘engages’, ‘series’, ‘interactive’, ‘reading’], [‘research’, ‘composing’, ‘activities’, ‘along’, ‘assignments’, ‘designed’, ‘help’]]

然后改成用多行的常规写法:


‘’’

texts_tokenized = [[‘writing’, ‘ii’, ‘rhetorical’, ‘composing’, ‘rhetorical’, ‘composing’],[‘engages’, ‘series’, ‘interactive’, ‘reading’],[‘research’, ‘composing’, ‘activities’, ‘along’, ‘assignments’, ‘designed’, ‘help’]]
documents = []
texts_filtered_stopwords =[]
for document in texts_tokenized:

for word in document:

if word not in english_stopwords: