Enum rust_bert::pipelines::token_classification::LabelAggregationOption [−][src]
pub enum LabelAggregationOption {
First,
Last,
Mode,
Custom(Box<fn(_: &[Token]) -> (i64, String)>),
}Expand description
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
impl RefUnwindSafe for LabelAggregationOption
impl Send for LabelAggregationOption
impl Sync for LabelAggregationOption
impl Unpin for LabelAggregationOption
impl UnwindSafe for LabelAggregationOption
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = T
Should always be Self
