Enum rust_bert::pipelines::zero_shot_classification::ZeroShotClassificationOption [−][src]
pub enum ZeroShotClassificationOption {
Bart(BartForSequenceClassification),
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)
Tuple Fields
Bart for Sequence Classification
Bert(BertForSequenceClassification)
Tuple Fields
Bert for Sequence Classification
DistilBert(DistilBertModelClassifier)
Tuple Fields
DistilBert for Sequence Classification
MobileBert(MobileBertForSequenceClassification)
Tuple Fields
MobileBert for Sequence Classification
Roberta(RobertaForSequenceClassification)
Tuple Fields
Roberta for Sequence Classification
XLMRoberta(RobertaForSequenceClassification)
Tuple Fields
XLMRoberta for Sequence Classification
Albert(AlbertForSequenceClassification)
Tuple Fields
Albert for Sequence Classification
XLNet(XLNetForSequenceClassification)
Tuple Fields
XLNet for Sequence Classification
Longformer(LongformerForSequenceClassification)
Tuple Fields
Longformer for Sequence Classification
Implementations
pub fn new<'p, P>(
model_type: ModelType,
p: P,
config: &ConfigOption
) -> Result<Self, RustBertError> where
P: Borrow<Path<'p>>,
pub fn new<'p, P>(
model_type: ModelType,
p: P,
config: &ConfigOption
) -> Result<Self, RustBertError> where
P: Borrow<Path<'p>>,
Instantiate a new zero shot classification model of the supplied type.
Arguments
model_type-ModelTypeindicating the model type to load (must match with the actual data to be loaded)p-tch::nn::Pathpath to the model file to load (e.g. model.ot)config- A configuration (the model type of the configuration must be compatible with the value formodel_type)
Returns the ModelType for this SequenceClassificationOption
Auto Trait Implementations
impl Send for ZeroShotClassificationOption
impl !Sync for ZeroShotClassificationOption
impl Unpin for ZeroShotClassificationOption
impl UnwindSafe for ZeroShotClassificationOption
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
