MaartenGr / BERTopic

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

How to calculate topic correlation in topic modeling? #1462

Open zhimin-z opened 1 year ago

zhimin-z commented 1 year ago

We know that for any single post, it is possible to calculate the probability distribution, but can we do the same thing on topics? That is, how to calculate the topic correlation after modeling? @MaartenGr

MaartenGr commented 1 year ago

Just to make sure if I understand correctly, do you mean the relationship between topics? If so, then you can use cosine similarity between the topic embeddings to see how they relate to one another. You can find something similar in .visualize_heatmap().