Skip to contents

Loads a designated pretrained model available in the `text2map.pretrained` package. For bundled models (e.g., STM models), uses `data()`. For downloaded models, automatically detects the file format and uses the appropriate loader function.

Usage

load_pretrained(model, location = NULL, quiet = FALSE)

Arguments

model

Character string indicating the model name to load.

location

Optional path to the model file. If NULL, looks in the package's data folder.

quiet

Logical (default `FALSE`) to suppress progress messages.

Value

The loaded model object (e.g., a matrix or list).

Note

The function loads models in the following format priority:

  1. .qs2 - Fastest loading (recommended, ~10x faster than .rda)

  2. .rda - Standard R format with best compression (~1x)