Bert Base Uncased Echr
模型简介
基于欧洲人权法院案例预训练的法律领域专用BERT模型,适用于法律文本分析、案例研究等专业场景
模型特点
法律领域优化
使用12GB法律专业文本预训练,包含欧盟立法、法院案例等专业语料
子领域专业化
针对欧洲人权法院案例特别优化的子模型,在相关任务上优于通用BERT
完整技术继承
保持原始BERT-base架构,确保兼容现有工具链
模型能力
法律文本理解
法律实体识别
法律文本分类
法律问答系统支持
使用案例
司法研究
人权案例分析
分析欧洲人权法院案例中的法律论证模式
可识别案例中的关键法律要素和判决依据
法律科技
法律文件处理
自动化处理法律合同和诉讼文件
提高法律文件处理效率和准确性
🚀 LEGAL - BERT:刚从法学院毕业的“布偶秀明星”
LEGAL - BERT是一系列用于法律领域的BERT模型,旨在助力法律自然语言处理研究、计算法学以及法律科技应用。为了预训练不同版本的LEGAL - BERT,我们从多个领域(如立法、法院案例、合同)的公开资源中收集了12GB多样的英文法律文本。特定子领域变体(如CONTRACTS - 、EURLEX - 、ECHR - )和/或通用的LEGAL - BERT在特定领域任务上的表现优于直接使用BERT。这是在欧洲人权法院(ECHR)案例上进行预训练的子领域变体模型。
🚀 快速开始
LEGAL - BERT是专门为法律领域打造的BERT模型家族,能为法律相关的自然语言处理研究和应用提供有力支持。以下将为你介绍该模型的相关信息,包括预训练语料、使用方法等。
✨ 主要特性
- 领域针对性强:基于大量法律文本进行预训练,在法律领域的特定任务上表现出色。
- 多种变体可选:有针对不同子领域(如合同、欧盟法律、欧洲人权法院案例)的变体模型。
- 性能优越:在法律相关任务中,比直接使用普通BERT模型效果更好。
📚 详细文档
预训练语料
LEGAL - BERT的预训练语料包括:
- 116,062份欧盟立法文件,可从EURLEX(http://eur - lex.europa.eu)获取,这是由欧盟出版局运营的欧盟法律知识库。
- 61,826份英国立法文件,可从英国立法门户(http://www.legislation.gov.uk)获取。
- 19,867份欧洲法院(ECJ)的案例,同样可从EURLEX获取。
- 12,554份欧洲人权法院(ECHR)的案例,可从HUDOC(http://hudoc.echr.coe.int/eng)获取。
- 164,141份美国各地法院的案例,可从Case Law Access Project门户(https://case.law)获取。
- 76,366份美国合同,来自美国证券交易委员会(SECOM)的EDGAR数据库(https://www.sec.gov/edgar.shtml)。
预训练细节
- 我们使用Google BERT的GitHub仓库(https://github.com/google - research/bert)中提供的官方代码对BERT进行训练。
- 我们发布了一个类似于英文BERT - BASE模型(12层、768隐藏层、12头、1.1亿参数)的模型。
- 我们选择遵循相同的训练设置:进行100万步训练,批次大小为256个长度为512的序列,初始学习率为1e - 4。
- 我们使用了由TensorFlow研究云(TFRC)免费提供的单个Google Cloud TPU v3 - 8,同时也利用了GCP研究信用。非常感谢谷歌的这两个项目对我们的支持!
模型列表
属性 | 详情 |
---|---|
模型名称 | CONTRACTS - BERT - BASE、EURLEX - BERT - BASE、ECHR - BERT - BASE、LEGAL - BERT - BASE、LEGAL - BERT - SMALL |
模型路径 | nlpaueb/bert - base - uncased - contracts 、nlpaueb/bert - base - uncased - eurlex 、nlpaueb/bert - base - uncased - echr 、nlpaueb/legal - bert - base - uncased 、nlpaueb/legal - bert - small - uncased |
训练数据 | 美国合同、欧盟立法、欧洲人权法院案例、所有上述数据、所有上述数据 |
注:
- LEGAL - BERT - BASE是Chalkidis等人(2020)中提到的LEGAL - BERT - SC模型;该模型是在下面提到的法律语料库上从头开始训练的,使用了由在相同语料库上训练的sentence - piece分词器创建的新词汇表。
- 由于很多人对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/bert-base-uncased-echr")
model = AutoModel.from_pretrained("nlpaueb/bert-base-uncased-echr")
作为语言模型使用
语料 | 模型 | 掩码标记 | 预测结果 |
---|---|---|---|
BERT - BASE - UNCASED | |||
(合同) | 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 | |||
(合同) | 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 | |||
(合同) | 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 | |||
(合同) | 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 | |||
(合同) | 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 | |||
(合同) | 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: The Muppets straight out of Law School"(Chalkidis等人,2020)中的实验内容(https://aclanthology.org/2020.findings - emnlp.261)。
📄 许可证
本项目采用CC - BY - SA - 4.0许可证。
引用
@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"
}
关于我们
雅典经济与商业大学自然语言处理小组致力于开发让计算机处理和生成自然语言文本的算法、模型和系统。该小组目前的研究兴趣包括:
- 数据库、本体、文档集合和网络的问答系统,特别是生物医学问答。
- 从数据库和本体(特别是语义网络本体)生成自然语言。
- 文本分类,包括过滤垃圾邮件和不良内容。
- 信息提取和观点挖掘,包括法律文本分析和情感分析。
- 希腊语的自然语言处理工具,如解析器和命名实体识别器。
- 自然语言处理中的机器学习,特别是深度学习。
该小组隶属于雅典经济与商业大学信息学系信息处理实验室。
Ilias Chalkidis 代表 雅典经济与商业大学自然语言处理小组
| GitHub: @ilias.chalkidis | Twitter: @KiddoThe2B |
Phi 2 GGUF
其他
Phi-2是微软开发的一个小型但强大的语言模型,具有27亿参数,专注于高效推理和高质量文本生成。
大型语言模型 支持多种语言
P
TheBloke
41.5M
205
Roberta Large
MIT
基于掩码语言建模目标预训练的大型英语语言模型,采用改进的BERT训练方法
大型语言模型 英语
R
FacebookAI
19.4M
212
Distilbert Base Uncased
Apache-2.0
DistilBERT是BERT基础模型的蒸馏版本,在保持相近性能的同时更轻量高效,适用于序列分类、标记分类等自然语言处理任务。
大型语言模型 英语
D
distilbert
11.1M
669
Llama 3.1 8B Instruct GGUF
Meta Llama 3.1 8B Instruct 是一个多语言大语言模型,针对多语言对话用例进行了优化,在常见的行业基准测试中表现优异。
大型语言模型 英语
L
modularai
9.7M
4
Xlm Roberta Base
MIT
XLM-RoBERTa是基于100种语言的2.5TB过滤CommonCrawl数据预训练的多语言模型,采用掩码语言建模目标进行训练。
大型语言模型 支持多种语言
X
FacebookAI
9.6M
664
Roberta Base
MIT
基于Transformer架构的英语预训练模型,通过掩码语言建模目标在海量文本上训练,支持文本特征提取和下游任务微调
大型语言模型 英语
R
FacebookAI
9.3M
488
Opt 125m
其他
OPT是由Meta AI发布的开放预训练Transformer语言模型套件,参数量从1.25亿到1750亿,旨在对标GPT-3系列性能,同时促进大规模语言模型的开放研究。
大型语言模型 英语
O
facebook
6.3M
198
1
基于transformers库的预训练模型,适用于多种NLP任务
大型语言模型
Transformers

1
unslothai
6.2M
1
Llama 3.1 8B Instruct
Llama 3.1是Meta推出的多语言大语言模型系列,包含8B、70B和405B参数规模,支持8种语言和代码生成,优化了多语言对话场景。
大型语言模型
Transformers 支持多种语言

L
meta-llama
5.7M
3,898
T5 Base
Apache-2.0
T5基础版是由Google开发的文本到文本转换Transformer模型,参数规模2.2亿,支持多语言NLP任务。
大型语言模型 支持多种语言
T
google-t5
5.4M
702
精选推荐AI模型
Llama 3 Typhoon V1.5x 8b Instruct
专为泰语设计的80亿参数指令模型,性能媲美GPT-3.5-turbo,优化了应用场景、检索增强生成、受限生成和推理任务
大型语言模型
Transformers 支持多种语言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一个基于SODA数据集训练的超小型对话模型,专为边缘设备推理设计,体积仅为Cosmo-3B模型的2%左右。
对话系统
Transformers 英语

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基于RoBERTa架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98