evalscope 0.17.1__py3-none-any.whl → 1.0.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/__init__.py +4 -1
- evalscope/api/benchmark/__init__.py +3 -0
- evalscope/api/benchmark/adapters/__init__.py +5 -0
- evalscope/api/benchmark/adapters/default_data_adapter.py +684 -0
- evalscope/api/benchmark/adapters/image_edit_adapter.py +82 -0
- evalscope/api/benchmark/adapters/multi_choice_adapter.py +83 -0
- evalscope/api/benchmark/adapters/text2image_adapter.py +156 -0
- evalscope/api/benchmark/adapters/vision_language_adapter.py +6 -0
- evalscope/api/benchmark/benchmark.py +356 -0
- evalscope/api/benchmark/meta.py +121 -0
- evalscope/api/dataset/__init__.py +2 -0
- evalscope/api/dataset/dataset.py +349 -0
- evalscope/api/dataset/loader.py +262 -0
- evalscope/api/dataset/utils.py +143 -0
- evalscope/api/evaluator/__init__.py +3 -0
- evalscope/api/evaluator/cache.py +378 -0
- evalscope/api/evaluator/evaluator.py +56 -0
- evalscope/api/evaluator/state.py +275 -0
- evalscope/api/filter/__init__.py +1 -0
- evalscope/api/filter/filter.py +72 -0
- evalscope/api/messages/__init__.py +12 -0
- evalscope/api/messages/chat_message.py +243 -0
- evalscope/api/messages/content.py +102 -0
- evalscope/api/messages/utils.py +35 -0
- evalscope/api/metric/__init__.py +2 -0
- evalscope/api/metric/metric.py +55 -0
- evalscope/api/metric/scorer.py +113 -0
- evalscope/api/mixin/__init__.py +1 -0
- evalscope/api/mixin/llm_judge_mixin.py +168 -0
- evalscope/api/model/__init__.py +12 -0
- evalscope/api/model/generate_config.py +155 -0
- evalscope/api/model/model.py +386 -0
- evalscope/api/model/model_output.py +285 -0
- evalscope/api/registry.py +182 -0
- evalscope/api/tool/__init__.py +3 -0
- evalscope/api/tool/tool_call.py +101 -0
- evalscope/api/tool/tool_info.py +173 -0
- evalscope/api/tool/utils.py +64 -0
- evalscope/app/app.py +3 -0
- evalscope/app/ui/app_ui.py +2 -1
- evalscope/app/ui/multi_model.py +50 -25
- evalscope/app/ui/single_model.py +26 -14
- evalscope/app/utils/data_utils.py +43 -27
- evalscope/app/utils/env_utils.py +12 -0
- evalscope/app/utils/text_utils.py +14 -14
- evalscope/app/utils/visualization.py +9 -4
- evalscope/arguments.py +7 -10
- evalscope/backend/opencompass/api_meta_template.py +2 -1
- evalscope/backend/opencompass/backend_manager.py +6 -5
- evalscope/backend/rag_eval/clip_benchmark/dataset_builder.py +10 -10
- evalscope/backend/rag_eval/clip_benchmark/task_template.py +8 -4
- evalscope/backend/rag_eval/ragas/task_template.py +2 -1
- evalscope/backend/rag_eval/ragas/tasks/build_distribution.py +2 -1
- evalscope/backend/rag_eval/ragas/tasks/build_transform.py +7 -4
- evalscope/backend/rag_eval/ragas/tasks/testset_generation.py +2 -1
- evalscope/backend/rag_eval/ragas/tasks/translate_prompt.py +2 -1
- evalscope/backend/rag_eval/utils/embedding.py +10 -1
- evalscope/backend/rag_eval/utils/llm.py +13 -12
- evalscope/benchmarks/__init__.py +0 -2
- evalscope/benchmarks/aime/aime24_adapter.py +38 -40
- evalscope/benchmarks/aime/aime25_adapter.py +34 -40
- evalscope/benchmarks/alpaca_eval/alpaca_eval_adapter.py +86 -60
- evalscope/benchmarks/arc/arc_adapter.py +34 -147
- evalscope/benchmarks/arena_hard/arena_hard_adapter.py +96 -70
- evalscope/benchmarks/arena_hard/utils.py +37 -1
- evalscope/benchmarks/bbh/bbh_adapter.py +72 -144
- evalscope/benchmarks/bfcl/bfcl_adapter.py +188 -171
- evalscope/benchmarks/bfcl/generation.py +222 -0
- evalscope/benchmarks/ceval/ceval_adapter.py +93 -162
- evalscope/benchmarks/chinese_simple_qa/csimple_qa_adapter.py +85 -82
- evalscope/benchmarks/cmmlu/cmmlu_adapter.py +34 -125
- evalscope/benchmarks/competition_math/competition_math_adapter.py +56 -108
- evalscope/benchmarks/data_collection/data_collection_adapter.py +187 -45
- evalscope/benchmarks/docmath/docmath_adapter.py +109 -51
- evalscope/benchmarks/docmath/utils.py +4 -5
- evalscope/benchmarks/drop/drop_adapter.py +88 -40
- evalscope/benchmarks/frames/frames_adapter.py +136 -52
- evalscope/benchmarks/general_arena/general_arena_adapter.py +140 -98
- evalscope/benchmarks/general_arena/utils.py +23 -27
- evalscope/benchmarks/general_mcq/general_mcq_adapter.py +40 -101
- evalscope/benchmarks/general_qa/general_qa_adapter.py +73 -134
- evalscope/benchmarks/gpqa/gpqa_adapter.py +61 -100
- evalscope/benchmarks/gpqa/{chain_of_thought.txt → prompt.py} +12 -5
- evalscope/benchmarks/gsm8k/gsm8k_adapter.py +62 -142
- evalscope/benchmarks/hellaswag/hellaswag_adapter.py +35 -124
- evalscope/benchmarks/hle/hle_adapter.py +127 -93
- evalscope/benchmarks/humaneval/humaneval_adapter.py +86 -55
- evalscope/benchmarks/ifeval/ifeval_adapter.py +69 -40
- evalscope/benchmarks/ifeval/instructions.py +109 -64
- evalscope/benchmarks/ifeval/instructions_registry.py +1 -1
- evalscope/benchmarks/ifeval/instructions_util.py +2 -3
- evalscope/benchmarks/ifeval/utils.py +6 -7
- evalscope/benchmarks/image_edit/gedit/__init__.py +0 -0
- evalscope/benchmarks/image_edit/gedit/gedit_adapter.py +138 -0
- evalscope/benchmarks/image_edit/gedit/utils.py +372 -0
- evalscope/benchmarks/image_edit/gedit/vie_prompts.py +406 -0
- evalscope/benchmarks/iquiz/iquiz_adapter.py +30 -65
- evalscope/benchmarks/live_code_bench/evaluate_utils.py +2 -2
- evalscope/benchmarks/live_code_bench/live_code_bench_adapter.py +121 -71
- evalscope/benchmarks/live_code_bench/load_utils.py +13 -21
- evalscope/benchmarks/live_code_bench/testing_util.py +6 -2
- evalscope/benchmarks/maritime_bench/maritime_bench_adapter.py +49 -75
- evalscope/benchmarks/math_500/math_500_adapter.py +41 -48
- evalscope/benchmarks/math_vista/__init__.py +0 -0
- evalscope/benchmarks/math_vista/math_vista_adapter.py +129 -0
- evalscope/benchmarks/mmlu/mmlu_adapter.py +32 -205
- evalscope/benchmarks/mmlu_pro/mmlu_pro_adapter.py +80 -99
- evalscope/benchmarks/mmlu_redux/mmlu_redux_adapter.py +64 -110
- evalscope/benchmarks/mmmu/__init__.py +0 -0
- evalscope/benchmarks/mmmu/mmmu_adapter.py +159 -0
- evalscope/benchmarks/mmmu_pro/__init__.py +0 -0
- evalscope/benchmarks/mmmu_pro/mmmu_pro_adapter.py +129 -0
- evalscope/benchmarks/musr/musr_adapter.py +33 -64
- evalscope/benchmarks/needle_haystack/needle_haystack_adapter.py +196 -152
- evalscope/benchmarks/process_bench/process_bench_adapter.py +144 -76
- evalscope/benchmarks/race/race_adapter.py +33 -119
- evalscope/benchmarks/simple_qa/simple_qa_adapter.py +72 -70
- evalscope/benchmarks/super_gpqa/{five_shot_prompt.txt → prompt.py} +14 -16
- evalscope/benchmarks/super_gpqa/super_gpqa_adapter.py +73 -117
- evalscope/benchmarks/super_gpqa/utils.py +2 -1
- evalscope/benchmarks/tau_bench/generation.py +147 -0
- evalscope/benchmarks/tau_bench/tau_bench_adapter.py +114 -60
- evalscope/benchmarks/text2image/__init__.py +0 -0
- evalscope/benchmarks/text2image/evalmuse_adapter.py +78 -0
- evalscope/benchmarks/text2image/genai_bench_adapter.py +53 -0
- evalscope/benchmarks/text2image/general_t2i_adapter.py +42 -0
- evalscope/benchmarks/text2image/hpdv2_adapter.py +52 -0
- evalscope/benchmarks/text2image/tifa_adapter.py +27 -0
- evalscope/benchmarks/tool_bench/tool_bench_adapter.py +91 -70
- evalscope/benchmarks/trivia_qa/trivia_qa_adapter.py +56 -124
- evalscope/benchmarks/truthful_qa/truthful_qa_adapter.py +70 -266
- evalscope/benchmarks/winogrande/winogrande_adapter.py +28 -54
- evalscope/cli/cli.py +2 -0
- evalscope/cli/start_app.py +7 -1
- evalscope/cli/start_perf.py +7 -1
- evalscope/cli/start_server.py +6 -3
- evalscope/collections/__init__.py +2 -10
- evalscope/collections/sampler.py +10 -10
- evalscope/collections/schema.py +13 -11
- evalscope/config.py +157 -57
- evalscope/constants.py +37 -61
- evalscope/evaluator/__init__.py +1 -1
- evalscope/evaluator/evaluator.py +275 -419
- evalscope/filters/__init__.py +2 -0
- evalscope/filters/extraction.py +126 -0
- evalscope/filters/selection.py +57 -0
- evalscope/metrics/__init__.py +13 -13
- evalscope/metrics/llm_judge.py +47 -33
- evalscope/metrics/math_parser.py +27 -22
- evalscope/metrics/metric.py +307 -0
- evalscope/metrics/metrics.py +22 -18
- evalscope/metrics/t2v_metrics/__init__.py +0 -52
- evalscope/metrics/t2v_metrics/models/clipscore_models/build_mps_model/clip_model.py +4 -2
- evalscope/metrics/t2v_metrics/models/clipscore_models/build_mps_model/cross_modeling.py +9 -13
- evalscope/metrics/t2v_metrics/models/clipscore_models/clip_model.py +2 -1
- evalscope/metrics/t2v_metrics/models/clipscore_models/hpsv2_model.py +3 -2
- evalscope/metrics/t2v_metrics/models/clipscore_models/mps_model.py +2 -1
- evalscope/metrics/t2v_metrics/models/clipscore_models/pickscore_model.py +2 -2
- evalscope/metrics/t2v_metrics/models/itmscore_models/blip2_itm_model.py +2 -1
- evalscope/metrics/t2v_metrics/models/itmscore_models/fga_blip2_model.py +4 -2
- evalscope/metrics/t2v_metrics/models/itmscore_models/image_reward/ImageReward.py +10 -5
- evalscope/metrics/t2v_metrics/models/itmscore_models/image_reward/blip_pretrain.py +4 -2
- evalscope/metrics/t2v_metrics/models/itmscore_models/image_reward_model.py +2 -1
- evalscope/metrics/t2v_metrics/models/vqascore_models/clip_t5/model/language_model/clip_t5.py +15 -9
- evalscope/metrics/t2v_metrics/models/vqascore_models/clip_t5/model/multimodal_encoder/clip_encoder.py +4 -2
- evalscope/metrics/t2v_metrics/models/vqascore_models/clip_t5_model.py +15 -10
- evalscope/metrics/t2v_metrics/models/vqascore_models/gpt4v_model.py +9 -6
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/common/config.py +2 -2
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/common/gradcam.py +4 -2
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/common/logger.py +4 -2
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/common/optims.py +3 -9
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/common/registry.py +16 -10
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/common/vqa_tools/vqa.py +3 -2
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/common/vqa_tools/vqa_eval.py +4 -2
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/__init__.py +8 -4
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip2_models/Qformer.py +47 -25
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip2_models/blip2_qformer.py +12 -7
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip2_models/blip2_t5.py +23 -17
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip2_models/blip2_t5_instruct.py +33 -23
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip2_models/fga_blip2.py +2 -1
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip2_models/modeling_llama.py +46 -30
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip2_models/modeling_t5.py +69 -37
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip_models/__init__.py +7 -5
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip_models/blip.py +6 -4
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip_models/blip_image_text_matching.py +7 -5
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip_models/blip_nlvr.py +3 -2
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip_models/blip_outputs.py +5 -2
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip_models/blip_vqa.py +17 -13
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/blip_models/nlvr_encoder.py +35 -19
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/clip_vit.py +14 -12
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/eva_vit.py +63 -52
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/med.py +63 -38
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/models/vit.py +6 -3
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/processors/__init__.py +6 -2
- evalscope/metrics/t2v_metrics/models/vqascore_models/lavis/processors/randaugment.py +3 -2
- evalscope/metrics/t2v_metrics/models/vqascore_models/mm_utils.py +15 -13
- evalscope/metrics/t2v_metrics/models/vqascore_models/vqa_model.py +3 -2
- evalscope/models/__init__.py +6 -29
- evalscope/models/image_edit_model.py +125 -0
- evalscope/models/mockllm.py +65 -0
- evalscope/models/model_apis.py +67 -0
- evalscope/models/modelscope.py +455 -0
- evalscope/models/openai_compatible.py +126 -0
- evalscope/models/text2image_model.py +124 -0
- evalscope/models/utils/openai.py +701 -0
- evalscope/perf/benchmark.py +4 -1
- evalscope/perf/http_client.py +4 -2
- evalscope/perf/plugin/api/custom_api.py +5 -4
- evalscope/perf/plugin/api/openai_api.py +11 -9
- evalscope/perf/plugin/datasets/custom.py +2 -1
- evalscope/perf/plugin/datasets/flickr8k.py +1 -1
- evalscope/perf/plugin/datasets/kontext_bench.py +1 -1
- evalscope/perf/plugin/datasets/line_by_line.py +2 -1
- evalscope/perf/plugin/datasets/longalpaca.py +2 -1
- evalscope/perf/plugin/datasets/openqa.py +4 -2
- evalscope/perf/utils/benchmark_util.py +15 -10
- evalscope/perf/utils/db_util.py +9 -6
- evalscope/perf/utils/local_server.py +11 -3
- evalscope/perf/utils/rich_display.py +16 -10
- evalscope/report/__init__.py +2 -3
- evalscope/report/combinator.py +18 -12
- evalscope/report/generator.py +51 -35
- evalscope/report/{utils.py → report.py} +8 -6
- evalscope/run.py +33 -47
- evalscope/summarizer.py +1 -1
- evalscope/third_party/toolbench_static/llm/swift_infer.py +0 -4
- evalscope/utils/__init__.py +21 -2
- evalscope/utils/chat_service.py +3 -2
- evalscope/utils/deprecation_utils.py +12 -1
- evalscope/utils/function_utils.py +29 -0
- evalscope/utils/import_utils.py +23 -1
- evalscope/utils/io_utils.py +142 -6
- evalscope/utils/json_schema.py +208 -0
- evalscope/utils/logger.py +51 -12
- evalscope/utils/model_utils.py +11 -7
- evalscope/utils/multi_choices.py +288 -0
- evalscope/utils/url_utils.py +65 -0
- evalscope/version.py +2 -2
- {evalscope-0.17.1.dist-info → evalscope-1.0.1.dist-info}/METADATA +108 -62
- {evalscope-0.17.1.dist-info → evalscope-1.0.1.dist-info}/RECORD +258 -226
- tests/benchmark/test_eval.py +385 -0
- tests/benchmark/test_image_edit.py +65 -0
- tests/{aigc → benchmark}/test_t2i.py +22 -4
- tests/benchmark/test_vlm.py +80 -0
- tests/cli/test_all.py +85 -47
- tests/cli/test_collection.py +20 -8
- tests/cli/test_custom.py +22 -15
- tests/cli/test_reasoning.py +81 -0
- tests/common.py +73 -0
- tests/perf/test_perf.py +4 -2
- tests/rag/test_clip_benchmark.py +0 -2
- evalscope/benchmarks/aigc/t2i/base.py +0 -56
- evalscope/benchmarks/aigc/t2i/evalmuse_adapter.py +0 -78
- evalscope/benchmarks/aigc/t2i/genai_bench_adapter.py +0 -58
- evalscope/benchmarks/aigc/t2i/general_t2i_adapter.py +0 -58
- evalscope/benchmarks/aigc/t2i/hpdv2_adapter.py +0 -57
- evalscope/benchmarks/aigc/t2i/tifa_adapter.py +0 -37
- evalscope/benchmarks/arc/ai2_arc.py +0 -151
- evalscope/benchmarks/benchmark.py +0 -81
- evalscope/benchmarks/ceval/ceval_exam.py +0 -146
- evalscope/benchmarks/cmmlu/cmmlu.py +0 -161
- evalscope/benchmarks/cmmlu/samples.jsonl +0 -5
- evalscope/benchmarks/competition_math/competition_math.py +0 -79
- evalscope/benchmarks/data_adapter.py +0 -528
- evalscope/benchmarks/filters.py +0 -59
- evalscope/benchmarks/gsm8k/gsm8k.py +0 -121
- evalscope/benchmarks/hellaswag/hellaswag.py +0 -112
- evalscope/benchmarks/humaneval/humaneval.py +0 -79
- evalscope/benchmarks/mmlu/mmlu.py +0 -160
- evalscope/benchmarks/mmlu/samples.jsonl +0 -5
- evalscope/benchmarks/process_bench/critique_template.txt +0 -13
- evalscope/benchmarks/race/race.py +0 -104
- evalscope/benchmarks/race/samples.jsonl +0 -5
- evalscope/benchmarks/super_gpqa/zero_shot_prompt.txt +0 -4
- evalscope/benchmarks/trivia_qa/trivia_qa.py +0 -89
- evalscope/benchmarks/truthful_qa/truthful_qa.py +0 -163
- evalscope/benchmarks/utils.py +0 -60
- evalscope/collections/evaluator.py +0 -375
- evalscope/metrics/completion_parsers.py +0 -227
- evalscope/metrics/named_metrics.py +0 -55
- evalscope/models/adapters/__init__.py +0 -14
- evalscope/models/adapters/base_adapter.py +0 -84
- evalscope/models/adapters/bfcl_adapter.py +0 -246
- evalscope/models/adapters/chat_adapter.py +0 -207
- evalscope/models/adapters/choice_adapter.py +0 -222
- evalscope/models/adapters/custom_adapter.py +0 -71
- evalscope/models/adapters/server_adapter.py +0 -236
- evalscope/models/adapters/t2i_adapter.py +0 -79
- evalscope/models/adapters/tau_bench_adapter.py +0 -189
- evalscope/models/custom/__init__.py +0 -4
- evalscope/models/custom/custom_model.py +0 -50
- evalscope/models/custom/dummy_model.py +0 -99
- evalscope/models/local_model.py +0 -128
- evalscope/models/register.py +0 -41
- tests/cli/test_run.py +0 -489
- /evalscope/{benchmarks/aigc → api}/__init__.py +0 -0
- /evalscope/benchmarks/{aigc/t2i → image_edit}/__init__.py +0 -0
- {evalscope-0.17.1.dist-info → evalscope-1.0.1.dist-info}/LICENSE +0 -0
- {evalscope-0.17.1.dist-info → evalscope-1.0.1.dist-info}/WHEEL +0 -0
- {evalscope-0.17.1.dist-info → evalscope-1.0.1.dist-info}/entry_points.txt +0 -0
- {evalscope-0.17.1.dist-info → evalscope-1.0.1.dist-info}/top_level.txt +0 -0
- /tests/{aigc → benchmark}/__init__.py +0 -0
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Alibaba, Inc. and its affiliates.
|
|
2
|
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
# flake8: noqa
|
|
16
|
-
"""Grade School Math 8k dataset."""
|
|
17
|
-
|
|
18
|
-
import datasets
|
|
19
|
-
import json
|
|
20
|
-
import textwrap
|
|
21
|
-
|
|
22
|
-
_CITATION = """\
|
|
23
|
-
@misc{cobbe2021training,
|
|
24
|
-
title={Training Verifiers to Solve Math Word Problems},
|
|
25
|
-
author={Karl Cobbe and Vineet Kosaraju and Mohammad Bavarian and Jacob Hilton and Reiichiro Nakano and Christopher Hesse and John Schulman},
|
|
26
|
-
year={2021},
|
|
27
|
-
eprint={2110.14168},
|
|
28
|
-
archivePrefix={arXiv},
|
|
29
|
-
primaryClass={cs.LG}
|
|
30
|
-
}
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
_DESCRIPTION = """\
|
|
34
|
-
GSM8K (Grade School Math 8K) is a dataset of 8.5K high quality
|
|
35
|
-
linguistically diverse grade school math word problems. The
|
|
36
|
-
dataset was created to support the task of question answering
|
|
37
|
-
on basic mathematical problems that require multi-step reasoning.
|
|
38
|
-
"""
|
|
39
|
-
|
|
40
|
-
_HOMEPAGE = 'https://openai.com/blog/grade-school-math'
|
|
41
|
-
_MODELSCOPE_PAGE = 'https://modelscope.cn/datasets/modelscope/gsm8k/summary'
|
|
42
|
-
|
|
43
|
-
_LICENSE = 'MIT'
|
|
44
|
-
|
|
45
|
-
# _BASE_URL = "https://raw.githubusercontent.com/openai/grade-school-math/master/grade_school_math/data/"
|
|
46
|
-
TRAIN_URL = 'https://sail-moe.oss-cn-hangzhou.aliyuncs.com/open_data/gsm8k/train.jsonl'
|
|
47
|
-
TEST_URL = 'https://sail-moe.oss-cn-hangzhou.aliyuncs.com/open_data/gsm8k/test.jsonl'
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
class Gsm8kConfig(datasets.BuilderConfig):
|
|
51
|
-
"""BuilderConfig for GSM8K."""
|
|
52
|
-
|
|
53
|
-
def __init__(self, urls, **kwargs):
|
|
54
|
-
"""BuilderConfig for GSM8K.
|
|
55
|
-
Args:
|
|
56
|
-
urls: *dict[string]*, the urls for each split of the GSM8k set.
|
|
57
|
-
"""
|
|
58
|
-
super().__init__(version=datasets.Version('1.1.0'), **kwargs)
|
|
59
|
-
self.urls = urls
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
class Gsm8k(datasets.GeneratorBasedBuilder):
|
|
63
|
-
"""Grade School Math 8k (GSM8K)"""
|
|
64
|
-
|
|
65
|
-
BUILDER_CONFIGS = [
|
|
66
|
-
Gsm8kConfig(
|
|
67
|
-
name='main',
|
|
68
|
-
description=textwrap.dedent(
|
|
69
|
-
"""
|
|
70
|
-
It is segmented into 7.5K training problems and 1K test problems.
|
|
71
|
-
These problems take between 2 and 8 steps to solve, and solutions
|
|
72
|
-
primarily involve performing a sequence of elementary calculations
|
|
73
|
-
using basic arithmetic operations (+ - / *) to reach the final
|
|
74
|
-
answer. A bright middle school student should be able to solve
|
|
75
|
-
every problem.
|
|
76
|
-
""", ),
|
|
77
|
-
urls={
|
|
78
|
-
'train': TRAIN_URL,
|
|
79
|
-
'test': TEST_URL,
|
|
80
|
-
},
|
|
81
|
-
),
|
|
82
|
-
]
|
|
83
|
-
|
|
84
|
-
def _info(self):
|
|
85
|
-
features = datasets.Features({
|
|
86
|
-
'question': datasets.Value('string'),
|
|
87
|
-
'answer': datasets.Value('string'),
|
|
88
|
-
})
|
|
89
|
-
return datasets.DatasetInfo(
|
|
90
|
-
description=_DESCRIPTION,
|
|
91
|
-
features=features,
|
|
92
|
-
homepage=_HOMEPAGE,
|
|
93
|
-
license=_LICENSE,
|
|
94
|
-
citation=_CITATION,
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
def _split_generators(self, dl_manager):
|
|
98
|
-
data_dir = dl_manager.download_and_extract(self.config.urls)
|
|
99
|
-
return [
|
|
100
|
-
datasets.SplitGenerator(
|
|
101
|
-
name=datasets.Split.TRAIN,
|
|
102
|
-
gen_kwargs={
|
|
103
|
-
'filepath': data_dir['train'],
|
|
104
|
-
},
|
|
105
|
-
),
|
|
106
|
-
datasets.SplitGenerator(
|
|
107
|
-
name=datasets.Split.TEST,
|
|
108
|
-
gen_kwargs={
|
|
109
|
-
'filepath': data_dir['test'],
|
|
110
|
-
},
|
|
111
|
-
),
|
|
112
|
-
]
|
|
113
|
-
|
|
114
|
-
def _generate_examples(self, filepath):
|
|
115
|
-
with open(filepath, encoding='utf-8') as f:
|
|
116
|
-
for key, row in enumerate(f):
|
|
117
|
-
data = json.loads(row)
|
|
118
|
-
yield key, {
|
|
119
|
-
'question': data['question'],
|
|
120
|
-
'answer': data['answer'],
|
|
121
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Alibaba, Inc. and its affiliates.
|
|
2
|
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
|
3
|
-
"""HellaSwag: Can a Machine Really Finish Your Sentence? is a new dataset for commonsense NLI.
|
|
4
|
-
A paper was published at ACL2019.
|
|
5
|
-
"""
|
|
6
|
-
"""DO NOT EDIT."""
|
|
7
|
-
|
|
8
|
-
import datasets
|
|
9
|
-
import json
|
|
10
|
-
|
|
11
|
-
# flake8: noqa
|
|
12
|
-
|
|
13
|
-
# HomePage: https://rowanzellers.com/hellaswag/
|
|
14
|
-
# GitHub: https://github.com/rowanz/hellaswag
|
|
15
|
-
|
|
16
|
-
_CITATION = """\
|
|
17
|
-
@inproceedings{zellers2019hellaswag,
|
|
18
|
-
title={HellaSwag: Can a Machine Really Finish Your Sentence?},
|
|
19
|
-
author={Zellers, Rowan and Holtzman, Ari and Bisk, Yonatan and Farhadi, Ali and Choi, Yejin},
|
|
20
|
-
booktitle ={Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics},
|
|
21
|
-
year={2019}
|
|
22
|
-
}
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
_DESCRIPTION = """
|
|
26
|
-
HellaSwag: Can a Machine Really Finish Your Sentence? is a new dataset for commonsense NLI. A paper was published at ACL2019.
|
|
27
|
-
"""
|
|
28
|
-
_URL = 'https://modelscope.oss-cn-beijing.aliyuncs.com/open_data/hellaswag/'
|
|
29
|
-
_URLS = {
|
|
30
|
-
'train': _URL + 'hellaswag_train.jsonl',
|
|
31
|
-
'test': _URL + 'hellaswag_test.jsonl',
|
|
32
|
-
'dev': _URL + 'hellaswag_val.jsonl',
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class Hellaswag(datasets.GeneratorBasedBuilder):
|
|
37
|
-
"""TODO(hellaswag): Short description of my dataset."""
|
|
38
|
-
|
|
39
|
-
# TODO(hellaswag): Set up version.
|
|
40
|
-
VERSION = datasets.Version('0.1.0')
|
|
41
|
-
|
|
42
|
-
def _info(self):
|
|
43
|
-
# TODO(hellaswag): Specifies the datasets.DatasetInfo object
|
|
44
|
-
return datasets.DatasetInfo(
|
|
45
|
-
# This is the description that will appear on the datasets page.
|
|
46
|
-
description=_DESCRIPTION,
|
|
47
|
-
# datasets.features.FeatureConnectors
|
|
48
|
-
features=datasets.Features({
|
|
49
|
-
# These are the features of your dataset like images, labels ...
|
|
50
|
-
'ind': datasets.Value('int32'),
|
|
51
|
-
'activity_label': datasets.Value('string'),
|
|
52
|
-
'ctx_a': datasets.Value('string'),
|
|
53
|
-
'ctx_b': datasets.Value('string'),
|
|
54
|
-
'ctx': datasets.Value('string'),
|
|
55
|
-
'endings': datasets.features.Sequence(datasets.Value('string')),
|
|
56
|
-
'source_id': datasets.Value('string'),
|
|
57
|
-
'split': datasets.Value('string'),
|
|
58
|
-
'split_type': datasets.Value('string'),
|
|
59
|
-
'label': datasets.Value('string'),
|
|
60
|
-
}),
|
|
61
|
-
# If there's a common (input, target) tuple from the features,
|
|
62
|
-
# specify them here. They'll be used if as_supervised=True in
|
|
63
|
-
# builder.as_dataset.
|
|
64
|
-
supervised_keys=None,
|
|
65
|
-
# Homepage of the dataset for documentation
|
|
66
|
-
homepage='https://rowanzellers.com/hellaswag/',
|
|
67
|
-
citation=_CITATION,
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
def _split_generators(self, dl_manager):
|
|
71
|
-
"""Returns SplitGenerators."""
|
|
72
|
-
# TODO(hellaswag): Downloads the data and defines the splits
|
|
73
|
-
# dl_manager is a datasets.download.DownloadManager that can be used to
|
|
74
|
-
# download and extract URLs
|
|
75
|
-
urls_to_download = _URLS
|
|
76
|
-
dl_dir = dl_manager.download_and_extract(urls_to_download)
|
|
77
|
-
return [
|
|
78
|
-
datasets.SplitGenerator(
|
|
79
|
-
name=datasets.Split.TRAIN,
|
|
80
|
-
# These kwargs will be passed to _generate_examples
|
|
81
|
-
gen_kwargs={'filepath': dl_dir['train']},
|
|
82
|
-
),
|
|
83
|
-
datasets.SplitGenerator(
|
|
84
|
-
name=datasets.Split.TEST,
|
|
85
|
-
# These kwargs will be passed to _generate_examples
|
|
86
|
-
gen_kwargs={'filepath': dl_dir['test']},
|
|
87
|
-
),
|
|
88
|
-
datasets.SplitGenerator(
|
|
89
|
-
name=datasets.Split.VALIDATION,
|
|
90
|
-
# These kwargs will be passed to _generate_examples
|
|
91
|
-
gen_kwargs={'filepath': dl_dir['dev']},
|
|
92
|
-
),
|
|
93
|
-
]
|
|
94
|
-
|
|
95
|
-
def _generate_examples(self, filepath):
|
|
96
|
-
"""Yields examples."""
|
|
97
|
-
# TODO(hellaswag): Yields (key, example) tuples from the dataset
|
|
98
|
-
with open(filepath, encoding='utf-8') as f:
|
|
99
|
-
for id_, row in enumerate(f):
|
|
100
|
-
data = json.loads(row)
|
|
101
|
-
yield id_, {
|
|
102
|
-
'ind': int(data['ind']),
|
|
103
|
-
'activity_label': data['activity_label'],
|
|
104
|
-
'ctx_a': data.get('ctx_a', ''),
|
|
105
|
-
'ctx_b': data.get('ctx_b', ''),
|
|
106
|
-
'ctx': data['ctx'],
|
|
107
|
-
'endings': data.get('endings', []),
|
|
108
|
-
'source_id': data['source_id'],
|
|
109
|
-
'split': data['split'],
|
|
110
|
-
'split_type': data['split_type'],
|
|
111
|
-
'label': str(data.get('label', '')),
|
|
112
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Alibaba, Inc. and its affiliates.
|
|
2
|
-
import datasets
|
|
3
|
-
import json
|
|
4
|
-
|
|
5
|
-
# flake8: noqa
|
|
6
|
-
|
|
7
|
-
# NOTE: AUTOGENERATED, DO NOT CHANGE.
|
|
8
|
-
|
|
9
|
-
_DESCRIPTION = """\
|
|
10
|
-
The HumanEval dataset released by OpenAI contains 164 handcrafted programming challenges together with unittests to very the viability of a proposed solution.
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
# _URL = "https://raw.githubusercontent.com/openai/human-eval/master/data/HumanEval.jsonl.gz"
|
|
14
|
-
_URL = 'https://sail-moe.oss-cn-hangzhou.aliyuncs.com/open_data/humaneval/HumanEval.jsonl.gz'
|
|
15
|
-
|
|
16
|
-
_CITATION = """\
|
|
17
|
-
@misc{chen2021evaluating,
|
|
18
|
-
title={Evaluating Large Language Models Trained on Code},
|
|
19
|
-
author={Mark Chen and Jerry Tworek and Heewoo Jun and Qiming Yuan and Henrique Ponde de Oliveira Pinto and Jared Kaplan and Harri Edwards and Yuri Burda and Nicholas Joseph and Greg Brockman and Alex Ray and Raul Puri and Gretchen Krueger and Michael Petrov and Heidy Khlaaf and Girish Sastry and Pamela Mishkin and Brooke Chan and Scott Gray and Nick Ryder and Mikhail Pavlov and Alethea Power and Lukasz Kaiser and Mohammad Bavarian and Clemens Winter and Philippe Tillet and Felipe Petroski Such and Dave Cummings and Matthias Plappert and Fotios Chantzis and Elizabeth Barnes and Ariel Herbert-Voss and William Hebgen Guss and Alex Nichol and Alex Paino and Nikolas Tezak and Jie Tang and Igor Babuschkin and Suchir Balaji and Shantanu Jain and William Saunders and Christopher Hesse and Andrew N. Carr and Jan Leike and Josh Achiam and Vedant Misra and Evan Morikawa and Alec Radford and Matthew Knight and Miles Brundage and Mira Murati and Katie Mayer and Peter Welinder and Bob McGrew and Dario Amodei and Sam McCandlish and Ilya Sutskever and Wojciech Zaremba},
|
|
20
|
-
year={2021},
|
|
21
|
-
eprint={2107.03374},
|
|
22
|
-
archivePrefix={arXiv},
|
|
23
|
-
primaryClass={cs.LG}
|
|
24
|
-
}"""
|
|
25
|
-
|
|
26
|
-
_HOMEPAGE = 'https://github.com/openai/human-eval'
|
|
27
|
-
|
|
28
|
-
_LICENSE = 'MIT'
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
class OpenaiHumaneval(datasets.GeneratorBasedBuilder):
|
|
32
|
-
"""HumanEval: A benchmark for code generation."""
|
|
33
|
-
|
|
34
|
-
VERSION = datasets.Version('1.0.0')
|
|
35
|
-
|
|
36
|
-
BUILDER_CONFIGS = [
|
|
37
|
-
datasets.BuilderConfig(
|
|
38
|
-
name='openai_humaneval',
|
|
39
|
-
version=datasets.Version('1.0.0'),
|
|
40
|
-
description=_DESCRIPTION,
|
|
41
|
-
)
|
|
42
|
-
]
|
|
43
|
-
|
|
44
|
-
def _info(self):
|
|
45
|
-
features = datasets.Features({
|
|
46
|
-
'task_id': datasets.Value('string'),
|
|
47
|
-
'prompt': datasets.Value('string'),
|
|
48
|
-
'canonical_solution': datasets.Value('string'),
|
|
49
|
-
'test': datasets.Value('string'),
|
|
50
|
-
'entry_point': datasets.Value('string'),
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
return datasets.DatasetInfo(
|
|
54
|
-
description=_DESCRIPTION,
|
|
55
|
-
features=features,
|
|
56
|
-
supervised_keys=None,
|
|
57
|
-
homepage=_HOMEPAGE,
|
|
58
|
-
license=_LICENSE,
|
|
59
|
-
citation=_CITATION,
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
def _split_generators(self, dl_manager):
|
|
63
|
-
"""Returns SplitGenerators."""
|
|
64
|
-
data_dir = dl_manager.download_and_extract(_URL)
|
|
65
|
-
return [datasets.SplitGenerator(
|
|
66
|
-
name=datasets.Split.TEST,
|
|
67
|
-
gen_kwargs={
|
|
68
|
-
'filepath': data_dir,
|
|
69
|
-
},
|
|
70
|
-
)]
|
|
71
|
-
|
|
72
|
-
def _generate_examples(self, filepath):
|
|
73
|
-
"""Yields examples."""
|
|
74
|
-
with open(filepath, encoding='utf-8') as file:
|
|
75
|
-
data = [json.loads(line) for line in file]
|
|
76
|
-
id_ = 0
|
|
77
|
-
for sample in data:
|
|
78
|
-
yield id_, sample
|
|
79
|
-
id_ += 1
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
# isort: skip_file
|
|
2
|
-
# Copyright (c) Alibaba, Inc. and its affiliates.
|
|
3
|
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
|
4
|
-
#
|
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
# you may not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
# See the License for the specific language governing permissions and
|
|
15
|
-
# limitations under the License.
|
|
16
|
-
# flake8: noqa
|
|
17
|
-
|
|
18
|
-
import datasets
|
|
19
|
-
import os
|
|
20
|
-
import pandas as pd
|
|
21
|
-
"""The MMLU dataset on ModelScope hub. READ ONLY, DO NOT MODIFY."""
|
|
22
|
-
|
|
23
|
-
_CITATION = """\
|
|
24
|
-
@article{hendryckstest2021,
|
|
25
|
-
title={Measuring Massive Multitask Language Understanding},
|
|
26
|
-
author={Dan Hendrycks and Collin Burns and Steven Basart and Andy Zou and Mantas Mazeika and Dawn Song and Jacob Steinhardt},
|
|
27
|
-
journal={Proceedings of the International Conference on Learning Representations (ICLR)},
|
|
28
|
-
year={2021}
|
|
29
|
-
}
|
|
30
|
-
"""
|
|
31
|
-
|
|
32
|
-
_DESCRIPTION = """\
|
|
33
|
-
Measuring Massive Multitask Language Understanding by Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas
|
|
34
|
-
Mazeika, Dawn Song, and Jacob Steinhardt (ICLR 2021).
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
|
-
_HOMEPAGE = 'https://modelscope.cn/datasets/modelscope/mmlu/summary'
|
|
38
|
-
|
|
39
|
-
_LICENSE = 'MIT'
|
|
40
|
-
|
|
41
|
-
# _URL = "https://people.eecs.berkeley.edu/~hendrycks/data.tar"
|
|
42
|
-
_URL = 'https://modelscope.cn/api/v1/datasets/modelscope/mmlu/repo?Revision=master&FilePath=data.tar'
|
|
43
|
-
|
|
44
|
-
task_list = [
|
|
45
|
-
'high_school_european_history',
|
|
46
|
-
'business_ethics',
|
|
47
|
-
'clinical_knowledge',
|
|
48
|
-
'medical_genetics',
|
|
49
|
-
'high_school_us_history',
|
|
50
|
-
'high_school_physics',
|
|
51
|
-
'high_school_world_history',
|
|
52
|
-
'virology',
|
|
53
|
-
'high_school_microeconomics',
|
|
54
|
-
'econometrics',
|
|
55
|
-
'college_computer_science',
|
|
56
|
-
'high_school_biology',
|
|
57
|
-
'abstract_algebra',
|
|
58
|
-
'professional_accounting',
|
|
59
|
-
'philosophy',
|
|
60
|
-
'professional_medicine',
|
|
61
|
-
'nutrition',
|
|
62
|
-
'global_facts',
|
|
63
|
-
'machine_learning',
|
|
64
|
-
'security_studies',
|
|
65
|
-
'public_relations',
|
|
66
|
-
'professional_psychology',
|
|
67
|
-
'prehistory',
|
|
68
|
-
'anatomy',
|
|
69
|
-
'human_sexuality',
|
|
70
|
-
'college_medicine',
|
|
71
|
-
'high_school_government_and_politics',
|
|
72
|
-
'college_chemistry',
|
|
73
|
-
'logical_fallacies',
|
|
74
|
-
'high_school_geography',
|
|
75
|
-
'elementary_mathematics',
|
|
76
|
-
'human_aging',
|
|
77
|
-
'college_mathematics',
|
|
78
|
-
'high_school_psychology',
|
|
79
|
-
'formal_logic',
|
|
80
|
-
'high_school_statistics',
|
|
81
|
-
'international_law',
|
|
82
|
-
'high_school_mathematics',
|
|
83
|
-
'high_school_computer_science',
|
|
84
|
-
'conceptual_physics',
|
|
85
|
-
'miscellaneous',
|
|
86
|
-
'high_school_chemistry',
|
|
87
|
-
'marketing',
|
|
88
|
-
'professional_law',
|
|
89
|
-
'management',
|
|
90
|
-
'college_physics',
|
|
91
|
-
'jurisprudence',
|
|
92
|
-
'world_religions',
|
|
93
|
-
'sociology',
|
|
94
|
-
'us_foreign_policy',
|
|
95
|
-
'high_school_macroeconomics',
|
|
96
|
-
'computer_security',
|
|
97
|
-
'moral_scenarios',
|
|
98
|
-
'moral_disputes',
|
|
99
|
-
'electrical_engineering',
|
|
100
|
-
'astronomy',
|
|
101
|
-
'college_biology',
|
|
102
|
-
]
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
class MMLUConfig(datasets.BuilderConfig):
|
|
106
|
-
|
|
107
|
-
def __init__(self, **kwargs):
|
|
108
|
-
super().__init__(version=datasets.Version('1.0.0'), **kwargs)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
class MMLU(datasets.GeneratorBasedBuilder):
|
|
112
|
-
BUILDER_CONFIGS = [MMLUConfig(name=task_name, ) for task_name in task_list]
|
|
113
|
-
|
|
114
|
-
def _info(self):
|
|
115
|
-
features = datasets.Features({
|
|
116
|
-
'input': datasets.Value('string'),
|
|
117
|
-
'A': datasets.Value('string'),
|
|
118
|
-
'B': datasets.Value('string'),
|
|
119
|
-
'C': datasets.Value('string'),
|
|
120
|
-
'D': datasets.Value('string'),
|
|
121
|
-
'target': datasets.Value('string'),
|
|
122
|
-
})
|
|
123
|
-
return datasets.DatasetInfo(
|
|
124
|
-
description=_DESCRIPTION,
|
|
125
|
-
features=features,
|
|
126
|
-
homepage=_HOMEPAGE,
|
|
127
|
-
license=_LICENSE,
|
|
128
|
-
citation=_CITATION,
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
def _split_generators(self, dl_manager):
|
|
132
|
-
data_dir = dl_manager.download_and_extract(_URL)
|
|
133
|
-
task_name = self.config.name
|
|
134
|
-
return [
|
|
135
|
-
datasets.SplitGenerator(
|
|
136
|
-
name=datasets.Split.TEST,
|
|
137
|
-
gen_kwargs={
|
|
138
|
-
'filepath': os.path.join(data_dir, 'data', 'test', f'{task_name}_test.csv'),
|
|
139
|
-
},
|
|
140
|
-
),
|
|
141
|
-
datasets.SplitGenerator(
|
|
142
|
-
name=datasets.Split.VALIDATION,
|
|
143
|
-
gen_kwargs={
|
|
144
|
-
'filepath': os.path.join(data_dir, 'data', 'val', f'{task_name}_val.csv'),
|
|
145
|
-
},
|
|
146
|
-
),
|
|
147
|
-
datasets.SplitGenerator(
|
|
148
|
-
name=datasets.Split.TRAIN,
|
|
149
|
-
gen_kwargs={
|
|
150
|
-
'filepath': os.path.join(data_dir, 'data', 'dev', f'{task_name}_dev.csv'),
|
|
151
|
-
},
|
|
152
|
-
),
|
|
153
|
-
]
|
|
154
|
-
|
|
155
|
-
def _generate_examples(self, filepath):
|
|
156
|
-
df = pd.read_csv(filepath)
|
|
157
|
-
df.columns = ['input', 'A', 'B', 'C', 'D', 'target']
|
|
158
|
-
|
|
159
|
-
for i, instance in enumerate(df.to_dict(orient='records')):
|
|
160
|
-
yield i, instance
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
{'input': 'A "dished face" profile is often associated with', 'A': 'a protruding mandible due to reactivation of the condylar cartilage by acromegaly.', 'B': 'a recessive maxilla due to failure of elongation of the cranial base.', 'C': 'an enlarged frontal bone due to hydrocephaly.', 'D': 'defective development of the maxillary air sinus.', 'target': 'B'}
|
|
2
|
-
{'input': '___________ is based on the idea that customer expectations of the service they will receive shape their perception of the actual service encounter.', 'A': 'Service quality.', 'B': 'Service action.', 'C': 'Service recovery.', 'D': 'Service satisfaction.', 'target': 'A'}
|
|
3
|
-
{'input': ' Information collected for the first time specifically for a marketing research study is called:', 'A': 'Secondary research.', 'B': 'Primary research.', 'C': 'Soft research.', 'D': 'Experimental research.', 'target': 'B'}
|
|
4
|
-
{'input': "This includes advertisements that contain 'call-to-response' mechanisms such as telephone numbers, website addresses, email and postal addresses:", 'A': 'Direct response advertising.', 'B': 'Sales promotions.', 'C': 'Mass media advertising.', 'D': 'Public relations.', 'target': 'A'}
|
|
5
|
-
{'input': 'Which of the following is not part of the external marketing environment?', 'A': 'Political.', 'B': 'Legal.', 'C': 'Product.', 'D': 'Socio-cultural.', 'target': 'C'}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
The following is a math problem and a solution (split into paragraphs, enclosed with tags and indexed from 0):
|
|
2
|
-
|
|
3
|
-
[Math Problem]
|
|
4
|
-
|
|
5
|
-
{problem}
|
|
6
|
-
|
|
7
|
-
[Solution]
|
|
8
|
-
|
|
9
|
-
{tagged_response}
|
|
10
|
-
|
|
11
|
-
Your task is to review and critique the solution paragraph by paragraph. Once you identify an error in a paragraph, return the index of the paragraph where the earliest error occurs. Otherwise, return the index of -1 (which typically denotes "not found").
|
|
12
|
-
|
|
13
|
-
Please put your final answer (i.e., the index) in \boxed{{}}.
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
import datasets
|
|
15
|
-
import os
|
|
16
|
-
import pandas as pd
|
|
17
|
-
|
|
18
|
-
_CITATION = """\
|
|
19
|
-
@inproceedings{lai-etal-2017-race,
|
|
20
|
-
title = "{RACE}: Large-scale {R}e{A}ding Comprehension Dataset From Examinations",
|
|
21
|
-
author = "Lai, Guokun and
|
|
22
|
-
Xie, Qizhe and
|
|
23
|
-
Liu, Hanxiao and
|
|
24
|
-
Yang, Yiming and
|
|
25
|
-
Hovy, Eduard",
|
|
26
|
-
booktitle = "Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing",
|
|
27
|
-
month = sep,
|
|
28
|
-
year = "2017",
|
|
29
|
-
address = "Copenhagen, Denmark",
|
|
30
|
-
publisher = "Association for Computational Linguistics",
|
|
31
|
-
url = "https://aclanthology.org/D17-1082",
|
|
32
|
-
doi = "10.18653/v1/D17-1082",
|
|
33
|
-
pages = "785--794",
|
|
34
|
-
}
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
|
-
_DESCRIPTION = """\
|
|
38
|
-
RACE is a large-scale reading comprehension dataset with more than 28,000 passages and nearly 100,000 questions.
|
|
39
|
-
"""
|
|
40
|
-
|
|
41
|
-
_HOMEPAGE = 'https://modelscope.cn/datasets/modelscope/race/summary'
|
|
42
|
-
|
|
43
|
-
_URL = 'https://modelscope.cn/api/v1/datasets/modelscope/race/repo?Revision=master&FilePath=race.zip'
|
|
44
|
-
|
|
45
|
-
task_list = [
|
|
46
|
-
'high',
|
|
47
|
-
'middle',
|
|
48
|
-
]
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class RACEConfig(datasets.BuilderConfig):
|
|
52
|
-
|
|
53
|
-
def __init__(self, **kwargs):
|
|
54
|
-
super().__init__(version=datasets.Version('1.0.0'), **kwargs)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
class RACE(datasets.GeneratorBasedBuilder):
|
|
58
|
-
BUILDER_CONFIGS = [RACEConfig(name=task_name, ) for task_name in task_list]
|
|
59
|
-
|
|
60
|
-
def _info(self):
|
|
61
|
-
features = datasets.Features({
|
|
62
|
-
'example_id': datasets.Value('string'),
|
|
63
|
-
'article': datasets.Value('string'),
|
|
64
|
-
'answer': datasets.Value('string'),
|
|
65
|
-
'question': datasets.Value('string'),
|
|
66
|
-
'options': [datasets.Value('string')],
|
|
67
|
-
})
|
|
68
|
-
return datasets.DatasetInfo(
|
|
69
|
-
description=_DESCRIPTION,
|
|
70
|
-
features=features,
|
|
71
|
-
homepage=_HOMEPAGE,
|
|
72
|
-
citation=_CITATION,
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
def _split_generators(self, dl_manager):
|
|
76
|
-
data_dir = dl_manager.download_and_extract(_URL)
|
|
77
|
-
task_name = self.config.name
|
|
78
|
-
return [
|
|
79
|
-
datasets.SplitGenerator(
|
|
80
|
-
name=datasets.Split.TEST,
|
|
81
|
-
gen_kwargs={
|
|
82
|
-
'filepath': os.path.join(data_dir, f'race/test/{task_name}-00000-of-00001.parquet'),
|
|
83
|
-
},
|
|
84
|
-
),
|
|
85
|
-
datasets.SplitGenerator(
|
|
86
|
-
name=datasets.Split.VALIDATION,
|
|
87
|
-
gen_kwargs={
|
|
88
|
-
'filepath': os.path.join(data_dir, f'race/val/{task_name}-00000-of-00001.parquet'),
|
|
89
|
-
},
|
|
90
|
-
),
|
|
91
|
-
datasets.SplitGenerator(
|
|
92
|
-
name=datasets.Split.TRAIN,
|
|
93
|
-
gen_kwargs={
|
|
94
|
-
'filepath': os.path.join(data_dir, f'race/train/{task_name}-00000-of-00001.parquet'),
|
|
95
|
-
},
|
|
96
|
-
),
|
|
97
|
-
]
|
|
98
|
-
|
|
99
|
-
def _generate_examples(self, filepath):
|
|
100
|
-
df = pd.read_parquet(filepath)
|
|
101
|
-
df.columns = ['example_id', 'article', 'answer', 'question', 'options']
|
|
102
|
-
|
|
103
|
-
for i, instance in enumerate(df.to_dict(orient='records')):
|
|
104
|
-
yield i, instance
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
{'example_id': 'middle4227.txt', 'article': 'There are many kinds...ealthy.\n,.', 'answer': 'D', 'question': 'We may read this pas... in _ .', 'options': ['a letter', 'a story', 'a newspaper', 'a health magazine']}
|
|
2
|
-
{'example_id': 'middle3329.txt', 'article': 'Do you know why diff...ng at all.', 'answer': 'B', 'question': 'Those pests with dif...of danger.', 'options': ['change their colours', 'hide in the day time...r at night', 'move quietly', 'hide at night and ap...e day time']}
|
|
3
|
-
{'example_id': 'middle3614.txt', 'article': 'The seahorse is a ve...o the sea.', 'answer': 'B', 'question': 'A seahorse eats _ .', 'options': ['sea weed', 'small fish', 'water', 'nothing']}
|
|
4
|
-
{'example_id': 'middle6632.txt', 'article': 'Kids have unbelievab...h at her."', 'answer': 'D', 'question': 'Which is NOT mention...e passage?', 'options': ['Robots keep secrets.', 'Robots give suggestions.', 'Robots do chores.', 'Robots make movies.']}
|
|
5
|
-
{'example_id': 'middle3503.txt', 'article': 'Have you ever heard ...eir lives.', 'answer': 'B', 'question': 'Which of the followi...lue moon"?', 'options': ['Simon often tells jo...blue moon.', 'Tom rarely remembers...blue moon.', 'Mary likes to go sho...blue moon.', 'Cindy hates to stay ...blue moon.']}
|