Skip to content

Commit

Permalink
Merge pull request #281 from rssdev10/fix/showprogress
Browse files Browse the repository at this point in the history
Fix/showprogress
  • Loading branch information
rssdev10 authored Feb 7, 2024
2 parents e130003 + 2c35760 commit 3ec01c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lda.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down

0 comments on commit 3ec01c8

Please sign in to comment.