evalscope 0.6.1__py3-none-any.whl → 0.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.
Potentially problematic release.
This version of evalscope might be problematic. Click here for more details.
- evalscope/backend/opencompass/tasks/eval_api.py +2 -1
- evalscope/backend/opencompass/tasks/eval_datasets.py +1 -0
- evalscope/backend/rag_eval/clip_benchmark/utils/webdataset_convert.py +230 -0
- evalscope/backend/rag_eval/clip_benchmark/utils/webdatasets.txt +43 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/AnswerCorrectness/correctness_prompt_chinese.json +87 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/AnswerCorrectness/long_form_answer_prompt_chinese.json +36 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/AnswerRelevancy/question_generation_chinese.json +26 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/ContextPrecision/context_precision_prompt_chinese.json +41 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/Faithfulness/nli_statements_message_chinese.json +60 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/Faithfulness/statement_prompt_chinese.json +36 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/HeadlinesExtractor/prompt_chinese.json +22 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/MultiHopAbstractQuerySynthesizer/concept_combination_prompt_chinese.json +35 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/MultiHopAbstractQuerySynthesizer/generate_query_reference_prompt_chinese.json +7 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/MultiHopAbstractQuerySynthesizer/theme_persona_matching_prompt_chinese.json +39 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/MultiHopSpecificQuerySynthesizer/generate_query_reference_prompt_chinese.json +7 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/MultiHopSpecificQuerySynthesizer/theme_persona_matching_prompt_chinese.json +39 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/MultiModalFaithfulness/faithfulness_prompt_chinese.json +34 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/MultiModalRelevance/relevance_prompt_chinese.json +36 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/NERExtractor/prompt_chinese.json +25 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/SingleHopSpecificQuerySynthesizer/generate_query_reference_prompt_chinese.json +7 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/SingleHopSpecificQuerySynthesizer/theme_persona_matching_prompt_chinese.json +39 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/SummaryExtractor/prompt_chinese.json +16 -0
- evalscope/backend/rag_eval/ragas/prompts/chinese/ThemesExtractor/prompt_chinese.json +24 -0
- evalscope/backend/rag_eval/ragas/prompts/persona_prompt.py +18 -0
- evalscope/backend/vlm_eval_kit/backend_manager.py +23 -21
- evalscope/benchmarks/ceval/samples.jsonl +1 -0
- evalscope/benchmarks/cmmlu/samples.jsonl +5 -0
- evalscope/benchmarks/mmlu/samples.jsonl +5 -0
- evalscope/benchmarks/race/samples.jsonl +5 -0
- evalscope/benchmarks/trivia_qa/samples.jsonl +5 -0
- evalscope/cli/start_perf.py +8 -11
- evalscope/metrics/resources/gpt2-zhcn3-v4.bpe +58485 -0
- evalscope/metrics/resources/gpt2-zhcn3-v4.json +1 -0
- evalscope/metrics/rouge_metric.py +30 -15
- evalscope/perf/arguments.py +179 -0
- evalscope/perf/benchmark.py +245 -0
- evalscope/perf/http_client.py +127 -711
- evalscope/perf/main.py +35 -0
- evalscope/perf/plugin/__init__.py +2 -0
- evalscope/perf/plugin/api/__init__.py +3 -0
- evalscope/perf/{api_plugin_base.py → plugin/api/base.py} +17 -18
- evalscope/perf/{custom_api.py → plugin/api/custom_api.py} +25 -19
- evalscope/perf/{dashscope_api.py → plugin/api/dashscope_api.py} +28 -14
- evalscope/perf/{openai_api.py → plugin/api/openai_api.py} +51 -27
- evalscope/perf/plugin/datasets/__init__.py +6 -0
- evalscope/perf/{dataset_plugin_base.py → plugin/datasets/base.py} +13 -10
- evalscope/perf/plugin/datasets/custom.py +21 -0
- evalscope/perf/plugin/datasets/flickr8k.py +51 -0
- evalscope/perf/{datasets → plugin/datasets}/line_by_line.py +9 -5
- evalscope/perf/plugin/datasets/longalpaca.py +28 -0
- evalscope/perf/plugin/datasets/openqa.py +38 -0
- evalscope/perf/plugin/datasets/speed_benchmark.py +50 -0
- evalscope/perf/plugin/registry.py +54 -0
- evalscope/perf/{how_to_analysis_result.py → utils/analysis_result.py} +11 -5
- evalscope/perf/utils/benchmark_util.py +135 -0
- evalscope/perf/utils/chat_service.py +252 -0
- evalscope/perf/utils/db_util.py +200 -0
- evalscope/perf/utils/handler.py +46 -0
- evalscope/perf/utils/local_server.py +139 -0
- evalscope/registry/config/cfg_arena.yaml +77 -0
- evalscope/registry/config/cfg_arena_zhihu.yaml +63 -0
- evalscope/registry/config/cfg_pairwise_baseline.yaml +83 -0
- evalscope/registry/config/cfg_single.yaml +78 -0
- evalscope/registry/data/prompt_template/lmsys_v2.jsonl +8 -0
- evalscope/registry/data/prompt_template/prompt_templates.jsonl +8 -0
- evalscope/registry/data/qa_browser/battle.jsonl +634 -0
- evalscope/registry/data/qa_browser/category_mapping.yaml +10 -0
- evalscope/registry/data/question.jsonl +80 -0
- evalscope/third_party/longbench_write/README.md +118 -0
- evalscope/third_party/longbench_write/default_task.json +27 -0
- evalscope/third_party/longbench_write/default_task.yaml +24 -0
- evalscope/third_party/toolbench_static/README.md +118 -0
- evalscope/third_party/toolbench_static/config_default.json +15 -0
- evalscope/third_party/toolbench_static/config_default.yaml +12 -0
- evalscope/third_party/toolbench_static/requirements.txt +2 -0
- evalscope/utils/logger.py +18 -20
- evalscope/utils/utils.py +41 -42
- evalscope/version.py +2 -2
- evalscope-0.7.1.dist-info/LICENSE +203 -0
- {evalscope-0.6.1.dist-info → evalscope-0.7.1.dist-info}/METADATA +93 -35
- {evalscope-0.6.1.dist-info → evalscope-0.7.1.dist-info}/RECORD +101 -31
- {evalscope-0.6.1.dist-info → evalscope-0.7.1.dist-info}/WHEEL +1 -1
- {evalscope-0.6.1.dist-info → evalscope-0.7.1.dist-info}/top_level.txt +1 -0
- tests/cli/__init__.py +1 -0
- tests/cli/test_run.py +76 -0
- tests/perf/__init__.py +1 -0
- tests/perf/test_perf.py +96 -0
- tests/rag/test_clip_benchmark.py +85 -0
- tests/rag/test_mteb.py +136 -0
- tests/rag/test_ragas.py +120 -0
- tests/swift/__init__.py +1 -0
- tests/swift/test_run_swift_eval.py +146 -0
- tests/swift/test_run_swift_vlm_eval.py +128 -0
- tests/swift/test_run_swift_vlm_jugde_eval.py +157 -0
- tests/test_run_all.py +12 -0
- tests/vlm/__init__.py +1 -0
- tests/vlm/test_vlmeval.py +59 -0
- evalscope/perf/_logging.py +0 -32
- evalscope/perf/datasets/longalpaca_12k.py +0 -20
- evalscope/perf/datasets/openqa.py +0 -22
- evalscope/perf/plugin_registry.py +0 -35
- evalscope/perf/query_parameters.py +0 -42
- evalscope/perf/server_sent_event.py +0 -43
- evalscope/preprocess/tokenizers/gpt2_tokenizer.py +0 -221
- /evalscope/perf/{datasets → utils}/__init__.py +0 -0
- {evalscope-0.6.1.dist-info → evalscope-0.7.1.dist-info}/entry_points.txt +0 -0
- {evalscope/preprocess → tests}/__init__.py +0 -0
- {evalscope/preprocess/tokenizers → tests/rag}/__init__.py +0 -0
|
@@ -6,7 +6,8 @@ from opencompass.tasks import OpenICLInferTask
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
with read_base():
|
|
9
|
-
from opencompass.configs.summarizers.medium import summarizer
|
|
9
|
+
# from opencompass.configs.summarizers.medium import summarizer
|
|
10
|
+
# from opencompass.configs.summarizers.PMMEval import summarizer
|
|
10
11
|
from evalscope.backend.opencompass.tasks.eval_datasets import datasets
|
|
11
12
|
|
|
12
13
|
# 1. Get datasets
|
|
@@ -51,6 +51,7 @@ with read_base():
|
|
|
51
51
|
from opencompass.configs.datasets.triviaqa.triviaqa_gen_2121ce import triviaqa_datasets
|
|
52
52
|
from opencompass.configs.datasets.cmb.cmb_gen_dfb5c4 import cmb_datasets
|
|
53
53
|
from opencompass.configs.datasets.cmmlu.cmmlu_gen_c13365 import cmmlu_datasets
|
|
54
|
+
from opencompass.configs.datasets.PMMEval.pmmeval_gen import PMMEval_datasets
|
|
54
55
|
|
|
55
56
|
# Note: to be supported
|
|
56
57
|
# from opencompass.configs.datasets.flores.flores_gen_806ede import flores_datasets
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# Convert datasets to webdataset format
|
|
2
|
+
import os
|
|
3
|
+
from tqdm import tqdm
|
|
4
|
+
import torch
|
|
5
|
+
import torch.utils.data
|
|
6
|
+
import webdataset
|
|
7
|
+
from evalscope.backend.rag_eval.clip_benchmark.dataset_builder import DatasetWrapper
|
|
8
|
+
from evalscope.backend.rag_eval.utils.tools import path_to_bytes, PIL_to_bytes
|
|
9
|
+
from evalscope.utils.logger import get_logger
|
|
10
|
+
|
|
11
|
+
logger = get_logger()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def convert_dataset(
|
|
15
|
+
dataset,
|
|
16
|
+
split,
|
|
17
|
+
output_folder,
|
|
18
|
+
*,
|
|
19
|
+
transform=None,
|
|
20
|
+
image_format="webp",
|
|
21
|
+
max_count=10_000,
|
|
22
|
+
max_size=1_000_000_000,
|
|
23
|
+
multilabel=False,
|
|
24
|
+
verbose=True,
|
|
25
|
+
):
|
|
26
|
+
"""
|
|
27
|
+
Convert an iterable `dataset` of (image, label) pairs to webdataset (.tar) format, and store in `output_folder/split`.
|
|
28
|
+
|
|
29
|
+
Images may be passed in as either:
|
|
30
|
+
* File paths: pass in `transform=path_to_bytes`;
|
|
31
|
+
* PIL images: pass in `transform=PIL_to_bytes(image_format)` where `image_format` is e.g. "webp"; or
|
|
32
|
+
* Raw binary data: use a PyTorch `Dataset` that supports `transform=PIL_to_bytes(image_format)`, and pass in `transform=None` here.
|
|
33
|
+
Be sure that the transform is not applied twice.
|
|
34
|
+
|
|
35
|
+
Copying image files directly or writing raw binary data is fastest since it allows multiprocessing;
|
|
36
|
+
passing in PIL images will be slower, but should work for any format of dataset.
|
|
37
|
+
|
|
38
|
+
Labels must be zero-indexed integers (for multilabel datasets, labels must be arrays/tensors).
|
|
39
|
+
|
|
40
|
+
Classnames and zero-shot classification templates can be provided as attributes of the dataset (`.classes` and `.templates`)
|
|
41
|
+
or filled in manually afterward. `dataset.classes` should be a list of strings indexed by the labels,
|
|
42
|
+
and `dataset.templates` should be a list of strings containing `{c}` to specify where classnames are to be inserted.
|
|
43
|
+
"""
|
|
44
|
+
# Create output directory
|
|
45
|
+
os.makedirs(os.path.join(output_folder, split), exist_ok=True)
|
|
46
|
+
# Multiprocessed dataloader, should work with Dataset or list
|
|
47
|
+
dataloader = torch.utils.data.DataLoader(
|
|
48
|
+
dataset,
|
|
49
|
+
batch_size=1,
|
|
50
|
+
num_workers=8,
|
|
51
|
+
collate_fn=lambda batch: batch[0], # No collate, only for multiprocessing
|
|
52
|
+
)
|
|
53
|
+
if verbose:
|
|
54
|
+
try:
|
|
55
|
+
logger.info(f"Dataset size: {len(dataset)}")
|
|
56
|
+
except TypeError:
|
|
57
|
+
logger.info("IterableDataset has no len()")
|
|
58
|
+
# Save classnames
|
|
59
|
+
if hasattr(dataset, "classes") and dataset.classes:
|
|
60
|
+
classnames_fname = os.path.join(output_folder, "classnames.txt")
|
|
61
|
+
with open(classnames_fname, "w") as classnames_file:
|
|
62
|
+
logger.info(*dataset.classes, sep="\n", end="\n", file=classnames_file)
|
|
63
|
+
if verbose:
|
|
64
|
+
logger.info("Saved class names to '%s'" % classnames_fname)
|
|
65
|
+
elif verbose:
|
|
66
|
+
logger.info("WARNING: No class names found")
|
|
67
|
+
# Save zeroshot templates
|
|
68
|
+
if hasattr(dataset, "templates") and dataset.templates:
|
|
69
|
+
templates_fname = os.path.join(
|
|
70
|
+
output_folder, "zeroshot_classification_templates.txt"
|
|
71
|
+
)
|
|
72
|
+
with open(templates_fname, "w") as templates_file:
|
|
73
|
+
logger.info(*dataset.templates, sep="\n", end="\n", file=templates_file)
|
|
74
|
+
if verbose:
|
|
75
|
+
logger.info("Saved class names to '%s'" % templates_fname)
|
|
76
|
+
elif verbose:
|
|
77
|
+
logger.info("WARNING: No zeroshot classification templates found")
|
|
78
|
+
# Save dataset type
|
|
79
|
+
if multilabel:
|
|
80
|
+
type_fname = os.path.join(output_folder, "dataset_type.txt")
|
|
81
|
+
with open(type_fname, "w") as type_file:
|
|
82
|
+
logger.info("multilabel", end="\n", file=type_file)
|
|
83
|
+
if verbose:
|
|
84
|
+
logger.info("Saved dataset type to '%s'" % type_fname)
|
|
85
|
+
# Write to TAR files
|
|
86
|
+
data_fname = os.path.join(output_folder, split, r"%d.tar")
|
|
87
|
+
sink = webdataset.ShardWriter(data_fname, maxcount=max_count, maxsize=max_size)
|
|
88
|
+
nsamples = 0
|
|
89
|
+
label_type = "npy" if multilabel else "cls"
|
|
90
|
+
for index, (input, output) in enumerate(tqdm(dataloader, desc="Converting")):
|
|
91
|
+
nsamples += 1
|
|
92
|
+
if isinstance(input, str) and transform is path_to_bytes:
|
|
93
|
+
# If copying file, determine image format from extension
|
|
94
|
+
extension = (
|
|
95
|
+
os.path.splitext(input)[1]
|
|
96
|
+
.replace(".", "")
|
|
97
|
+
.lower()
|
|
98
|
+
.replace("jpeg", "jpg")
|
|
99
|
+
or image_format
|
|
100
|
+
)
|
|
101
|
+
else:
|
|
102
|
+
extension = image_format
|
|
103
|
+
# Convert label if necessary
|
|
104
|
+
if isinstance(output, torch.Tensor):
|
|
105
|
+
if multilabel:
|
|
106
|
+
output = output.detach().cpu().numpy()
|
|
107
|
+
else:
|
|
108
|
+
output = output.item()
|
|
109
|
+
# Write example
|
|
110
|
+
sink.write(
|
|
111
|
+
{
|
|
112
|
+
"__key__": "s%07d" % index,
|
|
113
|
+
extension: transform(input) if transform else input,
|
|
114
|
+
label_type: output,
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
num_shards = sink.shard
|
|
118
|
+
sink.close()
|
|
119
|
+
if verbose:
|
|
120
|
+
logger.info(
|
|
121
|
+
"Saved dataset to '%s'"
|
|
122
|
+
% data_fname.replace(r"%d", "{0..%d}" % (num_shards - 1))
|
|
123
|
+
)
|
|
124
|
+
# Save number of shards
|
|
125
|
+
nshards_fname = os.path.join(output_folder, split, "nshards.txt")
|
|
126
|
+
with open(nshards_fname, "w") as nshards_file:
|
|
127
|
+
logger.info(num_shards, end="\n", file=nshards_file)
|
|
128
|
+
if verbose:
|
|
129
|
+
logger.info("Saved number of shards = %d to '%s'" % (num_shards, nshards_fname))
|
|
130
|
+
logger.info("Final dataset size:", nsamples)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def convert_retrieval_dataset(
|
|
134
|
+
dataset,
|
|
135
|
+
split,
|
|
136
|
+
output_folder,
|
|
137
|
+
*,
|
|
138
|
+
transform=None,
|
|
139
|
+
image_format="webp",
|
|
140
|
+
max_count=10_000,
|
|
141
|
+
max_size=1_000_000_000,
|
|
142
|
+
verbose=True,
|
|
143
|
+
):
|
|
144
|
+
"""
|
|
145
|
+
Convert an iterable `dataset` of (image, [caption1, caption2, ...]) pairs to webdataset (.tar) format, and store in `output_folder/split`.
|
|
146
|
+
|
|
147
|
+
Labels must be lists of strings, with no newlines.
|
|
148
|
+
|
|
149
|
+
Read the documentation of `convert_dataset` for more information.
|
|
150
|
+
"""
|
|
151
|
+
# Create output directory
|
|
152
|
+
os.makedirs(os.path.join(output_folder, split), exist_ok=True)
|
|
153
|
+
# Multiprocessed dataloader, should work with Dataset or list
|
|
154
|
+
dataloader = torch.utils.data.DataLoader(
|
|
155
|
+
dataset,
|
|
156
|
+
batch_size=1,
|
|
157
|
+
num_workers=8,
|
|
158
|
+
collate_fn=lambda batch: batch[0], # No collate, only for multiprocessing
|
|
159
|
+
)
|
|
160
|
+
if verbose:
|
|
161
|
+
try:
|
|
162
|
+
logger.info(f"Dataset size: {len(dataset)}")
|
|
163
|
+
except TypeError:
|
|
164
|
+
logger.info("IterableDataset has no len()")
|
|
165
|
+
# No classnames
|
|
166
|
+
# No zeroshot templates
|
|
167
|
+
# Save dataset type
|
|
168
|
+
type_fname = os.path.join(output_folder, "dataset_type.txt")
|
|
169
|
+
with open(type_fname, "w") as type_file:
|
|
170
|
+
logger.info("retrieval", end="\n", file=type_file)
|
|
171
|
+
if verbose:
|
|
172
|
+
logger.info("Saved dataset type to '%s'" % type_fname)
|
|
173
|
+
# Write to TAR files
|
|
174
|
+
data_fname = os.path.join(output_folder, split, r"%d.tar")
|
|
175
|
+
sink = webdataset.ShardWriter(data_fname, maxcount=max_count, maxsize=max_size)
|
|
176
|
+
nsamples = 0
|
|
177
|
+
for index, (input, output) in enumerate(tqdm(dataloader, desc="Converting")):
|
|
178
|
+
nsamples += 1
|
|
179
|
+
if isinstance(input, str) and transform is path_to_bytes:
|
|
180
|
+
# If copying file, determine image format from extension
|
|
181
|
+
extension = (
|
|
182
|
+
os.path.splitext(input)[1]
|
|
183
|
+
.replace(".", "")
|
|
184
|
+
.lower()
|
|
185
|
+
.replace("jpeg", "jpg")
|
|
186
|
+
or image_format
|
|
187
|
+
)
|
|
188
|
+
else:
|
|
189
|
+
extension = image_format
|
|
190
|
+
sink.write(
|
|
191
|
+
{
|
|
192
|
+
"__key__": "s%07d" % index,
|
|
193
|
+
extension: transform(input) if transform else input,
|
|
194
|
+
"txt": "\n".join(caption.replace("\n", r"\n") for caption in output),
|
|
195
|
+
}
|
|
196
|
+
)
|
|
197
|
+
num_shards = sink.shard
|
|
198
|
+
sink.close()
|
|
199
|
+
if verbose:
|
|
200
|
+
logger.info(
|
|
201
|
+
"Saved dataset to '%s'"
|
|
202
|
+
% data_fname.replace(r"%d", "{0..%d}" % (num_shards - 1))
|
|
203
|
+
)
|
|
204
|
+
# Save number of shards
|
|
205
|
+
nshards_fname = os.path.join(output_folder, split, "nshards.txt")
|
|
206
|
+
with open(nshards_fname, "w") as nshards_file:
|
|
207
|
+
logger.info(num_shards, end="\n", file=nshards_file)
|
|
208
|
+
if verbose:
|
|
209
|
+
logger.info("Saved number of shards = %d to '%s'" % (num_shards, nshards_fname))
|
|
210
|
+
logger.info("Final dataset size:", nsamples)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
if __name__ == "__main__":
|
|
214
|
+
from modelscope.msdatasets import MsDataset
|
|
215
|
+
|
|
216
|
+
splits = ["train", "validation"]
|
|
217
|
+
for split in splits:
|
|
218
|
+
ds = MsDataset.load("modelscope/muge", split=split)
|
|
219
|
+
hf_dataset = ds.to_hf_dataset()
|
|
220
|
+
pytorch_dataset = DatasetWrapper(
|
|
221
|
+
hf_dataset, image_key="image", text_key="query"
|
|
222
|
+
)
|
|
223
|
+
convert_retrieval_dataset(
|
|
224
|
+
pytorch_dataset,
|
|
225
|
+
split,
|
|
226
|
+
"data/muge",
|
|
227
|
+
transform=PIL_to_bytes("jpg"),
|
|
228
|
+
image_format="jpg",
|
|
229
|
+
max_count=50_000,
|
|
230
|
+
)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
muge
|
|
2
|
+
mscoco_captions
|
|
3
|
+
mscoco_captions2017
|
|
4
|
+
flickr8k
|
|
5
|
+
flickr30k
|
|
6
|
+
imagenet1k
|
|
7
|
+
imagenetv2
|
|
8
|
+
imagenet_sketch
|
|
9
|
+
imagenet-a
|
|
10
|
+
imagenet-r
|
|
11
|
+
imagenet-o
|
|
12
|
+
objectnet
|
|
13
|
+
fer2013
|
|
14
|
+
voc2007
|
|
15
|
+
voc2007_multilabel
|
|
16
|
+
sun397
|
|
17
|
+
cars
|
|
18
|
+
fgvc_aircraft
|
|
19
|
+
mnist
|
|
20
|
+
stl10
|
|
21
|
+
gtsrb
|
|
22
|
+
country211
|
|
23
|
+
renderedsst2
|
|
24
|
+
vtab_caltech101
|
|
25
|
+
vtab_cifar10
|
|
26
|
+
vtab_cifar100
|
|
27
|
+
vtab_clevr_count_all
|
|
28
|
+
vtab_clevr_closest_object_distance
|
|
29
|
+
vtab_diabetic_retinopathy
|
|
30
|
+
vtab_dmlab
|
|
31
|
+
vtab_dsprites_label_orientation
|
|
32
|
+
vtab_dsprites_label_x_position
|
|
33
|
+
vtab_dsprites_label_y_position
|
|
34
|
+
vtab_dtd
|
|
35
|
+
vtab_eurosat
|
|
36
|
+
vtab_kitti_closest_vehicle_distance
|
|
37
|
+
vtab_flowers
|
|
38
|
+
vtab_pets
|
|
39
|
+
vtab_pcam
|
|
40
|
+
vtab_resisc45
|
|
41
|
+
vtab_smallnorb_label_azimuth
|
|
42
|
+
vtab_smallnorb_label_elevation
|
|
43
|
+
vtab_svhn
|
evalscope/backend/rag_eval/ragas/prompts/chinese/AnswerCorrectness/correctness_prompt_chinese.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ragas_version": "0.2.5",
|
|
3
|
+
"original_hash": 963876325390538086,
|
|
4
|
+
"language": "chinese",
|
|
5
|
+
"instruction": "给定一个真实情况和一个答案陈述,分析每个陈述并将其分类为以下类别之一:TP(真正):答案中存在的陈述也直接由一个或多个真实情况中的陈述支持,FP(假正):答案中存在的陈述但没有被任何真实情况中的陈述直接支持,FN(假负):在真实情况中发现但在答案中不存在的陈述。每个陈述只能属于一个类别。为每个分类提供理由。",
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"input": {
|
|
9
|
+
"question": "是什么为太阳提供能量,它的主要功能是什么?",
|
|
10
|
+
"answer": [
|
|
11
|
+
"太阳的能量来源于核裂变,类似于地球上的核反应堆。",
|
|
12
|
+
"太阳的主要功能是为太阳系提供光。"
|
|
13
|
+
],
|
|
14
|
+
"ground_truth": [
|
|
15
|
+
"太阳的能量来源于核聚变,其中氢原子融合形成氦。",
|
|
16
|
+
"太阳核心的这种聚变过程释放出巨大的能量。",
|
|
17
|
+
"来自太阳的能量提供热量和光,这对地球上的生命至关重要。",
|
|
18
|
+
"太阳的光在地球的气候系统中起着关键作用。",
|
|
19
|
+
"阳光有助于驱动天气和海洋洋流。"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"output": {
|
|
23
|
+
"TP": [
|
|
24
|
+
{
|
|
25
|
+
"statement": "太阳的主要功能是为太阳系提供光。",
|
|
26
|
+
"reason": "这一说法在某种程度上得到了地面事实的支持,提到太阳提供光和它的作用,尽管它更广泛地关注太阳的能量。"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"FP": [
|
|
30
|
+
{
|
|
31
|
+
"statement": "太阳的能量来源于核裂变,类似于地球上的核反应堆。",
|
|
32
|
+
"reason": "这一说法是不正确的,与地面事实相矛盾,地面事实指出太阳的能量来源于核聚变。"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"FN": [
|
|
36
|
+
{
|
|
37
|
+
"statement": "太阳的能量来源于核聚变,其中氢原子融合形成氦。",
|
|
38
|
+
"reason": "这种对太阳能量来源的准确描述没有包含在答案中。"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"statement": "太阳核心的这种聚变过程释放出巨大的能量。",
|
|
42
|
+
"reason": "这个过程及其重要性没有在答案中提到。"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"statement": "来自太阳的能量提供热量和光,这对地球上的生命至关重要。",
|
|
46
|
+
"reason": "答案中只提到了光,忽略了热量及其对生命的必要性,这些在地面事实中都有涵盖。"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"statement": "太阳的光在地球的气候系统中起着关键作用。",
|
|
50
|
+
"reason": "太阳光对地球气候系统的这种更广泛的影响没有在答案中提到。"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"statement": "阳光有助于驱动天气和海洋洋流。",
|
|
54
|
+
"reason": "答案中省略了阳光对天气模式和海洋洋流的影响。"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"input": {
|
|
61
|
+
"question": "水的沸点是多少?",
|
|
62
|
+
"answer": [
|
|
63
|
+
"水的沸点在海平面上是100摄氏度。"
|
|
64
|
+
],
|
|
65
|
+
"ground_truth": [
|
|
66
|
+
"水的沸点在海平面上是100摄氏度(212华氏度)。",
|
|
67
|
+
"水的沸点会随着海拔的变化而变化。"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"output": {
|
|
71
|
+
"TP": [
|
|
72
|
+
{
|
|
73
|
+
"statement": "水的沸点在海平面上是100摄氏度。",
|
|
74
|
+
"reason": "这一说法得到了地面事实的直接支持,地面事实明确指出水的沸点在海平面上是100摄氏度。"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"FP": [],
|
|
78
|
+
"FN": [
|
|
79
|
+
{
|
|
80
|
+
"statement": "水的沸点会随着海拔的变化而变化。",
|
|
81
|
+
"reason": "关于水的沸点如何随海拔变化的额外信息没有在答案中提到。"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ragas_version": "0.2.5",
|
|
3
|
+
"original_hash": 8370494081602031492,
|
|
4
|
+
"language": "chinese",
|
|
5
|
+
"instruction": "给定一个问题、一个答案和答案中的句子,分析在“句子”下给出的每个句子的复杂性,并将每个句子分解为一个或多个完全可理解的陈述,同时确保每个陈述中不使用代词。将输出格式化为JSON。",
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"input": {
|
|
9
|
+
"question": "阿尔伯特·爱因斯坦是谁,他以什么而闻名?",
|
|
10
|
+
"answer": "他是一位出生于德国的理论物理学家,被广泛认为是有史以来最伟大和最有影响力的物理学家之一。他最著名的是发展了相对论,他还对量子力学理论的发展做出了重要贡献。",
|
|
11
|
+
"sentences": {
|
|
12
|
+
"0": "他是一位出生于德国的理论物理学家,被广泛认为是有史以来最伟大和最有影响力的物理学家之一。",
|
|
13
|
+
"1": "他最著名的是发展了相对论,他还对量子力学理论的发展做出了重要贡献。"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"output": {
|
|
17
|
+
"sentences": [
|
|
18
|
+
{
|
|
19
|
+
"sentence_index": 0,
|
|
20
|
+
"simpler_statements": [
|
|
21
|
+
"阿尔伯特·爱因斯坦是一位出生于德国的理论物理学家。",
|
|
22
|
+
"阿尔伯特·爱因斯坦被认为是有史以来最伟大和最有影响力的物理学家之一。"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"sentence_index": 1,
|
|
27
|
+
"simpler_statements": [
|
|
28
|
+
"阿尔伯特·爱因斯坦最著名的是发展了相对论。",
|
|
29
|
+
"阿尔伯特·爱因斯坦还对量子力学理论的发展做出了重要贡献。"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
evalscope/backend/rag_eval/ragas/prompts/chinese/AnswerRelevancy/question_generation_chinese.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ragas_version": "0.2.5",
|
|
3
|
+
"original_hash": -6199619726952258368,
|
|
4
|
+
"language": "chinese",
|
|
5
|
+
"instruction": "为给定的答案生成一个问题,并识别答案是否是不明确的。如果答案是不明确的,则给出1;如果答案是明确的,则给出0。不明确的答案是指那些含糊其辞、模棱两可或不清楚的答案。例如,“我不知道”或“我不确定”是不明确的答案。",
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"input": {
|
|
9
|
+
"response": "阿尔伯特·爱因斯坦出生在德国。"
|
|
10
|
+
},
|
|
11
|
+
"output": {
|
|
12
|
+
"question": "阿尔伯特·爱因斯坦出生在哪里?",
|
|
13
|
+
"noncommittal": 0
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"input": {
|
|
18
|
+
"response": "我不知道2023年发明的智能手机的突破性功能,因为我对2022年以后的信息不了解。"
|
|
19
|
+
},
|
|
20
|
+
"output": {
|
|
21
|
+
"question": "2023年发明的智能手机的突破性功能是什么?",
|
|
22
|
+
"noncommittal": 1
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ragas_version": "0.2.5",
|
|
3
|
+
"original_hash": 6611742689846464445,
|
|
4
|
+
"language": "chinese",
|
|
5
|
+
"instruction": "给定问题、答案和上下文,验证上下文在得出给定答案时是否有用。如果有用,给出判决为“1”,如果没有用,给出判决为“0”,并以json格式输出。",
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"input": {
|
|
9
|
+
"question": "你能告诉我关于阿尔伯特·爱因斯坦的什么?",
|
|
10
|
+
"context": "阿尔伯特·爱因斯坦(1879年3月14日-1955年4月18日)是一位出生于德国的理论物理学家,被广泛认为是有史以来最伟大和最具影响力的科学家之一。他因发展相对论而闻名,同时也对量子力学做出了重要贡献,因此在20世纪前几十年现代物理学对自然科学理解的革命性重塑中起到了核心作用。他的质能等价公式E=mc²源于相对论,被称为“世界上最著名的方程”。他因“对理论物理学的贡献,特别是发现光电效应定律”而获得1921年诺贝尔物理学奖,这是量子理论发展的关键一步。他的工作也因其对科学哲学的影响而闻名。在1999年由英国《物理世界》杂志对全球130位顶尖物理学家的调查中,爱因斯坦被评为有史以来最伟大的物理学家。他的智力成就和原创性使爱因斯坦成为天才的代名词。",
|
|
11
|
+
"answer": "阿尔伯特·爱因斯坦,生于1879年3月14日,是一位出生于德国的理论物理学家,被广泛认为是有史以来最伟大和最具影响力的科学家之一。他因对理论物理学的贡献而获得1921年诺贝尔物理学奖。"
|
|
12
|
+
},
|
|
13
|
+
"output": {
|
|
14
|
+
"reason": "提供的背景确实有助于得出给定的答案。背景包括关于阿尔伯特·爱因斯坦的生活和贡献的关键信息,这些信息在答案中得到了反映。",
|
|
15
|
+
"verdict": 1
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"input": {
|
|
20
|
+
"question": "谁赢得了2020年ICC世界杯?",
|
|
21
|
+
"context": "2022年ICC男子T20世界杯于2022年10月16日至11月13日在澳大利亚举行,是该赛事的第八届。原定于2020年举行,但因COVID-19大流行而推迟。英格兰在决赛中以五个小门击败巴基斯坦,赢得了他们的第二个ICC男子T20世界杯冠军。",
|
|
22
|
+
"answer": "英格兰"
|
|
23
|
+
},
|
|
24
|
+
"output": {
|
|
25
|
+
"reason": "背景有助于澄清关于2020年ICC世界杯的情况,并指出英格兰是原定于2020年举行但实际上在2022年举行的比赛的获胜者。",
|
|
26
|
+
"verdict": 1
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"input": {
|
|
31
|
+
"question": "世界上最高的山是什么?",
|
|
32
|
+
"context": "安第斯山脉是世界上最长的大陆山脉,位于南美洲。它横跨七个国家,拥有西半球许多最高的山峰。该山脉以其多样的生态系统而闻名,包括高海拔的安第斯高原和亚马逊雨林。",
|
|
33
|
+
"answer": "珠穆朗玛峰。"
|
|
34
|
+
},
|
|
35
|
+
"output": {
|
|
36
|
+
"reason": "提供的背景讨论了安第斯山脉,虽然令人印象深刻,但不包括珠穆朗玛峰,也与关于世界最高山的问题没有直接关系。",
|
|
37
|
+
"verdict": 0
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
evalscope/backend/rag_eval/ragas/prompts/chinese/Faithfulness/nli_statements_message_chinese.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ragas_version": "0.2.5",
|
|
3
|
+
"original_hash": -4418228766304805311,
|
|
4
|
+
"language": "chinese",
|
|
5
|
+
"instruction": "您的任务是根据给定的上下文判断一系列陈述的真实性。对于每个陈述,如果可以根据上下文直接推断出该陈述,则必须返回判决为1;如果不能根据上下文直接推断出该陈述,则返回判决为0。",
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"input": {
|
|
9
|
+
"context": "约翰是XYZ大学的学生。他正在攻读计算机科学学位。本学期他选修了几门课程,包括数据结构、算法和数据库管理。约翰是一个勤奋的学生,花费大量时间学习和完成作业。他经常在图书馆待到很晚以完成他的项目。",
|
|
10
|
+
"statements": [
|
|
11
|
+
"约翰主修生物学。",
|
|
12
|
+
"约翰正在学习人工智能课程。",
|
|
13
|
+
"约翰是一个勤奋的学生。",
|
|
14
|
+
"约翰有一份兼职工作。"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"output": {
|
|
18
|
+
"statements": [
|
|
19
|
+
{
|
|
20
|
+
"statement": "约翰主修生物学。",
|
|
21
|
+
"reason": "约翰的专业明确提到是计算机科学。没有信息表明他主修生物学。",
|
|
22
|
+
"verdict": 0
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"statement": "约翰正在学习人工智能课程。",
|
|
26
|
+
"reason": "上下文提到约翰目前选修的课程,并未提到人工智能。因此,无法推断出约翰正在学习人工智能课程。",
|
|
27
|
+
"verdict": 0
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"statement": "约翰是一个勤奋的学生。",
|
|
31
|
+
"reason": "上下文指出他花费大量时间学习和完成作业。此外,还提到他经常在图书馆待到很晚以完成他的项目,这表明了他的勤奋。",
|
|
32
|
+
"verdict": 1
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"statement": "约翰有一份兼职工作。",
|
|
36
|
+
"reason": "上下文中没有提供关于约翰有兼职工作的信息。",
|
|
37
|
+
"verdict": 0
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"input": {
|
|
44
|
+
"context": "光合作用是植物、藻类和某些细菌用来将光能转化为化学能的过程。",
|
|
45
|
+
"statements": [
|
|
46
|
+
"阿尔伯特·爱因斯坦是个天才。"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"output": {
|
|
50
|
+
"statements": [
|
|
51
|
+
{
|
|
52
|
+
"statement": "阿尔伯特·爱因斯坦是个天才。",
|
|
53
|
+
"reason": "上下文和陈述无关",
|
|
54
|
+
"verdict": 0
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ragas_version": "0.2.5",
|
|
3
|
+
"original_hash": 8370494081602031492,
|
|
4
|
+
"language": "chinese",
|
|
5
|
+
"instruction": "给定一个问题、一个答案和答案中的句子,分析在“句子”下给出的每个句子的复杂性,并将每个句子分解为一个或多个完全可理解的陈述,同时确保每个陈述中不使用代词。将输出格式化为JSON。",
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"input": {
|
|
9
|
+
"question": "阿尔伯特·爱因斯坦是谁,他最出名的是什么?",
|
|
10
|
+
"answer": "他是一位出生于德国的理论物理学家,被广泛认为是有史以来最伟大和最有影响力的物理学家之一。他最出名的是发展了相对论,他还对量子力学理论的发展做出了重要贡献。",
|
|
11
|
+
"sentences": {
|
|
12
|
+
"0": "他是一位出生于德国的理论物理学家,被广泛认为是有史以来最伟大和最有影响力的物理学家之一。",
|
|
13
|
+
"1": "他最出名的是发展了相对论,他还对量子力学理论的发展做出了重要贡献。"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"output": {
|
|
17
|
+
"sentences": [
|
|
18
|
+
{
|
|
19
|
+
"sentence_index": 0,
|
|
20
|
+
"simpler_statements": [
|
|
21
|
+
"阿尔伯特·爱因斯坦是一位出生于德国的理论物理学家。",
|
|
22
|
+
"阿尔伯特·爱因斯坦被认为是有史以来最伟大和最有影响力的物理学家之一。"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"sentence_index": 1,
|
|
27
|
+
"simpler_statements": [
|
|
28
|
+
"阿尔伯特·爱因斯坦最出名的是发展了相对论。",
|
|
29
|
+
"阿尔伯特·爱因斯坦还对量子力学理论的发展做出了重要贡献。"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ragas_version": "0.2.5",
|
|
3
|
+
"original_hash": 5488893487931336269,
|
|
4
|
+
"language": "chinese",
|
|
5
|
+
"instruction": "从给定文本中仅提取第2级和第3级标题。",
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"input": {
|
|
9
|
+
"text": " 介绍\n 主题概述...\n\n 主要概念\n 核心思想的解释...\n\n 详细分析\n 分析的技术和方法...\n\n 小节:专业技术\n 专业技术的进一步细节...\n\n 未来方向\n 对即将到来的趋势的见解...\n\n 小节:研究的下一步\n 新研究领域的讨论...\n\n 结论\n 最后的评论和总结。\n "
|
|
10
|
+
},
|
|
11
|
+
"output": {
|
|
12
|
+
"headlines": [
|
|
13
|
+
"主要概念",
|
|
14
|
+
"详细分析",
|
|
15
|
+
"小节:专业技术",
|
|
16
|
+
"未来方向",
|
|
17
|
+
"小节:研究的下一步"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ragas_version": "0.2.5",
|
|
3
|
+
"original_hash": -5063505674847369221,
|
|
4
|
+
"language": "chinese",
|
|
5
|
+
"instruction": "通过将来自至少两个不同列表的概念配对来形成组合。\n**说明:**\n- 查看每个节点的概念。\n- 确定可以逻辑连接或对比的概念。\n- 形成涉及来自不同节点的概念的组合。\n- 每个组合应至少包括来自两个或多个节点的一个概念。\n- 清晰简洁地列出组合。\n- 不要重复相同的组合。",
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"input": {
|
|
9
|
+
"lists_of_concepts": [
|
|
10
|
+
[
|
|
11
|
+
"人工智能",
|
|
12
|
+
"自动化"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"医疗保健",
|
|
16
|
+
"数据隐私"
|
|
17
|
+
]
|
|
18
|
+
],
|
|
19
|
+
"max_combinations": 2
|
|
20
|
+
},
|
|
21
|
+
"output": {
|
|
22
|
+
"combinations": [
|
|
23
|
+
[
|
|
24
|
+
"人工智能",
|
|
25
|
+
"医疗保健"
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"自动化",
|
|
29
|
+
"数据隐私"
|
|
30
|
+
]
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ragas_version": "0.2.5",
|
|
3
|
+
"original_hash": -1698100170803872933,
|
|
4
|
+
"language": "chinese",
|
|
5
|
+
"instruction": "根据指定的条件(角色、主题、风格、长度)和提供的上下文生成查询和答案。确保答案完全忠实于上下文,仅使用直接来自提供节点的信息。### 指令:\n1. **生成查询**:根据上下文、角色、主题、风格和长度,创建一个符合角色视角并反映主题的问题。\n2. **生成答案**:仅使用提供的上下文内容,创建一个忠实且详细的答案。不要包含任何不在或无法从给定上下文中推断的信息。\n### 示例输出:\n\n",
|
|
6
|
+
"examples": []
|
|
7
|
+
}
|