Commit
·
71431b1
1
Parent(s):
f54e02d
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,37 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
metrics:
|
4 |
+
- comet
|
5 |
---
|
6 |
+
|
7 |
+
Creator: [Unbabel](https://unbabel.github.io/COMET/html/index.html)
|
8 |
+
|
9 |
+
The Hub was created to enable the direct usage of the wmt21-comet-mqm model with Python from the Hub.
|
10 |
+
|
11 |
+
Code example:
|
12 |
+
|
13 |
+
```python
|
14 |
+
pip install --upgrade pip # ensures that pip is current
|
15 |
+
pip install unbabel-comet
|
16 |
+
```
|
17 |
+
```python
|
18 |
+
|
19 |
+
from comet import download_model, load_from_checkpoint
|
20 |
+
|
21 |
+
model_path = download_model("NataliaKhaidanova/wmt21-comet-qe-mqm")
|
22 |
+
model = load_from_checkpoint(model_path)
|
23 |
+
data = [
|
24 |
+
{
|
25 |
+
"src": "Dem Feuer konnte Einhalt geboten werden",
|
26 |
+
"mt": "The fire could be stopped",
|
27 |
+
"ref": "They were able to control the fire."
|
28 |
+
},
|
29 |
+
{
|
30 |
+
"src": "Schulen und Kindergärten wurden eröffnet.",
|
31 |
+
"mt": "Schools and kindergartens were open",
|
32 |
+
"ref": "Schools and kindergartens opened"
|
33 |
+
}
|
34 |
+
]
|
35 |
+
model_output = model.predict(data, batch_size=8, gpus=1)
|
36 |
+
print (model_output)
|
37 |
+
```
|