WordCloud停用词无法正常运行

时间:2019-07-18 05:51:55

标签: python nlp word-cloud

WordCloud的停用词不会阻止停用词出现在云中。这些单词在传递到stop_words对象的wc列表中,但是像'it'这样的停用词仍会出现在输出中:

'it' in wc.stopwords # -----> shows True

from wordcloud import WordCloud
wc = WordCloud(stopwords = stop_words, background_color="white", colormap="Dark2",
               max_font_size=150, random_state=42)


%%time
import matplotlib.pyplot as plt

plt.rcParams['figure.figsize'] = [18, 9]

names = names

for index, pres in enumerate(data.columns):
  wc.generate(data_clean.speech[pres])

  plt.subplot(3, 4, index+1)
  plt.imshow(wc, interpolation='bilinear')
  plt.title(names[index], color='white', size=16)
plt.show()

我希望在云中看不到“它”一词...

0 个答案:

没有答案