BERTopic icon indicating copy to clipboard operation
BERTopic copied to clipboard

topic_model.visualize_topics() get d1 d2 coordinates

Open studentdave opened this issue 4 years ago • 2 comments

is there a way to get the coordinates of d1 and d2 explicitly? i've written a hack to get out the d1 d2 dimensions, but it doesn't always work (e.g. not all coordinates are given sometimes, e.g. 0_topic is sometimes missing)

fig_dict = fig.to_dict() d1_x = fig_dict['data'][0]['x'] d2_y = fig_dict['data'][0]['y']

studentdave avatar Jun 02 '22 16:06 studentdave

I believe that the coordinates should work if you install BERTopic from the main branch. The missing topic 0 is due to an issue that is fixed within that branch and simply upgrading it to the latest commit should solve that issue.

MaartenGr avatar Jun 02 '22 19:06 MaartenGr

ah ok. i'm just running pip install. i'll review

studentdave avatar Jun 03 '22 08:06 studentdave