Download try.py from lm2445/PPCBERTopic: direct link, hf CLI and curl.
- Browser
- Download file 278 Bytes
-
https://huggingface.co/lm2445/PPCBERTopic/resolve/main/try.py
- Command line
-
hf download hf://lm2445/PPCBERTopic/try.py
-
curl -L -o try.py https://huggingface.co/lm2445/PPCBERTopic/resolve/main/try.py
278 Bytes
| from bertopic import BERTopic | |
| topic_model = BERTopic.load("my_bertopic_model_HDBSCAN") | |
| sentences = [ | |
| "My appointment is next week.", | |
| "Doctor prescribed new medication." | |
| ] | |
| topics, probs = topic_model.transform(sentences) | |
| print("Topics:", topics) | |
| print("Probs:", probs) | |