dominguesm commited on
Commit
3b7d670
1 Parent(s): 41954e1

Update readme

Browse files
Files changed (1) hide show
  1. README.md +92 -0
README.md CHANGED
@@ -1,3 +1,95 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - pt
4
+ tags:
5
+ - generated_from_trainer
6
+ model-index:
7
+ - name: checkpoints
8
+ results:
9
+ - task:
10
+ name: Fill Mask
11
+ type: fill-mask
12
+ metrics:
13
+ - name: Loss
14
+ type: loss
15
+ value: 0.47251805663108826
16
  license: apache-2.0
17
+ widget:
18
+ - text: "Com efeito, se tal fosse possível, o Poder [MASK] – que não dispõe de função legislativa – passaria a desempenhar atribuição que lhe é institucionalmente estranha (a de legislador positivo), usurpando, desse modo, no contexto de um sistema de poderes essencialmente limitados, competência que não lhe pertence, com evidente transgressão ao princípio constitucional da separação de poderes."
19
  ---
20
+
21
+ ## (BERT base) Language modeling in the legal domain in Portuguese
22
+
23
+ **legal-bert-base-cased-ptbr** is a Language Model in the legal domain in Portuguese based on the model [BERTimbau base](https://huggingface.co/neuralmind/bert-base-portuguese-cased) by using a MASK objective.
24
+
25
+ The model is intended to assist NLP research in the legal field, computer law and legal technology applications. Several legal texts in Portuguese were used (more information below).
26
+
27
+ **Large version of the model will be available soon**.
28
+
29
+ ## Pre-training corpora
30
+
31
+ The pre-training corpora of **legal-bert-base-cased-ptbr** include:
32
+
33
+ * 61309 - Documentos juridicos diversos | (Miscellaneous legal documents)
34
+ * 751 - Petições (Recurso Extraordinário JEC) | (Petitions)
35
+ * 682 - Sentenças | (Sentences)
36
+ * 498 - Acordãos 2º Instancia | (2nd Instance Accords)
37
+ * 469 - Agravos Recurso extraordinário | (RE grievances)
38
+ * 411 - Despacho de Admissibilidade | (Admissibility Order)
39
+
40
+ The data used was provided by the BRAZILIAN SUPREME FEDERAL TRIBUNAL, through the terms of use: [LREC 2020](https://ailab.unb.br/victor/lrec2020).
41
+
42
+ The results of this project do not imply in any way the position of the BRAZILIAN SUPREME FEDERAL TRIBUNAL, all being the sole and exclusive responsibility of the author of the model.
43
+
44
+ ## Load Pretrained Model
45
+ ````python
46
+ from transformers import AutoTokenizer, AutoModel
47
+
48
+ tokenizer = AutoTokenizer.from_pretrained("dominguesm/legal-bert-base-cased-ptbr")
49
+ model = AutoModel.from_pretrained("dominguesm/legal-bert-base-cased-ptbr")
50
+
51
+ # OR
52
+
53
+ from transformers import pipeline
54
+
55
+ pipe = pipeline('fill-mask', "dominguesm/legal-bert-base-cased-ptbr")
56
+ ````
57
+
58
+ ## Use **legal-bert-base-cased-ptbr** variants as Language Models
59
+ | Text | Masked token | Predictions |
60
+ | ---------------------------------- | ------------ | ------------ |
61
+ | De ordem, a Secretaria Judiciária do Supremo Tribunal Federal INTIMA a parte abaixo identificada, ou quem as suas vezes fizer, do inteiro teor do(a) despacho/decisão presente nos autos (art. 270 do Código de Processo [MASK] e art 5º da Lei 11.419/2006). | Civil | ('Civil', 0.9999), ('civil', 0.0001), ('Penal', 0.0000), ('eletrônico', 0.0000), ('2015', 0.0000) |
62
+ | 2. INTIMAÇÃO da Autarquia: 2.2 Para que apresente em Juízo, com a contestação, cópia do processo administrativo referente ao benefício [MASK] em discussão na lide | previdenciário | ('ora', 0.9424), ('administrativo', 0.0202), ('doença', 0.0117), ('acidente', 0.0037), ('posto', 0.0036) |
63
+ | Certifico que, nesta data, os presentes autos foram remetidos ao [MASK] para processar e julgar recurso (Agravo de Instrumento). | STF | ('Tribunal', 0.4278), ('Supremo', 0.1657), ('origem', 0.1538), ('arquivo', 0.1415), ('sistema', 0.0216) |
64
+ | TEMA: 810. Validade da correção monetária e dos juros moratórios [MASK] sobre as condenações impostas à Fazenda Pública, conforme previstos no art. 1º-F da Lei 9.494/1997, com a redação dada pela Lei 11.960/2009. | incidentes | ('incidentes', 0.9979), ('incidente', 0.0021), ('aplicados', 0.0000), (',', 0.0000), ('aplicada', 0.0000) |
65
+
66
+ ## Training results
67
+
68
+ ````
69
+ Num examples = 353435
70
+ Num Epochs = 3
71
+ Instantaneous batch size per device = 4
72
+ Total train batch size (w. parallel, distributed & accumulation) = 32
73
+ Gradient Accumulation steps = 1
74
+ Total optimization steps = 33135
75
+
76
+ TRAIN RESULTS
77
+
78
+ "epoch": 3.0
79
+ "train_loss": 0.6107781137512769
80
+ "train_runtime": 10192.1545
81
+ "train_samples": 353435
82
+ "train_samples_per_second": 104.031
83
+ "train_steps_per_second": 3.251
84
+
85
+ EVAL RESULTS
86
+
87
+ "epoch": 3.0
88
+ "eval_loss": 0.47251805663108826
89
+ "eval_runtime": 126.3026
90
+ "eval_samples": 17878
91
+ "eval_samples_per_second": 141.549
92
+ "eval_steps_per_second": 4.426
93
+ "perplexity": 1.604028145934512
94
+
95
+ ````