init commit
Browse files- .gitattributes +1 -0
- README.md +141 -0
- checkpoints/model.ckpt +3 -0
- hparams.yaml +28 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
checkpoints/ filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pipeline_tag: translation
|
| 3 |
+
language:
|
| 4 |
+
- multilingual
|
| 5 |
+
- af
|
| 6 |
+
- am
|
| 7 |
+
- ar
|
| 8 |
+
- as
|
| 9 |
+
- az
|
| 10 |
+
- be
|
| 11 |
+
- bg
|
| 12 |
+
- bn
|
| 13 |
+
- br
|
| 14 |
+
- bs
|
| 15 |
+
- ca
|
| 16 |
+
- cs
|
| 17 |
+
- cy
|
| 18 |
+
- da
|
| 19 |
+
- de
|
| 20 |
+
- el
|
| 21 |
+
- en
|
| 22 |
+
- eo
|
| 23 |
+
- es
|
| 24 |
+
- et
|
| 25 |
+
- eu
|
| 26 |
+
- fa
|
| 27 |
+
- fi
|
| 28 |
+
- fr
|
| 29 |
+
- fy
|
| 30 |
+
- ga
|
| 31 |
+
- gd
|
| 32 |
+
- gl
|
| 33 |
+
- gu
|
| 34 |
+
- ha
|
| 35 |
+
- he
|
| 36 |
+
- hi
|
| 37 |
+
- hr
|
| 38 |
+
- hu
|
| 39 |
+
- hy
|
| 40 |
+
- id
|
| 41 |
+
- is
|
| 42 |
+
- it
|
| 43 |
+
- ja
|
| 44 |
+
- jv
|
| 45 |
+
- ka
|
| 46 |
+
- kk
|
| 47 |
+
- km
|
| 48 |
+
- kn
|
| 49 |
+
- ko
|
| 50 |
+
- ku
|
| 51 |
+
- ky
|
| 52 |
+
- la
|
| 53 |
+
- lo
|
| 54 |
+
- lt
|
| 55 |
+
- lv
|
| 56 |
+
- mg
|
| 57 |
+
- mk
|
| 58 |
+
- ml
|
| 59 |
+
- mn
|
| 60 |
+
- mr
|
| 61 |
+
- ms
|
| 62 |
+
- my
|
| 63 |
+
- ne
|
| 64 |
+
- nl
|
| 65 |
+
- 'no'
|
| 66 |
+
- om
|
| 67 |
+
- or
|
| 68 |
+
- pa
|
| 69 |
+
- pl
|
| 70 |
+
- ps
|
| 71 |
+
- pt
|
| 72 |
+
- ro
|
| 73 |
+
- ru
|
| 74 |
+
- sa
|
| 75 |
+
- sd
|
| 76 |
+
- si
|
| 77 |
+
- sk
|
| 78 |
+
- sl
|
| 79 |
+
- so
|
| 80 |
+
- sq
|
| 81 |
+
- sr
|
| 82 |
+
- su
|
| 83 |
+
- sv
|
| 84 |
+
- sw
|
| 85 |
+
- ta
|
| 86 |
+
- te
|
| 87 |
+
- th
|
| 88 |
+
- tl
|
| 89 |
+
- tr
|
| 90 |
+
- ug
|
| 91 |
+
- uk
|
| 92 |
+
- ur
|
| 93 |
+
- uz
|
| 94 |
+
- vi
|
| 95 |
+
- xh
|
| 96 |
+
- yi
|
| 97 |
+
- zh
|
| 98 |
+
license: apache-2.0
|
| 99 |
+
base_model:
|
| 100 |
+
- FacebookAI/xlm-roberta-large
|
| 101 |
+
---
|
| 102 |
+
|
| 103 |
+
# COMET-instant-confidence
|
| 104 |
+
|
| 105 |
+
This model is based on [COMET-early-exit](https://github.com/zouharvi/COMET-early-exit), which is a fork but not compatible with original Unbabel's COMET.
|
| 106 |
+
To run the model, you need to first install this version of COMET either with:
|
| 107 |
+
```bash
|
| 108 |
+
pip install "git+https://github.com/zouharvi/COMET-early-exit#egg=comet-early-exit&subdirectory=comet_early_exit"
|
| 109 |
+
```
|
| 110 |
+
or in editable mode:
|
| 111 |
+
```bash
|
| 112 |
+
git clone https://github.com/zouharvi/COMET-early-exit.git
|
| 113 |
+
cd COMET-early-exit
|
| 114 |
+
pip3 install -e comet_early_exit
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
This model specifically behaves like standard quality estimation, but outputs two numbers: `scores` (as usual) and `confidences`, which is the estimated absolute error from the human score.
|
| 118 |
+
Thus, contrary to expectations, higher "confidence" correponds to less correct QE estimation.
|
| 119 |
+
```python
|
| 120 |
+
model = comet_early_exit.load_from_checkpoint(comet_early_exit.download_model("zouharvi/COMET-instant-confidence"))
|
| 121 |
+
data = [
|
| 122 |
+
{
|
| 123 |
+
"src": "Can I receive my food in 10 to 15 minutes?",
|
| 124 |
+
"mt": "Moh bych obdržet jídlo v 10 do 15 minut?",
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"src": "Can I receive my food in 10 to 15 minutes?",
|
| 128 |
+
"mt": "Mohl bych dostat jídlo během 10 či 15 minut?",
|
| 129 |
+
}
|
| 130 |
+
]
|
| 131 |
+
model_output = model.predict(data, batch_size=8, gpus=1)
|
| 132 |
+
print("scores", model_output["scores"])
|
| 133 |
+
print("estimated errors", model_output["confidences"])
|
| 134 |
+
|
| 135 |
+
assert len(model_output["scores"]) == 2 and len(model_output["confidences"]) == 2
|
| 136 |
+
```
|
| 137 |
+
Outputs (formatted):
|
| 138 |
+
```
|
| 139 |
+
scores 72.71 88.56
|
| 140 |
+
estimated errors 15.63 9.74
|
| 141 |
+
```
|
checkpoints/model.ckpt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c21f04dad763461cae88ec0750784e52979e509e5b9c4510ed2abc529c9127ef
|
| 3 |
+
size 2277506916
|
hparams.yaml
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
activations: Tanh
|
| 2 |
+
batch_size: 32
|
| 3 |
+
class_identifier: instantconf_metric
|
| 4 |
+
dropout: 0.1
|
| 5 |
+
encoder_learning_rate: 1.0e-06
|
| 6 |
+
encoder_model: XLM-RoBERTa
|
| 7 |
+
final_activation: null
|
| 8 |
+
hidden_sizes:
|
| 9 |
+
- 2048
|
| 10 |
+
- 1024
|
| 11 |
+
keep_embeddings_frozen: true
|
| 12 |
+
layer: mix
|
| 13 |
+
layer_norm: false
|
| 14 |
+
layer_transformation: sparsemax
|
| 15 |
+
layerwise_decay: 0.95
|
| 16 |
+
learning_rate: 1.5e-05
|
| 17 |
+
load_pretrained_weights: true
|
| 18 |
+
local_files_only: false
|
| 19 |
+
loss: mse
|
| 20 |
+
nr_frozen_epochs: 0.3
|
| 21 |
+
optimizer: AdamW
|
| 22 |
+
pool: cls
|
| 23 |
+
pretrained_model: xlm-roberta-large
|
| 24 |
+
train_data:
|
| 25 |
+
- data/csv/train_da.csv
|
| 26 |
+
validation_data:
|
| 27 |
+
- data/csv/dev_da.csv
|
| 28 |
+
warmup_steps: 0
|