sfa_build_bank: Pre-Embed a Set of Texts into a Reusable Bank

View source: R/bank.R

sfa_build_bankR Documentation

Pre-Embed a Set of Texts into a Reusable Bank

Description

Embeds texts (typically: every scale item, every construct definition, and every planned narrowing of a study) under one encoder and stores the vectors keyed by the exact strings sfa_coverage() will pass to its embedder. Feed the result to audits via sfa_embedding_bank().

Usage

sfa_build_bank(
  texts,
  instruction = TRUE,
  embed = "sbert",
  model = NULL,
  cache = TRUE,
  file = NULL
)

Arguments

texts

Character vector of raw texts (items, definitions). Wrapped with instruction exactly as sfa_coverage() wraps them, so lookups match.

instruction

TRUE (the construct-retrieval instruction the regions use, default), FALSE, or a custom string. Must match the regions the bank will be used with.

embed, model, cache

As in sfa_embed().

file

Optional path to save the bank (.rds).

Value

An "sfa_bank": vectors, texts, instruction, encoder, timestamp.


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