Я пытаюсь выполнить приведенную ниже команду
import os
os.environ.update({'MALLET_HOME':r'C:/Users/N-Workstation/Desktop/mallet-2.0.8/'})
mallet_path = 'C:\\Users\\N-Workstation\\Desktop\\mallet-2.0.8\\bin\\mallet' # update this path
ldamallet = gensim.models.wrappers.LdaMallet(mallet_path, corpus=corpus, num_topics=3, id2word=id2word)
Я пробовал различные способы изменения пути, но все еще получаю следующую ошибку:
CalledProcessError Traceback (most recent call last)
<ipython-input-66-25177da4755d> in <module>
5
6 mallet_path = 'C:\\Users\\N-Workstation\\Desktop\\mallet-2.0.8\\bin\\mallet' # update this path
----> 7 ldamallet = gensim.models.wrappers.LdaMallet(mallet_path, corpus=corpus, num_topics=3, id2word=id2word)
C:\ProgramData\Anaconda3\lib\site-packages\gensim\models\wrappers\ldamallet.py in __init__(self, mallet_path, corpus, num_topics, alpha, id2word, workers, prefix, optimize_interval, iterations, topic_threshold, random_seed)
129 self.random_seed = random_seed
130 if corpus is not None:
--> 131 self.train(corpus)
132
133 def finferencer(self):
C:\ProgramData\Anaconda3\lib\site-packages\gensim\models\wrappers\ldamallet.py in train(self, corpus)
270
271 """
--> 272 self.convert_input(corpus, infer=False)
273 cmd = self.mallet_path + ' train-topics --input %s --num-topics %s --alpha %s --optimize-interval %s '\
274 '--num-threads %s --output-state %s --output-doc-topics %s --output-topic-keys %s '\
C:\ProgramData\Anaconda3\lib\site-packages\gensim\models\wrappers\ldamallet.py in convert_input(self, corpus, infer, serialize_corpus)
259 cmd = cmd % (self.fcorpustxt(), self.fcorpusmallet())
260 logger.info("converting temporary corpus to MALLET format with %s", cmd)
--> 261 check_output(args=cmd, shell=True)
262
263 def train(self, corpus):
C:\ProgramData\Anaconda3\lib\site-packages\gensim\utils.py in check_output(stdout, *popenargs, **kwargs)
1916 error = subprocess.CalledProcessError(retcode, cmd)
1917 error.output = output
-> 1918 raise error
1919 return output
1920 except KeyboardInterrupt:
CalledProcessError: Command 'C:\Users\N-Workstation\Desktop\mallet-2.0.8\bin\mallet import-file --preserve-case --keep-sequence --remove-stopwords --token-regex "\S+" --input C:\Users\N-WORK~1\AppData\Local\Temp\f5956b_corpus.txt --output C:\Users\N-WORK~1\AppData\Local\Temp\f5956b_corpus.mallet' returned non-zero exit status 1.
Может кто-нибудь помочь мне с эта ошибка?
Спасибо, Naseer