Downloads · 30 days
28
0% of all-time downloads
xcjthu/Lawformer
Lawformer is a fill-mask model from xcjthu. Use it when you need the model to fill a missing word. It is set up for transformers.
This repository provides the source code and checkpoints of the paper "Lawformer: A Pre-trained Language Model forChinese Legal Long Documents". You can download the checkpoint from the huggingface model hub or from h…
Downloads · 30 days
28
0% of all-time downloads
All-time downloads
5.8K
Public
Repo size
1 GB
Likes
7
Public
Click a slice to open those files.
.bin505 MB · 100%
From the Hugging Face model README
This repository provides the source code and checkpoints of the paper "Lawformer: A Pre-trained Language Model forChinese Legal Long Documents". You can download the checkpoint from the huggingface model hub or from here.
We have uploaded our model to the huggingface model hub. Make sure you have installed transformers.
>>> from transformers import AutoModel, AutoTokenizer
>>> tokenizer = AutoTokenizer.from_pretrained("hfl/chinese-roberta-wwm-ext")
>>> model = AutoModel.from_pretrained("xcjthu/Lawformer")
>>> inputs = tokenizer("任某提起诉讼,请求判令解除婚姻关系并对夫妻共同财产进行分割。", return_tensors="pt")
>>> outputs = model(**inputs)
If you use the pre-trained models, please cite this paper:
@article{xiao2021lawformer,
title={Lawformer: A Pre-trained Language Model forChinese Legal Long Documents},
author={Xiao, Chaojun and Hu, Xueyu and Liu, Zhiyuan and Tu, Cunchao and Sun, Maosong},
year={2021}
}