gonzalez-agirre
commited on
Commit
•
612eee4
1
Parent(s):
238324c
Update README.md
Browse files
README.md
CHANGED
@@ -45,24 +45,28 @@ model-index:
|
|
45 |
|
46 |
# Catalan BERTa-v2 (roberta-base-ca-v2) finetuned for Semantic Textual Similarity.
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
|
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
|
65 |
-
|
66 |
|
67 |
## How to use
|
68 |
To get the correct<sup>1</sup> model's prediction scores with values between 0.0 and 5.0, use the following code:
|
@@ -87,7 +91,7 @@ sentence_pairs = [("El llibre va caure per la finestra.", "El llibre va sortir v
|
|
87 |
|
88 |
predictions = pipe(prepare(sentence_pairs), add_special_tokens=False)
|
89 |
|
90 |
-
# convert back to scores to the original
|
91 |
for prediction in predictions:
|
92 |
prediction['score'] = logit(prediction['score'])
|
93 |
print(predictions)
|
@@ -101,7 +105,37 @@ Expected output:
|
|
101 |
|
102 |
<sup>1</sup> _**avoid using the widget** scores since they are normalized and do not reflect the original annotation values._
|
103 |
|
104 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
If you use any of these resources (datasets or models) in your work, please cite our latest paper:
|
106 |
```bibtex
|
107 |
@inproceedings{armengol-estape-etal-2021-multilingual,
|
@@ -126,4 +160,8 @@ If you use any of these resources (datasets or models) in your work, please cite
|
|
126 |
```
|
127 |
|
128 |
### Funding
|
129 |
-
This work was funded by the [
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
# Catalan BERTa-v2 (roberta-base-ca-v2) finetuned for Semantic Textual Similarity.
|
47 |
|
48 |
+
## Table of Contents
|
49 |
+
- [Model Description](#model-description)
|
50 |
+
- [Intended Uses and Limitations](#intended-uses-and-limitations)
|
51 |
+
- [How to Use](#how-to-use)
|
52 |
+
- [Training](#training)
|
53 |
+
- [Training Data](#training-data)
|
54 |
+
- [Training Procedure](#training-procedure)
|
55 |
+
- [Evaluation](#evaluation)
|
56 |
+
- [Variable and Metrics](#variable-and-metrics)
|
57 |
+
- [Evaluation Results](#evaluation-results)
|
58 |
+
- [Licensing Information](#licensing-information)
|
59 |
+
- [Citation Information](#citation-information)
|
60 |
+
- [Funding](#funding)
|
61 |
+
- [Contributions](#contributions)
|
62 |
+
|
63 |
+
## Model description
|
64 |
|
65 |
+
The **roberta-base-ca-v2-cased-sts** is a Semantic Textual Similarity (STS) model for the Catalan language fine-tuned from the [roberta-base-ca-v2](https://huggingface.co/projecte-aina/roberta-base-ca-v2) model, a [RoBERTa](https://arxiv.org/abs/1907.11692) base model pre-trained on a medium-size corpus collected from publicly available corpora and crawlers (check the roberta-base-ca-v2 model card for more details).
|
66 |
|
67 |
+
## Intended Uses and Limitations
|
68 |
|
69 |
+
**roberta-base-ca-v2-cased-sts** model can be used to assess the similarity between two snippets of text. The model is limited by its training dataset and may not generalize well for all use cases.
|
70 |
|
71 |
## How to use
|
72 |
To get the correct<sup>1</sup> model's prediction scores with values between 0.0 and 5.0, use the following code:
|
|
|
91 |
|
92 |
predictions = pipe(prepare(sentence_pairs), add_special_tokens=False)
|
93 |
|
94 |
+
# convert back to scores to the original 0 and 5 interval
|
95 |
for prediction in predictions:
|
96 |
prediction['score'] = logit(prediction['score'])
|
97 |
print(predictions)
|
|
|
105 |
|
106 |
<sup>1</sup> _**avoid using the widget** scores since they are normalized and do not reflect the original annotation values._
|
107 |
|
108 |
+
## Training
|
109 |
+
|
110 |
+
### Training data
|
111 |
+
We used the STS dataset in Catalan called [STS-ca](https://huggingface.co/datasets/projecte-aina/sts-ca) for training and evaluation.
|
112 |
+
|
113 |
+
### Training Procedure
|
114 |
+
The model was trained with a batch size of 16 and a learning rate of 5e-5 for 5 epochs. We then selected the best checkpoint using the downstream task metric in the corresponding development set, and then evaluated it on the test set.
|
115 |
+
|
116 |
+
## Evaluation
|
117 |
+
|
118 |
+
### Variable and Metrics
|
119 |
+
|
120 |
+
This model was finetuned maximizing the average score between the Pearson and Spearman correlations.
|
121 |
+
|
122 |
+
## Evaluation results
|
123 |
+
We evaluated the _roberta-base-ca-v2-cased-sts_ on the STS-ca test set against standard multilingual and monolingual baselines:
|
124 |
+
|
125 |
+
| Model | STS-ca (Combined score) |
|
126 |
+
| ------------|:-------------|
|
127 |
+
| roberta-base-ca-v2-cased-sts | 79.07 |
|
128 |
+
| roberta-base-ca-cased-sts | **80.19** |
|
129 |
+
| mBERT | 74.26 |
|
130 |
+
| XLM-RoBERTa | 61.61 |
|
131 |
+
|
132 |
+
For more details, check the fine-tuning and evaluation scripts in the official [GitHub repository](https://github.com/projecte-aina/club).
|
133 |
+
|
134 |
+
## Licensing Information
|
135 |
+
|
136 |
+
[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
137 |
+
|
138 |
+
## Citation Information
|
139 |
If you use any of these resources (datasets or models) in your work, please cite our latest paper:
|
140 |
```bibtex
|
141 |
@inproceedings{armengol-estape-etal-2021-multilingual,
|
|
|
160 |
```
|
161 |
|
162 |
### Funding
|
163 |
+
This work was funded by the [Departament de la Vicepresidència i de Polítiques Digitals i Territori de la Generalitat de Catalunya](https://politiquesdigitals.gencat.cat/en/inici/index.html) within the framework of [Projecte AINA](https://politiquesdigitals.gencat.cat/ca/economia/catalonia-ai/aina).
|
164 |
+
|
165 |
+
## Contributions
|
166 |
+
|
167 |
+
[N/A]
|