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

Function test_online_cv

tests/test_vectorizers/test_online_cv.py:16–26  ·  view source on GitHub ↗
(model, documents, request)

Source from the content-addressed store, hash-verified

14 ],
15)
16def test_online_cv(model, documents, request):
17 topic_model = copy.deepcopy(request.getfixturevalue(model))
18 vectorizer_model = OnlineCountVectorizer(stop_words="english", ngram_range=(2, 2))
19
20 topics = [topic_model.get_topic(topic) for topic in set(topic_model.topics_)]
21 topic_model.update_topics(documents, vectorizer_model=vectorizer_model)
22 new_topics = [topic_model.get_topic(topic) for topic in set(topic_model.topics_)]
23
24 for old_topic, new_topic in zip(topics, new_topics):
25 if old_topic[0][0] != "":
26 assert old_topic != new_topic
27
28
29@pytest.mark.parametrize("model", [("online_topic_model")])

Callers

nothing calls this directly

Calls 3

get_topicMethod · 0.80
update_topicsMethod · 0.80

Tested by

no test coverage detected