![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
主题模型
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 评论 -
主题模型Gensim入门系列之一:核心概念
Gensim 有4个核心概念,分别为Document、Corpus、Vector、Model,因为是核心概念,这里沿用英文的解释,并尝试翻译:1、Document:some text. 文档:一些文本。2、Corpus:a collections of documents 语料:文档的集合3、Vector:a mathematically convenient representation of a document. 向量:文档的数值表达4、Model:an algo...原创 2020-10-31 17:34:50 · 1083 阅读 · 1 评论 -
主题模型Gensim入门系列
Gensim是一个开源的python工具包,主要实现自然语言的词向量模型和主题模型,可以实现词向量转换、文本相似性计算和文本分类等应用,其官网的简介为:topic modelling for humans。在该工具包中,实现了word2vec,fastext词向量模型,LSA和LDA主题模型等。Gensim的官网为:https://radimrehurek.com/gensim/index.htmlGensim的github地址为:https://github.com/RaRe-Te..原创 2020-10-31 17:27:41 · 354 阅读 · 0 评论