🚀 BERTikal (aka legalnlp-bert
)
BERTikal [1] is a cased BERT-base model tailored for the Brazilian legal language. It was trained from the BERTimbau's [2] checkpoint using Brazilian legal texts. For more details on the datasets and training procedures, please refer to [1].
💡 Usage Tip
Check out Legal-NLP for more resources on (PT-BR) legal natural language processing: https://github.com/felipemaiapolo/legalnlp.
⚠️ Important Note
If you use this work, please cite it as: Polo, Felipe Maia, et al. "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}
}
🚀 Quick Start
💻 Usage Examples
Basic Usage
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)
Advanced Usage
from transformers import pipeline
pipe = pipeline("feature-extraction", model='felipemaiapolo/legalnlp-bert')
encoded_sentence = pipe('Juíz negou o recurso.')
Masked Language Modeling Prediction
from transformers import pipeline
pipe = pipeline('fill-mask', model='felipemaiapolo/legalnlp-bert')
pipe('Juíz negou o [MASK].')
📚 References
[1] Polo, Felipe Maia, et al. "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., and Lotufo, R. (2020). BERTimbau: pretrained BERT models for Brazilian Portuguese. In 9th Brazilian Conference on Intelligent Systems, BRACIS, Rio Grande do Sul, Brazil, October 20 - 23
📄 License
This project is licensed under the MIT license.