myyycroft commited on
Commit
8d0dffd
·
verified ·
1 Parent(s): 2ffad2e

Improving README with links and quick start example

Browse files
Files changed (1) hide show
  1. README.md +35 -2
README.md CHANGED
@@ -10,6 +10,39 @@ base_model:
10
  - Unbabel/XCOMET-XXL
11
  ---
12
 
13
- This is a distilled version of [`Unbabel/XCOMET-XXL`](https://huggingface.co/Unbabel/XCOMET-XXL) - a machine translation evaluation model trained to provide an overall quality score between 0 and 1, where 1 is perfect translation.
14
 
15
- `XCOMET-lite` is based on [`microsoft/mdeberta-v3-base`](https://huggingface.co/microsoft/deberta-v3-base) and has 278 M parameters, which is ~38x smaller than 10.7 B `XCOMET-XXL`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  - Unbabel/XCOMET-XXL
11
  ---
12
 
13
+ # XCOMET-lite
14
 
15
+ **Links:** [EMNLP 2024](https://aclanthology.org/2024.emnlp-main.1223/) | [Arxiv](https://arxiv.org/abs/2406.14553) | [Github repository](https://github.com/NL2G/xCOMET-lite)
16
+
17
+ `XCOMET-lite` is a distilled version of [`Unbabel/XCOMET-XXL`](https://huggingface.co/Unbabel/XCOMET-XXL) — a machine translation evaluation model trained to provide an overall quality score between 0 and 1, where 1 represents a perfect translation.
18
+
19
+ This model uses [`microsoft/mdeberta-v3-base`](https://huggingface.co/microsoft/deberta-v3-base) as its backbone and has 278 million parameters, making it approximately 38 times smaller than the 10.7 billion-parameter `XCOMET-XXL`.
20
+
21
+ ## Quick Start
22
+
23
+ 1. Clone the [GitHub repository](https://github.com/NL2G/xCOMET-lite).
24
+ 2. Create a conda environment as instructed in the README.
25
+
26
+ Then, run the following code:
27
+
28
+ ```
29
+ from xcomet.deberta_encoder import XCOMETLite
30
+
31
+ model = XCOMETLite().from_pretrained("myyycroft/XCOMET-lite")
32
+ data = [
33
+ {
34
+ "src": "Elon Musk has acquired Twitter and plans significant changes.",
35
+ "mt": "Илон Маск приобрел Twitter и планировал значительные искажения.",
36
+ "ref": "Илон Маск приобрел Twitter и планирует значительные изменения."
37
+ },
38
+ {
39
+ "src": "Elon Musk has acquired Twitter and plans significant changes.",
40
+ "mt": "Илон Маск приобрел Twitter.",
41
+ "ref": "Илон Маск приобрел Twitter и планирует значительные изменения."
42
+ }
43
+ ]
44
+
45
+ model_output = model.predict(data, batch_size=2, gpus=1)
46
+
47
+ print("Segment-level scores:", model_output.scores)
48
+ ```