MCPcopy Index your code
hub / github.com/MaartenGr/BERTopic / zeroshot_topic_model

Function zeroshot_topic_model

tests/conftest.py:59–70  ·  view source on GitHub ↗
(documents, document_embeddings, embedding_model)

Source from the content-addressed store, hash-verified

57
58@pytest.fixture(scope="session")
59def zeroshot_topic_model(documents, document_embeddings, embedding_model):
60 zeroshot_topic_list = ["religion", "cars", "electronics"]
61 model = BERTopic(
62 embedding_model=embedding_model,
63 calculate_probabilities=True,
64 zeroshot_topic_list=zeroshot_topic_list,
65 zeroshot_min_similarity=0.3,
66 )
67 model.umap_model.random_state = 42
68 model.hdbscan_model.min_cluster_size = 2
69 model.fit(documents, document_embeddings)
70 return model
71
72
73@pytest.fixture(scope="session")

Callers

nothing calls this directly

Calls 2

fitMethod · 0.95
BERTopicClass · 0.90

Tested by

no test coverage detected