extract_topics {LBDiscover}R Documentation

Apply topic modeling to a corpus

Description

This function implements a simple non-negative matrix factorization (NMF) approach to topic modeling, without requiring additional packages.

Usage

extract_topics(
  text_data,
  text_column = "abstract",
  n_topics = 5,
  max_terms = 10,
  n_iterations = 50,
  seed = NULL
)

Arguments

text_data

A data frame containing the text data

text_column

Name of the column containing the text

n_topics

Number of topics to extract

max_terms

Maximum number of terms per topic to return

n_iterations

Number of iterations for the NMF algorithm

seed

Optional seed for reproducibility. If NULL, no seed is set.

Value

A list containing topic-term and document-topic matrices


[Package LBDiscover version 0.1.0 Index]