Joint Laboratory of HIT and iFLYTEK Research (HFL)
commited on
Commit
·
0aeac08
1
Parent(s):
a925d74
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- zh
|
| 4 |
+
tags:
|
| 5 |
+
- bert
|
| 6 |
+
license: "apache-2.0"
|
| 7 |
+
---
|
| 8 |
+
<p align="center">
|
| 9 |
+
<br>
|
| 10 |
+
<img src="./pics/banner.png" width="500"/>
|
| 11 |
+
<br>
|
| 12 |
+
</p>
|
| 13 |
+
<p align="center">
|
| 14 |
+
<a href="https://github.com/ymcui/MacBERT/blob/master/LICENSE">
|
| 15 |
+
<img alt="GitHub" src="https://img.shields.io/github/license/ymcui/MacBERT.svg?color=blue&style=flat-square">
|
| 16 |
+
</a>
|
| 17 |
+
</p>
|
| 18 |
+
|
| 19 |
+
# Please use 'Bert' related functions to load this model!
|
| 20 |
+
|
| 21 |
+
This repository contains the resources in our paper **"Revisiting Pre-trained Models for Chinese Natural Language Processing"**, which will be published in "[Findings of EMNLP](https://2020.emnlp.org)". You can read our camera-ready paper through [ACL Anthology](#) or [arXiv pre-print](https://arxiv.org/abs/2004.13922).
|
| 22 |
+
|
| 23 |
+
**[Revisiting Pre-trained Models for Chinese Natural Language Processing](https://arxiv.org/abs/2004.13922)**
|
| 24 |
+
*Yiming Cui, Wanxiang Che, Ting Liu, Bing Qin, Shijin Wang, Guoping Hu*
|
| 25 |
+
|
| 26 |
+
You may also interested in,
|
| 27 |
+
- Chinese BERT series: https://github.com/ymcui/Chinese-BERT-wwm
|
| 28 |
+
- Chinese ELECTRA: https://github.com/ymcui/Chinese-ELECTRA
|
| 29 |
+
- Chinese XLNet: https://github.com/ymcui/Chinese-XLNet
|
| 30 |
+
- Knowledge Distillation Toolkit - TextBrewer: https://github.com/airaria/TextBrewer
|
| 31 |
+
|
| 32 |
+
More resources by HFL: https://github.com/ymcui/HFL-Anthology
|
| 33 |
+
|
| 34 |
+
## Introduction
|
| 35 |
+
**MacBERT** is an improved BERT with novel **M**LM **a**s **c**orrection pre-training task, which mitigates the discrepancy of pre-training and fine-tuning.
|
| 36 |
+
|
| 37 |
+
Instead of masking with [MASK] token, which never appears in the fine-tuning stage, **we propose to use similar words for the masking purpose**. A similar word is obtained by using [Synonyms toolkit (Wang and Hu, 2017)](https://github.com/chatopera/Synonyms), which is based on word2vec (Mikolov et al., 2013) similarity calculations. If an N-gram is selected to mask, we will find similar words individually. In rare cases, when there is no similar word, we will degrade to use random word replacement.
|
| 38 |
+
|
| 39 |
+
Here is an example of our pre-training task.
|
| 40 |
+
| | Example |
|
| 41 |
+
| -------------- | ----------------- |
|
| 42 |
+
| **Original Sentence** | we use a language model to predict the probability of the next word. |
|
| 43 |
+
| **MLM** | we use a language [M] to [M] ##di ##ct the pro [M] ##bility of the next word . |
|
| 44 |
+
| **Whole word masking** | we use a language [M] to [M] [M] [M] the [M] [M] [M] of the next word . |
|
| 45 |
+
| **N-gram masking** | we use a [M] [M] to [M] [M] [M] the [M] [M] [M] [M] [M] next word . |
|
| 46 |
+
| **MLM as correction** | we use a text system to ca ##lc ##ulate the po ##si ##bility of the next word . |
|
| 47 |
+
|
| 48 |
+
Except for the new pre-training task, we also incorporate the following techniques.
|
| 49 |
+
|
| 50 |
+
- Whole Word Masking (WWM)
|
| 51 |
+
- N-gram masking
|
| 52 |
+
- Sentence-Order Prediction (SOP)
|
| 53 |
+
|
| 54 |
+
**Note that our MacBERT can be directly replaced with the original BERT as there is no differences in the main neural architecture.**
|
| 55 |
+
|
| 56 |
+
For more technical details, please check our paper: [Revisiting Pre-trained Models for Chinese Natural Language Processing](https://arxiv.org/abs/2004.13922)
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
## Citation
|
| 60 |
+
If you find our resource or paper is useful, please consider including the following citation in your paper.
|
| 61 |
+
- https://arxiv.org/abs/2004.13922
|
| 62 |
+
```
|
| 63 |
+
@inproceedings{cui-etal-2020-revisiting,
|
| 64 |
+
title = "Revisiting Pre-Trained Models for {C}hinese Natural Language Processing",
|
| 65 |
+
author = "Cui, Yiming and
|
| 66 |
+
Che, Wanxiang and
|
| 67 |
+
Liu, Ting and
|
| 68 |
+
Qin, Bing and
|
| 69 |
+
Wang, Shijin and
|
| 70 |
+
Hu, Guoping",
|
| 71 |
+
booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings",
|
| 72 |
+
month = nov,
|
| 73 |
+
year = "2020",
|
| 74 |
+
address = "Online",
|
| 75 |
+
publisher = "Association for Computational Linguistics",
|
| 76 |
+
url = "https://www.aclweb.org/anthology/2020.findings-emnlp.58",
|
| 77 |
+
pages = "657--668",
|
| 78 |
+
}
|
| 79 |
+
```
|