🚀 意大利法律預訓練模型 ITALIAN-LEGAL-BERT
ITALIAN-LEGAL-BERT 是一個基於 Transformer 的預訓練語言模型,專門針對意大利法律領域進行優化。它在意大利民法語料庫上進行了額外的預訓練,在特定領域任務中比通用的意大利語 BERT 模型表現更出色。

🚀 快速開始
ITALIAN-LEGAL-BERT 基於 bert-base-italian-xxl-cased,並在意大利民法語料庫上對意大利語 BERT 模型進行了額外的預訓練。與“通用”的意大利語 BERT 相比,它在不同的特定領域任務中取得了更好的效果。
✨ 主要特性
模型變體 [新!!!]
注意:我們正在撰寫包含更多細節和這些新模型結果的擴展版論文,稍後會及時更新。
🔧 技術細節
我們使用 ITALIAN XXL BERT 初始化 ITALIAN-LEGAL-BERT,並使用 Huggingface PyTorch-Transformers 庫在 3.7 GB 來自國家判例法檔案的預處理文本上進行了額外 4 個輪次的預訓練。具體參數如下:
- 模型架構:BERT,頂部帶有語言建模頭
- 優化器:AdamW
- 初始學習率:5e-5(線性學習率衰減,結束於 2.525e-9)
- 序列長度:512
- 批量大小:10(受 GPU 容量限制)
- 訓練步數:840 萬
- 設備:1 * GPU V100 16GB
💻 使用示例
基礎用法
可以像下面這樣加載 ITALIAN-LEGAL-BERT 模型:
from transformers import AutoModel, AutoTokenizer
model_name = "dlicari/Italian-Legal-BERT"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModel.from_pretrained(model_name)
高級用法
可以使用 Transformers 庫的填充掩碼管道對 ITALIAN-LEGAL-BERT 進行推理:
from transformers import pipeline
model_name = "dlicari/Italian-Legal-BERT"
fill_mask = pipeline("fill-mask", model_name)
fill_mask("Il [MASK] ha chiesto revocarsi l'obbligo di pagamento")
在這個 COLAB: ITALIAN-LEGAL-BERT: 意大利法律下游任務的最小啟動示例 中展示瞭如何將其用於句子相似度、句子分類和命名實體識別任務。

📄 許可證
本項目採用 AFL-3.0 許可證。
📚 詳細文檔
引用
如果您發現我們的資源或論文有用,請在您的論文中包含以下引用:
@inproceedings{licari_italian-legal-bert_2022,
address = {Bozen-Bolzano, Italy},
series = {{CEUR} {Workshop} {Proceedings}},
title = {{ITALIAN}-{LEGAL}-{BERT}: {A} {Pre}-trained {Transformer} {Language} {Model} for {Italian} {Law}},
volume = {3256},
shorttitle = {{ITALIAN}-{LEGAL}-{BERT}},
url = {https://ceur-ws.org/Vol-3256/#km4law3},
language = {en},
urldate = {2022-11-19},
booktitle = {Companion {Proceedings} of the 23rd {International} {Conference} on {Knowledge} {Engineering} and {Knowledge} {Management}},
publisher = {CEUR},
author = {Licari, Daniele and Comandè, Giovanni},
editor = {Symeonidou, Danai and Yu, Ran and Ceolin, Davide and Poveda-Villalón, María and Audrito, Davide and Caro, Luigi Di and Grasso, Francesca and Nai, Roberto and Sulis, Emilio and Ekaputra, Fajar J. and Kutz, Oliver and Troquard, Nicolas},
month = sep,
year = {2022},
note = {ISSN: 1613-0073},
file = {Full Text PDF:https://ceur-ws.org/Vol-3256/km4law3.pdf},
}