Applies the pooling strategy of the loaded model — attention-mask-aware mean pooling (the Sentence-BERT default) or CLS-token pooling (used by the BGE and mxbai families) — and optional row-wise L2 normalization.
Usage
pool(
token_embeddings,
attention_mask,
normalize = TRUE,
method = c("mean", "cls")
)