| hf_extract_topics | R Documentation |
Identify semantic topics by clustering embeddings and extracting representative keywords from each cluster.
hf_extract_topics(data, text_col = "text", k = 5, top_n = 10)
data |
A data frame with text and embeddings. |
text_col |
Character string. Name of text column. |
k |
Integer. Number of topics/clusters. Default: 5. |
top_n |
Integer. Number of top words per topic. Default: 10. |
A tibble with topics and their top terms.
## Not run:
library(tidytext)
# Extract topics
topics <- docs_embedded |>
hf_extract_topics(text_col = "text", k = 3, top_n = 5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.