Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTM k=1 exit program and not show any messages #212

Open
Indigo-Coder-github opened this issue Nov 20, 2023 · 0 comments
Open

DTM k=1 exit program and not show any messages #212

Indigo-Coder-github opened this issue Nov 20, 2023 · 0 comments

Comments

@Indigo-Coder-github
Copy link

#데이터 준비, 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant