pub enum TokenClassificationOption {
Bert(BertForTokenClassification),
Deberta(DebertaForTokenClassification),
DebertaV2(DebertaV2ForTokenClassification),
DistilBert(DistilBertForTokenClassification),
MobileBert(MobileBertForTokenClassification),
Roberta(RobertaForTokenClassification),
XLMRoberta(RobertaForTokenClassification),
Electra(ElectraForTokenClassification),
Albert(AlbertForTokenClassification),
XLNet(XLNetForTokenClassification),
Longformer(LongformerForTokenClassification),
FNet(FNetForTokenClassification),
}
Expand description
§Abstraction that holds one particular token sequence classifier model, for any of the supported models
Variants§
Bert(BertForTokenClassification)
Bert for Token Classification
Deberta(DebertaForTokenClassification)
DeBERTa for Token Classification
DebertaV2(DebertaV2ForTokenClassification)
DeBERTa V2 for Token Classification
DistilBert(DistilBertForTokenClassification)
DistilBert for Token Classification
MobileBert(MobileBertForTokenClassification)
MobileBert for Token Classification
Roberta(RobertaForTokenClassification)
Roberta for Token Classification
XLMRoberta(RobertaForTokenClassification)
XLM Roberta for Token Classification
Electra(ElectraForTokenClassification)
Electra for Token Classification
Albert(AlbertForTokenClassification)
Albert for Token Classification
XLNet(XLNetForTokenClassification)
XLNet for Token Classification
Longformer(LongformerForTokenClassification)
Longformer for Token Classification
FNet(FNetForTokenClassification)
FNet for Token Classification
Implementations§
Source§impl TokenClassificationOption
impl TokenClassificationOption
Sourcepub fn new(config: &TokenClassificationConfig) -> Result<Self, RustBertError>
pub fn new(config: &TokenClassificationConfig) -> Result<Self, RustBertError>
Instantiate a new sequence classification model of the supplied type.
§Arguments
TokenClassificationConfig
- Token classification pipeline configuration. The type of model created will be inferred from theModelResources
(Torch or ONNX) andModelType
(Architecture for Torch models) variants provided and
Sourcepub fn model_type(&self) -> ModelType
pub fn model_type(&self) -> ModelType
Returns the ModelType
for this TokenClassificationOption
Auto Trait Implementations§
impl Freeze for TokenClassificationOption
impl RefUnwindSafe for TokenClassificationOption
impl Send for TokenClassificationOption
impl !Sync for TokenClassificationOption
impl Unpin for TokenClassificationOption
impl UnwindSafe for TokenClassificationOption
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more