mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00

* add Chinese version: csqa crowspairs nq * Update cn_data * Update cn_data * update format --------- Co-authored-by: liuhongwei <liuhongwei@pjlab.org.cn> Co-authored-by: Leymore <zfz-960727@163.com>
24 lines
523 B
Python
24 lines
523 B
Python
import json
|
|
|
|
from datasets import Dataset, DatasetDict
|
|
|
|
from .base import BaseDataset
|
|
|
|
|
|
class CrowspairsDataset_CN(BaseDataset):
|
|
|
|
@staticmethod
|
|
def load(path):
|
|
data = []
|
|
with open(path, 'r') as f:
|
|
for line in f:
|
|
item = json.loads(line)
|
|
data.append(item)
|
|
|
|
def preprocess(example):
|
|
example['label'] = 'A'
|
|
return example
|
|
|
|
dataset = Dataset.from_list(data).map(preprocess)
|
|
return DatasetDict({'test': dataset})
|