Datasets:

Modalities:
Text
Formats:
json
Languages:
Chinese
Size:
< 1K
Libraries:
Datasets
pandas
License:
suolyer commited on
Commit
109c359
1 Parent(s): 2cad8af

Delete Ziya-Eval-Chinese.py

Browse files
Files changed (1) hide show
  1. Ziya-Eval-Chinese.py +0 -133
Ziya-Eval-Chinese.py DELETED
@@ -1,133 +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
- # TODO: Address all TODOs and remove all explanatory comments
15
- """"""
16
-
17
-
18
- import csv
19
- import json
20
- import os
21
-
22
- import datasets
23
-
24
-
25
- # TODO: Add BibTeX citation
26
- # Find for instance the citation on arxiv or on the dataset repo/website
27
- _CITATION = """\
28
- @article{fengshenbang,
29
- author = {Jiaxing Zhang and Ruyi Gan and Junjie Wang and Yuxiang Zhang and Lin Zhang and Ping Yang and Xinyu Gao and Ziwei Wu and Xiaoqun Dong and Junqing He and Jianheng Zhuo and Qi Yang and Yongfeng Huang and Xiayu Li and Yanghan Wu and Junyu Lu and Xinyu Zhu and Weifeng Chen and Ting Han and Kunhao Pan and Rui Wang and Hao Wang and Xiaojun Wu and Zhongshen Zeng and Chongpei Chen},
30
- title = {Fengshenbang 1.0: Being the Foundation of Chinese Cognitive Intelligence},
31
- journal = {CoRR},
32
- volume = {abs/2209.02970},
33
- year = {2022}
34
- }
35
-
36
- """
37
-
38
- # TODO: Add description of the dataset here
39
- # You can copy an official description
40
- _DESCRIPTION = """\
41
- This IDEA-CCNL/Ziya-Eval-Chinese dataset is designed to evaluate the ability of LLM in chinese.
42
- """
43
-
44
- # TODO: Add a link to an official homepage for the dataset here
45
- _HOMEPAGE = "https://huggingface.co/datasets/IDEA-CCNL/Ziya-Eval-Chinese"
46
-
47
- # TODO: Add the licence for the dataset here if you can find it
48
- _LICENSE = "apache-license-2.0"
49
-
50
- # TODO: Add link to the official dataset URLs here
51
- # The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
52
- # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
53
-
54
-
55
- # TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
56
- class ZiyaEvalChinese(datasets.GeneratorBasedBuilder):
57
- """TODO: Short description of my dataset."""
58
-
59
- VERSION = datasets.Version("1.0.0")
60
-
61
- # This is an example of a dataset with multiple configurations.
62
- # If you don't want/need to define several sub-sets in your dataset,
63
- # just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
64
-
65
- # If you need to make complex sub-parts in the datasets with configurable options
66
- # You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
67
- # BUILDER_CONFIG_CLASS = MyBuilderConfig
68
-
69
- # You will be able to load one or the other configurations in the following list with
70
- # data = datasets.load_dataset('my_dataset', 'first_domain')
71
- # data = datasets.load_dataset('my_dataset', 'second_domain')
72
-
73
- # DEFAULT_CONFIG_NAME = "first_domain" # It's not mandatory to have a default configuration. Just use one if it make sense.
74
-
75
- def _info(self):
76
- features = datasets.Features(
77
- {
78
- "class": datasets.Value("string"),
79
- "type": datasets.Value("string"),
80
- "query": datasets.Value("string"),
81
- }
82
- )
83
- return datasets.DatasetInfo(
84
- # This is the description that will appear on the datasets page.
85
- description=_DESCRIPTION,
86
- # This defines the different columns of the dataset and their types
87
- features=features, # Here we define them above because they are different between the two configurations
88
- # If there's a common (input, target) tuple from the features, uncomment supervised_keys line below and
89
- # specify them. They'll be used if as_supervised=True in builder.as_dataset.
90
- # supervised_keys=("sentence", "label"),
91
- # Homepage of the dataset for documentation
92
- homepage=_HOMEPAGE,
93
- # License for the dataset if available
94
- license=_LICENSE,
95
- # Citation for the dataset
96
- citation=_CITATION,
97
- )
98
-
99
- def _split_generators(self, dl_manager):
100
- # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
101
- # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
102
-
103
- # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
104
- # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
105
- # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
106
- urls = {
107
- "test": os.path.join("", f"test.jsonl"),
108
- }
109
- data_dir = dl_manager.download_and_extract(urls)
110
- return [
111
- datasets.SplitGenerator(
112
- name=datasets.Split.TEST,
113
- # These kwargs will be passed to _generate_examples
114
- gen_kwargs={
115
- "filepath": data_dir['test'],
116
- "split": "test"
117
- },
118
- ),
119
- ]
120
-
121
- # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
122
- def _generate_examples(self, filepath, split):
123
- # TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
124
- # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
125
- with open(filepath, encoding="utf-8") as f:
126
- for key, row in enumerate(f):
127
- data = json.loads(row)
128
- # Yields examples as (key, example) tuples
129
- yield key, {
130
- "class": data["class"],
131
- "type": data["type"],
132
- "query": data["query"],
133
- }