如何用Python的语料库创建词云? [英] How to create a word cloud from a corpus in Python?

查看:165
本文介绍了如何用Python的语料库创建词云?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

>从语料库中创建单词的子集在R 中,应答者可以轻松地将term-document matrix转换为词云.

From Creating a subset of words from a corpus in R, the answerer can easily convert a term-document matrix into a word cloud easily.

python库中是否存在类似的功能,可以将原始单词文本文件或NLTK语料库或Gensim Mmcorpus纳入词云?

Is there a similar function from python libraries that takes either a raw word textfile or NLTK corpus or Gensim Mmcorpus into a word cloud?

结果将看起来像这样:

The result will look somewhat like this:

推荐答案

以下是一个博客文章,内容如下:

Here's a blog post which does just that: http://peekaboo-vision.blogspot.com/2012/11/a-wordcloud-in-python.html

整个代码在这里: https://github.com/amueller/word_cloud

这篇关于如何用Python的语料库创建词云?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆