View Source TxtaiEx.Labels (txtai_ex v0.1.1)
txtai labels instance for interfacing with a remote txtai service via REST API calls, providing functionality for applying zero-shot classification to text.
Summary
Functions
Applies zero-shot classification in batch mode to a list of texts using a provided list of labels.
Applies zero-shot classification to a given text using a provided list of labels.
Functions
Applies zero-shot classification in batch mode to a list of texts using a provided list of labels.
Parameters
- api: The API struct containing configuration for URL and token.
- texts: A list of texts to classify.
- labels: A list of labels for classification.
Returns
- on success, where
batch_classifications
contains a list of classification results for each text. - on failure.
Applies zero-shot classification to a given text using a provided list of labels.
Parameters
- api: The API struct containing configuration for URL and token.
- text: The text to classify.
- labels: A list of labels for classification.
Returns
- on success, where
classifications
is a list of maps with keysid
andscore
, sorted by highest score. - on failure.