-
-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
#데이터 준비, vocab 준비 및 전처리
df = list()
with open("result/mecab_lda_corpus.csv", mode="r", encoding="UTF-8") as f:
df = f.readlines()
df = [i.rstrip() for i in df]
df = list(reversed(df))
time_point_list = [387,693,991]
#DTM 모델
model = tp.DTModel(k=1, t=3, alpha_var=5.56, eta_var=0.1)
for cnt, line in enumerate(df):
for time_point, accumulate_value in enumerate(time_point_list):
if cnt < accumulate_value:
model.add_doc(line.split(), timepoint=time_point)
break
#model training 및 로그우도 그래프와 summary
loglikelihood_list = list()
for _ in range(10000):
model.train(1, workers=4)
loglikelihood_list.append(model.ll_per_word)
sns.lineplot(loglikelihood_list)
plt.title("Convergence Graph of Log-Likelihood per Word by Iterating DTM Model")
plt.show()
print(model.summary())
I tested above code but it was breaked. The initial value of K is 1 and it's also possible in official documentation. But at model.train()
, the code was exit without any messages. I also tested it on LDAModel and it worked. Is there a bug in DTM on k=1?
Metadata
Metadata
Assignees
Labels
No labels