From 42d563e5e9718a64ec3242e13e69f4aa11741bfb Mon Sep 17 00:00:00 2001 From: Roman S Samarev Date: Sat, 3 Feb 2024 14:41:37 -0800 Subject: [PATCH 1/2] lda.jl: fixed deprecated @showprogress with new form 'dt=wait_time' --- src/lda.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lda.jl b/src/lda.jl index cbdd55f1..33aa69bb 100644 --- a/src/lda.jl +++ b/src/lda.jl @@ -69,7 +69,7 @@ function lda(dtm::DocumentTermMatrix, ntopics::Int, iteration::Int, wait_time = showprogress ? 1.0 : Inf # Gibbs sampling - @showprogress wait_time for _ in 1:iteration + @showprogress dt=wait_time for _ in 1:iteration for doc in docs for (i, word) in enumerate(doc.text) topicid_current = doc.topic[i] From 2c35760dfe6b3287ce3018f710ff3a7582bff89e Mon Sep 17 00:00:00 2001 From: Roman S Samarev Date: Sat, 3 Feb 2024 14:55:19 -0800 Subject: [PATCH 2/2] lda.jl: fixed potential error index value --- src/lda.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lda.jl b/src/lda.jl index 33aa69bb..97c80253 100644 --- a/src/lda.jl +++ b/src/lda.jl @@ -89,7 +89,7 @@ function lda(dtm::DocumentTermMatrix, ntopics::Int, iteration::Int, # select new topic select = rand() sum_of_prob = 0.0 - new_topicid = 0 + new_topicid = 1 for (selected_topicid, prob) in enumerate(probs) sum_of_prob += prob / normalize_probs if select < sum_of_prob