如何通过mac使用dtm模型/包装器dtm?

2024-09-28 23:36:33 发布

您现在位置:Python中文网/ 问答频道 /正文

我想通过Mac使用wrappers.dtmmodel。对于Mac,我需要为操作系统版本unterladenhttps://github.com/magsilva/dtm/tree/master/bin使用预编译的二进制文件 但是我下载了dtm-darwin64,并尝试运行代码,错误显示:

dtm_path must point to the binary file, not to a folder

我能做些什么来处理这个问题

守则:


from gensim.models.wrappers.dtmmodel import DtmModel

from gensim.corpora import Dictionary, bleicorpus

dtm_path = "/Users/123/Desktop/dtm-darwin64"

dtm_model = DtmModel(dtm_path, corpus, time_slice, num_topics=3, id2word=dictionary, initialize_lda=True)

错误是:

ValueError: dtm_path must point to the binary file, not to a folder

谢谢


Tags: thetopathmac错误notfolderfile
2条回答

要加载特定模型,您应该提供单个文件的路径,而不是像使用dtm_path那样提供文件夹

只需选择文件夹中的一个文件,并提供文件的完整路径

首先从以下位置下载操作系统的预编译二进制文件:https://github.com/magsilva/dtm/tree/master/bin 然后在代码中输入方向,例如:
dtm_path='C:/Users/Windows T3N.6/Desktop/dtm-win64.exe'
请确保“.exe”对于识别这是一个二进制文件很重要

相关问题 更多 >