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

Treemap visualization instead of hierarchical tree #2208

Open munt-create opened 1 week ago

munt-create commented 1 week ago

Feature request

Is there way to make a Treemap visualization instead of hierarchical tree provided in topic_model.visualize_hierarchy(hierarchical_topics=hierarchical_topics, custom_labels=True)

Motivation

Since I have almost 138 topics it is more readable to have that

Your contribution

I am currently having trouble finding the tree structure used in topic_model.visualize_hierarchy(hierarchical_topics=hierarchical_topics, custom_labels=True)

MaartenGr commented 1 week ago

Thank you for sharing this feature request. This is indeed currently not implemented but should be doable with plotlys treemap. Do note though that there is one difficulty, namely the extend to which you keep combining topics. Since this is a bottom-up approach and treemaps are top-bottom, they may be a bit misleading here.

Unfortunately, I can't take this on at the moment but I'll keep this open for others to see.