% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/topic_modeling.R
\name{extract_topic_terms_df}
\alias{extract_topic_terms_df}
\title{Build a topic-term data frame from any supported topic model}
\usage{
extract_topic_terms_df(model, n = 7)
}
\arguments{
\item{model}{A topic model object (STM fit or embedding result).}

\item{n}{Number of top terms per topic (default 7).}
}
\value{
\code{data.frame(topic, term, beta)} in long format.
}
\description{
Unified helper that produces the long-format \code{data.frame(topic, term, beta)}
expected by \code{\link[=generate_topic_labels]{generate_topic_labels()}} from an STM model or an embedding result.
Dispatches on the object's structure:
\itemize{
\item STM model (has \verb{$beta$logbeta} and \verb{$vocab}) -> top terms via \code{\link[stm:labelTopics]{stm::labelTopics()}} FREX
\item Embedding result (has \verb{$topic_keywords}) -> c-TF-IDF keywords with rank-derived pseudo-beta
}
}
\concept{topic-modeling}
