🚀 MacBERT
MacBERT 是一種改進版的 BERT 模型,通過引入新穎的 MLM as correction 預訓練任務,有效緩解了預訓練和微調之間的差異,為中文自然語言處理帶來了更優的解決方案。
🚀 快速開始
請使用與 'Bert' 相關的函數來加載此模型!
本倉庫包含了論文 《Revisiting Pre-trained Models for Chinese Natural Language Processing》 中的相關資源,該論文即將發表於 "Findings of EMNLP"。你可以通過 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] 標記進行掩碼不同([MASK] 標記在微調階段從未出現過),我們提出使用近義詞進行掩碼。近義詞通過 Synonyms 工具包 (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 as correction |
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",
}