📅  最后修改于: 2022-03-11 14:45:05.503000             🧑  作者: Mango
from nltk.corpus import stopwords
stop_words = stopwords.words('english')
sentence = [('the', 2112), ('and', 1914), ('to', 1505), ('of', 1086), ('a', 986), ('you', 912),
('in', 754), ('with', 549), ('is', 536), ('for', 473), ('it', 461), ('book', 427),
('how', 368), ('that', 347), ('as', 304), ('on', 301), ('this', 290), ('java', 289),
('s', 267), ('your', 263), ('applications', 248), ('web', 231), ('can', 219),
('new', 218), ('an', 206), ('are', 197), ('will', 187), ('from', 185), ('use', 185), ('ll', 183),
('development', 182), ('code', 180), ('by', 177), ('programming', 172), ('application', 170), ('or', 169),
('action', 163), ('developers', 150), ('features', 141), ('examples', 139), ('learn', 135), ('using', 132),
('be', 132), ('data', 131), ('more', 118), ('like', 115), ('build', 110), ('into', 109), ('net', 106), ('language', 105)]
sentence = [(word, count) for word, count in sentence if word not in stop_words]
print sentence