Dataset Viewer
Auto-converted to Parquet Duplicate
qid
uint32
0
9.83k
image
imagewidth (px)
240
1.02k
question
stringlengths
6
108
answer
stringclasses
484 values
q_lang
class label
2 classes
img_id
uint32
0
641
location
class label
10 classes
modality
class label
3 classes
base_type
class label
2 classes
answer_type
class label
2 classes
content_type
class label
10 classes
triple
listlengths
3
3
0
What modality is used to take this image?
MRI
0en
1
0Abdomen
0MRI
0vqa
0OPEN
0Modality
[ "vhead", "_", "_" ]
1
Which part of the body does this image belong to?
Abdomen
0en
1
0Abdomen
0MRI
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
2
What is the mr weighting in this image?
T2
0en
1
0Abdomen
0MRI
0vqa
0OPEN
0Modality
[ "vhead", "_", "_" ]
3
Does the picture contain liver?
Yes
0en
1
0Abdomen
0MRI
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
4
Does the picture contain kidney?
No
0en
1
0Abdomen
0MRI
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
5
Does the picture contain spleen?
No
0en
1
0Abdomen
0MRI
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
6
Where is the liver?
Right
0en
1
0Abdomen
0MRI
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
7
What modality is used to take this image?
CT
0en
100
1Lung
1CT
0vqa
0OPEN
0Modality
[ "vhead", "_", "_" ]
8
Which part of the body does this image belong to?
Chest
0en
100
1Lung
1CT
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
9
What is the main organ in the image?
Liver, Heart, Spleen, Lung
0en
100
1Lung
1CT
0vqa
0OPEN
2Organ
[ "vhead", "_", "_" ]
10
What is the largest organ in the picture?
Liver
0en
100
1Lung
1CT
0vqa
0OPEN
3Size
[ "vhead", "_", "_" ]
11
Does the picture contain liver?
Yes
0en
100
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
12
Does the picture contain lung?
Yes
0en
100
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
13
Does the picture contain heart?
Yes
0en
100
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
14
Is the lung healthy?
Yes
0en
100
1Lung
1CT
0vqa
1CLOSED
4Abnormality
[ "vhead", "_", "_" ]
15
Which is the biggest in this image,lung,liver or heart?
Liver
0en
100
1Lung
1CT
0vqa
1CLOSED
3Size
[ "vhead", "_", "_" ]
16
What modality is used to take this image?
CT
0en
101
1Lung
1CT
0vqa
0OPEN
0Modality
[ "vhead", "_", "_" ]
17
Which part of the body does this image belong to?
Chest
0en
101
1Lung
1CT
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
18
What is the main organ in the image?
Spinal Cord
0en
101
1Lung
1CT
0vqa
0OPEN
2Organ
[ "vhead", "_", "_" ]
19
Does the picture contain liver?
No
0en
101
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
20
Does the picture contain lung?
No
0en
101
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
21
Does the picture contain heart?
No
0en
101
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
22
What modality is used to take this image?
CT
0en
104
0Abdomen
1CT
0vqa
0OPEN
0Modality
[ "vhead", "_", "_" ]
23
Which part of the body does this image belong to?
Chest
0en
104
0Abdomen
1CT
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
24
What is the main organ in the image?
Lung
0en
104
0Abdomen
1CT
0vqa
0OPEN
2Organ
[ "vhead", "_", "_" ]
25
What is the largest organ in the picture?
Lung
0en
104
0Abdomen
1CT
0vqa
0OPEN
3Size
[ "vhead", "_", "_" ]
26
Does the picture contain liver?
No
0en
104
0Abdomen
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
27
Does the picture contain lung?
Yes
0en
104
0Abdomen
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
28
Does the picture contain heart?
No
0en
104
0Abdomen
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
29
What diseases are included in the picture?
Lung Cancer
0en
104
0Abdomen
1CT
0vqa
0OPEN
4Abnormality
[ "vhead", "_", "_" ]
30
Does the lung look abnormal?
Yes
0en
104
0Abdomen
1CT
0vqa
1CLOSED
4Abnormality
[ "vhead", "_", "_" ]
31
Where is/are the abnormality located?
Right Lung, Left
0en
104
0Abdomen
1CT
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
32
What modality is used to take this image?
CT
0en
107
1Lung
1CT
0vqa
0OPEN
0Modality
[ "vhead", "_", "_" ]
33
Which part of the body does this image belong to?
Chest
0en
107
1Lung
1CT
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
34
What is the main organ in the image?
Lung, Heart
0en
107
1Lung
1CT
0vqa
0OPEN
2Organ
[ "vhead", "_", "_" ]
35
What is the largest organ in the picture?
Lung
0en
107
1Lung
1CT
0vqa
0OPEN
3Size
[ "vhead", "_", "_" ]
36
Does the picture contain liver?
No
0en
107
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
37
Does the picture contain lung?
Yes
0en
107
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
38
Does the picture contain heart?
Yes
0en
107
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
39
What diseases are included in the picture?
None
0en
107
1Lung
1CT
0vqa
0OPEN
4Abnormality
[ "vhead", "_", "_" ]
40
Is the lung healthy?
Yes
0en
107
1Lung
1CT
0vqa
1CLOSED
4Abnormality
[ "vhead", "_", "_" ]
41
Which is the bigger in this image,lung or heart?
Lung
0en
107
1Lung
1CT
0vqa
1CLOSED
3Size
[ "vhead", "_", "_" ]
42
What modality is used to take this image?
CT
0en
108
1Lung
1CT
0vqa
0OPEN
0Modality
[ "vhead", "_", "_" ]
43
Which part of the body does this image belong to?
Chest
0en
108
1Lung
1CT
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
44
What is the main organ in the image?
Lung, Heart
0en
108
1Lung
1CT
0vqa
0OPEN
2Organ
[ "vhead", "_", "_" ]
45
What is the largest organ in the picture?
Lung
0en
108
1Lung
1CT
0vqa
0OPEN
3Size
[ "vhead", "_", "_" ]
46
Does the picture contain liver?
No
0en
108
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
47
Does the picture contain lung?
Yes
0en
108
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
48
Does the picture contain heart?
Yes
0en
108
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
49
What diseases are included in the picture?
Lung Cancer
0en
108
1Lung
1CT
0vqa
0OPEN
4Abnormality
[ "vhead", "_", "_" ]
50
Does the lung look normal?
No
0en
108
1Lung
1CT
0vqa
1CLOSED
4Abnormality
[ "vhead", "_", "_" ]
51
Where is/are the abnormality located?
Left Lung, Right
0en
108
1Lung
1CT
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
52
Which is the bigger in this image, lung or heart?
Lung
0en
108
1Lung
1CT
0vqa
1CLOSED
3Size
[ "vhead", "_", "_" ]
53
What modality is used to take this image?
CT
0en
109
1Lung
1CT
0vqa
0OPEN
0Modality
[ "vhead", "_", "_" ]
54
Which part of the body does this image belong to?
Chest
0en
109
1Lung
1CT
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
55
What is the main organ in the image?
Lung, Heart
0en
109
1Lung
1CT
0vqa
0OPEN
2Organ
[ "vhead", "_", "_" ]
56
What is the largest organ in the picture?
Lung
0en
109
1Lung
1CT
0vqa
0OPEN
3Size
[ "vhead", "_", "_" ]
57
Does the picture contain liver?
No
0en
109
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
58
Does the picture contain lung?
Yes
0en
109
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
59
Does the picture contain heart?
Yes
0en
109
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
60
What diseases are included in the picture?
Lung Cancer
0en
109
1Lung
1CT
0vqa
0OPEN
4Abnormality
[ "vhead", "_", "_" ]
61
Where is/are the abnormality located?
Left Lung, Lower Right
0en
109
1Lung
1CT
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
62
Does the lung look normal?
No
0en
109
1Lung
1CT
0vqa
1CLOSED
4Abnormality
[ "vhead", "_", "_" ]
63
Which is the bigger in this image, lung or heart?
Lung
0en
109
1Lung
1CT
0vqa
1CLOSED
3Size
[ "vhead", "_", "_" ]
64
What modality is used to take this image?
MRI
0en
11
0Abdomen
0MRI
0vqa
0OPEN
0Modality
[ "vhead", "_", "_" ]
65
Which part of the body does this image belong to?
Abdomen
0en
11
0Abdomen
0MRI
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
66
What is the mr weighting in this image?
T2
0en
11
0Abdomen
0MRI
0vqa
0OPEN
0Modality
[ "vhead", "_", "_" ]
67
Does spleen look abnormal?
No
0en
11
0Abdomen
0MRI
0vqa
1CLOSED
4Abnormality
[ "vhead", "_", "_" ]
68
Does the picture contain liver?
Yes
0en
11
0Abdomen
0MRI
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
69
Does the picture contain kidney?
No
0en
11
0Abdomen
0MRI
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
70
Does the picture contain spleen?
Yes
0en
11
0Abdomen
0MRI
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
71
Where is the spleen?
Lower right
0en
11
0Abdomen
0MRI
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
72
What modality is used to take this image?
CT
0en
110
1Lung
1CT
0vqa
0OPEN
0Modality
[ "vhead", "_", "_" ]
73
Which part of the body does this image belong to?
Chest
0en
110
1Lung
1CT
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
74
What is the main organ in the image?
Lung, Heart
0en
110
1Lung
1CT
0vqa
0OPEN
2Organ
[ "vhead", "_", "_" ]
75
What is the largest organ in the picture?
Lung
0en
110
1Lung
1CT
0vqa
0OPEN
3Size
[ "vhead", "_", "_" ]
76
Does the picture contain liver?
No
0en
110
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
77
Does the picture contain lung?
Yes
0en
110
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
78
Does the picture contain heart?
Yes
0en
110
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
79
What diseases are included in the picture?
Lung Cancer
0en
110
1Lung
1CT
0vqa
0OPEN
4Abnormality
[ "vhead", "_", "_" ]
80
Is the lung healthy?
No
0en
110
1Lung
1CT
0vqa
1CLOSED
4Abnormality
[ "vhead", "_", "_" ]
81
Where is/are the abnormality located?
Left Lung, Lower Right
0en
110
1Lung
1CT
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
82
Which is the biggest in this image,lung,liver or heart?
Lung
0en
110
1Lung
1CT
0vqa
1CLOSED
3Size
[ "vhead", "_", "_" ]
83
What modality is used to take this image?
CT
0en
111
1Lung
1CT
0vqa
0OPEN
0Modality
[ "vhead", "_", "_" ]
84
Which part of the body does this image belong to?
Chest
0en
111
1Lung
1CT
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
85
What is the main organ in the image?
Lung, Liver
0en
111
1Lung
1CT
0vqa
0OPEN
2Organ
[ "vhead", "_", "_" ]
86
What is the largest organ in the picture?
Liver
0en
111
1Lung
1CT
0vqa
0OPEN
3Size
[ "vhead", "_", "_" ]
87
Does the picture contain liver?
Yes
0en
111
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
88
Does the picture contain lung?
Yes
0en
111
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
89
Does the picture contain heart?
No
0en
111
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
90
Is the lung healthy?
Yes
0en
111
1Lung
1CT
0vqa
1CLOSED
4Abnormality
[ "vhead", "_", "_" ]
91
Which is the biggest in this image,lung,liver or heart?
Liver
0en
111
1Lung
1CT
0vqa
1CLOSED
3Size
[ "vhead", "_", "_" ]
92
What modality is used to take this image?
CT
0en
113
1Lung
1CT
0vqa
0OPEN
0Modality
[ "vhead", "_", "_" ]
93
Which part of the body does this image belong to?
Chest
0en
113
1Lung
1CT
0vqa
0OPEN
1Position
[ "vhead", "_", "_" ]
94
What is the main organ in the image?
Lung
0en
113
1Lung
1CT
0vqa
0OPEN
2Organ
[ "vhead", "_", "_" ]
95
What is the largest organ in the picture?
Lung
0en
113
1Lung
1CT
0vqa
0OPEN
3Size
[ "vhead", "_", "_" ]
96
Does the picture contain liver?
No
0en
113
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
97
Does the picture contain lung?
Yes
0en
113
1Lung
1CT
0vqa
1CLOSED
2Organ
[ "vhead", "_", "_" ]
98
What diseases are included in the picture?
Lung Cancer
0en
113
1Lung
1CT
0vqa
0OPEN
4Abnormality
[ "vhead", "_", "_" ]
99
Does the lung look normal?
No
0en
113
1Lung
1CT
0vqa
1CLOSED
4Abnormality
[ "vhead", "_", "_" ]
End of preview. Expand in Data Studio

Fork of BoKelvin/SLAKE converted to:

  1. Wrap images as binary object
  2. Classify categorical information into class labels

Metadata

Name #train #val #test img#train img#val img#test
SLAKE 9,835 2,099 2,094 586 174 180

Conversion script

from pathlib import Path

from datasets import ClassLabel, Dataset, Features, Image, Sequence, Value

SLAKE_FEAT = {
    "qid": Value("uint32"),
    "image": Image(decode=True),
    "question": Value("string"),
    "answer": Value("string"),
    "q_lang": ClassLabel(names=["en", "zh"]),
    "img_id": Value("uint32"),
    "location": ClassLabel(
        names=[
            "Abdomen",
            "Lung",
            "Chest_heart",
            "Chest_lung",
            "Brain_Tissue",
            "Brain_Face",
            "Brain",
            "Neck",
            "Chest_mediastinal",
            "Pelvic Cavity",
        ]
    ),
    "modality": ClassLabel(names=["MRI", "CT", "X-Ray"]),
    "base_type": ClassLabel(names=["vqa", "kvqa"]),
    "answer_type": ClassLabel(names=["OPEN", "CLOSED"]),
    "content_type": ClassLabel(
        names=[
            "Modality",
            "Position",
            "Organ",
            "Size",
            "Abnormality",
            "Quantity",
            "Plane",
            "Shape",
            "Color",
            "KG",
        ]
    ),
    "triple": Sequence(Value("string")),
}


def reformat(
    jsonl_path: Path,
    upload_to: str | None = None,
    image_dir: str = "images",
):
    split = jsonl_path.stem
    d = Dataset.from_json(jsonl_path.as_posix())
    d = d.map(
        lambda e: {
            "image": {"path": f"{image_dir}/{e['img_name']}"},
        },
        num_proc=16,
        features=Features(SLAKE_FEAT),
        remove_columns=["img_name"]
    )

    if upload_to:
        d.push_to_hub(upload_to, split=split)
    else:
        print(d)
        print(d[0])
        print(f"Would upload to split={split} on the hub.")
Downloads last month
63