miugod commited on
Commit
9b14204
·
verified ·
1 Parent(s): 674b840

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -9,7 +9,6 @@
9
  *.joblib filter=lfs diff=lfs merge=lfs -text
10
  *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
  *.lz4 filter=lfs diff=lfs merge=lfs -text
12
- *.mds filter=lfs diff=lfs merge=lfs -text
13
  *.mlmodel filter=lfs diff=lfs merge=lfs -text
14
  *.model filter=lfs diff=lfs merge=lfs -text
15
  *.msgpack filter=lfs diff=lfs merge=lfs -text
@@ -54,6 +53,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
54
  *.jpg filter=lfs diff=lfs merge=lfs -text
55
  *.jpeg filter=lfs diff=lfs merge=lfs -text
56
  *.webp filter=lfs diff=lfs merge=lfs -text
57
- # Video files - compressed
58
- *.mp4 filter=lfs diff=lfs merge=lfs -text
59
- *.webm filter=lfs diff=lfs merge=lfs -text
 
9
  *.joblib filter=lfs diff=lfs merge=lfs -text
10
  *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
  *.lz4 filter=lfs diff=lfs merge=lfs -text
 
12
  *.mlmodel filter=lfs diff=lfs merge=lfs -text
13
  *.model filter=lfs diff=lfs merge=lfs -text
14
  *.msgpack filter=lfs diff=lfs merge=lfs -text
 
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
56
+ CMB-Exam/CMB-train/CMB-train-merge.json filter=lfs diff=lfs merge=lfs -text
 
 
CMB-Clin/CMB-Clin-qa.json ADDED
The diff for this file is too large to render. See raw diff
 
CMB-Exam/CMB-test/CMB-test-choice-hierarchy.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "总题量": {
3
+ "总题量": 11200,
4
+ "医师考试": 2000,
5
+ "护理考试": 1600,
6
+ "药师考试": 3200,
7
+ "医技考试": 1200,
8
+ "专业知识考试": 1600,
9
+ "医学考研": 1600
10
+ },
11
+ "医师考试": {
12
+ "规培结业": 400,
13
+ "执业助理医师": 400,
14
+ "执业医师": 400,
15
+ "中级职称": 400,
16
+ "高级职称": 400
17
+ },
18
+ "护理考试": {
19
+ "护士执业资格": 400,
20
+ "护师执业资格": 400,
21
+ "主管护师": 400,
22
+ "高级护师": 400
23
+ },
24
+ "药师考试": {
25
+ "执业西药师": 400,
26
+ "执业中药师": 400,
27
+ "初级药士": 400,
28
+ "初级药师": 400,
29
+ "初级中药士": 400,
30
+ "初级中药师": 400,
31
+ "主管药师": 400,
32
+ "主管中药师": 400
33
+ },
34
+ "医技考试": {
35
+ "医技士": 400,
36
+ "医技师": 400,
37
+ "主管技师": 400
38
+ },
39
+ "专业知识考试": {
40
+ "基础医学": 400,
41
+ "临床医学": 400,
42
+ "预防医学与公共卫生学": 400,
43
+ "中医学与中药学": 400
44
+ },
45
+ "医学考研": {
46
+ "护理学": 400,
47
+ "考研政治": 400,
48
+ "西医综合": 400,
49
+ "中医综合": 400
50
+ }
51
+ }
CMB-Exam/CMB-test/CMB-test-choice-question-merge.json ADDED
The diff for this file is too large to render. See raw diff
 
CMB-Exam/CMB-train/CMB-train-hierarchy.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "总题量": {
3
+ "总题量": 269359,
4
+ "医师考试": 122876,
5
+ "护理考试": 15279,
6
+ "药师考试": 30074,
7
+ "医技考试": 25774,
8
+ "专业知识考试": 60631,
9
+ "医学考研": 14725
10
+ },
11
+ "医师考试": {
12
+ "规培结业": 14201,
13
+ "执业助理医师": 15006,
14
+ "执业医师": 25231,
15
+ "中级职称": 55729,
16
+ "高级职称": 12709
17
+ },
18
+ "护理考试": {
19
+ "护士执业资格": 2893,
20
+ "护师执业资格": 3813,
21
+ "主管护师": 7107,
22
+ "高级护师": 1466
23
+ },
24
+ "药师考试": {
25
+ "执业西药师": 7838,
26
+ "执业中药师": 4050,
27
+ "初级药士": 2310,
28
+ "初级药师": 3295,
29
+ "初级中药士": 3092,
30
+ "初级中药师": 3607,
31
+ "主管药师": 2993,
32
+ "主管中药师": 2889
33
+ },
34
+ "医技考试": {
35
+ "医技士": 4627,
36
+ "医技师": 5662,
37
+ "主管技师": 15485
38
+ },
39
+ "专业知识考试": {
40
+ "基础医学": 24299,
41
+ "临床医学": 18753,
42
+ "预防医学与公共卫生学": 3332,
43
+ "中医学与中药学": 14247
44
+ },
45
+ "医学考研": {
46
+ "护理学": 1604,
47
+ "考研政治": 1104,
48
+ "西医综合": 8503,
49
+ "中医综合": 3514
50
+ }
51
+ }
CMB-Exam/CMB-train/CMB-train-merge.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f256b724b5662a8eb666921b33c698c067b8b5857a23b4ee425c887ed7708cfb
3
+ size 141602733
CMB-Exam/CMB-val/CMB-val-hierarchy.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "专业知识考试": {
3
+ "中医学与中药学": 10,
4
+ "临床医学": 10,
5
+ "基础医学": 10,
6
+ "预防医学与公共卫生学": 10
7
+ },
8
+ "医学考研": {
9
+ "中医综合": 10,
10
+ "护理学": 10,
11
+ "考研政治": 10,
12
+ "西医综合": 10
13
+ },
14
+ "医师考试": {
15
+ "中级职称": 10,
16
+ "执业助理": 10,
17
+ "执业医师": 10,
18
+ "规培结业": 10,
19
+ "高级职称": 10
20
+ },
21
+ "医技考试": {
22
+ "主管技师": 10,
23
+ "医技士": 10,
24
+ "医技师": 10
25
+ },
26
+ "护理考试": {
27
+ "主管护师": 10,
28
+ "护士执业资格": 10,
29
+ "护师执业资格": 10,
30
+ "高级护师": 10
31
+ },
32
+ "药师考试": {
33
+ "主管中药师": 10,
34
+ "主管药师": 10,
35
+ "初级中药士": 10,
36
+ "初级中药师": 10,
37
+ "初级药士": 10,
38
+ "初级药师": 10,
39
+ "执业中药师": 10,
40
+ "执业西药师": 10
41
+ }
42
+ }
CMB-Exam/CMB-val/CMB-val-merge.json ADDED
The diff for this file is too large to render. See raw diff
 
README.md CHANGED
@@ -1,3 +1,154 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ task_categories:
4
+ - question-answering
5
+ - text-generation
6
+ language:
7
+ - zh
8
+ tags:
9
+ - medical
10
+ - biology
11
+ - chemistry
12
+ size_categories:
13
+ - 100K<n<1M
14
+ configs:
15
+ - config_name: CMB-Clin
16
+ data_files:
17
+ - split: test
18
+ path: CMB-Clin/CMB-Clin-qa.json
19
+ - config_name: CMB-Exam
20
+ data_files:
21
+ - split: test
22
+ path: CMB-Exam/CMB-test/CMB-test-choice-question-merge.json
23
+ - split: train
24
+ path: CMB-Exam/CMB-train/CMB-train-merge.json
25
+ - split: val
26
+ path: CMB-Exam/CMB-val/CMB-val-merge.json
27
+ ---
28
+
29
+ # CMB: A Comprehensive Medical Benchmark in Chinese
30
+ ![CMB](assets/title.png)
31
+ <p align="center">
32
+ 🌐 <a href="https://github.com/FreedomIntelligence/CMB" target="_blank">Github</a> • 🌐 <a href="https://cmedbenchmark.llmzoo.com/#home" target="_blank">Website</a> • 🤗 <a href="https://huggingface.co/datasets/FreedomIntelligence/CMB" target="_blank">HuggingFace</a>
33
+
34
+ ## 🌈 Update
35
+ * **[2024.02.21]** The [answers](https://github.com/FreedomIntelligence/CMB/tree/main/data) to the CMB-Exam test has been updated and some errors caused by omissions in version management have been fixed.
36
+ * **[2024.01.08]** In order to facilitate testing, we disclose the [answers](https://github.com/FreedomIntelligence/CMB/tree/main/data) to the CMB-Exam test
37
+ * **[2023.09.22]** CMB is included in [OpenCompass](https://github.com/open-compass/opencompass).
38
+ * **[2023.08.21]** [Paper](https://arxiv.org/abs/2308.08833) released.
39
+ * **[2023.08.01]** 🎉🎉🎉 CMB is published!🎉🎉🎉
40
+
41
+
42
+ ## 🌐 Download Data
43
+
44
+ - (Recommended) Download the [zip file](https://github.com/FreedomIntelligence/CMB/tree/main/data) and unzip:
45
+ ```bash
46
+ git clone "https://github.com/FreedomIntelligence/CMB.git" && cd CMB && unzip "./data/CMB.zip" -d "./data/" && rm "./data/CMB.zip"
47
+ ```
48
+ - Or load our data as follows:
49
+ ```python
50
+ from datasets import load_dataset
51
+ # CMB-Exam datasets (multiple-choice and multiple-answer questions)
52
+ exam_datasets = load_dataset('miugod/CMB','CMB-Exam')
53
+ # CMB-Clin datasets
54
+ clin_datasets = load_dataset('miugod/CMB','CMB-Clin')
55
+ ```
56
+
57
+
58
+
59
+ ## 🥇 Leaderboard
60
+
61
+ Please Check [Leaderboard](https://cmedbenchmark.llmzoo.com/static/leaderboard.html).
62
+
63
+
64
+
65
+ ## 🥸 Dataset intro
66
+ ![CMB](assets/CMB-2.svg)
67
+ ### Components
68
+
69
+ - CMB-Exam: Comprehensive multi-level assessment for medical knowledge
70
+ - Structure: 6 major categories and 28 subcategories, [View Catalog](catalog.md)
71
+ - CMB-test: 400 questions per subcategories, 11200 questions in total
72
+ - CMB-val: 280 questions with solutions and explanations; used as source for CoT and few-shot
73
+ - CMB-train: 269359 questions for medical knowledge injection
74
+
75
+ - CMB-Clin: 74 cases of complex medical inquires
76
+
77
+
78
+ ### CMB-Exam Item
79
+ ```json
80
+ {
81
+ "exam_type": "医师考试",
82
+ "exam_class": "执业医师",
83
+ "exam_subject": "口腔执业医师",
84
+ "question": "患者,男性,11岁。近2个月来时有低热(37~38℃),全身无明显症状。查体无明显阳性体征。X线检查发现右肺中部有一直径约0.8cm类圆形病灶,边缘稍模糊,肺门淋巴结肿大。此男孩可能患",
85
+ "answer": "D",
86
+ "question_type": "单项选择题",
87
+ "option": {
88
+ "A": "小叶型肺炎",
89
+ "B": "浸润性肺结核",
90
+ "C": "继发性肺结核",
91
+ "D": "原发性肺结核",
92
+ "E": "粟粒型肺结核"
93
+ }
94
+ },
95
+ ```
96
+ - exam_type: major category
97
+ - exam_class: sub-category
98
+ - exam_subject: Specific departments or subdivisions of disciplines
99
+ - question_type: *multiple-choice (单项选择题)* or *multiple-answer (多项选择题)*
100
+
101
+
102
+ ### CMB-Clin Item
103
+ ```json
104
+ {
105
+ "id": 0,
106
+ "title": "案例分析-腹外疝",
107
+ "description": "现病史\n(1)病史摘要\n 病人,男,49岁,3小时前解大便后出现右下腹疼痛,右下腹可触及一包块,既往体健。\n(2)主诉\n 右下腹痛并自扪及包块3小时。\n\n体格检查\n体温: T 37.8℃,P 101次/分,呼吸22次/分,BP 100/60mmHg,腹软,未见胃肠型蠕动波,肝脾肋下未及,于右侧腹股沟区可扪及一圆形肿块,约4cm×4cm大小,有压痛、界欠清,且肿块位于腹股沟韧带上内方。\n\n辅助检查\n(1)实验室检查\n 血常规:WBC 5.0×109/L,N 78%。\n 尿常规正常。\n(2)多普勒超声检查\n 沿腹股沟纵切可见一多层分布的混合回声区,宽窄不等,远端膨大,边界整齐,长约4~5cm。\n(3)腹部X线检查\n 可见阶梯状液气平。",
108
+ "QA_pairs": [
109
+ {
110
+ "question": "简述该病人的诊断及诊断依据。",
111
+ "solution": "诊断:嵌顿性腹股沟斜疝合并肠梗阻。\n诊断依据:\n①右下腹痛并自扪及包块3小时;\n②有腹胀、呕吐,类似肠梗阻表现;腹部平片可见阶梯状液平,考虑肠梗阻可能;腹部B超考虑,\n腹部包��内可能为肠管可能;\n③有轻度毒性反应或是中毒反应,如 T 37.8℃,P 101次/分,白细胞中性分类78%;\n④腹股沟区包块位于腹股沟韧带上内方。"
112
+ },
113
+ {
114
+ "question": "简述该病人的鉴别诊断。",
115
+ "solution": "(1)睾丸鞘膜积液:鞘膜积液所呈现的肿块完全局限在阴囊内,其上界可以清楚地摸到;用透光试验检查肿块,鞘膜积液多为透光(阳性),而疝块则不能透光。\n(2)交通性鞘膜积液:肿块的外形与睾丸鞘膜积液相似。于每日起床后或站立活动时肿块缓慢地出现并增大。平卧或睡觉后肿块逐渐缩小,挤压肿块,其体积也可逐渐缩小。透光试验为阳性。\n(3)精索鞘膜积液:肿块较小,在腹股沟管内,牵拉同侧睾丸可见肿块移动。\n(4)隐睾:腹股沟管内下降不全的睾丸可被误诊为斜疝或精索鞘膜积液。隐睾肿块较小,挤压时可出现特有的胀痛感觉。如患侧阴囊内睾丸缺如,则诊断更为明确。\n(5)急性肠梗阻:肠管被嵌顿的疝可伴发急性肠梗阻,但不应仅满足于肠梗阻的诊断而忽略疝的存在;尤其是病人比较肥胖或疝块较小时,更易发生这类问题而导致治疗上的错误。\n(6)此外,腹股沟区肿块还应与以下疾病鉴别:肿大的淋巴结、动(静)脉瘤、软组织肿瘤、脓肿、\n圆韧带囊肿、子宫内膜异位症等。"
116
+ },
117
+ {
118
+ "question": "简述该病人的治疗原则。",
119
+ "solution": "嵌顿性疝原则上需要紧急手术治疗,以防止疝内容物坏死并解除伴发的肠梗阻。术前应做好必要的准备,如有脱水和电解质紊乱,应迅速补液加以纠正。手术的关键在于正确判断疝内容物的活力,然后根据病情确定处理方法。在扩张或切开疝环、解除疝环压迫的前提下,凡肠管呈紫黑色,失去光泽和弹性,刺激后无蠕动和相应肠系膜内无动脉搏动者,即可判定为肠坏死。如肠管尚未坏死,则可将其送回腹腔,按一般易复性疝处理,即行疝囊高位结扎+疝修补术。如肠管确已坏死或一时不能肯定肠管是否已失去活力时,则应在病人全身情况允许的前提下,切除该段肠管并进行一期吻合。凡施行肠切除吻合术的病人,因手术区污染,在高位结扎疝囊后,一般不宜作疝修补术,以免因感染而致修补失败。"
120
+ }
121
+ ]
122
+ },
123
+ ```
124
+ - title: name of disease
125
+ - description: information of patient
126
+ - QA_pairs: a series of questions and their solutions based on the description
127
+
128
+
129
+
130
+ ## ℹ️ How to evaluate and submit refer to [link](https://github.com/FreedomIntelligence/CMB)
131
+
132
+ ## 😘 Citation
133
+ Please use the following citation if you intend to use our dataset for training or evaluation:
134
+
135
+ ```
136
+ @misc{cmedbenchmark,
137
+ title={CMB: Chinese Medical Benchmark},
138
+ author={Xidong Wang*, Guiming Hardy Chen*, Dingjie Song*, Zhiyi Zhang*, Qingying Xiao, Xiangbo Wu, Feng Jiang, Jianquan Li, Benyou Wang},
139
+ note={Xidong Wang, Guiming Hardy Chen, Dingjie Song, and Zhiyi Zhang contributed equally to this github repo.},
140
+ year = {2023},
141
+ publisher = {GitHub},
142
+ journal = {GitHub repository},
143
+ howpublished = {\url{https://github.com/FreedomIntelligence/CMB}},
144
+ }
145
+ ```
146
+
147
+ ## Acknowledgement
148
+ - We thank [Shenzhen Research Institute of Big Data](http://www.sribd.cn/) for their enormous support for this project.
149
+
150
+ - We thank the following doctors for participating in the human evaluation of CMB-Clin:
151
+
152
+ - 林士军 (香港中文大学(深圳)附属第二医院)
153
+ - 常河
154
+ - 许晓爽
assets/CMB-2.svg ADDED
assets/CMB-final.png ADDED

Git LFS Details

  • SHA256: 1ac0f8261ff0d0f2e4cfef7d44d48b7a5541e5a7f769a318b143bf1f82e62ccb
  • Pointer size: 132 Bytes
  • Size of remote file: 1.04 MB
assets/CMB-qa.png ADDED

Git LFS Details

  • SHA256: 65f9bfb0b5a8bf56f18a00b98c84a03dc890d2b0f78a8d592c0304205e4ec146
  • Pointer size: 131 Bytes
  • Size of remote file: 344 kB
assets/test ADDED
File without changes
assets/title.png ADDED

Git LFS Details

  • SHA256: 645e4f830d2a40d0a11e2f1d843f814223ab389998d8924f7d4d9693758ab81e
  • Pointer size: 131 Bytes
  • Size of remote file: 119 kB
output_normalized.json ADDED
The diff for this file is too large to render. See raw diff
 
preprocess.py ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import os
3
+ from typing import Dict, Any, List
4
+
5
+ OPTION_KEYS = ["A", "B", "C", "D", "E", "F"]
6
+
7
+
8
+ def normalize_option(option: Dict[str, Any]) -> Dict[str, str]:
9
+ new_option = {}
10
+ option = option or {}
11
+ for k in OPTION_KEYS:
12
+ new_option[k] = str(option.get(k, "")).strip()
13
+ return new_option
14
+
15
+
16
+ def normalize_item(item: Dict[str, Any], idx: int) -> Dict[str, Any]:
17
+ return {
18
+ "id": item.get("id", idx),
19
+ "exam_type": item.get("exam_type", ""),
20
+ "exam_class": item.get("exam_class", ""),
21
+ "exam_subject": item.get("exam_subject", ""),
22
+ "question": item.get("question", ""),
23
+ "answer": item.get("answer", ""),
24
+ "explanation": item.get("explanation", ""),
25
+ "question_type": item.get("question_type", ""),
26
+ "option": normalize_option(item.get("option")),
27
+ }
28
+
29
+
30
+ def clean_json(input_path: str) -> None:
31
+ with open(input_path, "r", encoding="utf-8") as f:
32
+ data: List[Dict[str, Any]] = json.load(f)
33
+
34
+ cleaned = []
35
+ for idx, item in enumerate(data, start=1):
36
+ cleaned.append(normalize_item(item, idx))
37
+
38
+ base, ext = os.path.splitext(input_path)
39
+ output_path = f"{base}-clean{ext}"
40
+
41
+ with open(output_path, "w", encoding="utf-8") as f:
42
+ json.dump(cleaned, f, ensure_ascii=False, indent=2)
43
+
44
+ print(f"[OK] {output_path} ({len(cleaned)} samples)")
45
+
46
+
47
+ if __name__ == "__main__":
48
+ input_files = [
49
+ "CMB-Exam/CMB-train/CMB-train-merge.json",
50
+ "CMB-Exam/CMB-val/CMB-val-merge.json",
51
+ "CMB-Exam/CMB-test/CMB-test-choice-question-merge.json",
52
+ ]
53
+
54
+ for path in input_files:
55
+ clean_json(path)
read_data.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from datasets import load_dataset
2
+
3
+ # ds = load_dataset('FreedomIntelligence/CMB', 'CMB-Clin')
4
+ # print(ds)
5
+
6
+ ds = load_dataset(
7
+ "json",
8
+ data_files={
9
+ "test": "CMB-Clin/CMB-Clin-qa.json",
10
+ }
11
+ )
12
+
13
+ print(ds["test"][0])
14
+
15
+
16
+ ds = load_dataset(
17
+ "json",
18
+ data_files={
19
+ "test": "CMB-Exam/CMB-test/CMB-test-choice-question-merge-clean.json",
20
+ "train": "CMB-Exam/CMB-train/CMB-train-merge-clean.json",
21
+ "val": "CMB-Exam/CMB-val/CMB-val-merge-clean.json",
22
+
23
+ }
24
+ )
25
+ print(ds)