MaartenGr / BERTopic

Leveraging BERT and c-TF-IDF to create easily interpretable topics.
https://maartengr.github.io/BERTopic/
MIT License
6.19k stars 765 forks source link

Visualization doesn't show up on Jupyter Lab #2163

Closed liuzz10 closed 1 month ago

liuzz10 commented 1 month ago

Have you searched existing issues? 🔎

Desribe the bug

Screenshot 2024-10-02 at 5 58 25 PM

Hi, I'm using Jupyter Lab and am visualizing topics using the following code:

fig = topic_model_for_all.visualize_topics(top_n_topics=5)
fig.show()

But the figure doesn't show up somehow. Can you help? Thank you.

BERTopic Version

0.16.3

MaartenGr commented 1 month ago

I believe there is no need to do fig.show() as just running fig is sufficient for me. Have you tried that? If it does not work, then it might be worthwhile to do a quick search on jupyter lab with plotly since I do not think this is related directly to the code of BERTopic.

liuzz10 commented 1 month ago

I believe there is no need to do fig.show() as just running fig is sufficient for me. Have you tried that? If it does not work, then it might be worthwhile to do a quick search on jupyter lab with plotly since I do not think this is related directly to the code of BERTopic.

Thank you! It turns out that it is indeed a problem of jupyter lab with plotly but I haven't solved it yet.

liuzz10 commented 1 month ago

Using VScode to run jupyter and it works.