小编Tay*_*ici的帖子

Wordcloud for only emojis

I have a text full of emojis.

import matplotlib.pyplot as plt
from wordcloud import WordCloud
wordcloud = WordCloud().generate(text)
plt.imshow(wordcloud)
plt.axis("off")
plt.show()
Run Code Online (Sandbox Code Playgroud)

when i try to get a wordcloud for those emojis like the code above, it returns an error like this:

ValueError: We need at least 1 word to plot a word cloud, got 0.
Run Code Online (Sandbox Code Playgroud)

I think the wordcloud library is unable to read emojis. I want to get an output like this(with emojis of course):

词云

Anyone knows how to …

python nlp matplotlib word-cloud

5
推荐指数
1
解决办法
1991
查看次数

标签 统计

matplotlib ×1

nlp ×1

python ×1

word-cloud ×1