MCPcopy
hub / github.com/MaartenGr/BERTopic / _is_zeroshot

Method _is_zeroshot

bertopic/_bertopic.py:4068–4076  ·  view source on GitHub ↗

Check whether zero-shot topic modeling is possible. * Embedding model is necessary to convert zero-shot topics to embeddings * Zero-shot topics should be defined

(self)

Source from the content-addressed store, hash-verified

4066 return documents, embeddings, assigned_documents, assigned_embeddings
4067
4068 def _is_zeroshot(self):
4069 """Check whether zero-shot topic modeling is possible.
4070
4071 * Embedding model is necessary to convert zero-shot topics to embeddings
4072 * Zero-shot topics should be defined
4073 """
4074 if self.zeroshot_topic_list is not None and self.embedding_model is not None:
4075 return True
4076 return False
4077
4078 def _combine_zeroshot_topics(
4079 self,

Callers 4

topic_labels_Method · 0.95
fit_transformMethod · 0.95
test_full_modelFunction · 0.80
add_mappingsMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_full_modelFunction · 0.64