简体   繁体   中英

how to use dtm model/ wrappers dtm by mac?

I want to use wrappers.dtmmodel by Mac. 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:

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

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

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 .

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:
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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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