Upload try.py with huggingface_hub
Browse files
try.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from bertopic import BERTopic
|
| 2 |
+
topic_model = BERTopic.load("my_bertopic_model_HDBSCAN")
|
| 3 |
+
sentences = [
|
| 4 |
+
"My appointment is next week.",
|
| 5 |
+
"Doctor prescribed new medication."
|
| 6 |
+
]
|
| 7 |
+
|
| 8 |
+
topics, probs = topic_model.transform(sentences)
|
| 9 |
+
|
| 10 |
+
print("Topics:", topics)
|
| 11 |
+
print("Probs:", probs)
|