Struct txtai::labels::Labels[][src]

pub struct Labels { /* fields omitted */ }
Expand description

Labels definition

Implementations

Labels implementation

Creates a Labels instance.

Arguments
  • url - base url of txtai API

Applies a zero shot classifier to text using a list of labels. Returns a list of {id: value, score: value} sorted by highest score, where id is the index in labels.

Arguments
  • text - input text
  • labels - list of labels

Applies a zero shot classifier to list of text using a list of labels. Returns a list of {id: value, score: value} sorted by highest score, where id is the index in labels per text element.

Arguments
  • texts - list of texts
  • labels - list of labels

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more