dominguesm
commited on
Commit
•
c213c3d
1
Parent(s):
d8e9d4a
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: pt
|
3 |
+
license: cc-by-sa-4.0
|
4 |
+
---
|
5 |
+
|
6 |
+
# LegalBERT Tokenizer
|
7 |
+
|
8 |
+
**LegalBERT** tokenizer is a word level byte-pair encoding with
|
9 |
+
vocabulary size of 52k tokens (containing the most common words in legal documents), based on the [BERTimbau](https://huggingface.co/neuralmind/bert-base-portuguese-cased) tokenizer. The tokenizer was trained on data provided by the **BRAZILIAN SUPREME FEDERAL TRIBUNAL**, through the terms of use: [LREC 2020](https://ailab.unb.br/victor/lrec2020).
|
10 |
+
Tokenizer utilize `BertTokenizer` implementation from [transformers](https://github.com/huggingface/transformers).
|
11 |
+
|
12 |
+
**NOTE**: 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.
|
13 |
+
|
14 |
+
## Tokenizer usage
|
15 |
+
|
16 |
+
```python
|
17 |
+
from transformers import AutoTokenizer
|
18 |
+
|
19 |
+
tokenizer = AutoTokenizer.from_pretrained("dominguesm/legal-bert-tokenizer")
|
20 |
+
|
21 |
+
example = ""
|
22 |
+
tokens = tokenizer.tokenize(example)
|
23 |
+
```
|
24 |
+
|
25 |
+
### Comparison of results
|
26 |
+
|
27 |
+
Original Text: ```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 Cívil e art 5º da Lei 11.419/2006).```
|
28 |
+
|
29 |
+
| Tokenizer | Tokens | Num. Tokens |
|
30 |
+
| --------- | ------ | ----------- |
|
31 |
+
| BERTimbau | ```['De', 'ordem', ',', 'a', 'Secretaria', 'Judic', '##iária', 'do', 'Supremo', 'Tribunal', 'Federal', 'IN', '##TI', '##MA', 'a', 'parte', 'abaixo', 'identificada', ',', 'ou', 'quem', 'as', 'suas', 'vezes', 'fiz', '##er', ',', 'do', 'inteiro', 'teor', 'do', '(', 'a', ')', 'despa', '##cho', '/', 'decisão', 'presente', 'nos', 'auto', '##s', '(', 'art', '.', '27', '##0', 'do', 'Código', 'de', 'Processo', 'Cí', '##vil', 'e', 'art', '[UNK]', 'da', 'Lei', '11', '.', '41', '##9', '/', '2006', ')', '.']``` | 66 |
|
32 |
+
| LegalBERT | ```['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', 'Cív', '##il', 'e', 'art', '5º', 'da', 'Lei', '11', '.', '419', '/', '2006', ')', '.']``` | 58 |
|
33 |
+
|
34 |
+
|
35 |
+
## Citation
|
36 |
+
|
37 |
+
If you use this tokenizer, please cite:
|
38 |
+
```
|
39 |
+
@misc {maicon_domingues_2022,
|
40 |
+
author = { {Maicon Domingues} },
|
41 |
+
title = { legal-bert-tokenizer (Revision d8e9d4a) },
|
42 |
+
year = 2022,
|
43 |
+
url = { https://huggingface.co/dominguesm/legal-bert-tokenizer },
|
44 |
+
doi = { 10.57967/hf/0110 },
|
45 |
+
publisher = { Hugging Face }
|
46 |
+
}
|
47 |
+
```
|
48 |
+
|
49 |
+
## Contacts:
|
50 |
+
|
51 |
+
* <a href="mailto:dominguesm@outlook.com">dominguesm@outlook.com</a>
|
52 |
+
* [NLP.ROCKS](http://nlp.rocks)
|