Ryoo72 commited on
Commit
f7fc6bb
·
verified ·
1 Parent(s): 76c1de5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +36 -0
README.md CHANGED
@@ -21,3 +21,39 @@ configs:
21
  - split: val
22
  path: data/val-*
23
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  - split: val
22
  path: data/val-*
23
  ---
24
+
25
+ [NCSOFT/K-MMStar](https://huggingface.co/datasets/NCSOFT/K-MMStar) 를 쓰기 좋게 바꾸어놓았습니다.
26
+
27
+ 아래 코드를 이용하였습니다.
28
+ ```python
29
+ from datasets import load_dataset, DatasetDict, Dataset
30
+ from huggingface_hub import login; login(token="YOUR TOKEN")
31
+
32
+ dataset = load_dataset("NCSOFT/K-MMStar")
33
+
34
+ def preprocess_dataset(examples):
35
+ processed_examples = {
36
+ "index": examples["index"],
37
+ "image": examples["image"],
38
+ "answer": examples["answer"]
39
+ }
40
+
41
+ processed_examples["question"] = [
42
+ q.replace("<image>", "").strip() for q in examples["question"]
43
+ ]
44
+
45
+ return processed_examples
46
+
47
+ processed_dataset = DatasetDict()
48
+ for split, dataset_split in dataset.items():
49
+ processed_dataset[split] = dataset_split.map(
50
+ preprocess_dataset,
51
+ batched=True,
52
+ remove_columns=["category", "l2_category", "meta_info"]
53
+ )
54
+
55
+ processed_dataset.push_to_hub(
56
+ "Ryoo72/K-MMStar",
57
+ private=False
58
+ )
59
+ ```