roberta-large
RoBERTa large是基于英文海量语料预训练的大模型底座,支持空缺文本补全,主要供各类英文自然语言处理下游任务微调使用。
13.2M次下载最近更新于 895 天前维护状态mit · 可评估商用商用提醒
在 Hugging Face 查看官方项目适合解决作为问答、生成和智能体应用的基础模型
更适合正在比较模型能力、成本与部署方式的团队
投入判断上手门槛:较高。需要评测真实业务数据与许可边界
一分钟看懂
AI 依据上游资料解读 · 2026/8/3这个项目值得继续研究吗?
RoBERTa large是基于英文海量语料预训练的大模型底座,支持空缺文本补全,主要供各类英文自然语言处理下游任务微调使用。
- 解决什么问题
- 企业开发英文文本分类、内容审核、智能问答等自然语言相关业务时,从零训练大模型存在成本高、周期长、需标注大量数据的痛点,该预训练底座可直接微调降低落地门槛。
- 适合什么团队
- 有英文自然语言处理业务需求,具备基础大模型微调能力,需要开发文本分类、智能问答、词法标注类应用的企业团队。
- 使用前注意
- 该模型仅支持英文、区分大小写,适合微调后用于分类、问答等场景,不适合文本生成类需求,采用MIT许可可自由商用。
本页用于缩短初步筛选时间,不构成技术、采购或法律结论。 正式使用前请在真实业务数据上验证,并以官方说明与许可证为准。
可核对的事实层
查看来源 →官方资料与来源
- transformers
- pytorch
- tf
- jax
- onnx
- safetensors
- roberta
- fill-mask
- exbert
- en
- endpoints_compatible
查看上游原始说明节选
任务类型:fill-mask
# RoBERTa large model
Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in
[this paper](https://arxiv.org/abs/1907.11692) and first released in
[this repository](https://github.com/pytorch/fairseq/tree/master/examples/roberta). This model is case-sensitive: it
makes a difference between english and English.
Disclaimer: The team releasing RoBERTa did not write a model card for this model so this model card has been written by
the Hugging Face team.
## Model description
RoBERTa is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means
it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of
publicly available data) with an automatic process to generate inputs and labels from those texts.
More precisely, it was pretrained with the Masked language modeling (MLM) objective. Taking a sentence, the model
randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict
the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one
after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to
learn a bidirectional representation of the sentence.
This way, the model learns an inner representation of the English language that can then be used to extract features
useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard
classifier using the features produced by the BERT model as inputs.
## Intended uses & limitations
You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task.
See the [model hub](https://huggingface.co/models?filter=roberta) to look for fine-tuned versions on a task that
interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
to make decisions, such as sequence classification, token classification or question answering. For tasks such as text
generation you should look at model like GPT2.
### How to use
You can use this model directly with a pipeline for masked language modeling:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='roberta-large')
>>> unmasker("Hello I'm a <mask> model.")
[{'sequence': "<s>Hello I'm a male model.</s>",
'score': 0.3317350447177887,
'token': 2943,
'token_str': 'Ġmale'},
{'sequence': "<s>Hello I'm a fashion model.</s>",
'score': 0.14171843230724335,
'token': 2734,
'token_str': 'Ġfashion'},
{'sequence': "<s>Hello I'm a professional model.</s>",
'score': 0.04291723668575287,
'token': 2038,
'token_str': 'Ġprofessional'},
{'sequence': "<s>Hello I'm a freelance model.</s>",
'score': 0.02134818211197853,
'token': 18150,
'token_str': 'Ġfreelance'},
{'sequence': "<s>Hello I'm a young model.</s>",
'score': 0.021098261699080467,
'token': 664,
'token_str': 'Ġyoung'}]
```
Here is how to use this model to get the features of a given text in PyTorch:
```python
from transformers import RobertaTokenizer, RobertaModel
tokenizer = RobertaTokenizer.from_pretrained('roberta-large')
model = RobertaModel.from_pretrained('roberta-large')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
```
and in TensorFlow:
```python
from transformers import RobertaTokenizer, TFRobertaModel
tokenizer = RobertaTokenizer.from_pretrained('roberta-large')
model = TFRobertaModel.from_pretrained('roberta-large')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
```
### Limitations and bias
Th上游文档较长,此处为节选。完整内容见官方项目。