For further accelerating Chinese natural language processing, we provide Chinese pre-trained BERT with Whole Word Masking.
Pre-Training with Whole Word Masking for Chinese BERT
Yiming Cui, Wanxiang Che, Ting Liu, Bing Qin, Ziqing Yang, Shijin Wang, Guoping Hu
This repository is developed based on:https://github.com/google-research/bert
You may also interested in,
More resources by HFL: https://github.com/ymcui/HFL-Anthology
from modelscope.models import Model
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
if __name__ == '__main__':
task = Tasks.fill_mask
sentence1 = '巴黎是[MASK]国的首都。'
model_id = 'dienstag/chinese-roberta-wwm-ext-large'
model = Model.from_pretrained(model_id)
pipeline_ins = pipeline(task=Tasks.fill_mask,
model=model,
model_revision='v1.0.0')
print(pipeline_ins(input=sentence1))
If you find the technical report or resource is useful, please cite the following technical report in your paper.
@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",
}
@article{chinese-bert-wwm,
title={Pre-Training with Whole Word Masking for Chinese BERT},
author={Cui, Yiming and Che, Wanxiang and Liu, Ting and Qin, Bing and Yang, Ziqing and Wang, Shijin and Hu, Guoping},
journal={arXiv preprint arXiv:1906.08101},
year={2019}
}