这是 python 3.8 的 gensim hdp 模型的错误吗?
Is this a bug on gensim hdp model for python 3.8?
我想使用 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
您遇到了由 deprecation of clock
function of time
module. It has been deprecated since Python v. 3.3 and removed in v. 3.8 引起的问题。
要解决它,您有 2 个选择:
- 如果您没有最新版本,请尝试升级
gensim
。
- 尝试降级 Python。
我想使用 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
您遇到了由 deprecation of clock
function of time
module. It has been deprecated since Python v. 3.3 and removed in v. 3.8 引起的问题。
要解决它,您有 2 个选择:
- 如果您没有最新版本,请尝试升级
gensim
。 - 尝试降级 Python。