This is the converted model from Unbabel/wmt22-cometkiwi-da
Just kept the weights/bias keys()
Renamed the keys to match the original Facebook/XLM-roberta-large
kept the layer_wise_attention / estimator layers
Because of a hack in HF's code I had to rename the "layerwise_attention.gamma" key to "layerwise_attention.gam"
I changed the config.json key "layer_transformation" from sparsemax to softmax because there is a bug in COMET since the flag is not passed, the actual function used is the default which is softmax.
Let's double check with the original code from Unbabel Comet:
from comet import download_model, load_from_checkpoint
model = load_from_checkpoint("/home/vincent/Downloads/cometkiwi22/checkpoints/model.ckpt") # this is the Unbabel checkpoint
data = [{"mt": "Hello world!", "src": "Bonjour le monde"}]
output = model.predict(data, gpus=0)
print(output)
Prediction([('scores', [0.863973081111908]),
('system_score', 0.863973081111908)])
extra_gated_heading: Acknowledge license to accept the repository
extra_gated_button_content: Acknowledge license
pipeline_tag: translation
language:
This is a COMET quality estimation model: It receives a source sentence and the respective translation and returns a score that reflects the quality of the translation.
1from comet import download_model, load_from_checkpoint
23model_path = download_model("Unbabel/wmt22-cometkiwi-da")4model = load_from_checkpoint(model_path)5data =[6{7"src":"The output signal provides constant sync so the display never glitches.",8"mt":"Das Ausgangssignal bietet eine konstante Synchronisation, so dass die Anzeige nie stört."9},10{11"src":"Kroužek ilustrace je určen všem milovníkům umění ve věku od 10 do 15 let.",12"mt":"Кільце ілюстрації призначене для всіх любителів мистецтва у віці від 10 до 15 років."13},14{15"src":"Mandela then became South Africa's first black president after his African National Congress party won the 1994 election.",16"mt":"その後、1994年の選挙でアフリカ国民会議派が勝利し、南アフリカ初の黒人大統領となった。"17}18]19model_output = model.predict(data, batch_size=8, gpus=1)20print(model_output)
Intended uses
Our model is intented to be used for reference-free MT evaluation.
Given a source text and its translation, outputs a single score between 0 and 1 where 1 represents a perfect translation.
Languages Covered:
This model builds on top of InfoXLM which cover the following languages: