![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
gensim
liuzard
刚毅木讷,近仁。
展开
-
主题模型Gensim入门系列之四:文本相似度查询
本文主要介绍如何从一个语料库中,查询一个指定文本的相似文本。1、创建语料创建语料和之前的三节相似,代码如下:from collections import defaultdictfrom gensim import corpora documents = [ "Human machine interface for lab abc computer applications", "A survey of user opinion of computer system re原创 2020-10-31 17:58:27 · 2478 阅读 · 0 评论 -
主题模型Gensim入门系列之三:主题和变换
本节主要介绍Gensim中从一个向量空间转换到另外一个向量空间的变换的概念,通过一个简单的语料加以说明,变换主要达到以下目的:(1)揭示语料的隐含结构,发现单词之间的联系,并用它们来更具语义地描述文档(2)使文档的描述更加紧凑,这种描述更加突出文档特征,同时更加高效。1、创建语料创建语料的方法和前两个部分的处理一样,即将原始文档进行分词,去除停止词、低频词和标点符号之后,得到每一个文档的单词列表。from collections import defaultdictfrom gens原创 2020-10-31 17:52:43 · 913 阅读 · 0 评论 -
主题模型Gensim入门系列之二:语料和向量空间
本文主要介绍将文档(Document)转换为向量空间,同时介绍语料流(corpus streaming) 和通过多种格式存储到磁盘。1、从字符串到向量首先,假设作为字符串,有如下语料:documents = [ "Human machine interface for lab abc computer applications", "A survey of user opinion of computer system response time", "The EPS原创 2020-10-31 17:45:48 · 847 阅读 · 0 评论