MaartenGr / MaartenGr/BERTopic

Question on incremental training and a suggestion

Open
#1,429 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi, Thank you so much for creating such a cool and interactive and highly modular technique in Topic Modeling.

I have a question and a recommendation.

Regarding the question, I'm curious if there are any options for online training while still using HDBSCAN and UMAP. These methods offer powerful concepts for dimensionality reduction and hierarchical density-based clustering, and I would like to retain their benefits. Other methods tend to lack support for noise detection since they don't include a density component. I'm interested in your suggestions for online training that can preserve these outstanding components.

Additionally, I'd like to recommend using the following function to wrap the document text for hovertext:

def insert_newlines(text, every=20):
words = text.split()
lines = [' '.join(words[i:i+every]) for i in range(0, len(words), every)]
return '
'.join(lines)

By applying this function to selection["doc"], the document text can be made more readable with hovertext in document plots.
I've tested the function with every = 20, and it works effectively with documents of any length.

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 reviewing BERTopic's online-training options involving UMAP and HDBSCAN, then inspect the document-plot code where selection["doc"] is used for hovertext. The issue does not name files or tests. Done would require a decided approach for incremental training and clearer hovertext, with project tests or examples updated accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.