🚀 BERTikal(又名 legalnlp-bert
)
BERTikal [1] 是一個針對巴西法律語言的大小寫敏感的BERT基礎模型,它基於BERTimbau [2] 的檢查點,使用巴西法律文本進行訓練。關於數據集和訓練過程的更多細節可在 [1] 中找到。
更多關於巴西葡萄牙語(PT - BR)法律自然語言處理的資源,請查看 Legal - NLP(https://github.com/felipemaiapolo/legalnlp)。
引用格式:Polo, Felipe Maia等人的論文 “LegalNLP - Natural Language Processing methods for the Brazilian Legal Language”,發表於 Anais do XVIII Encontro Nacional de Inteligência Artificial e Computacional。SBC, 2021。
@inproceedings{polo2021legalnlp,
title={LegalNLP-Natural Language Processing methods for the Brazilian Legal Language},
author={Polo, Felipe Maia and Mendon{\c{c}}a, Gabriel Caiaffa Floriano and Parreira, Kau{\^e} Capellato J and Gianvechio, Lucka and Cordeiro, Peterson and Ferreira, Jonathan Batista and de Lima, Leticia Maria Paz and do Amaral Maia, Ant{\^o}nio Carlos and Vicente, Renato},
booktitle={Anais do XVIII Encontro Nacional de Intelig{\^e}ncia Artificial e Computacional},
pages={763--774},
year={2021},
organization={SBC}
}
🚀 快速開始
BERTikal 是專門為巴西法律語言設計的BERT模型,可用於法律文本的自然語言處理任務,如特徵提取、掩碼語言建模預測等。
💻 使用示例
基礎用法
示例:加載通用模型
from transformers import AutoTokenizer
from transformers import AutoModelForPreTraining
from transformers import AutoModel
model = AutoModelForPreTraining.from_pretrained('felipemaiapolo/legalnlp-bert')
tokenizer = AutoTokenizer.from_pretrained('felipemaiapolo/legalnlp-bert', do_lower_case=False)
示例:獲取BERT嵌入
from transformers import pipeline
pipe = pipeline("feature-extraction", model='felipemaiapolo/legalnlp-bert')
encoded_sentence = pipe('Juíz negou o recurso.')
高級用法
示例:掩碼語言建模預測
from transformers import pipeline
pipe = pipeline('fill-mask', model='felipemaiapolo/legalnlp-bert')
pipe('Juíz negou o [MASK].')
📄 許可證
本項目採用 MIT 許可證。
📚 參考文獻
[1] Polo, Felipe Maia 等人. "LegalNLP - Natural Language Processing methods for the Brazilian Legal Language." Anais do XVIII Encontro Nacional de Inteligência Artificial e Computacional. SBC, 2021.
[2] Souza, F., Nogueira, R., 和 Lotufo, R. (2020). BERTimbau: pretrained BERT 模型 for Brazilian Portuguese. In 9th Brazilian Conference on Intelligent Systems, BRACIS, Rio Grande do Sul, Brazil, October 20 - 23