🚀 羅馬尼亞語無大小寫區分基礎版BERT模型 v1
這是一個針對羅馬尼亞語的BERT 基礎、無大小寫區分 模型,在15GB的語料庫上進行訓練,版本為
。該模型能夠為羅馬尼亞語的自然語言處理任務提供強大的支持,例如文本分類、命名實體識別等。
🚀 快速開始
模型使用
from transformers import AutoTokenizer, AutoModel
import torch
tokenizer = AutoTokenizer.from_pretrained("dumitrescustefan/bert-base-romanian-uncased-v1", do_lower_case=True)
model = AutoModel.from_pretrained("dumitrescustefan/bert-base-romanian-uncased-v1")
input_ids = torch.tensor(tokenizer.encode("Acesta este un test.", add_special_tokens=True)).unsqueeze(0)
outputs = model(input_ids)
last_hidden_states = outputs[0]
文本清理提示
⚠️ 重要提示
請始終對文本進行清理!將 s
和 t
的軟音符字母替換為逗號字母,使用以下代碼:
text = text.replace("ţ", "ț").replace("ş", "ș").replace("Ţ", "Ț").replace("Ş", "Ș")
因為該模型 未 在帶有軟音符的 s
和 t
字母上進行訓練。如果不進行替換,由於出現 <UNK>
標記以及每個單詞的標記數量增加,模型性能將會下降。
📊 評估結果
評估是在通用依存關係 羅馬尼亞語RRT 的UPOS、XPOS和LAS上進行的,同時也在基於 RONEC 的命名實體識別(NER)任務上進行了評估。詳細信息以及更多未在此展示的深度測試內容,請參考專門的 評估頁面。
基準模型是 多語言BERT 模型 bert-base-multilingual-(un)cased
,在編寫本文時,它是唯一可用於羅馬尼亞語的BERT模型。
模型 |
UPOS |
XPOS |
NER |
LAS |
bert-base-multilingual-uncased |
97.65 |
95.72 |
83.91 |
87.65 |
bert-base-romanian-uncased-v1 |
98.18 |
96.84 |
85.26 |
89.61 |
從評估結果可以看出,本模型在各項指標上均優於多語言BERT模型,表現更出色。
📚 訓練語料庫
該模型在以下語料庫上進行訓練(下表中的統計數據是清理後的結果):
語料庫 |
行數(百萬) |
單詞數(百萬) |
字符數(十億) |
大小(GB) |
OPUS |
55.05 |
635.04 |
4.045 |
3.8 |
OSCAR |
33.56 |
1725.82 |
11.411 |
11 |
維基百科 |
1.54 |
60.47 |
0.411 |
0.4 |
總計 |
90.15 |
2421.33 |
15.867 |
15.2 |
這些豐富的語料庫為模型的訓練提供了充足的數據支持,有助於模型學習到更全面的語言知識。
📖 引用信息
如果您在研究論文中使用了該模型,請引用以下論文:
Stefan Dumitrescu, Andrei-Marius Avram, and Sampo Pyysalo. 2020. The birth of Romanian BERT. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 4324–4328, Online. Association for Computational Linguistics.
或者使用BibTeX格式引用:
@inproceedings{dumitrescu-etal-2020-birth,
title = "The birth of {R}omanian {BERT}",
author = "Dumitrescu, Stefan and
Avram, Andrei-Marius and
Pyysalo, Sampo",
booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2020",
month = nov,
year = "2020",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2020.findings-emnlp.387",
doi = "10.18653/v1/2020.findings-emnlp.387",
pages = "4324--4328",
}
🙏 致謝
我們要感謝來自圖爾庫自然語言處理小組(TurkuNLP)的 Sampo Pyysalo,他為預訓練v1.0 BERT模型提供了計算資源支持,非常感謝他的幫助!
📄 許可證
本項目採用MIT許可證。