Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
---
|
2 |
language:
|
3 |
- pt
|
@@ -19,14 +20,27 @@ widget:
|
|
19 |
- "O juíz leu o recurso."
|
20 |
- "O juíz atirou uma pedra."
|
21 |
example_title: "Example 1"
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
---
|
25 |
-
|
26 |
-
# rufimelo/Legal-SBERTimbau-sts-base-ma
|
27 |
|
28 |
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
29 |
-
rufimelo/rufimelo/Legal-
|
30 |
It is adapted to the Portuguese legal domain and trained for STS on portuguese datasets.
|
31 |
|
32 |
## Usage (Sentence-Transformers)
|
@@ -43,7 +57,7 @@ Then you can use the model like this:
|
|
43 |
from sentence_transformers import SentenceTransformer
|
44 |
sentences = ["Isto é um exemplo", "Isto é um outro exemplo"]
|
45 |
|
46 |
-
model = SentenceTransformer('rufimelo/Legal-
|
47 |
embeddings = model.encode(sentences)
|
48 |
print(embeddings)
|
49 |
```
|
@@ -69,8 +83,8 @@ def mean_pooling(model_output, attention_mask):
|
|
69 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
70 |
|
71 |
# Load model from HuggingFace Hub
|
72 |
-
tokenizer = AutoTokenizer.from_pretrained('rufimelo/Legal-
|
73 |
-
model = AutoModel.from_pretrained('rufimelo/Legal-
|
74 |
|
75 |
# Tokenize sentences
|
76 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
@@ -89,29 +103,26 @@ print(sentence_embeddings)
|
|
89 |
|
90 |
## Evaluation Results STS
|
91 |
|
92 |
-
| Model|
|
93 |
-
| ---------------------------------------- | ---------- | ---------- |
|
94 |
-
| Legal-
|
95 |
-
| Legal-
|
96 |
-
| Legal-
|
97 |
-
| Legal-
|
98 |
-
| Legal-
|
99 |
-
| Legal-
|
100 |
-
| Legal-
|
101 |
-
| Legal-
|
102 |
-
|
|
103 |
-
|
|
104 |
-
|
|
105 |
-
|
|
106 |
-
| paraphrase-multilingual-mpnet-base-v2|
|
107 |
-
| paraphrase-multilingual-mpnet-base-v2
|
108 |
-
| paraphrase-multilingual-mpnet-base-v2 Fine tuned with assin(s)| Assin | 0.77641 |
|
109 |
-
| paraphrase-multilingual-mpnet-base-v2 Fine tuned with assin(s)| Assin2| 0.79831 |
|
110 |
-
| paraphrase-multilingual-mpnet-base-v2 Fine tuned with assin(s)| stsb_multi_mt pt| 0.84575 |
|
111 |
|
112 |
## Training
|
113 |
|
114 |
-
rufimelo/Legal-
|
115 |
|
116 |
Firstly, due to the lack of portuguese datasets, it was trained using multilingual knowledge distillation.
|
117 |
For the Multilingual Knowledge Distillation process, the teacher model was 'sentence-transformers/paraphrase-xlm-r-multilingual-v1', the supposed supported language as English and the language to learn was portuguese.
|
|
|
1 |
+
|
2 |
---
|
3 |
language:
|
4 |
- pt
|
|
|
20 |
- "O juíz leu o recurso."
|
21 |
- "O juíz atirou uma pedra."
|
22 |
example_title: "Example 1"
|
23 |
+
model-index:
|
24 |
+
- name: BERTimbau
|
25 |
+
results:
|
26 |
+
- task:
|
27 |
+
name: STS
|
28 |
+
type: STS
|
29 |
+
metrics:
|
30 |
+
- name: Pearson Correlation - assin Dataset
|
31 |
+
type: Pearson Correlation
|
32 |
+
value: 0.74874
|
33 |
+
- name: Pearson Correlation - assin2 Dataset
|
34 |
+
type: Pearson Correlation
|
35 |
+
value: 0.79532
|
36 |
+
- name: Pearson Correlation - stsb_multi_mt pt Dataset
|
37 |
+
type: Pearson Correlation
|
38 |
+
value: 0.82254
|
39 |
---
|
40 |
+
# rufimelo/Legal-BERTimbau-sts-base-ma
|
|
|
41 |
|
42 |
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
43 |
+
rufimelo/rufimelo/Legal-BERTimbau-sts-base-ma is based on Legal-BERTimbau-base which derives from [BERTimbau](https://huggingface.co/neuralmind/bert-large-portuguese-cased) alrge.
|
44 |
It is adapted to the Portuguese legal domain and trained for STS on portuguese datasets.
|
45 |
|
46 |
## Usage (Sentence-Transformers)
|
|
|
57 |
from sentence_transformers import SentenceTransformer
|
58 |
sentences = ["Isto é um exemplo", "Isto é um outro exemplo"]
|
59 |
|
60 |
+
model = SentenceTransformer('rufimelo/Legal-BERTimbau-sts-base-ma')
|
61 |
embeddings = model.encode(sentences)
|
62 |
print(embeddings)
|
63 |
```
|
|
|
83 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
84 |
|
85 |
# Load model from HuggingFace Hub
|
86 |
+
tokenizer = AutoTokenizer.from_pretrained('rufimelo/Legal-BERTimbau-sts-base-ma')
|
87 |
+
model = AutoModel.from_pretrained('rufimelo/Legal-BERTimbau-sts-base-ma')
|
88 |
|
89 |
# Tokenize sentences
|
90 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
|
|
103 |
|
104 |
## Evaluation Results STS
|
105 |
|
106 |
+
| Model| Assin | Assin2|stsb_multi_mt pt|
|
107 |
+
| ---------------------------------------- | ---------- | ---------- |---------- |
|
108 |
+
| Legal-BERTimbau-sts-base| 0.71457| 0.73545 | |
|
109 |
+
| Legal-BERTimbau-sts-base-ma| 0.74874 | 0.79532|0.82254 |
|
110 |
+
| Legal-BERTimbau-sts-base-ma-v2| 0.75481 | 0.80262|0.82178|
|
111 |
+
| Legal-BERTimbau-sts-large| 0.76629| 0.82357 | |
|
112 |
+
| Legal-BERTimbau-sts-large-v2| 0.76299 | 0.81121|0.81726 |
|
113 |
+
| Legal-BERTimbau-sts-large-ma| 0.76195| 0.81622 | 0.82608|
|
114 |
+
| Legal-BERTimbau-sts-large-ma-v2| 0.7836| 0.8462| 0.8261|
|
115 |
+
| Legal-BERTimbau-sts-large-ma-v3| 0.7749| 0.8470| 0.8364|
|
116 |
+
| ---------------------------------------- | ---------- |---------- |---------- |
|
117 |
+
| BERTimbau base Fine-tuned for STS|0.78455 | 0.80626|0.82841|
|
118 |
+
| BERTimbau large Fine-tuned for STS|0.78193 | 0.81758|0.83784|
|
119 |
+
| ---------------------------------------- | ---------- |---------- |---------- |
|
120 |
+
| paraphrase-multilingual-mpnet-base-v2| 0.71457| 0.79831 |0.83999 |
|
121 |
+
| paraphrase-multilingual-mpnet-base-v2 Fine-tuned with assin(s)| 0.77641|0.79831 |0.84575 |
|
|
|
|
|
|
|
122 |
|
123 |
## Training
|
124 |
|
125 |
+
rufimelo/Legal-BERTimbau-sts-base-ma is based on Legal-BERTimbau-base which derives from [BERTimbau](https://huggingface.co/neuralmind/bert-base-portuguese-cased) base.
|
126 |
|
127 |
Firstly, due to the lack of portuguese datasets, it was trained using multilingual knowledge distillation.
|
128 |
For the Multilingual Knowledge Distillation process, the teacher model was 'sentence-transformers/paraphrase-xlm-r-multilingual-v1', the supposed supported language as English and the language to learn was portuguese.
|