[][src]Enum rust_bert::pipelines::token_classification::LabelAggregationOption

pub enum LabelAggregationOption {
    First,
    Last,
    Mode,
    Custom(Box<fn(_: &[Token]) -> (i64, String)>),
}

Enum defining the label aggregation method for sub tokens

Defines the behaviour for labels aggregation if the consolidation of sub-tokens is enabled.

Variants

First

The label of the first sub token is assigned to the entire token

Last

The label of the last sub token is assigned to the entire token

Mode

The most frequent sub- token is assigned to the entire token

Custom(Box<fn(_: &[Token]) -> (i64, String)>)

The user can provide a function mapping a &Vec<Token> to a (i64, String) tuple corresponding to the label index, label String to return

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,