【发布时间】:2020-08-02 05:36:16
【问题描述】:
我想使用来自gensim 的 HDP 模型来获取我的语料库的主题数量,我已经使用这个语料库和字典来训练来自gensim 的常规 LDA 模型,它工作正常。但现在当我这样做时
hdp = models.HdpModel(bow_corpus, dictionary)
我明白了
Traceback (most recent call last):
File "models.py", line 185, in <module>
hdp = models.HdpModel(bow_corpus, dictionary)
File "/usr/lib/python3.8/site-packages/gensim/models/hdpmodel.py", line 391, in __init__
self.update(corpus)
File "/usr/lib/python3.8/site-packages/gensim/models/hdpmodel.py", line 467, in update
start_time = time.clock()
AttributeError: module 'time' has no attribute 'clock'
这是一个错误吗?
$ python --version
Python 3.8.2 (default, Feb 26 2020, 22:21:03)
编辑以添加更多系统信息
>>> print(gensim.__version__)
3.8.1
uname -a
Linux ** 5.5.9-arch1-2 #1 SMP PREEMPT Thu, 12 Mar 2020 23:01:33 +0000 x86_64 GNU/Linux
【问题讨论】:
-
如果您添加您使用的
gensim的版本和操作系统平台会有所帮助。
标签: python-3.x time gensim python-3.8