| 57 | |
| 58 | @pytest.fixture(scope="session") |
| 59 | def 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") |