推文词云
本练习的任务是用一组 Twitter 数据绘制词云,展示客户对航空公司的情感。已经为您创建了字符串 text_tweet,其中包含了 1000 位客户在 Twitter 上分享的消息。
第一步,请在不去除停用词的情况下生成词云;第二步,再在去除停用词后生成相同的词云进行对比。
您可以先浏览并熟悉 text_tweet 列表。
本练习是课程的一部分
Python 中的情感分析
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Import the word cloud function
from ____ import ____
# Create and generate a word cloud image
my_cloud = ____(background_color='white').____(text_tweet)
# Display the generated wordcloud image
plt.imshow(my_cloud, interpolation='bilinear')
plt.axis("off")
# Don't forget to show the final image
plt.show()