Я изо всех сил пытаюсь выяснить, как установить временные интервалы для динамических тематических моделей.Я использую gensims LdaSeqModel , для которого требуется целочисленный интервал времени.Любая помощь будет оценена.
ldaseq = LdaSeqModel(corpus=bow_corpus, time_slice=[], num_topics=15, chunksize=1)
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-5-e58059a7fb6f> in <module>
----> 1 ldaseq = LdaSeqModel(corpus=bow_corpus, time_slice=[], num_topics=15, chunksize=1)
~\AppData\Local\Continuum\anaconda3\lib\site-packages\gensim\models\ldaseqmodel.py in __init__(self, corpus, time_slice, id2word, alphas, num_topics, initialize, sstats, lda_model, obs_variance, chain_variance, passes, random_state, lda_inference_max_iter, em_min_iter, em_max_iter, chunksize)
186
187 # fit DTM
--> 188 self.fit_lda_seq(corpus, lda_inference_max_iter, em_min_iter, em_max_iter, chunksize)
189
190 def init_ldaseq_ss(self, topic_chain_variance, topic_obs_variance, alpha, init_suffstats):
~\AppData\Local\Continuum\anaconda3\lib\site-packages\gensim\models\ldaseqmodel.py in fit_lda_seq(self, corpus, lda_inference_max_iter, em_min_iter, em_max_iter, chunksize)
275 # seq model and find the evidence lower bound. This is the E - Step
276 bound, gammas = \
--> 277 self.lda_seq_infer(corpus, topic_suffstats, gammas, lhoods, iter_, lda_inference_max_iter, chunksize)
278 self.gammas = gammas
279
~\AppData\Local\Continuum\anaconda3\lib\site-packages\gensim\models\ldaseqmodel.py in lda_seq_infer(self, corpus, topic_suffstats, gammas, lhoods, iter_, lda_inference_max_iter, chunksize)
351 bound, gammas = self.inferDTMseq(
352 corpus, topic_suffstats, gammas, lhoods, lda,
--> 353 ldapost, iter_, bound, lda_inference_max_iter, chunksize
354 )
355 elif model == "DIM":
~\AppData\Local\Continuum\anaconda3\lib\site-packages\gensim\models\ldaseqmodel.py in inferDTMseq(self, corpus, topic_suffstats, gammas, lhoods, lda, ldapost, iter_, bound, lda_inference_max_iter, chunksize)
401 time = 0 # current time-slice
402 doc_num = 0 # doc-index in current time-slice
--> 403 lda = self.make_lda_seq_slice(lda, time) # create lda_seq slice
404
405 time_slice = np.cumsum(np.array(self.time_slice))
~\AppData\Local\Continuum\anaconda3\lib\site-packages\gensim\models\ldaseqmodel.py in make_lda_seq_slice(self, lda, time)
459 """
460 for k in range(self.num_topics):
--> 461 lda.topics[:, k] = self.topic_chains[k].e_log_prob[:, time]
462
463 lda.alpha = np.copy(self.alphas)
IndexError: index 0 is out of bounds for axis 1 with size 0