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