MaartenGr / MaartenGr/BERTopic

Custom labels for get_topic_tree

Open
#2,123 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
Python
Stars
7.8k
Forks
920
Avg merge
22h 24m
Merged PRs (30d)
5

Description

### Discussed in https://github.com/MaartenGr/BERTopic/discussions/2122

Originally posted by **clfkenny** August 17, 2024
Hi there, I noticed the `visualize_hierarchy` method has a `custom_labels` parameter. Is there anything similar to this for the `get_topic_tree` method? I use the LLM generated labels as the custom labels so the hierarchy tree is much easier to interpret. Thanks!

This seems like a good first issue for someone wanting to contribute to this repository. It has a very similar structure to the `visualize_hierarchy` functionality, so I believe it should be straightforward to implement. Unfortunately, I have a large backlog and cannot prioritize this, so if anyone wants to help out then that would be great!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the get_topic_tree method with visualize_hierarchy, especially how visualize_hierarchy handles its custom_labels parameter. Trace how labels are produced for the hierarchy tree, then add equivalent custom-label support to get_topic_tree. Done means callers can provide custom labels and receive a more interpretable hierarchy tree.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.