Learn R Programming

textpress (version 1.1.0)

util_fetch_embeddings: Fetch embeddings (Hugging Face utility)

Description

Fetch embeddings (Hugging Face utility)

Usage

util_fetch_embeddings(
  corpus,
  by,
  api_token,
  api_url = "https://router.huggingface.co/hf-inference/models/BAAI/bge-small-en-v1.5"
)

Value

A numeric matrix with row names derived from by.

Arguments

corpus

A data frame or data.table with a text column.

by

Character vector of column names that identify each text unit.

api_token

Your Hugging Face API token.

api_url

The inference endpoint URL.