Skip to main content

Module bgem3

Module bgem3 

Source
Expand description

BGE-M3 joint dense + sparse embedding (feature embedding-fastembed). BGE-M3 joint (dense + sparse) embedding.

One forward pass yields both a dense vector and a learned-lexical sparse vector. That is what makes hybrid retrieval cheap here: no second model and no separate BM25 index — the sparse side already carries the exact-term signal (identifiers, statute numbers, rare jargon) that dense vectors blur.

Structs§

Bgem3Provider
BGE-M3 joint embedder — dense + sparse from one pass.
JointEmbedding
One text’s dense + sparse representation from a single BGE-M3 pass.

Constants§

BGEM3_DENSE_DIM
Dense width of BGE-M3.
BGEM3_VOCAB_SIZE
Vocabulary size of BGE-M3’s XLM-RoBERTa tokenizer — the dimension a pgvector sparsevec column must declare for these sparse vectors.