mirror of
https://github.com/guillaume-be/rust-bert.git
synced 2024-09-11 12:55:34 +03:00
Update Zero-shot classification docs to fix formatting errors
This commit is contained in:
parent
3dd173da97
commit
f8b7bea3dd
18
src/lib.rs
18
src/lib.rs
@ -360,15 +360,15 @@
|
||||
//! # use rust_bert::pipelines::zero_shot_classification::ZeroShotClassificationModel;
|
||||
//! # fn main() -> anyhow::Result<()> {
|
||||
//! let sequence_classification_model = ZeroShotClassificationModel::new(Default::default())?;
|
||||
//! let input_sentence = "Who are you voting for in 2020?";
|
||||
//! let input_sequence_2 = "The prime minister has announced a stimulus package which was widely criticized by the opposition.";
|
||||
//! let candidate_labels = &["politics", "public health", "economics", "sports"];
|
||||
//! let output = sequence_classification_model.predict_multilabel(
|
||||
//! &[input_sentence, input_sequence_2],
|
||||
//! candidate_labels,
|
||||
//! None,
|
||||
//! 128,
|
||||
//! );
|
||||
//! let input_sentence = "Who are you voting for in 2020?";
|
||||
//! let input_sequence_2 = "The prime minister has announced a stimulus package which was widely criticized by the opposition.";
|
||||
//! let candidate_labels = &["politics", "public health", "economics", "sports"];
|
||||
//! let output = sequence_classification_model.predict_multilabel(
|
||||
//! &[input_sentence, input_sequence_2],
|
||||
//! candidate_labels,
|
||||
//! None,
|
||||
//! 128,
|
||||
//! );
|
||||
//! # Ok(())
|
||||
//! # }
|
||||
//! ```
|
||||
|
@ -20,7 +20,7 @@
|
||||
//! use rust_bert::pipelines::common::ModelType;
|
||||
//! use rust_bert::pipelines::masked_language::{MaskedLanguageConfig, MaskedLanguageModel};
|
||||
//! use rust_bert::resources::RemoteResource;
|
||||
//!
|
||||
//!
|
||||
//! fn main() -> anyhow::Result<()> {
|
||||
//! use rust_bert::pipelines::common::ModelResource;
|
||||
//! let config = MaskedLanguageConfig::new(
|
||||
|
@ -205,15 +205,15 @@
|
||||
//! # use rust_bert::pipelines::zero_shot_classification::ZeroShotClassificationModel;
|
||||
//! # fn main() -> anyhow::Result<()> {
|
||||
//! let sequence_classification_model = ZeroShotClassificationModel::new(Default::default())?;
|
||||
//! let input_sentence = "Who are you voting for in 2020?";
|
||||
//! let input_sequence_2 = "The prime minister has announced a stimulus package which was widely criticized by the opposition.";
|
||||
//! let candidate_labels = &["politics", "public health", "economics", "sports"];
|
||||
//! let output = sequence_classification_model.predict_multilabel(
|
||||
//! &[input_sentence, input_sequence_2],
|
||||
//! candidate_labels,
|
||||
//! None,
|
||||
//! 128,
|
||||
//! );
|
||||
//! let input_sentence = "Who are you voting for in 2020?";
|
||||
//! let input_sequence_2 = "The prime minister has announced a stimulus package which was widely criticized by the opposition.";
|
||||
//! let candidate_labels = &["politics", "public health", "economics", "sports"];
|
||||
//! let output = sequence_classification_model.predict_multilabel(
|
||||
//! &[input_sentence, input_sequence_2],
|
||||
//! candidate_labels,
|
||||
//! None,
|
||||
//! 128,
|
||||
//! );
|
||||
//! # Ok(())
|
||||
//! # }
|
||||
//! ```
|
||||
|
@ -25,15 +25,15 @@
|
||||
//! # use rust_bert::pipelines::zero_shot_classification::ZeroShotClassificationModel;
|
||||
//! # fn main() -> anyhow::Result<()> {
|
||||
//! let sequence_classification_model = ZeroShotClassificationModel::new(Default::default())?;
|
||||
//! let input_sentence = "Who are you voting for in 2020?";
|
||||
//! let input_sequence_2 = "The prime minister has announced a stimulus package which was widely criticized by the opposition.";
|
||||
//! let candidate_labels = &["politics", "public health", "economics", "sports"];
|
||||
//! let output = sequence_classification_model.predict_multilabel(
|
||||
//! &[input_sentence, input_sequence_2],
|
||||
//! candidate_labels,
|
||||
//! None,
|
||||
//! 128,
|
||||
//! );
|
||||
//! let input_sentence = "Who are you voting for in 2020?";
|
||||
//! let input_sequence_2 = "The prime minister has announced a stimulus package which was widely criticized by the opposition.";
|
||||
//! let candidate_labels = &["politics", "public health", "economics", "sports"];
|
||||
//! let output = sequence_classification_model.predict_multilabel(
|
||||
//! &[input_sentence, input_sequence_2],
|
||||
//! candidate_labels,
|
||||
//! None,
|
||||
//! 128,
|
||||
//! );
|
||||
//! # Ok(())
|
||||
//! # }
|
||||
//! ```
|
||||
|
Loading…
Reference in New Issue
Block a user