language: zh
tags:
- bert
- fill-mask
license: mit
bert-base-romanian-cased-v1
这是针对罗马尼亚语的BERT 基础、区分大小写模型,基于15GB语料库训练,版本号为
使用方法
from transformers import AutoTokenizer, AutoModel
import torch
tokenizer = AutoTokenizer.from_pretrained("dumitrescustefan/bert-base-romanian-cased-v1")
model = AutoModel.from_pretrained("dumitrescustefan/bert-base-romanian-cased-v1")
input_ids = torch.tensor(tokenizer.encode("这是一个测试。", 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>
的出现和每个单词的标记数量增加,性能将会下降。
评估
评估基于Universal Dependencies的罗马尼亚语RRT UPOS、XPOS和LAS,以及基于RONEC的命名实体识别任务。详细评估结果及更多深入测试请参见专门的评估页面。
基线模型为多语言BERT bert-base-multilingual-(un)cased
,因为在撰写本文时,它是唯一可用于罗马尼亚语的BERT模型。
模型 |
UPOS |
XPOS |
NER |
LAS |
bert-base-multilingual-cased |
97.87 |
96.16 |
84.13 |
88.04 |
bert-base-romanian-cased-v1 |
98.00 |
96.46 |
85.88 |
89.69 |
语料库
该模型基于以下语料库训练(下表数据为清理后的统计):
语料库 |
行数(百万) |
词数(百万) |
字符数(十亿) |
大小(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",
}
致谢