Mainak Manna
commited on
Commit
•
5d1188f
1
Parent(s):
d028544
First version of the model
Browse files
README.md
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
language: Spanish English
|
4 |
+
tags:
|
5 |
+
- translation Spanish English model
|
6 |
+
datasets:
|
7 |
+
- dcep europarl jrc-acquis
|
8 |
+
widget:
|
9 |
+
- text: "PPE-DE: 6', PSE: 6', ALDE: 5', Verts/ALE: 4', GUE/NGL: 4', IND/DEM:4', UEN: 4', NI: 4'"
|
10 |
+
|
11 |
+
---
|
12 |
+
|
13 |
+
# legal_t5_small_multitask_es_en model
|
14 |
+
|
15 |
+
Model on translating legal text from Spanish to English. It was first released in
|
16 |
+
[this repository](https://github.com/agemagician/LegalTrans). The model is parallely trained on the three parallel corpus with 42 language pair
|
17 |
+
from jrc-acquis, europarl and dcep along with the unsupervised task where the model followed the task of prediction in a masked language model.
|
18 |
+
|
19 |
+
|
20 |
+
## Model description
|
21 |
+
|
22 |
+
No pretraining is involved in case of legal_t5_small_multitask_es_en model, rather the unsupervised task is added with all the translation task
|
23 |
+
to realize the multitask learning scenario.
|
24 |
+
|
25 |
+
## Intended uses & limitations
|
26 |
+
|
27 |
+
The model could be used for translation of legal texts from Spanish to English.
|
28 |
+
|
29 |
+
### How to use
|
30 |
+
|
31 |
+
Here is how to use this model to translate legal text from Spanish to English in PyTorch:
|
32 |
+
|
33 |
+
```python
|
34 |
+
from transformers import AutoTokenizer, AutoModelWithLMHead, TranslationPipeline
|
35 |
+
|
36 |
+
pipeline = TranslationPipeline(
|
37 |
+
model=AutoModelWithLMHead.from_pretrained("SEBIS/legal_t5_small_multitask_es_en"),
|
38 |
+
tokenizer=AutoTokenizer.from_pretrained(pretrained_model_name_or_path = "SEBIS/legal_t5_small_multitask_es_en", do_lower_case=False,
|
39 |
+
skip_special_tokens=True),
|
40 |
+
device=0
|
41 |
+
)
|
42 |
+
|
43 |
+
es_text = "PPE-DE: 6', PSE: 6', ALDE: 5', Verts/ALE: 4', GUE/NGL: 4', IND/DEM:4', UEN: 4', NI: 4'"
|
44 |
+
|
45 |
+
pipeline([es_text], max_length=512)
|
46 |
+
```
|
47 |
+
|
48 |
+
## Training data
|
49 |
+
|
50 |
+
The legal_t5_small_multitask_es_en model (the supervised task which involved only the corresponding langauge pair and as well as unsupervised task where all of the data of all language pairs were available) model was trained on [JRC-ACQUIS](https://wt-public.emm4u.eu/Acquis/index_2.2.html), [EUROPARL](https://www.statmt.org/europarl/), and [DCEP](https://ec.europa.eu/jrc/en/language-technologies/dcep) dataset consisting of 9 Million parallel texts.
|
51 |
+
|
52 |
+
## Training procedure
|
53 |
+
|
54 |
+
The model was trained on a single TPU Pod V3-8 for 250K steps in total, using sequence length 512 (batch size 4096). It has a total of approximately 220M parameters and was trained using the encoder-decoder architecture. The optimizer used is AdaFactor with inverse square root learning rate schedule.
|
55 |
+
|
56 |
+
### Preprocessing
|
57 |
+
|
58 |
+
An unigram model trained with 88M lines of text from the parallel corpus (of all possible language pairs) to get the vocabulary (with byte pair encoding), which is used with this model.
|
59 |
+
|
60 |
+
### Pretraining
|
61 |
+
|
62 |
+
|
63 |
+
## Evaluation results
|
64 |
+
|
65 |
+
When the model is used for translation test dataset, achieves the following results:
|
66 |
+
|
67 |
+
Test results :
|
68 |
+
|
69 |
+
| Model | BLEU score |
|
70 |
+
|:-----:|:-----:|
|
71 |
+
| legal_t5_small_multitask_es_en | 36.607|
|
72 |
+
|
73 |
+
|
74 |
+
### BibTeX entry and citation info
|
75 |
+
|
76 |
+
> Created by [Ahmed Elnaggar/@Elnaggar_AI](https://twitter.com/Elnaggar_AI) | [LinkedIn](https://www.linkedin.com/in/prof-ahmed-elnaggar/)
|