From a095e58e6ea46ed45e7a62b0db92c5743b474dd8 Mon Sep 17 00:00:00 2001 From: Renee Ti Chou <28791315+RTChou@users.noreply.github.com> Date: Wed, 7 Aug 2024 05:29:11 -0400 Subject: [PATCH] Fix #2036 (#2115) --- bertopic/_bertopic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bertopic/_bertopic.py b/bertopic/_bertopic.py index 0c732338..3cac30ce 100644 --- a/bertopic/_bertopic.py +++ b/bertopic/_bertopic.py @@ -3955,7 +3955,7 @@ def _guided_topic_modeling(self, embeddings: np.ndarray) -> Tuple[List[int], np. # embedding of the seeded topic to force the documents in a cluster for seed_topic in range(len(seed_topic_list)): indices = [index for index, topic in enumerate(y) if topic == seed_topic] - embeddings[indices] = np.average([embeddings[indices], seed_topic_embeddings[seed_topic]], weights=[3, 1]) + embeddings[indices] = embeddings[indices] * 0.75 + seed_topic_embeddings[seed_topic] * 0.25 logger.info("Guided - Completed \u2713") return y, embeddings