pub enum ZeroShotClassificationOption {
Bart(BartForSequenceClassification),
Deberta(DebertaForSequenceClassification),
DebertaV2(DebertaV2ForSequenceClassification),
Bert(BertForSequenceClassification),
DistilBert(DistilBertModelClassifier),
MobileBert(MobileBertForSequenceClassification),
Roberta(RobertaForSequenceClassification),
XLMRoberta(RobertaForSequenceClassification),
Albert(AlbertForSequenceClassification),
XLNet(XLNetForSequenceClassification),
Longformer(LongformerForSequenceClassification),
}
Expand description
§Abstraction that holds one particular zero shot classification model, for any of the supported models
The models are using a classification architecture that should be trained on Natural Language Inference. The models should output a Tensor of size > 2 in the label dimension, with the first logit corresponding to contradiction and the last logit corresponding to entailment.
Variants§
Bart(BartForSequenceClassification)
Bart for Sequence Classification
Deberta(DebertaForSequenceClassification)
DeBERTa for Sequence Classification
DebertaV2(DebertaV2ForSequenceClassification)
DeBERTaV2 for Sequence Classification
Bert(BertForSequenceClassification)
Bert for Sequence Classification
DistilBert(DistilBertModelClassifier)
DistilBert for Sequence Classification
MobileBert(MobileBertForSequenceClassification)
MobileBert for Sequence Classification
Roberta(RobertaForSequenceClassification)
Roberta for Sequence Classification
XLMRoberta(RobertaForSequenceClassification)
XLMRoberta for Sequence Classification
Albert(AlbertForSequenceClassification)
Albert for Sequence Classification
XLNet(XLNetForSequenceClassification)
XLNet for Sequence Classification
Longformer(LongformerForSequenceClassification)
Longformer for Sequence Classification
Implementations§
Source§impl ZeroShotClassificationOption
impl ZeroShotClassificationOption
Sourcepub fn new(config: &ZeroShotClassificationConfig) -> Result<Self, RustBertError>
pub fn new(config: &ZeroShotClassificationConfig) -> Result<Self, RustBertError>
Instantiate a new zer-shot classification model of the supplied type.
§Arguments
ZeroShotClassificationConfig
- Zero-shot 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 SequenceClassificationOption
Auto Trait Implementations§
impl Freeze for ZeroShotClassificationOption
impl RefUnwindSafe for ZeroShotClassificationOption
impl Send for ZeroShotClassificationOption
impl !Sync for ZeroShotClassificationOption
impl Unpin for ZeroShotClassificationOption
impl UnwindSafe for ZeroShotClassificationOption
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
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>
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>
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