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

Blue bars change their width when topics aren't selected or when different topic is selected #105

Open
scherbakovdmitri opened this issue Mar 21, 2022 · 0 comments

Comments

@scherbakovdmitri
Copy link

Maybe I don't get how it works, but I am following the example in the package text2vec:

library(text2vec)
data("movie_review")
N = 500
tokens = word_tokenizer(tolower(movie_review$review[1:N]))
it = itoken(tokens, ids = movie_review$id[1:N])
v = create_vocabulary(it)
v = prune_vocabulary(v, term_count_min = 5, doc_proportion_max = 0.2)
dtm = create_dtm(it, vocab_vectorizer(v))
lda_model = LDA$new(n_topics = 10)
doc_topic_distr = lda_model$fit_transform(dtm, n_iter = 20)
# run LDAvis visualisation if needed (make sure LDAvis package installed)
lda_model$plot()

Notice how for the token "end" the bars are different (one crosses the tick , and the other - does not)
Screenshot 2022-03-22 at 01 41 57
Screenshot 2022-03-22 at 01 41 53

This becomes more obvious if you have few tokens in corpus, then the width changes considerably.
Any explanation to this? Thanks!

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