lm2445 commited on
Commit
b3eb8be
·
verified ·
1 Parent(s): c7d8939

Upload try.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. try.py +11 -0
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)