Views
No views yet
(source, machine-translation, reference) triplet it returns a quality
score, roughly in [0, 1] — higher is better.xcomet-xl-tr-v2.bf16.ckpt (BF16, ~7 GB).| Metric | Baseline xCOMET-XL | This model |
|---|---|---|
| Pearson (regression-only) | 0.473 | 0.547 |
| Spearman (regression-only) | 0.531 | 0.562 |
| Kendall (regression-only) | 0.368 | 0.394 |
| Pearson (full predict_step) | 0.479 | 0.515 |
unbabel-comet over-pins numpy/protobuf, so they are restored afterwards:1# clone the (anonymized) code repository, then:
2cd xcomet-xl-tr
3bash install.sh
4# install.sh runs:
5# pip install "unbabel-comet==2.2.7" "sentence-transformers>=3.0.0" \
6# "sacrebleu>=2.4.0" "zemberek-python>=0.2.3" "huggingface_hub>=0.23"
7# pip install "numpy==2.0.2" "protobuf>=5.29,<6"huggingface-cli login # or: export HF_TOKEN=hf_xxx1from huggingface_hub import hf_hub_download
2from xcomet_tr import load_model, score
3
4ckpt = hf_hub_download("XCOMETTR/XCOMET-XL-TR", "xcomet-xl-tr-v2.bf16.ckpt")
5model = load_model(ckpt) # bf16, GPU if available
6
7# (source, machine_translation, reference, direction) — direction: "en-tr" | "tr-en"
8triplets = [
9 ("Istanbul is the largest city in Turkey.",
10 "İstanbul, Türkiye'nin en büyük şehridir.",
11 "İstanbul, Türkiye'nin en büyük şehridir.", "en-tr"),
12 ("Hava bugün çok güzel.",
13 "The weather is very nice today.",
14 "The weather is very nice today.", "tr-en"),
15]
16print(score(model, triplets)) # e.g. [0.97, 0.96]python example.py in the code repo runs exactly this end-to-end.XCOMETFeatures (an XCOMETMetric subclass) adds one module — a
[encoder_dim + 5] → 64 → encoder_dim bottleneck added residually (zero-init,
so it starts identical to xCOMET-XL) to the pooled sentence embedding. The 5
features are: chrF++(mt,ref), LaBSE cos(src,mt), length-ratio z-score, lemma-TER
(Turkish lemmatised via Zemberek), and a direction flag. Load it via the code
repo's load_model, which uses load_pretrained_weights=False so the
self-contained checkpoint needs no extra base-encoder download.mt+src,
mt+ref, and mt+src+ref, so long documents are truncated. Best used per
sentence / short paragraph; for documents, score sentences and average.