[论文解读] Pre-trained Language Models for the Legal Domain: A Case Study on Indian Law
本文研究对两种 LegalBERT 家族模型在印度法律文本上进行继续预训练,并从零开始训练一个自定义的印度法律词汇模型。它在印度和非印度法律任务上进行评估,结果显示印度领域的预训练可以提高表现,其中 InLegalBERT 在大多数终端任务上取得了出色的结果。
NLP in the legal domain has seen increasing success with the emergence of Transformer-based Pre-trained Language Models (PLMs) pre-trained on legal text. PLMs trained over European and US legal text are available publicly; however, legal text from other domains (countries), such as India, have a lot of distinguishing characteristics. With the rapidly increasing volume of Legal NLP applications in various countries, it has become necessary to pre-train such LMs over legal text of other countries as well. In this work, we attempt to investigate pre-training in the Indian legal domain. We re-train (continue pre-training) two popular legal PLMs, LegalBERT and CaseLawBERT, on Indian legal data, as well as train a model from scratch with a vocabulary based on Indian legal text. We apply these PLMs over three benchmark legal NLP tasks -- Legal Statute Identification from facts, Semantic Segmentation of Court Judgment Documents, and Court Appeal Judgment Prediction -- over both Indian and non-Indian (EU, UK) datasets. We observe that our approach not only enhances performance on the new domain (Indian texts) but also over the original domain (European and UK texts). We also conduct explainability experiments for a qualitative comparison of all these different PLMs.
研究动机与目标
- 评估在印度法律数据上对 LegalBERT-系列模型进行继续预训练是否能提升下游法律 NLP 任务的性能。
- 开发印度域 PLMs(InLegalBERT、InCaseLawBERT、CustomInLawBERT)并与基础模型进行比较。
- 在印度和非印度数据集上评估模型在 Legal Statute Identification、判决语义分割以及 Court Judgement Prediction 任务的表现。
- 分析模型注意力模式以理解领域自适应的影响。
- 公开发布模型以便可重复性研究与进一步研究。
提出的方法
- 组建一个大型印度法律语料库(~5.4M 文档,~27GB),涵盖最高法院/上诉法院判决和中央法令。
- 在印度数据上对 LegalBERT 和 CaseLawBERT 进行继续预训练以获得 InLegalBERT 和 InCaseLawBERT;从头训练一个带有自定义印度法律词汇的 BERT-base-uncased 模型(CustomInLawBERT)。
- 使用 WordPiece 构建一个自定义印度词汇表,基于来自头部数据的 10% 计算,供从头训练模型使用。
- 使用 512-token 输入块和 254-token 段以在预训练阶段实现更长的上下文;采用 MLM 的动态掩码和 NSP 的动态采样。
- 在印度法律测试集上评估困惑度;在 HierBERT 架构(句子/块编码器 + 带注意力的 LSTM)上对各任务进行终端任务微调。
- 在 Legal Statute Identification(LSI)与印度及欧盟/英国数据集、Semantic Segmentation of judgments、和 Court Judgement Prediction 上比较模型。
实验结果
研究问题
- RQ1在印度法律数据上进一步的预训练是否相较于基础的 LegalBERT/CaseLawBERT 能提高印度法律 NLP 任务的表现?
- RQ2从头开始的印度法律词汇模型(CustomInLawBERT)与重新训练的印度域模型相比有何差异?
- RQ3印度域 PLMs 是否在非印度法律数据集(EU/UK)上实现泛化或迁移?
- RQ4注意力模式揭示的印度特定预训练的领域自适应效果如何?
- RQ5印度域 PLMs 在基准法律数据集上达到了何种最先进水平?
主要发现
| 模型 | ILSI (mP) | ILSI (mR) | ILSI (mF1) | ECtHR-B (mP) | ECtHR-B (mR) | ECtHR-B (mF1) |
|---|---|---|---|---|---|---|
| BERT | 82.12 | 49.07 | 59.11 | 77.50 | 69.31 | 72.95 |
| LegalBERT | 83.98 | 53.83 | 63.89 | 80.85 | 70.76 | 75.09 |
| CaseLawBERT | 82.89 | 54.72 | 64.53 | 82.37 | 66.45 | 72.87 |
| InLegalBERT | 82.42 | 55.16 | 64.58 | 83.93 | 71.41 | 75.88 |
| InCaseLawBERT | 81.07 | 55.64 | 64.44 | 77.35 | 69.45 | 72.86 |
| CustomInLawBERT | 82.48 | 54.46 | 64.29 | 79.64 | 67.09 | 72.56 |
- InLegalBERT 在印度数据上的困惑度达到研究模型中最佳(5.2547),并且在大多数终端任务上普遍优于其他变体。
- CustomInLawBERT 尽管训练步数较少(700k),但在多个数据集上相较 BERT 有所提升,并接近 InLegalBERT/InCaseLawBERT 的性能。
- InLegalBERT 在大多数终端任务上优于所有其他 PLM,并在与原始工作数据集相比时,在4/5 个数据集上确立了最先进的结果。
- 困惑度结果表明印度域预训练相对于基础模型以及面向 EU/US 的 LegalBERT/CaseLawBERT 模型显著降低困惑度(例如,BERT 25.76 vs InLegalBERT 5.25)。
- 微调的 HierBERT 架构及其编码器变体(LegalBERT、InLegalBERT 等)在印度和非印度基准(LSI 与 ECtHR-B 数据集)上均超越基线。
- 作者在 HuggingFace 上公开可访问的模型包括:InLegalBERT、InCaseLawBERT、CustomInLawBERT,以及随附的预训练代码。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。