sfa_pool: Fetch or Build the Candidate Pool for a Naming Model

View source: R/pool.R

sfa_poolR Documentation

Fetch or Build the Candidate Pool for a Naming Model

Description

Returns the candidate pool used by sfa_name(): the pre-filtered word list (369,703 label-eligible terms with precomputed word-family and dictionary-membership columns) together with its embedding matrix under the given model. Pre-generated pools are downloaded once and cached; for models without a pre-generated pool the word list is embedded locally (slow without a GPU) and cached thereafter.

Usage

sfa_pool(
  model,
  precision = c("int8", "fp16"),
  download = interactive(),
  build = interactive(),
  dir = NULL
)

Arguments

model

Embedding model id (as used by the sbert backend).

precision

"int8" (default) or "fp16". int8 pools are half the download and reproduce the fp16 labels on all but 3 of 75 benchmark factors (each a weak factor relabeled with a near-synonym; the diff is listed in the package documentation). Use "fp16" for exact parity with the published research pipeline. Locally built pools are always fp16.

download

Permission to download missing artifacts. Defaults to interactive(); in non-interactive sessions pass TRUE explicitly (CRAN policy: no silent large downloads).

build

Permission to embed the word list locally when no pre-generated pool exists for model. Defaults to interactive().

dir

Cache directory override (mainly for tests).

Value

An object of class sfa_pool: a list with words (data.frame: word, family, tier1), emb (matrix-like, one row per word, memory-mapped when read from disk), dim, model, precision.


semanticfa documentation built on Sept. 2, 2026, 1:07 a.m.