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

Function test_no_plotly

tests/test_other.py:31–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29
30
31def test_no_plotly():
32 model = BERTopic(
33 language="Dutch",
34 embedding_model=None,
35 min_topic_size=2,
36 top_n_words=1,
37 umap_model=BaseDimensionalityReduction(),
38 )
39 model.fit(["hello", "hi", "goodbye", "goodbye", "whats up"] * 10)
40
41 try:
42 out = model.visualize_topics()
43 assert isinstance(out, Figure) if Figure else False
44 except ImportError as e:
45 assert "Plotly is required to use" in str(e)

Callers

nothing calls this directly

Calls 4

fitMethod · 0.95
visualize_topicsMethod · 0.95
BERTopicClass · 0.90

Tested by

no test coverage detected