MaartenGr / MaartenGr/BERTopic

Hyperparameter Tuning

Open
#1,642 15 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

Hello, I am preparing a research paper, and I've come across a somewhat tricky issue.

During hyperparameter optimization, I've identified four hyperparameters: min_topic_size, nr_topics, min_cluster_size, and min_samples, all of which potentially influence the determination of the number of topics. I'm wondering if these four hyperparameters have any priorities, meaning that if one is set at a certain value, the others will be ignored.

If my understanding is correct, it seems that HDBSCAN runs first, and topics are generated within each cluster. If so, what role does min_topic_size play? Is it used to filter out topics if the number of documents within a cluster is insufficient?

Another issue I'm encountering is related to outliers. Is there any way to handle or avoid outliers? It appears that outliers are not clustered. Consequently, in hyperparameter optimization, comparing BERTopic with other methods might not be fair as the number of documents could vary significantly due to the presence of outliers.

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

The issue names min_topic_size, nr_topics, min_cluster_size, and min_samples, but no files, tests, or entry points. First establish how these parameters interact and how outliers are handled; done would require a decided explanation or documented behavior addressing the questions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.