模型:
nlpaueb/legal-bert-small-uncased
LEGAL-BERT 是用于法律领域的BERT模型家族,旨在辅助法律自然语言处理研究、计算法律和法律技术应用。为了预训练LEGAL-BERT的不同变体,我们从公开可获得的资源中收集了12GB多样化的英文法律文本,包括立法、法院案例和合同等多个领域。子领域变体(CONTRACTS、EURLEX、ECHR)和(或)通用LEGAL-BERT在领域特定任务中表现优于直接使用原始的BERT模型。本版本是使用法律数据从头开始预训练的BERT-BASE的轻量级版本(仅为BERT-BASE的33%大小),在达到相当性能的同时,更加高效(速度提升约4倍),占用资源更少。
I. Chalkidis, M. Fergadiotis, P. Malakasiotis, N. Aletras and I. Androutsopoulos. "LEGAL-BERT: The Muppets straight out of Law School". 在Empirical Methods in Natural Language Processing (EMNLP 2020)(短论文)发表的论文中,将在2020年线上举办。( https://aclanthology.org/2020.findings-emnlp.261 )
LEGAL-BERT的预训练语料库包括:
从欧盟法律库EURLEX( http://eur-lex.europa.eu )中公开获取的116,062份欧盟立法文档。
从英国立法门户网站( http://www.legislation.gov.uk )中公开获取的61,826份英国立法文档。
从EURLEX中获取的19,867个欧洲法院判决案例。
从欧洲人权法院(ECHR)的存储库HUDOC中获取的12,554个案例( http://hudoc.echr.coe.int/eng )。
从美国各地法院(托管在Case Law Access Project门户网站)获取的164,141个案例( https://case.law )。
从美国证券交易委员会(SEC)的数据库EDGAR获取的76,366份美国合同( https://www.sec.gov/edgar.shtml )。
Model name | Model Path | Training corpora |
---|---|---|
CONTRACTS-BERT-BASE | nlpaueb/bert-base-uncased-contracts | US contracts |
EURLEX-BERT-BASE | nlpaueb/bert-base-uncased-eurlex | EU legislation |
ECHR-BERT-BASE | nlpaueb/bert-base-uncased-echr | ECHR cases |
LEGAL-BERT-BASE * | nlpaueb/legal-bert-base-uncased | All |
LEGAL-BERT-SMALL | nlpaueb/legal-bert-small-uncased | All |
* LEGAL-BERT-BASE是Chalkidis等人(2020)中称为LEGAL-BERT-SC的模型;它是在下面提到的法律语料库上使用新创建的词汇表通过句子片段分词器训练的模型。
** 对于对LEGAL-BERT-FP模型(依赖于原始BERT-BASE检查点)表示兴趣的许多人,它们已在Archive.org( https://archive.org/details/legal_bert_fp )上发布,因为这些模型是次要的,可能只对那些对Chalkidis等人(2020)的未解之谜感兴趣的人有意义。
from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("nlpaueb/legal-bert-small-uncased") model = AutoModel.from_pretrained("nlpaueb/legal-bert-small-uncased")
Corpus | Model | Masked token | Predictions |
---|---|---|---|
BERT-BASE-UNCASED | |||
(Contracts) | This [MASK] Agreement is between General Motors and John Murray . | employment | ('new', '0.09'), ('current', '0.04'), ('proposed', '0.03'), ('marketing', '0.03'), ('joint', '0.02') |
(ECHR) | The applicant submitted that her husband was subjected to treatment amounting to [MASK] whilst in the custody of Adana Security Directorate | torture | ('torture', '0.32'), ('rape', '0.22'), ('abuse', '0.14'), ('death', '0.04'), ('violence', '0.03') |
(EURLEX) | Establishing a system for the identification and registration of [MASK] animals and regarding the labelling of beef and beef products . | bovine | ('farm', '0.25'), ('livestock', '0.08'), ('draft', '0.06'), ('domestic', '0.05'), ('wild', '0.05') |
CONTRACTS-BERT-BASE | |||
(Contracts) | This [MASK] Agreement is between General Motors and John Murray . | employment | ('letter', '0.38'), ('dealer', '0.04'), ('employment', '0.03'), ('award', '0.03'), ('contribution', '0.02') |
(ECHR) | The applicant submitted that her husband was subjected to treatment amounting to [MASK] whilst in the custody of Adana Security Directorate | torture | ('death', '0.39'), ('imprisonment', '0.07'), ('contempt', '0.05'), ('being', '0.03'), ('crime', '0.02') |
(EURLEX) | Establishing a system for the identification and registration of [MASK] animals and regarding the labelling of beef and beef products . | bovine | (('domestic', '0.18'), ('laboratory', '0.07'), ('household', '0.06'), ('personal', '0.06'), ('the', '0.04') |
EURLEX-BERT-BASE | |||
(Contracts) | This [MASK] Agreement is between General Motors and John Murray . | employment | ('supply', '0.11'), ('cooperation', '0.08'), ('service', '0.07'), ('licence', '0.07'), ('distribution', '0.05') |
(ECHR) | The applicant submitted that her husband was subjected to treatment amounting to [MASK] whilst in the custody of Adana Security Directorate | torture | ('torture', '0.66'), ('death', '0.07'), ('imprisonment', '0.07'), ('murder', '0.04'), ('rape', '0.02') |
(EURLEX) | Establishing a system for the identification and registration of [MASK] animals and regarding the labelling of beef and beef products . | bovine | ('live', '0.43'), ('pet', '0.28'), ('certain', '0.05'), ('fur', '0.03'), ('the', '0.02') |
ECHR-BERT-BASE | |||
(Contracts) | This [MASK] Agreement is between General Motors and John Murray . | employment | ('second', '0.24'), ('latter', '0.10'), ('draft', '0.05'), ('bilateral', '0.05'), ('arbitration', '0.04') |
(ECHR) | The applicant submitted that her husband was subjected to treatment amounting to [MASK] whilst in the custody of Adana Security Directorate | torture | ('torture', '0.99'), ('death', '0.01'), ('inhuman', '0.00'), ('beating', '0.00'), ('rape', '0.00') |
(EURLEX) | Establishing a system for the identification and registration of [MASK] animals and regarding the labelling of beef and beef products . | bovine | ('pet', '0.17'), ('all', '0.12'), ('slaughtered', '0.10'), ('domestic', '0.07'), ('individual', '0.05') |
LEGAL-BERT-BASE | |||
(Contracts) | This [MASK] Agreement is between General Motors and John Murray . | employment | ('settlement', '0.26'), ('letter', '0.23'), ('dealer', '0.04'), ('master', '0.02'), ('supplemental', '0.02') |
(ECHR) | The applicant submitted that her husband was subjected to treatment amounting to [MASK] whilst in the custody of Adana Security Directorate | torture | ('torture', '1.00'), ('detention', '0.00'), ('arrest', '0.00'), ('rape', '0.00'), ('death', '0.00') |
(EURLEX) | Establishing a system for the identification and registration of [MASK] animals and regarding the labelling of beef and beef products . | bovine | ('live', '0.67'), ('beef', '0.17'), ('farm', '0.03'), ('pet', '0.02'), ('dairy', '0.01') |
LEGAL-BERT-SMALL | |||
(Contracts) | This [MASK] Agreement is between General Motors and John Murray . | employment | ('license', '0.09'), ('transition', '0.08'), ('settlement', '0.04'), ('consent', '0.03'), ('letter', '0.03') |
(ECHR) | The applicant submitted that her husband was subjected to treatment amounting to [MASK] whilst in the custody of Adana Security Directorate | torture | ('torture', '0.59'), ('pain', '0.05'), ('ptsd', '0.05'), ('death', '0.02'), ('tuberculosis', '0.02') |
(EURLEX) | Establishing a system for the identification and registration of [MASK] animals and regarding the labelling of beef and beef products . | bovine | ('all', '0.08'), ('live', '0.07'), ('certain', '0.07'), ('the', '0.07'), ('farm', '0.05') |
请参考文章“LEGAL-BERT: 立法学院的木偶”。 Chalkidis等人,2020年,( https://aclanthology.org/2020.findings-emnlp.261 )。
@inproceedings{chalkidis-etal-2020-legal, title = "{LEGAL}-{BERT}: The Muppets straight out of Law School", author = "Chalkidis, Ilias and Fergadiotis, Manos and Malakasiotis, Prodromos and Aletras, Nikolaos and Androutsopoulos, Ion", booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2020", month = nov, year = "2020", address = "Online", publisher = "Association for Computational Linguistics", doi = "10.18653/v1/2020.findings-emnlp.261", pages = "2898--2904" }
AUEB's Natural Language Processing Group 开发算法、模型和系统,使计算机能够处理和生成自然语言文本。
该小组目前的研究兴趣包括:
该小组属于雅典经济和商业科学大学计算机科学系信息处理实验室。
Ilias Chalkidis 代表 AUEB's Natural Language Processing Group
| Github: @ilias.chalkidis | Twitter: @KiddoThe2B |