pub struct Labels { /* private fields */ }Expand description
Labels definition
Implementations§
Source§impl Labels
Labels implementation
impl Labels
Labels implementation
Sourcepub fn with_url_token(url: &str, token: &str) -> Labels
pub fn with_url_token(url: &str, token: &str) -> Labels
Sourcepub async fn label(&self, text: &str, labels: &Vec<&str>) -> IndexResults
pub async fn label(&self, text: &str, labels: &Vec<&str>) -> IndexResults
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 textlabels- list of labels
Sourcepub async fn batchlabel(
&self,
texts: &Vec<&str>,
labels: &Vec<&str>,
) -> IndexResultsBatch
pub async fn batchlabel( &self, texts: &Vec<&str>, labels: &Vec<&str>, ) -> IndexResultsBatch
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 textslabels- list of labels
Auto Trait Implementations§
impl Freeze for Labels
impl RefUnwindSafe for Labels
impl Send for Labels
impl Sync for Labels
impl Unpin for Labels
impl UnsafeUnpin for Labels
impl UnwindSafe for Labels
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more