Open tmthyjames opened 6 years ago
In pyLDAvis.gensim, replacing line 42
gamma, _ = topic_model.inference(corpus)
with
doc2author = atmodel.construct_doc2author(topic_model.corpus, topic_model.author2doc)
gamma, _ = topic_model.inference(topic_model.corpus, topic_model.author2doc, doc2author, 0)
seems to work.
Integrating the new Author/Document tags into the data structure is the next step.
Will submit a PR when finished.
Thank you for your code. I tested suggested change and it works adding the following import code line
import gensim.models.atmodel as atmodel
doc2author = atmodel.construct_doc2author(topic_model.corpus, topic_model.author2doc)
gamma, _ = topic_model.inference(topic_model.corpus, topic_model.author2doc, doc2author, 0)
I am facing this same issue and would like to try the solution described by @clopezno and @tmthyjames but I am not sure how to modify the pyLDAvis.gensim code. Specifically, it appears to be the extract_data function I need to alter to work with my author-topic model. Here is my error code:
TypeError Traceback (most recent call last)
@menyalas Add the lines mentioned in my PR #161 or wait until my PR is merged
waiting on the conflict resolution for PR #161 before can make the merge.
Currently when I try to run LDAviz on gensim's AuthorTopic mode I get the following error