Пожалуйста, помогите мне со следующей ошибкой. Я много пытался это исправить, но без посторонней помощи. Код:
MALLET_PATH = './Mallet/bin/mallet'
def topic_model_coherence_generator(corpus, texts, dictionary, start_topic_count=2, end_topic_count=10, step=1,cpus=1):
models = []
coherence_scores = []
for topic_nums in tqdm(range(start_topic_count, end_topic_count + 1, step)):
mallet_lda_model = gensim.models.wrappers.LdaMallet(mallet_path=MALLET_PATH, corpus=corpus, num_topics=topic_nums, id2word=dictionary, iterations=500, workers=cpus)
cv_coherence_model_mallet_lda = gensim.models.CoherenceModel(model=mallet_lda_model, corpus=corpus, texts=texts, dictionary=dictionary, coherence='c_v')
coherence_score = cv_coherence_model_mallet_lda.get_coherence()
coherence_scores.append(coherence_score)
models.append(mallet_lda_model)
return models, coherence_scores
lda_models, coherence_scores = topic_model_coherence_generator(corpus=bow_corpus, texts=norm_corpus_bigrams, dictionary=dictionary, start_topic_count=2, end_topic_count=30, step=1, cpus=16)
Ошибка:
0%| | 0/29 [00:00<?, ?it/s]'.' is not recognized as an internal or external command,
operable program or batch file.
subprocess.CalledProcessError: Command './Mallet/bin/mallet import-file --preserve-case --keep-sequence --remove-stopwords --token-regex "\S+" --input C:\Users\yaiza\AppData\Local\Temp\b44add_corpus.txt --output C:\Users\yaiza\AppData\Local\Temp\b44add_corpus.mallet' returned non-zero exit status 1.
Если я напишу MALLET_PATH = 'C:/Program files/Mallet/bin/mallet'
или 'MALLET_PATH = 'rC:/Program files/Mallet/bin/mallet'
, вернуть ту же ошибку, но в первом предложении изменится на
0%| | 0/29 [00:00<?, ?it/s]'C:/Program files' is not recognized as an internal or external command,
operable program or batch file..
Спасибо