BERTopic
BERTopic copied to clipboard
Create topic tree with custom labels
Hello, I am trying to print the topic tree to get a text based visualization of the hierarchy. Is there a way to replace the Parent_Name, Child_Left_Name, Child_Right_Name values form hierarchical_topics() with the CustomName's from the representation model?
That is currently not possible since the custom label is only created for the topics found during .fit
or .fit_transform
, not the topics found using .hierarchical_topics
. If there is enough interest, that can be included in a future release.
Ah ok, that certainly would be a feature of interest, at least to me! Right now I'm using llama2 for the topic representation model so it might be possible to feed this tree back into it and get it to generate labels for the parents as well. Thanks for the reply!
That is indeed a nice solution for now! Calculating multiple aspects might become tricky with multiple layers of hierarchy and methods of doing so but I'll make sure to definitely track this issue.
That is currently not possible since the custom label is only created for the topics found during
.fit
or.fit_transform
, not the topics found using.hierarchical_topics
. If there is enough interest, that can be included in a future release.
Definitely interested!
+1 from me!