Struct rust_bert::pipelines::sequence_classification::SequenceClassificationConfig [−][src]
pub struct SequenceClassificationConfig {
pub model_type: ModelType,
pub model_resource: Resource,
pub config_resource: Resource,
pub vocab_resource: Resource,
pub merges_resource: Option<Resource>,
pub lower_case: bool,
pub strip_accents: Option<bool>,
pub add_prefix_space: Option<bool>,
pub device: Device,
}Expand description
Configuration for SequenceClassificationModel
Contains information regarding the model to load and device to place the model on.
Fields
model_type: ModelTypeModel type
model_resource: ResourceModel weights resource (default: pretrained BERT model on CoNLL)
config_resource: ResourceConfig resource (default: pretrained BERT model on CoNLL)
vocab_resource: ResourceVocab resource (default: pretrained BERT model on CoNLL)
merges_resource: Option<Resource>Merges resource (default: None)
lower_case: boolAutomatically lower case all input upon tokenization (assumes a lower-cased model)
strip_accents: Option<bool>Flag indicating if the tokenizer should strip accents (normalization). Only used for BERT / ALBERT models
add_prefix_space: Option<bool>Flag indicating if the tokenizer should add a white space before each tokenized input (needed for some Roberta models)
device: DeviceDevice to place the model on (default: CUDA/GPU when available)
Implementations
Instantiate a new sequence classification configuration of the supplied type.
Arguments
model_type-ModelTypeindicating the model type to load (must match with the actual data to be loaded!)- model - The
Resourcepointing to the model to load (e.g. model.ot) - config - The `Resource’ pointing to the model configuration to load (e.g. config.json)
- vocab - The `Resource’ pointing to the tokenizer’s vocabulary to load (e.g. vocab.txt/vocab.json)
- vocab - An optional
Resourcetuple (Option<Resource>) pointing to the tokenizer’s merge file to load (e.g. merges.txt), needed only for Roberta. - lower_case - A `bool’ indicating whether the tokenizer should lower case all input (in case of a lower-cased model)
Trait Implementations
Provides a defaultSST-2 sentiment analysis model (English)
Auto Trait Implementations
impl Send for SequenceClassificationConfig
impl Sync for SequenceClassificationConfig
impl Unpin for SequenceClassificationConfig
impl UnwindSafe for SequenceClassificationConfig
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
