🚀 AraBERTv0.2-Twitter
AraBERTv0.2-Twitter是用於阿拉伯語方言和推文的兩個新模型。它們通過在約6000萬條阿拉伯語推文(從1億條推文中篩選而來)上繼續使用掩碼語言模型(MLM)任務進行預訓練而得到。
這兩個新模型在其詞彙表中添加了表情符號,以及一些最初未包含的常用詞彙。預訓練僅進行了1個輪次,且最大句子長度為64。
AraBERT 是一個基於 Google的BERT架構 的阿拉伯語預訓練語言模型。AraBERT使用與BERT-Base相同的配置。更多詳細信息可在 AraBERT論文 和 AraBERT Meetup 中找到。
📦 訓練數據集
- wikipedia
- Osian
- 1.5B-Arabic-Corpus
- oscar-arabic-unshuffled
- Assafir(私有)
- Twitter(私有)
📊 模型示例
{
"text": " عاصمة لبنان هي [MASK] ."
}
✨ 主要特性
- 專為阿拉伯語方言和推文設計,在相關任務上表現更優。
- 詞彙表中添加了表情符號和常用詞彙,增強了對多樣化文本的處理能力。
📦 其他模型
💻 使用示例
基礎用法
from arabert.preprocess import ArabertPreprocessor
from transformers import AutoTokenizer, AutoModelForMaskedLM
model_name="aubmindlab/bert-base-arabertv02-twitter"
arabert_prep = ArabertPreprocessor(model_name=model_name)
text = "ولن نبالغ إذا قلنا إن هاتف أو كمبيوتر المكتب في زمننا هذا ضروري"
arabert_prep.preprocess(text)
tokenizer = AutoTokenizer.from_pretrained("aubmindlab/bert-base-arabertv02-twitter")
model = AutoModelForMaskedLM.from_pretrained("aubmindlab/bert-base-arabertv02-twitter")
注意事項
⚠️ 重要提示
該模型是在序列長度為64的情況下進行訓練的,使用超過64的最大長度可能會導致性能下降。
💡 使用建議
建議在對任何數據集進行訓練/測試之前應用預處理函數。當使用“twitter”模型時,預處理器會保留表情符號並將其分隔開。
📖 引用格式
如果你使用了此模型,請按以下格式引用我們:
Google Scholar的Bibtex格式有誤(缺少名稱),請使用以下內容:
@inproceedings{antoun2020arabert,
title={AraBERT: Transformer-based Model for Arabic Language Understanding},
author={Antoun, Wissam and Baly, Fady and Hajj, Hazem},
booktitle={LREC 2020 Workshop Language Resources and Evaluation Conference 11--16 May 2020},
pages={9}
}
🙏 致謝
感謝TensorFlow研究雲(TFRC)提供免費的Cloud TPU訪問權限,沒有這個項目我們無法完成這項工作。感謝 AUB MIND實驗室 成員的持續支持。同時感謝 Yakshof 和Assafir提供數據和存儲訪問權限。還要感謝Habib Rahal(https://www.behance.net/rahalhabib)為AraBERT設計了形象。
📞 聯繫方式
Wissam Antoun:領英 | 推特 | Github | wfa07@mail.aub.edu | wissam.antoun@gmail.com
Fady Baly:領英 | 推特 | Github | fgb06@mail.aub.edu | baly.fady@gmail.com