Use the code below to get started with the model. The model can be loaded with the zero-shot-classification pipeline like so:
from transformers import pipeline
classifier = pipeline('zero-shot-classification', model='roberta-large-mnli')
You can then use this pipeline to classify sequences into any of the class names you specify. For example:
sequence_to_classify = "one day I will see the world"
candidate_labels = ['travel', 'cooking', 'dancing']
classifier(sequence_to_classify, candidate_labels)
Uses
Direct Use
This fine-tuned model can be used for zero-shot classification tasks, including zero-shot sentence-pair classification (see the
GitHub repo
for examples) and zero-shot sequence classification.
Misuse and Out-of-scope Use
The model should not be used to intentionally create hostile or alienating environments for people. In addition, the model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.
Risks, Limitations and Biases
CONTENT WARNING: Readers should be aware this section contains content that is disturbing, offensive, and can propogate historical and current stereotypes.
Significant research has explored bias and fairness issues with language models (see, e.g.,
Sheng et al. (2021)
and
Bender et al. (2021)
). The
RoBERTa large model card
notes that: "The training data used for this model contains a lot of unfiltered content from the internet, which is far from neutral."
Predictions generated by the model can include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups. For example:
sequence_to_classify = "The CEO had a strong handshake."
candidate_labels = ['male', 'female']
hypothesis_template = "This text speaks about a {} profession."
classifier(sequence_to_classify, candidate_labels, hypothesis_template=hypothesis_template)
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
The texts are tokenized using a byte version of Byte-Pair Encoding (BPE) and a vocabulary size of 50,000. The inputs of
the model take pieces of 512 contiguous token that may span over documents. The beginning of a new document is marked
with
<s>
and the end of one by
</s>
The details of the masking procedure for each sentence are the following:
15% of the tokens are masked.
In 80% of the cases, the masked tokens are replaced by
<mask>
.
In 10% of the cases, the masked tokens are replaced by a random token (different) from the one they replace.
In the 10% remaining cases, the masked tokens are left as is.
Contrary to BERT, the masking is done dynamically during pretraining (e.g., it changes at each epoch and is not fixed).
The model was trained on 1024 V100 GPUs for 500K steps with a batch size of 8K and a sequence length of 512. The
optimizer used is Adam with a learning rate of 4e-4,
β
1
=
0.9
,
β
2
=
0.98
and
ϵ
=
1
e
−
6
, a weight decay of 0.01, learning rate warmup for 30,000 steps and linear decay of the learning
rate after.
The Multi-Genre Natural Language Inference Corpus
(Williams et al., 2018)
is a crowd-sourced collection of sentence pairs with textual entailment annotations. Given a premise sentence and a hypothesis sentence, the task is to predict whether the premise entails the hypothesis (entailment), contradicts the hypothesis (contradiction), or neither (neutral). The premise sentences are gathered from ten different sources, including transcribed speech, fiction, and government reports. We use the standard test set, for which we obtained private labels from the authors, and evaluate on both the matched (in-domain) and mismatched (cross-domain) sections. We also use and recommend the SNLI corpus
(Bowman et al., 2015)
as 550k examples of auxiliary training data.
See the
associated paper
for details on the modeling architecture, objective, compute infrastructure, and training details.
Citation Information
@article{liu2019roberta,
title = {RoBERTa: A Robustly Optimized BERT Pretraining Approach},
author = {Yinhan Liu and Myle Ott and Naman Goyal and Jingfei Du and
Mandar Joshi and Danqi Chen and Omer Levy and Mike Lewis and
Luke Zettlemoyer and Veselin Stoyanov},
journal={arXiv preprint arXiv:1907.11692},
year = {2019},
}
Runs of FacebookAI roberta-large-mnli on huggingface.co
277.9K
Total runs
0
24-hour runs
-14.7K
3-day runs
-28.3K
7-day runs
-9.2K
30-day runs
More Information About roberta-large-mnli huggingface.co Model
roberta-large-mnli huggingface.co is an AI model on huggingface.co that provides roberta-large-mnli's model effect (), which can be used instantly with this FacebookAI roberta-large-mnli model. huggingface.co supports a free trial of the roberta-large-mnli model, and also provides paid use of the roberta-large-mnli. Support call roberta-large-mnli model through api, including Node.js, Python, http.
roberta-large-mnli huggingface.co is an online trial and call api platform, which integrates roberta-large-mnli's modeling effects, including api services, and provides a free online trial of roberta-large-mnli, you can try roberta-large-mnli online for free by clicking the link below.
FacebookAI roberta-large-mnli online free url in huggingface.co:
roberta-large-mnli is an open source model from GitHub that offers a free installation service, and any user can find roberta-large-mnli on GitHub to install. At the same time, huggingface.co provides the effect of roberta-large-mnli install, users can directly use roberta-large-mnli installed effect in huggingface.co for debugging and trial. It also supports api for free installation.