This function implements a simple non-negative matrix factorization (NMF) approach to topic modeling, without requiring additional packages.
extract_topics(
text_data,
text_column = "abstract",
n_topics = 5,
max_terms = 10,
n_iterations = 50,
seed = NULL
)A list containing topic-term and document-topic matrices
A data frame containing the text data
Name of the column containing the text
Number of topics to extract
Maximum number of terms per topic to return
Number of iterations for the NMF algorithm
Optional seed for reproducibility. If NULL, no seed is set.