🚀 MacBERT
MacBERT是一個改進版的BERT模型,通過引入新穎的預訓練任務,有效緩解了預訓練和微調之間的差異問題。本項目包含了相關論文的資源,為中文自然語言處理提供了更強大的預訓練模型。
🚀 快速開始
請使用與 'Bert' 相關的函數來加載此模型!
本倉庫包含了我們發表在 "Findings of EMNLP" 上的論文 "Revisiting Pre-trained Models for Chinese Natural Language Processing" 的相關資源。你可以通過 ACL Anthology 或 arXiv預印本 閱讀我們的終稿論文。
Revisiting Pre-trained Models for Chinese Natural Language Processing
Yiming Cui, Wanxiang Che, Ting Liu, Bing Qin, Shijin Wang, Guoping Hu
你可能還對以下項目感興趣:
- 中文BERT系列: https://github.com/ymcui/Chinese-BERT-wwm
- 中文ELECTRA: https://github.com/ymcui/Chinese-ELECTRA
- 中文XLNet: https://github.com/ymcui/Chinese-XLNet
- 知識蒸餾工具包 - TextBrewer: https://github.com/airaria/TextBrewer
更多由HFL提供的資源:https://github.com/ymcui/HFL-Anthology
✨ 主要特性
MacBERT 是一種改進的BERT模型,具有新穎的 MLM as correction 預訓練任務,可緩解預訓練和微調之間的差異。
與使用在微調階段從未出現過的 [MASK] 標記進行掩碼不同,我們建議使用相似的詞進行掩碼。相似詞是通過 同義詞工具包 (Wang and Hu, 2017) 獲取的,該工具包基於word2vec (Mikolov et al., 2013) 相似度計算。如果選擇對一個N-gram進行掩碼,我們將分別查找相似的詞。在極少數情況下,當沒有相似詞時,我們將退而使用隨機詞替換。
以下是我們預訓練任務的一個示例:
|
示例 |
原始句子 |
we use a language model to predict the probability of the next word. |
MLM |
we use a language [M] to [M] ##di ##ct the pro [M] ##bility of the next word . |
全詞掩碼 |
we use a language [M] to [M] [M] [M] the [M] [M] [M] of the next word . |
N-gram掩碼 |
we use a [M] [M] to [M] [M] [M] the [M] [M] [M] [M] [M] next word . |
MLM作為校正 |
we use a text system to ca ##lc ##ulate the po ##si ##bility of the next word . |
除了新的預訓練任務,我們還結合了以下技術:
- 全詞掩碼 (WWM)
- N-gram掩碼
- 句子順序預測 (SOP)
請注意,由於我們的MacBERT在主要神經網絡架構上與原始BERT沒有差異,因此可以直接替換原始BERT。
有關更多技術細節,請查看我們的論文:Revisiting Pre-trained Models for Chinese Natural Language Processing
📄 許可證
本項目採用 Apache-2.0 許可證。
📚 詳細文檔
引用
如果您發現我們的資源或論文有用,請考慮在您的論文中包含以下引用:
- https://arxiv.org/abs/2004.13922
@inproceedings{cui-etal-2020-revisiting,
title = "Revisiting Pre-Trained Models for {C}hinese Natural Language Processing",
author = "Cui, Yiming and
Che, Wanxiang and
Liu, Ting and
Qin, Bing and
Wang, Shijin and
Hu, Guoping",
booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings",
month = nov,
year = "2020",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://www.aclweb.org/anthology/2020.findings-emnlp.58",
pages = "657--668",
}