EuroEval 15.12.0__py3-none-any.whl → 16.7.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- euroeval/__init__.py +32 -14
- euroeval/benchmark_config_factory.py +92 -180
- euroeval/benchmark_modules/base.py +49 -39
- euroeval/benchmark_modules/fresh.py +35 -21
- euroeval/benchmark_modules/hf.py +280 -244
- euroeval/benchmark_modules/litellm.py +752 -312
- euroeval/benchmark_modules/vllm.py +570 -268
- euroeval/benchmarker.py +651 -528
- euroeval/caching_utils.py +79 -0
- euroeval/callbacks.py +5 -7
- euroeval/cli.py +49 -38
- euroeval/constants.py +44 -25
- euroeval/data_loading.py +111 -55
- euroeval/data_models.py +490 -323
- euroeval/dataset_configs/__init__.py +26 -4
- euroeval/dataset_configs/bosnian.py +39 -0
- euroeval/dataset_configs/bulgarian.py +56 -0
- euroeval/dataset_configs/croatian.py +56 -0
- euroeval/dataset_configs/czech.py +75 -0
- euroeval/dataset_configs/danish.py +78 -50
- euroeval/dataset_configs/dutch.py +74 -44
- euroeval/dataset_configs/english.py +71 -36
- euroeval/dataset_configs/estonian.py +111 -0
- euroeval/dataset_configs/faroese.py +25 -18
- euroeval/dataset_configs/finnish.py +63 -26
- euroeval/dataset_configs/french.py +65 -32
- euroeval/dataset_configs/german.py +77 -36
- euroeval/dataset_configs/greek.py +64 -0
- euroeval/dataset_configs/icelandic.py +68 -57
- euroeval/dataset_configs/italian.py +68 -36
- euroeval/dataset_configs/latvian.py +87 -0
- euroeval/dataset_configs/lithuanian.py +64 -0
- euroeval/dataset_configs/norwegian.py +98 -72
- euroeval/dataset_configs/polish.py +96 -0
- euroeval/dataset_configs/portuguese.py +63 -40
- euroeval/dataset_configs/serbian.py +64 -0
- euroeval/dataset_configs/slovak.py +55 -0
- euroeval/dataset_configs/slovene.py +56 -0
- euroeval/dataset_configs/spanish.py +68 -34
- euroeval/dataset_configs/swedish.py +82 -41
- euroeval/dataset_configs/ukrainian.py +64 -0
- euroeval/enums.py +12 -6
- euroeval/exceptions.py +21 -1
- euroeval/finetuning.py +34 -26
- euroeval/generation.py +76 -41
- euroeval/generation_utils.py +169 -34
- euroeval/languages.py +1020 -188
- euroeval/logging_utils.py +268 -0
- euroeval/metrics/__init__.py +6 -0
- euroeval/metrics/base.py +85 -0
- euroeval/metrics/huggingface.py +216 -0
- euroeval/metrics/llm_as_a_judge.py +260 -0
- euroeval/metrics/pipeline.py +289 -0
- euroeval/metrics/speed.py +48 -0
- euroeval/model_cache.py +40 -21
- euroeval/model_config.py +4 -5
- euroeval/model_loading.py +3 -0
- euroeval/prompt_templates/__init__.py +2 -0
- euroeval/prompt_templates/classification.py +206 -0
- euroeval/prompt_templates/linguistic_acceptability.py +157 -22
- euroeval/prompt_templates/multiple_choice.py +159 -17
- euroeval/prompt_templates/named_entity_recognition.py +318 -21
- euroeval/prompt_templates/reading_comprehension.py +207 -16
- euroeval/prompt_templates/sentiment_classification.py +205 -22
- euroeval/prompt_templates/summarization.py +122 -22
- euroeval/prompt_templates/token_classification.py +279 -0
- euroeval/scores.py +20 -9
- euroeval/speed_benchmark.py +11 -12
- euroeval/task_group_utils/multiple_choice_classification.py +21 -12
- euroeval/task_group_utils/question_answering.py +101 -73
- euroeval/task_group_utils/sequence_classification.py +144 -61
- euroeval/task_group_utils/text_to_text.py +33 -12
- euroeval/task_group_utils/token_classification.py +86 -89
- euroeval/tasks.py +75 -16
- euroeval/tokenisation_utils.py +603 -0
- euroeval/types.py +17 -11
- euroeval/utils.py +332 -137
- euroeval-16.7.1.dist-info/METADATA +623 -0
- euroeval-16.7.1.dist-info/RECORD +84 -0
- {euroeval-15.12.0.dist-info → euroeval-16.7.1.dist-info}/entry_points.txt +0 -1
- euroeval/human_evaluation.py +0 -737
- euroeval/metrics.py +0 -452
- euroeval/tokenization_utils.py +0 -498
- euroeval-15.12.0.dist-info/METADATA +0 -285
- euroeval-15.12.0.dist-info/RECORD +0 -63
- {euroeval-15.12.0.dist-info → euroeval-16.7.1.dist-info}/WHEEL +0 -0
- {euroeval-15.12.0.dist-info → euroeval-16.7.1.dist-info}/licenses/LICENSE +0 -0
euroeval/model_cache.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""ModelCache class for caching model outputs."""
|
|
2
2
|
|
|
3
|
+
import collections.abc as c
|
|
3
4
|
import hashlib
|
|
4
5
|
import json
|
|
5
6
|
import logging
|
|
@@ -8,9 +9,9 @@ import typing as t
|
|
|
8
9
|
from collections import defaultdict
|
|
9
10
|
from dataclasses import asdict
|
|
10
11
|
|
|
11
|
-
from
|
|
12
|
-
|
|
12
|
+
from .constants import NUM_GENERATION_TOKENS_FOR_CLASSIFICATION
|
|
13
13
|
from .data_models import GenerativeModelOutput, SingleGenerativeModelOutput
|
|
14
|
+
from .logging_utils import get_pbar, log, log_once
|
|
14
15
|
|
|
15
16
|
if t.TYPE_CHECKING:
|
|
16
17
|
from pathlib import Path
|
|
@@ -18,9 +19,6 @@ if t.TYPE_CHECKING:
|
|
|
18
19
|
from datasets import Dataset
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
logger = logging.getLogger("euroeval")
|
|
22
|
-
|
|
23
|
-
|
|
24
22
|
class ModelCache:
|
|
25
23
|
"""A cache for model outputs.
|
|
26
24
|
|
|
@@ -33,10 +31,16 @@ class ModelCache:
|
|
|
33
31
|
The model output cache.
|
|
34
32
|
max_generated_tokens:
|
|
35
33
|
The maximum number of tokens to generate for each example.
|
|
34
|
+
progress_bar:
|
|
35
|
+
Whether to show a progress bar when caching model outputs.
|
|
36
36
|
"""
|
|
37
37
|
|
|
38
38
|
def __init__(
|
|
39
|
-
self,
|
|
39
|
+
self,
|
|
40
|
+
model_cache_dir: "Path",
|
|
41
|
+
cache_name: str,
|
|
42
|
+
max_generated_tokens: int,
|
|
43
|
+
progress_bar: bool,
|
|
40
44
|
) -> None:
|
|
41
45
|
"""Initialise the model output cache.
|
|
42
46
|
|
|
@@ -47,11 +51,14 @@ class ModelCache:
|
|
|
47
51
|
The name of the cache file.
|
|
48
52
|
max_generated_tokens:
|
|
49
53
|
The maximum number of tokens to generate for each example.
|
|
54
|
+
progress_bar:
|
|
55
|
+
Whether to show a progress bar when caching model outputs.
|
|
50
56
|
"""
|
|
51
57
|
self.model_cache_dir = model_cache_dir
|
|
52
58
|
self.model_cache_dir.mkdir(parents=True, exist_ok=True)
|
|
53
59
|
self.cache_path = self.model_cache_dir / cache_name.replace("/", "--")
|
|
54
60
|
self.max_generated_tokens = max_generated_tokens
|
|
61
|
+
self.progress_bar = progress_bar
|
|
55
62
|
|
|
56
63
|
def load(self) -> None:
|
|
57
64
|
"""Load the model output cache."""
|
|
@@ -63,9 +70,10 @@ class ModelCache:
|
|
|
63
70
|
with self.cache_path.open() as f:
|
|
64
71
|
json_cache = json.load(f)
|
|
65
72
|
except json.JSONDecodeError:
|
|
66
|
-
|
|
73
|
+
log(
|
|
67
74
|
f"Failed to load the cache from {self.cache_path}. The cache will be "
|
|
68
|
-
f"re-initialised."
|
|
75
|
+
f"re-initialised.",
|
|
76
|
+
level=logging.WARNING,
|
|
69
77
|
)
|
|
70
78
|
json_cache = dict()
|
|
71
79
|
with self.cache_path.open("w") as f:
|
|
@@ -87,15 +95,16 @@ class ModelCache:
|
|
|
87
95
|
with self.cache_path.open("w") as f:
|
|
88
96
|
json.dump(dumpable_cache, f)
|
|
89
97
|
except KeyError:
|
|
90
|
-
|
|
98
|
+
log(
|
|
91
99
|
f"Failed to load the cache from {self.cache_path}. The cache will be "
|
|
92
|
-
f"re-initialised."
|
|
100
|
+
f"re-initialised.",
|
|
101
|
+
level=logging.WARNING,
|
|
93
102
|
)
|
|
94
103
|
self.cache = dict()
|
|
95
104
|
with self.cache_path.open("w") as f:
|
|
96
105
|
json.dump(dict(), f)
|
|
97
106
|
|
|
98
|
-
def _hash_key(self, key: str |
|
|
107
|
+
def _hash_key(self, key: str | c.Sequence[dict[str, str]]) -> str:
|
|
99
108
|
"""Hash the key to use as an index in the cache.
|
|
100
109
|
|
|
101
110
|
Args:
|
|
@@ -108,7 +117,7 @@ class ModelCache:
|
|
|
108
117
|
return hashlib.md5(string=str(key).encode()).hexdigest()
|
|
109
118
|
|
|
110
119
|
def __getitem__(
|
|
111
|
-
self, key: str |
|
|
120
|
+
self, key: str | c.Sequence[dict[str, str]]
|
|
112
121
|
) -> SingleGenerativeModelOutput:
|
|
113
122
|
"""Get an item from the cache.
|
|
114
123
|
|
|
@@ -123,7 +132,7 @@ class ModelCache:
|
|
|
123
132
|
return self.cache[hashed_key]
|
|
124
133
|
|
|
125
134
|
def __setitem__(
|
|
126
|
-
self, key: str |
|
|
135
|
+
self, key: str | c.Sequence[dict[str, str]], value: SingleGenerativeModelOutput
|
|
127
136
|
) -> None:
|
|
128
137
|
"""Set an item in the cache.
|
|
129
138
|
|
|
@@ -141,7 +150,7 @@ class ModelCache:
|
|
|
141
150
|
self.cache_path.unlink()
|
|
142
151
|
del self.cache
|
|
143
152
|
|
|
144
|
-
def __contains__(self, key: str |
|
|
153
|
+
def __contains__(self, key: str | c.Sequence[dict[str, str]]) -> bool:
|
|
145
154
|
"""Check if a key is in the cache.
|
|
146
155
|
|
|
147
156
|
Args:
|
|
@@ -170,29 +179,39 @@ class ModelCache:
|
|
|
170
179
|
|
|
171
180
|
# Double check that the number of inputs and outputs match
|
|
172
181
|
if not len(model_inputs) == len(model_output.sequences):
|
|
173
|
-
|
|
182
|
+
log(
|
|
174
183
|
f"Number of model inputs ({len(model_inputs)}) does not match the "
|
|
175
184
|
f"number of model outputs ({len(model_output.sequences)}). We will not "
|
|
176
|
-
f"cache the model outputs."
|
|
185
|
+
f"cache the model outputs.",
|
|
186
|
+
level=logging.WARNING,
|
|
177
187
|
)
|
|
178
188
|
return
|
|
179
189
|
|
|
180
190
|
# Store the generated sequences in the cache, one by one
|
|
181
|
-
with
|
|
191
|
+
with get_pbar(
|
|
182
192
|
iterable=model_inputs,
|
|
183
193
|
desc="Caching model outputs",
|
|
184
|
-
|
|
185
|
-
disable=hasattr(sys, "_called_from_test"),
|
|
194
|
+
disable=hasattr(sys, "_called_from_test") or not self.progress_bar,
|
|
186
195
|
) as pbar:
|
|
187
196
|
for sample_idx, model_input in enumerate(pbar):
|
|
188
197
|
# Extract the scores from the model output, to be cached. We only store
|
|
189
198
|
# the indices of the top scores, to save space. Further, we only store
|
|
190
199
|
# the scores if the generated sequence is shorter than the maximum
|
|
191
200
|
# length
|
|
192
|
-
if
|
|
201
|
+
if (
|
|
202
|
+
model_output.scores is not None
|
|
203
|
+
and self.max_generated_tokens
|
|
204
|
+
<= NUM_GENERATION_TOKENS_FOR_CLASSIFICATION
|
|
205
|
+
):
|
|
193
206
|
assert model_output.scores is not None
|
|
194
207
|
scores = model_output.scores[sample_idx]
|
|
195
208
|
else:
|
|
209
|
+
if model_output.scores is not None:
|
|
210
|
+
log_once(
|
|
211
|
+
"The generated sequence is longer than the maximum "
|
|
212
|
+
"length for classification. Not caching the scores.",
|
|
213
|
+
level=logging.DEBUG,
|
|
214
|
+
)
|
|
196
215
|
scores = None
|
|
197
216
|
self[model_input] = SingleGenerativeModelOutput(
|
|
198
217
|
sequence=model_output.sequences[sample_idx], scores=scores
|
|
@@ -249,7 +268,7 @@ def load_cached_model_outputs(
|
|
|
249
268
|
The model output containing the cached sequences.
|
|
250
269
|
"""
|
|
251
270
|
input_column = "messages" if "messages" in cached_dataset.column_names else "text"
|
|
252
|
-
cached_model_outputs:
|
|
271
|
+
cached_model_outputs: c.Sequence[SingleGenerativeModelOutput] = [
|
|
253
272
|
cache[prompt] for prompt in cached_dataset[input_column]
|
|
254
273
|
]
|
|
255
274
|
|
euroeval/model_config.py
CHANGED
|
@@ -5,14 +5,12 @@ import typing as t
|
|
|
5
5
|
|
|
6
6
|
from . import benchmark_modules
|
|
7
7
|
from .exceptions import InvalidModel, NeedsEnvironmentVariable, NeedsExtraInstalled
|
|
8
|
+
from .logging_utils import log
|
|
8
9
|
|
|
9
10
|
if t.TYPE_CHECKING:
|
|
10
11
|
from .data_models import BenchmarkConfig, ModelConfig
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
logger = logging.getLogger("euroeval")
|
|
14
|
-
|
|
15
|
-
|
|
16
14
|
def get_model_config(
|
|
17
15
|
model_id: str, benchmark_config: "BenchmarkConfig"
|
|
18
16
|
) -> "ModelConfig":
|
|
@@ -51,9 +49,10 @@ def get_model_config(
|
|
|
51
49
|
elif isinstance(exists_or_err, NeedsEnvironmentVariable):
|
|
52
50
|
needs_env_vars.append(exists_or_err.env_var)
|
|
53
51
|
elif exists_or_err is True:
|
|
54
|
-
|
|
52
|
+
log(
|
|
55
53
|
f"The model {model_id!r} was identified by the "
|
|
56
|
-
f"{benchmark_module.__name__} benchmark module."
|
|
54
|
+
f"{benchmark_module.__name__} benchmark module.",
|
|
55
|
+
logging.DEBUG,
|
|
57
56
|
)
|
|
58
57
|
model_config = benchmark_module.get_model_config(
|
|
59
58
|
model_id=model_id, benchmark_config=benchmark_config
|
euroeval/model_loading.py
CHANGED
|
@@ -10,6 +10,7 @@ from .benchmark_modules import (
|
|
|
10
10
|
)
|
|
11
11
|
from .enums import InferenceBackend, ModelType
|
|
12
12
|
from .exceptions import InvalidModel
|
|
13
|
+
from .logging_utils import log_once
|
|
13
14
|
|
|
14
15
|
if t.TYPE_CHECKING:
|
|
15
16
|
from .benchmark_modules import BenchmarkModule
|
|
@@ -34,6 +35,8 @@ def load_model(
|
|
|
34
35
|
Returns:
|
|
35
36
|
The model.
|
|
36
37
|
"""
|
|
38
|
+
log_once(f"\nLoading the model {model_config.model_id}...")
|
|
39
|
+
|
|
37
40
|
# The order matters; the first model type that matches will be used. For this
|
|
38
41
|
# reason, they have been ordered in terms of the most common model types.
|
|
39
42
|
model_class: t.Type[BenchmarkModule]
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"""The different prompt templates used in EuroEval."""
|
|
2
2
|
|
|
3
|
+
from .classification import CLASSIFICATION_TEMPLATES
|
|
3
4
|
from .linguistic_acceptability import LA_TEMPLATES
|
|
4
5
|
from .multiple_choice import MULTIPLE_CHOICE_TEMPLATES
|
|
5
6
|
from .named_entity_recognition import NER_TEMPLATES
|
|
6
7
|
from .reading_comprehension import RC_TEMPLATES
|
|
7
8
|
from .sentiment_classification import SENT_TEMPLATES
|
|
8
9
|
from .summarization import SUMM_TEMPLATES
|
|
10
|
+
from .token_classification import TOKEN_CLASSIFICATION_TEMPLATES
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"""Templates for the classification task."""
|
|
2
|
+
|
|
3
|
+
import typing as t
|
|
4
|
+
|
|
5
|
+
from ..data_models import PromptConfig
|
|
6
|
+
from ..languages import (
|
|
7
|
+
BULGARIAN,
|
|
8
|
+
CZECH,
|
|
9
|
+
DANISH,
|
|
10
|
+
DUTCH,
|
|
11
|
+
ENGLISH,
|
|
12
|
+
ESTONIAN,
|
|
13
|
+
FAROESE,
|
|
14
|
+
FINNISH,
|
|
15
|
+
FRENCH,
|
|
16
|
+
GERMAN,
|
|
17
|
+
GREEK,
|
|
18
|
+
ICELANDIC,
|
|
19
|
+
ITALIAN,
|
|
20
|
+
LATVIAN,
|
|
21
|
+
LITHUANIAN,
|
|
22
|
+
NORWEGIAN,
|
|
23
|
+
NORWEGIAN_BOKMÅL,
|
|
24
|
+
NORWEGIAN_NYNORSK,
|
|
25
|
+
POLISH,
|
|
26
|
+
PORTUGUESE,
|
|
27
|
+
SLOVAK,
|
|
28
|
+
SPANISH,
|
|
29
|
+
SWEDISH,
|
|
30
|
+
UKRAINIAN,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
if t.TYPE_CHECKING:
|
|
34
|
+
from ..languages import Language
|
|
35
|
+
|
|
36
|
+
CLASSIFICATION_TEMPLATES: dict["Language", PromptConfig] = {
|
|
37
|
+
ENGLISH: PromptConfig(
|
|
38
|
+
default_prompt_prefix="The following are texts and their labels.",
|
|
39
|
+
default_prompt_template="Text: {text}\nLabel: {label}",
|
|
40
|
+
default_instruction_prompt="Here is a text:\n'{text}'.\n\nClassify the text "
|
|
41
|
+
"into the categories {labels_str}, and reply with only the label.",
|
|
42
|
+
default_prompt_label_mapping="auto",
|
|
43
|
+
),
|
|
44
|
+
BULGARIAN: PromptConfig(
|
|
45
|
+
default_prompt_prefix="Следват текстове и техните етикети.",
|
|
46
|
+
default_prompt_template="Текст: {text}\nЕтикет: {label}",
|
|
47
|
+
default_instruction_prompt="Ето един текст:\n'{text}'.\n\nКласифицирайте "
|
|
48
|
+
"текста в категориите {labels_str} и отговорете само с етикета.",
|
|
49
|
+
default_prompt_label_mapping="auto",
|
|
50
|
+
),
|
|
51
|
+
CZECH: PromptConfig(
|
|
52
|
+
default_prompt_prefix="Následují texty a jejich štítky.",
|
|
53
|
+
default_prompt_template="Text: {text}\nŠtítek: {label}",
|
|
54
|
+
default_instruction_prompt="Zde je text:\n'{text}'.\n\nKlasifikujte text do "
|
|
55
|
+
"kategorií {labels_str} a odpovězte pouze štítkem.",
|
|
56
|
+
default_prompt_label_mapping="auto",
|
|
57
|
+
),
|
|
58
|
+
DANISH: PromptConfig(
|
|
59
|
+
default_prompt_prefix="Følgende er tekster og deres etiketter.",
|
|
60
|
+
default_prompt_template="Tekst: {text}\nEtiket: {label}",
|
|
61
|
+
default_instruction_prompt="Her er en tekst:\n'{text}'.\n\nKlassificer teksten "
|
|
62
|
+
"i kategorierne {labels_str}, og svar kun med etiketten.",
|
|
63
|
+
default_prompt_label_mapping="auto",
|
|
64
|
+
),
|
|
65
|
+
GERMAN: PromptConfig(
|
|
66
|
+
default_prompt_prefix="Im Folgenden sind Texte und ihre Labels aufgeführt.",
|
|
67
|
+
default_prompt_template="Text: {text}\nLabel: {label}",
|
|
68
|
+
default_instruction_prompt="Hier ist ein Text:\n'{text}'.\n\nKlassifiziere den "
|
|
69
|
+
"Text in die Kategorien {labels_str} und antworte nur mit dem Label.",
|
|
70
|
+
default_prompt_label_mapping="auto",
|
|
71
|
+
),
|
|
72
|
+
GREEK: PromptConfig(
|
|
73
|
+
default_prompt_prefix="Ακολουθούν κείμενα και οι ετικέτες τους.",
|
|
74
|
+
default_prompt_template="Κείμενο: {text}\nΕτικέτα: {label}",
|
|
75
|
+
default_instruction_prompt="Εδώ είναι ένα κείμενο:\n'{text}'.\n\n"
|
|
76
|
+
"Κατηγοριοποιήστε το κείμενο στις κατηγορίες {labels_str} και απαντήστε μόνο "
|
|
77
|
+
"με την ετικέτα.",
|
|
78
|
+
default_prompt_label_mapping="auto",
|
|
79
|
+
),
|
|
80
|
+
SPANISH: PromptConfig(
|
|
81
|
+
default_prompt_prefix="A continuación se presentan textos y sus etiquetas.",
|
|
82
|
+
default_prompt_template="Texto: {text}\nEtiqueta: {label}",
|
|
83
|
+
default_instruction_prompt="Aquí hay un texto:\n'{text}'.\n\nClasifica el "
|
|
84
|
+
"texto en las categorías {labels_str} y responde solo con la etiqueta.",
|
|
85
|
+
default_prompt_label_mapping="auto",
|
|
86
|
+
),
|
|
87
|
+
ESTONIAN: PromptConfig(
|
|
88
|
+
default_prompt_prefix="Järgnevad on tekstid ja nende sildid.",
|
|
89
|
+
default_prompt_template="Tekst: {text}\nSilt: {label}",
|
|
90
|
+
default_instruction_prompt="Siin on tekst:\n'{text}'.\n\nKlassifitseeri tekst "
|
|
91
|
+
"kategooriatesse {labels_str} ja vasta ainult sildiga.",
|
|
92
|
+
default_prompt_label_mapping="auto",
|
|
93
|
+
),
|
|
94
|
+
FINNISH: PromptConfig(
|
|
95
|
+
default_prompt_prefix="Seuraavassa on tekstejä ja niiden tunnisteita.",
|
|
96
|
+
default_prompt_template="Teksti: {text}\nTunniste: {label}",
|
|
97
|
+
default_instruction_prompt="Tässä on teksti:\n'{text}'.\n\nLuokittele teksti "
|
|
98
|
+
"kategorioihin {labels_str} ja vastaa vain tunnisteella.",
|
|
99
|
+
default_prompt_label_mapping="auto",
|
|
100
|
+
),
|
|
101
|
+
FAROESE: PromptConfig(
|
|
102
|
+
default_prompt_prefix="Hér eru tekster og teirra etikettir.",
|
|
103
|
+
default_prompt_template="Tekstur: {text}\nEtikettur: {label}",
|
|
104
|
+
default_instruction_prompt="Her er ein tekstur:\n'{text}'.\n\nFlokka teksturin "
|
|
105
|
+
"í bólkar {labels_str} og svara bert við etikettinum.",
|
|
106
|
+
default_prompt_label_mapping="auto",
|
|
107
|
+
),
|
|
108
|
+
FRENCH: PromptConfig(
|
|
109
|
+
default_prompt_prefix="Voici des textes et leurs étiquettes.",
|
|
110
|
+
default_prompt_template="Texte : {text}\nÉtiquette : {label}",
|
|
111
|
+
default_instruction_prompt="Voici un texte :\n'{text}'.\n\nClassifiez le texte "
|
|
112
|
+
"dans les catégories {labels_str} et répondez uniquement avec l'étiquette.",
|
|
113
|
+
default_prompt_label_mapping="auto",
|
|
114
|
+
),
|
|
115
|
+
ICELANDIC: PromptConfig(
|
|
116
|
+
default_prompt_prefix="Hér fyrir neðan eru textar og merkingar þeirra.",
|
|
117
|
+
default_prompt_template="Texti: {text}\nMerking: {label}",
|
|
118
|
+
default_instruction_prompt="Hér er texti:\n'{text}'.\n\nFlokkaðu textann "
|
|
119
|
+
"í flokkana {labels_str} og svaraðu aðeins með merkingenni.",
|
|
120
|
+
default_prompt_label_mapping="auto",
|
|
121
|
+
),
|
|
122
|
+
ITALIAN: PromptConfig(
|
|
123
|
+
default_prompt_prefix="Di seguito sono riportati testi e le loro etichette.",
|
|
124
|
+
default_prompt_template="Testo: {text}\nEtichetta: {label}",
|
|
125
|
+
default_instruction_prompt="Ecco un testo:\n'{text}'.\n\nClassifica il testo "
|
|
126
|
+
"nelle categorie {labels_str} e rispondi solo con l'etichetta.",
|
|
127
|
+
default_prompt_label_mapping="auto",
|
|
128
|
+
),
|
|
129
|
+
LITHUANIAN: PromptConfig(
|
|
130
|
+
default_prompt_prefix="Toliau pateikiami tekstai ir jų etiketės.",
|
|
131
|
+
default_prompt_template="Tekstas: {text}\nEtiketė: {label}",
|
|
132
|
+
default_instruction_prompt="Štai tekstas:\n'{text}'.\n\nKlasifikuokite tekstą "
|
|
133
|
+
"į kategorijas {labels_str} ir atsakykite tik etiketę.",
|
|
134
|
+
default_prompt_label_mapping="auto",
|
|
135
|
+
),
|
|
136
|
+
LATVIAN: PromptConfig(
|
|
137
|
+
default_prompt_prefix="Turpmāk ir teksti un to etiķetes.",
|
|
138
|
+
default_prompt_template="Teksts: {text}\nEtiķete: {label}",
|
|
139
|
+
default_instruction_prompt="Šeit ir teksts:\n'{text}'.\n\nKlasificējiet tekstu "
|
|
140
|
+
"kategorijās {labels_str} un atbildiet tikai ar etiķeti.",
|
|
141
|
+
default_prompt_label_mapping="auto",
|
|
142
|
+
),
|
|
143
|
+
NORWEGIAN_BOKMÅL: PromptConfig(
|
|
144
|
+
default_prompt_prefix="Følgende er tekster og deres etiketter.",
|
|
145
|
+
default_prompt_template="Tekst: {text}\nEtikett: {label}",
|
|
146
|
+
default_instruction_prompt="Her er en tekst:\n'{text}'.\n\nKlassifiser teksten "
|
|
147
|
+
"i kategoriene {labels_str}, og svar kun med etiketten.",
|
|
148
|
+
default_prompt_label_mapping="auto",
|
|
149
|
+
),
|
|
150
|
+
DUTCH: PromptConfig(
|
|
151
|
+
default_prompt_prefix="Hieronder volgen teksten en hun labels.",
|
|
152
|
+
default_prompt_template="Tekst: {text}\nLabel: {label}",
|
|
153
|
+
default_instruction_prompt="Hier is een tekst:\n'{text}'.\n\nClassificeer de "
|
|
154
|
+
"tekst in de categorieën {labels_str} en antwoord alleen met het label.",
|
|
155
|
+
default_prompt_label_mapping="auto",
|
|
156
|
+
),
|
|
157
|
+
NORWEGIAN_NYNORSK: PromptConfig(
|
|
158
|
+
default_prompt_prefix="Følgjande er tekstar og deira etikettar.",
|
|
159
|
+
default_prompt_template="Tekst: {text}\nEtikett: {label}",
|
|
160
|
+
default_instruction_prompt="Her er ein tekst:\n'{text}'.\n\nKlassifiser "
|
|
161
|
+
"teksten i kategoriane {labels_str}, og svar berre med etiketten.",
|
|
162
|
+
default_prompt_label_mapping="auto",
|
|
163
|
+
),
|
|
164
|
+
NORWEGIAN: PromptConfig(
|
|
165
|
+
default_prompt_prefix="Følgende er tekster og deres etiketter.",
|
|
166
|
+
default_prompt_template="Tekst: {text}\nEtikett: {label}",
|
|
167
|
+
default_instruction_prompt="Her er en tekst:\n'{text}'.\n\nKlassifiser teksten "
|
|
168
|
+
"i kategoriene {labels_str}, og svar kun med etiketten.",
|
|
169
|
+
default_prompt_label_mapping="auto",
|
|
170
|
+
),
|
|
171
|
+
POLISH: PromptConfig(
|
|
172
|
+
default_prompt_prefix="Poniżej znajdują się teksty i ich etykiety.",
|
|
173
|
+
default_prompt_template="Tekst: {text}\nEtykieta: {label}",
|
|
174
|
+
default_instruction_prompt="Oto tekst:\n'{text}'.\n\nSklasyfikuj tekst do "
|
|
175
|
+
"kategorii {labels_str} i odpowiedz tylko etykietą.",
|
|
176
|
+
default_prompt_label_mapping="auto",
|
|
177
|
+
),
|
|
178
|
+
PORTUGUESE: PromptConfig(
|
|
179
|
+
default_prompt_prefix="A seguir estão textos e seus rótulos.",
|
|
180
|
+
default_prompt_template="Texto: {text}\nRótulo: {label}",
|
|
181
|
+
default_instruction_prompt="Aqui está um texto:\n'{text}'.\n\nClassifique o "
|
|
182
|
+
"texto nas categorias {labels_str} e responda apenas com o rótulo.",
|
|
183
|
+
default_prompt_label_mapping="auto",
|
|
184
|
+
),
|
|
185
|
+
SLOVAK: PromptConfig(
|
|
186
|
+
default_prompt_prefix="Nasledujú texty a ich štítky.",
|
|
187
|
+
default_prompt_template="Text: {text}\nŠtítok: {label}",
|
|
188
|
+
default_instruction_prompt="Tu je text:\n'{text}'.\n\nKlasifikujte text do "
|
|
189
|
+
"kategorií {labels_str} a odpovedzte iba štítkom.",
|
|
190
|
+
default_prompt_label_mapping="auto",
|
|
191
|
+
),
|
|
192
|
+
SWEDISH: PromptConfig(
|
|
193
|
+
default_prompt_prefix="Följande är texter och deras etiketter.",
|
|
194
|
+
default_prompt_template="Text: {text}\nEtikett: {label}",
|
|
195
|
+
default_instruction_prompt="Här är en text:\n'{text}'.\n\nKlassificera texten "
|
|
196
|
+
"i kategorierna {labels_str} och svara endast med etiketten.",
|
|
197
|
+
default_prompt_label_mapping="auto",
|
|
198
|
+
),
|
|
199
|
+
UKRAINIAN: PromptConfig(
|
|
200
|
+
default_prompt_prefix="Нижче наведено тексти та їхні позначки.",
|
|
201
|
+
default_prompt_template="Текст: {text}\nПозначка: {label}",
|
|
202
|
+
default_instruction_prompt="Ось текст:\n'{text}'.\n\nКласифікуйте текст у "
|
|
203
|
+
"категорії {labels_str} і відповідайте лише позначкою.",
|
|
204
|
+
default_prompt_label_mapping="auto",
|
|
205
|
+
),
|
|
206
|
+
}
|