【发布时间】:2019-05-28 13:49:27
【问题描述】:
我想将某些单词添加到 wordcloud 中使用的默认停用词列表中。当前代码:
all_text = " ".join(rev for rev in twitter_clean.text)
stop_words = ["https", "co", "RT"]
wordcloud = WordCloud(stopwords = stop_words, background_color="white").generate(all_text)
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()
当我使用自定义 stop_words 变量时,诸如“is”、“was”和“the”之类的词都被解释并显示为高频词。但是,当我使用默认停用词列表(没有停用词参数)时,还有许多其他词显示为非常频繁。如何将我的自定义 stop_words 变量与默认停用词列表一起添加到我的 wordcloud?
【问题讨论】:
标签: python matplotlib data-analysis stop-words word-cloud