英文

Legal-HeBERT

Legal-HeBERT是用于希伯来语法律和立法领域的BERT模型。它旨在改善希伯来语法律自然语言处理(NLP)研究和工具开发。我们发布了两个版本的Legal-HeBERT。第一个版本是对 HeBERT 进行微调后应用于法律和立法文件的模型。第二个版本使用 HeBERT 的架构指导从头开始训练BERT模型。我们还将继续收集法律数据,研究不同的架构设计,并进行标记数据集和法律任务的评估,以开发希伯来语法律工具。

训练数据

我们的训练数据集包括:

| Name | Hebrew Description | Size (GB) | Documents | Sentences | Words | Notes ||----------------------------------------------------------------------------------------------------------------------------------- |-------------------------------------------------------------------------- |----------- |----------- |------------ |------------- |----------------------------------------- || The Israeli Law Book | ספר החוקים הישראלי | 0.05 | 2338 | 293352 | 4851063 | || Judgments of the Supreme Court | מאגר פסקי הדין של בית המשפט העליון | 0.7 | 212348 | 5790138 | 79672415 | || custody courts | החלטות בתי הדין למשמורת | 2.46 | 169,708 | 8,555,893 | 213,050,492 | || Law memoranda, drafts of secondary legislation and drafts of support tests that have been distributed to the public for comment | תזכירי חוק, טיוטות חקיקת משנה וטיוטות מבחני תמיכה שהופצו להערות הציבור | 0.4 | 3,291 | 294,752 | 7,218,960 | || Supervisors of Land Registration judgments | מאגר פסקי דין של המפקחים על רישום המקרקעין | 0.02 | 559 | 67,639 | 1,785,446 | || Decisions of the Labor Court - Corona | מאגר החלטות בית הדין לעניין שירות התעסוקה – קורונה | 0.001 | 146 | 3505 | 60195 | || Decisions of the Israel Lands Council | החלטות מועצת מקרקעי ישראל | | 118 | 11283 | 162692 | aggregate file || Judgments of the Disciplinary Tribunal and the Israel Police Appeals Tribunal | פסקי דין של בית הדין למשמעת ובית הדין לערעורים של משטרת ישראל | 0.02 | 54 | 83724 | 1743419 | aggregate files || Disciplinary Appeals Committee in the Ministry of Health | ועדת ערר לדין משמעתי במשרד הבריאות | 0.004 | 252 | 21010 | 429807 | 465 files are scanned and didn't parser || Attorney General's Positions | מאגר התייצבויות היועץ המשפטי לממשלה | 0.008 | 281 | 32724 | 813877 | || Legal-Opinion of the Attorney General | מאגר חוות דעת היועץ המשפטי לממשלה | 0.002 | 44 | 7132 | 188053 | || | | | | | | || total | | 3.665 | 389,139 | 15,161,152 | 309,976,419 | |

我们感谢Yair Gardin提供管理数据的建议,Elhanan Schwarts收集和解析以色列法律书籍,Jonathan Schler收集最高法院的裁决。

训练过程

  • 词汇表大小:50,000个标记
  • 4个时期(1M步左右)
  • lr=5e-5
  • mlm_probability=0.15
  • 批大小=32(每个GPU)
  • NVIDIA GeForce RTX 2080 TI + NVIDIA GeForce RTX 3090(1周训练)

其他训练设置:

经过微调的 HeBERT 模型:前8层被冻结(如 Lee et al. (2019) 建议的那样)从头开始训练的Legal-HeBERT:训练过程类似于 HeBERT ,并受到 Chalkidis et al. (2020) 的启发

如何使用

这些模型可以在Hugging Face Hub中找到,并且可以微调以适用于任何下游任务:

# !pip install transformers==4.14.1
from transformers import AutoTokenizer, AutoModel

model_name = 'avichr/Legal-heBERT_ft' # for the fine-tuned HeBERT model 
model_name = 'avichr/Legal-heBERT' # for legal HeBERT model trained from scratch

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModel.from_pretrained(model_name)

from transformers import pipeline
fill_mask = pipeline(
    "fill-mask",
    model=model_name,
)
fill_mask("הקורונה לקחה את [MASK] ולנו לא נשאר דבר.")

敬请关注!

我们仍在继续改进我们的模型和数据集。随着工作的进展,我们将编辑此页面。我们欢迎合作。

如果您使用此模型,请引用我们:

Chriqui, Avihay, Yahav, Inbal and Bar-Siman-Tov, Ittai, Legal HeBERT: A BERT-based NLP Model for Hebrew Legal, Judicial and Legislative Texts (June 27, 2022). Available at: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4147127

@article{chriqui2021hebert,
  title={Legal HeBERT: A BERT-based NLP Model for Hebrew Legal, Judicial and Legislative Texts},
  author={Chriqui, Avihay, Yahav, Inbal and Bar-Siman-Tov, Ittai},
  journal={SSRN preprint:4147127},
  year={2022}
}

联系我们

Avichay Chriqui,Coller AI实验室 Inbal yahav,Coller AI实验室 Ittai Bar-Siman-Tov,BIU创新实验室(法律,数据科学和数字伦理方面)

谢谢,תודה,شكرا