Ryoo72 commited on
Commit
8994c84
·
verified ·
1 Parent(s): 347cb50

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -1
README.md CHANGED
@@ -24,4 +24,35 @@ configs:
24
  path: data/test-*
25
  ---
26
 
27
- [NCSOFT/K-DTCBench](https://huggingface.co/datasets/NCSOFT/K-DTCBench) 를 쓰기 좋게 바꾸어놓았습니다.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  path: data/test-*
25
  ---
26
 
27
+ [NCSOFT/K-DTCBench](https://huggingface.co/datasets/NCSOFT/K-DTCBench) 를 쓰기 좋게 바꾸어놓았습니다.
28
+
29
+ 아래 코드를 이용하였습니다.
30
+ ```python
31
+ from datasets import load_dataset, Dataset
32
+ from huggingface_hub import login; login(token="YOUR TOKEN")
33
+
34
+ dataset = load_dataset("NCSOFT/K-DTCBench")
35
+
36
+ def transform_format(example):
37
+ formatted_question = f"{example['question']}\nOptions: A: {example['choice_a']}, B: {example['choice_b']}, C: {example['choice_c']}, D: {example['choice_d']}\n주어진 선택지 중 해당 옵션의 문자로 직접 답하세요."
38
+
39
+ return {
40
+ "question": formatted_question,
41
+ "answer": example['answer'],
42
+ "image": example['image'],
43
+ "index": example['index'],
44
+ "category": example['category'],
45
+ }
46
+
47
+ new_test_dataset = dataset['test'].map(transform_format, remove_columns=[
48
+ 'choice_a', 'choice_b', 'choice_c', 'choice_d'
49
+ ])
50
+
51
+ new_dataset = {}
52
+ new_dataset['test'] = new_test_dataset
53
+
54
+ from datasets import DatasetDict
55
+ new_dataset_dict = DatasetDict(new_dataset)
56
+
57
+ new_dataset_dict.push_to_hub('Ryoo72/K-DTCBench', private=False, max_shard_size="500MB")
58
+ ```