简体   繁体   English

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

[英]how to use dtm model/ wrappers dtm by mac?

I want to use wrappers.dtmmodel by Mac.我想通过 Mac 使用wrappers.dtmmodel For Mac I need to use pre-compiled binaries for OS version unterladen https://github.com/magsilva/dtm/tree/master/bin but wenn I download the dtm-darwin64 , and try to run the code, the error shows:对于 Mac,我需要为操作系统版本 unterladen https://github.com/magsilva/dtm/tree/master/bin使用预编译的二进制文件,但是我下载了dtm-darwin64并尝试运行代码,错误显示:

dtm_path must point to the binary file, not to a folder dtm_path 必须指向二进制文件,而不是文件夹

What can I do to deal with this problem?我能做些什么来处理这个问题?

the code:编码:


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)

And the error is:错误是:

ValueError: dtm_path must point to the binary file, not to a folder ValueError:dtm_path 必须指向二进制文件,而不是文件夹

thanks谢谢

To load a particular model you are supposed to provide a path to an individual file instead of a folder as you did with dtm_path .要加载特定的 model 您应该提供单个文件的路径,而不是像使用dtm_path那样提供文件夹。

Just pick one of the files in the folder, and provide the full path to a file.只需选择文件夹中的一个文件,并提供文件的完整路径。

First download pre-compiled binaries for your os from: https://github.com/magsilva/dtm/tree/master/bin Then put the direction in your code for example:首先从以下位置为您的操作系统下载预编译的二进制文件: https://github.com/magsilva/dtm/tree/master/bin然后将方向放入您的代码中,例如:
dtm_path = 'C:/Users/Windows T3N.6/Desktop/dtm-win64.exe' dtm_path = 'C:/Users/Windows T3N.6/Desktop/dtm-win64.exe'
please be sure that '.exe ' is important for identifying this is a binary file请确保“.exe”对于识别这是一个二进制文件很重要

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM