MaartenGr / MaartenGr/BERTopic

Clusters changed for assigned text after reducing outliers

Open
#1,520 1 comment 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,

I was calling

topic_model = BERTopic()
topics, probs = topic_model.fit_transform(docs)
new_topics = topic_model.reduce_outliers(docs, topics)

to reduce outliers according this page. But I found some of the assigned clusters (before reducing outliers) of the text are changed to a different cluster after reducing outliers.

Shouldn't the already assigned clusters will not change after reducing outliers according to "You can pass outlier and non-outlier documents together since it will only try to reduce outlier documents and label them to a non-outlier topic."?

Is this an expected phenomenon due to that I misunderstand anywhere or there is something wrong inside it?

Thank you for helping me out!

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

Reproduce the reported sequence using BERTopic.fit_transform followed by reduce_outliers(docs, topics), then compare the original and returned topic assignments for non-outlier documents. Read the reduce_outliers behavior and the referenced documentation first; done means determining whether non-outlier labels change and providing a focused explanation or reproducible discrepancy for maintainers.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.