File size: 1,754 Bytes
b575c59
e80be70
 
 
b575c59
e80be70
 
 
 
 
 
 
 
b575c59
e80be70
 
 
 
 
5ba2fc5
e80be70
 
 
 
 
 
5ba2fc5
e80be70
 
 
 
 
 
79e2e4f
e80be70
 
 
 
 
 
 
 
 
 
 
 
 
 
5ba2fc5
ed71ed6
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
language: 
  - zh

license: mit

tags:
  - RoBERTa

inference: true

widget:
- text: "生活的真谛是[MASK]。"
---

# autohome-roberta-base

## 简介 Brief Introduction

善于处理NLU任务,采用全词掩码的,中文版的1.1亿参数RoBERTa-base。


## 模型分类 Model Taxonomy

|  需求 Demand  | 任务 Task       | 系列 Series      | 模型 Model    | 参数 Parameter | 额外 Extra |
|  :----:  | :----:  | :----:  | :----:  | :----:  | :----:  |
| 通用 General  | 自然语言理解 NLU | RoBERTa | RoBERTa |      110M      |    中文 Chinese     |


## 模型信息 Model Information

参考论文:[RoBERTa: A Robustly Optimized BERT Pretraining Approach](https://arxiv.org/abs/1907.11692)

为了得到一个中文版的autohome-roberta-base(110M),我们用autohome口碑板块语料库(1.2G)进行二次预训练。模型初始化参数采用hfl/chinese-bert-wwm-ext的参数进行初始化,我们在MLM中使用了全词掩码(wwm)的方式。具体地,我们在预训练阶段中使用了[transformers框架](https://github.com/huggingface/transformers)大概花费了4张A100约4小时。


## 使用 Usage

```python
from transformers import AutoModelForMaskedLM, AutoTokenizer, FillMaskPipeline
import torch

tokenizer=AutoTokenizer.from_pretrained('ChaosW/autohome-roberta-base')
model=AutoModelForMaskedLM.from_pretrained('ChaosW/autohome-roberta-base')
text = '生活的真谛是[MASK]。'
fillmask_pipe = FillMaskPipeline(model, tokenizer, device=0)
print(fillmask_pipe(text, top_k=10))
```
## 参考 Reference
本readme参考 https://huggingface.co/IDEA-CCNL/Erlangshen-DeBERTa-v2-97M-Chinese

## 下一步计划 Feature Work
下一步将推出基于汽车论坛数据的定制化预训练模型