| Title: | Shiny Application for Topic Modeling of Scientific Literature |
|---|---|
| Description: | A 'shiny' application that guides users through an exploratory review of scientific literature using Latent Dirichlet Allocation (LDA) topic modeling. It imports bibliometric records exported from databases such as 'Scopus' and 'Web of Science', performs text preprocessing, helps select the number of topics, fits the final model, and visualizes the results and the evolution of topics over time. The methodology is described in De la Hoz-M et al. (2021) <doi:10.3390/math9141671>. |
| Authors: | Javier De La Hoz-M [aut, cre] (ORCID: <https://orcid.org/0000-0001-7779-0803>), Maria Camila Samper Meza [aut] (ORCID: <https://orcid.org/0009-0005-9235-8732>), Alexander Armando Bustamante MartÃnez [aut] (ORCID: <https://orcid.org/0000-0003-4422-018X>) |
| Maintainer: | Javier De La Hoz-M <[email protected]> |
| License: | GPL-3 |
| Version: | 1.1.0 |
| Built: | 2026-10-30 21:06:01 UTC |
| Source: | https://github.com/cran/LDAShiny |
About Server
mod_about_server(id)mod_about_server(id)
id |
Shiny module id |
Server logic for importing, validating and combining Scopus/WoS datasets.
mod_import_bibliometrics_server(id)mod_import_bibliometrics_server(id)
id |
Shiny module ID. |
A list containing: * 'data' - cleaned combined dataset
Shiny module UI for importing and validating bibliometric datasets (Scopus + Web of Science) in LDAShiny.
mod_import_bibliometrics_ui(id)mod_import_bibliometrics_ui(id)
id |
Shiny module ID. |
A Shiny UI element.
UI and server logic for LDA model selection. Runs multiple LDA models for a range of k and computes coherence to determine the optimal number of topics.
themes_gg mod_inference_ui(id) mod_inference_server(id, dtm_reactive)themes_gg mod_inference_ui(id) mod_inference_server(id, dtm_reactive)
id |
Shiny module id. |
dtm_reactive |
Reactive expression returning a dgCMatrix DTM. |
An object of class list of length 9.
A list with: * model_list : reactive list of fitted LDA models for each k * coherence_mat : reactive data.frame with columns k and coherence * k_optimal : reactive integer, best k (max coherence)
Trains the final LDA model using the processed DTM. The number of topics (K) is automatically initialized with the optimal K found in the inference module, but the user can manually modify it.
mod_lda_train_ui(id) mod_lda_train_server(id, dtm_reactive, k_optimal_reactive, bd_reactive)mod_lda_train_ui(id) mod_lda_train_server(id, dtm_reactive, k_optimal_reactive, bd_reactive)
id |
Shiny module id |
dtm_reactive |
Reactive expression returning the DTM (dgCMatrix) |
k_optimal_reactive |
Reactive expression returning the optimal K (integer) |
bd_reactive |
Reactive expression with the original metadata (Scopus/WoS) |
A list of reactive values containing the LDA model outputs.
Provides UI and server functions to clean, tokenize, stem, remove stopwords, build a document-term matrix (DTM), filter sparse terms, and export intermediate objects for topic modeling.
mod_preprocess_ui(id) mod_preprocess_server(id, data_reactive)mod_preprocess_ui(id) mod_preprocess_server(id, data_reactive)
id |
module id |
data_reactive |
reactive containing the input data frame |
Evaluates how robust the chosen K is by: 1. Training LDA with multiple random seeds for candidate K values and measuring coherence variability (stability). 2. Computing Adjusted Rand Index (ARI) between seed-pairs to quantify assignment reproducibility. 3. Testing whether the winning K changes under alternative weight schemes (sensitivity of the composite score).
mod_sensitivity_ui(id) mod_sensitivity_server( id, dtm_reactive, coherence_mat_reactive, k_optimal_reactive )mod_sensitivity_ui(id) mod_sensitivity_server( id, dtm_reactive, coherence_mat_reactive, k_optimal_reactive )
id |
Shiny module id |
dtm_reactive |
Reactive expression returning the DTM (dgCMatrix) |
coherence_mat_reactive |
Reactive returning data.frame(k, coherence) |
k_optimal_reactive |
Reactive returning the best K (integer) |
A list of reactive values containing stability and sensitivity results.
Performs linear regression analysis on topic intensity (Gamma mean) over years to classify topics as increasing (HOT), decreasing (COLD), or stable (EQUAL) trends.
mod_trend_ui(id) mod_trend_server(id, df_year_topic_reactive, lda_model_reactive)mod_trend_ui(id) mod_trend_server(id, df_year_topic_reactive, lda_model_reactive)
id |
Shiny module id |
df_year_topic_reactive |
Reactive expression returning the data frame with Topic, year, and Intensity (mean Gamma) from mod_lda_train. |
lda_model_reactive |
Reactive expression returning the final LDA model (passed for completeness, but not used for labels). |
Launches the LDAShiny Shiny application using the golem framework. The function temporarily raises the maximum upload size for the duration of the session and restores the previous value on exit.
run_LDAShiny(max_upload_mb = 2500, ...)run_LDAShiny(max_upload_mb = 2500, ...)
max_upload_mb |
Maximum file upload size in megabytes (default 500).
Passed to |
... |
Additional named options forwarded to
|
A Shiny app object (invisibly).
if (interactive()) { run_LDAShiny() }if (interactive()) { run_LDAShiny() }