モデル概要
モデル特徴
モデル能力
使用事例
🚀 LEGAL - BERT: 法科大学院を卒業したマッペットたち
LEGAL - BERTは、法的ドメイン向けのBERTモデルファミリーです。法的NLP研究、コンピュータ法、および法的技術アプリケーションを支援することを目的としています。LEGAL - BERTのさまざまなバリエーションを事前学習するために、公開されているリソースからいくつかの分野(例えば、立法、裁判例、契約)の多様な英語の法的テキストを12GB収集しました。サブドメインバリアント(CONTRACTS - 、EURLEX - 、ECHR - )および/または一般的なLEGAL - BERTは、ドメイン固有のタスクにおいて、そのままのBERTよりも優れた性能を発揮します。法的データでゼロから事前学習され、競争力のある性能を持つ軽量モデル(BERT - BASEの33%のサイズ)も利用可能です。
I. Chalkidis, M. Fergadiotis, P. Malakasiotis, N. Aletras and I. Androutsopoulos. "LEGAL - BERT: The Muppets straight out of Law School". In Findings of Empirical Methods in Natural Language Processing (EMNLP 2020) (Short Papers), to be held online, 2020. (https://aclanthology.org/2020.findings-emnlp.261)
🚀 クイックスタート
LEGAL - BERTは法的ドメインのNLPタスクに役立つBERTモデルです。以下のコードで事前学習済みモデルをロードできます。
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("nlpaueb/legal-bert-base-uncased")
model = AutoModel.from_pretrained("nlpaueb/legal-bert-base-uncased")
✨ 主な機能
- 法的ドメイン向けに最適化されたBERTモデルファミリー。
- サブドメインバリアントや軽量モデルが利用可能。
- ドメイン固有のタスクでBERTよりも優れた性能を発揮。
📚 ドキュメント
事前学習コーパス
LEGAL - BERTの事前学習コーパスには以下のものが含まれます。
- 116,062件のEU立法文書(EURLEX(http://eur - lex.europa.eu)から公開されています。EURLEXはEU出版局が運営する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億1000万パラメータ)を公開しました。
- 同じ学習設定を選択しました。すなわち、バッチサイズ256、シーケンス長512で100万ステップの学習を初期学習率1e - 4で行いました。
- TensorFlow Research Cloud (TFRC)から無料で提供された単一のGoogle Cloud TPU v3 - 8を使用することができました。また、GCP research creditsも活用しました。両方のGoogleプログラムに支援をしてくれたことに感謝します。
- LEGAL - BERTの一部には、法的データでゼロから事前学習された軽量モデルがあり、これは大きなモデルと同等の性能を達成しつつ、はるかに効率的で(約4倍高速)、環境への影響も小さくなっています。
モデル一覧
モデル名 | モデルパス | 学習コーパス |
---|---|---|
CONTRACTS - BERT - BASE | nlpaueb/bert - base - uncased - contracts |
米国の契約書 |
EURLEX - BERT - BASE | nlpaueb/bert - base - uncased - eurlex |
EUの立法文書 |
ECHR - BERT - BASE | nlpaueb/bert - base - uncased - echr |
欧州人権裁判所の裁判例 |
LEGAL - BERT - BASE * | nlpaueb/legal - bert - base - uncased |
すべて |
LEGAL - BERT - SMALL | 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)の未解決の問題を深く掘り下げたい人にのみ興味があるかもしれません。
LEGAL - BERTバリアントを言語モデルとして使用する
コーパス | モデル | マスクトークン | 予測結果 |
---|---|---|---|
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)の実験を参照してください。
著者 - 出版物
@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の自然言語処理グループは、コンピュータが自然言語テキストを処理および生成できるようにするアルゴリズム、モデル、およびシステムを開発しています。
グループの現在の研究興味は以下の通りです。
- データベース、オントロジー、文書コレクション、およびウェブの質問応答システム、特にバイオメディカル質問応答。
- データベースおよびオントロジー、特にセマンティックウェブオントロジーからの自然言語生成。
- テキスト分類、スパムや虐待的なコンテンツのフィルタリングを含む。
- 情報抽出および意見マイニング、法的テキスト分析や感情分析を含む。
- ギリシャ語の自然言語処理ツール、例えばパーサーや固有表現認識器。
- 自然言語処理における機械学習、特にディープラーニング。
このグループは、アテネ経済大学の情報学部の情報処理研究所の一部です。
Ilias Chalkidis 代表 AUEBの自然言語処理グループ
| Github: @ilias.chalkidis | Twitter: @KiddoThe2B |
📄 ライセンス
このプロジェクトはCC - BY - SA - 4.0ライセンスの下で公開されています。



