junwen-liu commited on
Commit
0ebc9aa
·
1 Parent(s): 7078ffc

commit samples, chatbot and readme

Browse files
README.md CHANGED
@@ -1,3 +1,160 @@
1
- ---
2
- license: bigscience-bloom-rail-1.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Large Language Model Locally Fine-tuning (LLMLF) on Chinese Medical Imaging Reports
2
+
3
+ ## Data Specification
4
+
5
+ <center>
6
+
7
+ | Medical Image Report Type | Train & Validate Dataset Size (9:1) | Test Dataset Size | Best Train Epochs |
8
+ |-------------------------------------|:-----------------------------------:|:-----------------:|:------------:|
9
+ | Endocrine Adrenal CT | 1240 | 110 | 100 |
10
+ | Hepatobiliary Upper Abdomen CT | 833 | 88 | 16 |
11
+ | Pancreatic Preoperative Staging CTA | 1228 | 115 | 50 |
12
+
13
+ </center>
14
+
15
+ ## Repository Specification
16
+
17
+ - **model-endocrine-100**: [bloom-1b1-zh](https://huggingface.co/ckip-joint/bloom-1b1-zh) model, fine-tuned for 100 epochs on Endocrine Adrenal CT dataset.
18
+
19
+ - **model-hepatobiliary-16**: [bloom-1b1-zh](https://huggingface.co/ckip-joint/bloom-1b1-zh) model, fine-tuned for 16 epochs on Hepatobiliary Upper Abdomen CT dataset.
20
+
21
+ - **model-pancreatic-50**: [bloom-1b1-zh](https://huggingface.co/ckip-joint/bloom-1b1-zh) model, fine-tuned for 50 epochs on Pancreatic Preoperative Staging CTA dataset.
22
+
23
+ - **samples**: Sample files in csv format. Each model has a sample input and a sample output file. The input file has an `INSTRUCTION` column and a `RESPONSE` column, containing 2 medical image reports and corresponding physicians' clinical advice, respectively, randomly selected from the test dataset. The output file is the same as the input file except for an additional `GENERATED` column, containing clinical advice generated by the model. Users may refer to these sample files when inference using `chatbot.py`. Details will be explained in the next section.
24
+
25
+ - **chatbot.py**: A CLI (command-line interface) for inferencing, modified from [chatbot.py](https://github.com/microsoft/DeepSpeedExamples/blob/master/applications/DeepSpeed-Chat/inference/chatbot.py). Note that unlike [chatbot.py](https://github.com/microsoft/DeepSpeedExamples/blob/master/applications/), <u>we disabled context preservation</u>, assuming that each input report is complete, independent from its previous context. Users may assume that a `clear` command is automatically executed after every single inference. Also, <u>we replaced the default prefix "Human: " and suffix "Assistant: " with "根据下面一段影像描述:" ("According to the following medical image report: ") and "生成一份对应的诊断意见:" ("Generate a piece of clinical advice: ")</u>, to better accomodate to Chinese usage.
26
+
27
+ ## Prerequisites (Ours)
28
+
29
+ - python 3.9.13
30
+ - pandas 2.0.1
31
+ - transformers 4.28.1
32
+
33
+
34
+ ## Getting Started
35
+
36
+ ### Installation
37
+
38
+ ```bash
39
+ pip install pandas==2.0.1 transformers==4.28.1
40
+ git clone https://github.com/Junwen-Liu/IMIT-MedImg-LLMLF
41
+ cd IMIT-MedImg-LLMLF
42
+ ```
43
+
44
+ ### Basic Usage
45
+
46
+ ```bash
47
+ python chatbot.py \
48
+ --path [directory containing trained model] \
49
+ --max_new_tokens [maximum new tokens to generate per response] \
50
+ --in_csv [path to the input csv file] \
51
+ --out_csv [path to the output csv file]
52
+ ```
53
+
54
+ ### Example: Interactive Inferencing on Endocrine Adrenal CT Test Dataset
55
+
56
+ `chatbot.py` allows interactive inferencing that users munually feed medical image reports to it and get clinical advice in a conversational style.
57
+
58
+ - **Step 1**: Get the two Endocrine Adrenal CT reports from the `INSTRUCTION` column of `samples/sample-input-endocrine.csv`, as listed below:
59
+
60
+ ```bash
61
+ # report 1
62
+ 左侧肾上腺体部见大小约为17.8mm×15.7mm结节;密度不均匀;其内可见斑片状脂肪密度及结节状钙化灶。右侧肾上腺未见明显异常。右肾实质见低密度灶。左肾实质未见异常密度影。双肾轮廓不光整。腹膜后见淋巴结显示。附见肝实质密度减低。
63
+ # report 2
64
+ 左侧肾上腺稍增粗;右侧肾上腺大小、形态、密度未见明显异常;双侧肾上腺未见明显异常强化区。所见双肾形态大小位置正常;均匀强化;未见异常密度影;未见阳性结石影。肾盂肾盏及近端输尿管未见扩张积水及破坏。腹膜后未见异常增大的淋巴结影。附见肝脏多发血管瘤;肝右叶小囊肿。
65
+ ```
66
+
67
+ - **Step 2**: Launch CLI:
68
+
69
+ ```bash
70
+ python chatbot.py \
71
+ --path model-endocrine-100/ \
72
+ --max_new_tokens 512
73
+ ```
74
+
75
+ - **Step 3**: Enter the first report and wait for the generated clinical advice.
76
+
77
+ - **Step 4**: Enter the second report and wait for the generated clinical advice.
78
+
79
+ - **Step 5**: Enter `quit` to quit inferencing.
80
+
81
+ The overall command-line should look something like below:
82
+
83
+ ```bash
84
+ $ python chatbot.py \
85
+ > --path model-endocrine-100/ \
86
+ > --max_new_tokens 512
87
+ Enter input (type 'quit' to exit): 左侧肾上腺体部见大小约为17.8mm×15.7mm结节;密度不均匀;其内可见斑片状脂肪密度及结节状钙化灶。右侧肾上腺未见明显异常。右肾实质见低密度灶。左肾实质未见异常密度影。双肾轮廓不光整。腹膜后见淋巴结显示。附见肝实质密度减低。
88
+ ----------------------------------------
89
+ 根据下面一段影像描述:左侧肾上腺体部见大小约为17.8mm×15.7mm结节;密度不均匀;其内可见斑片状脂肪密度及结节状钙化灶。右侧肾上腺未见明显异常。右肾实质见低密度灶。左肾实质未见异常密度影。双肾轮廓不光整。腹膜后见淋巴结显示。附见肝实质密度减低。
90
+ 生成一份对应的诊断意见:
91
+ 左侧肾上腺体部结节;右肾低密度灶;拟复杂囊肿。附见脂肪肝。请结合临床及其他相关检查;随诊。
92
+
93
+ Enter input (type 'quit' to exit): 左侧肾上腺稍增粗;右侧肾上腺大小、形态、密度未见明显异常;双侧肾上腺未见明显异常强化区。所见双肾形态大小位置正常;均匀强化;未见异常密度影;未见阳性结石影。肾盂肾盏及近端输尿管未见扩张积水及破坏。腹膜后未见异常增大的淋巴结影。附见肝脏多发血管瘤;肝右叶小囊肿。
94
+ ----------------------------------------
95
+ 根据下面一段影像描述:左侧肾上腺稍增粗;右侧肾上腺大小、形态、密度未见明显异常;双侧肾上腺未见明显异常强化区。所见双肾形态大小位置正常;均匀强化;未见异常密度影;未见阳性结石影。肾盂肾盏及近端输尿管未见扩张积水及破坏。腹膜后未见异常增大的淋巴结影。附见肝脏多发血管瘤;肝右叶小囊肿。
96
+ 生成一份对应的诊断意见:
97
+ 左侧肾上腺稍增粗。附见肝脏多发血管瘤;肝右叶小囊肿。请结合临床病史及其他相关检查;随访。
98
+
99
+ Enter input (type 'quit' to exit): quit
100
+ $
101
+ ```
102
+
103
+ Users may compare the generated clinical advice (the line after " 生成一份对应的诊断意见:") with the sample data in the `GENERATED` column of `samples/sample-output-endocrine.csv`.
104
+
105
+ ### Example: Batch Inferencing on Endocrine Adrenal CT Test Dataset
106
+
107
+ `chatbot.py` also allows batch inferencing that users input a csv file containing all medical image reports and get all clinical advice at once in a generated csv file.
108
+
109
+ - **Step 1**: Prepare a csv file with an `INSTRUCTION` column that contains all medical image reports. Here we use `samples/sample-input-endocrine.csv` as input, which has the following structure:
110
+
111
+ ```
112
+ INSTRUCTION,RESPONSE
113
+ [report 1],[physician advice 1]
114
+ [report 2],[physician advice 2]
115
+ ...
116
+ [report n],[physician advice n]
117
+ ```
118
+
119
+ - **Step 2**: Launch CLI:
120
+
121
+ ```bash
122
+ python chatbot.py \
123
+ --path model-endocrine-100/ \
124
+ --max_new_tokens 512 \
125
+ --in_csv samples/sample-input-endocrine.csv \
126
+ --out_csv samples/generated-output-endocrine.csv
127
+ ```
128
+
129
+ The overall command-line should look something like below:
130
+
131
+ ```bash
132
+ $ python chatbot.py \
133
+ > --path model-endocrine-100/ \
134
+ > --max_new_tokens 512 \
135
+ > --in_csv samples/sample-input-endocrine.csv \
136
+ > --out_csv samples/generated-output-endocrine.csv
137
+ -------------------- Instruction 1 --------------------
138
+ 根据下面一段影像描述:左侧肾上腺体部见大小约为17.8mm×15.7mm结节;密度不均匀;其内可见斑片状脂肪密度及结节状钙化灶。右侧肾上腺未见明显异常。右肾实质见低密度灶。左肾实质未见异常密度影。双肾轮廓不光整。腹膜后见淋巴结显示。附见肝实质密度减低。
139
+ 生成一份对应的诊断意见:
140
+ 左侧肾上腺体部结节;右肾低密度灶;拟复杂囊肿。附见脂肪肝。请结合临床及其他相关检查;随诊。
141
+
142
+ -------------------- Instruction 2 --------------------
143
+ 根据下面一段影像描述:左侧肾上腺稍增粗;右侧肾上腺大小、形态、密度未见明显异常;双侧肾上腺未见明显异常强化区。所见双肾形态大小位置正常;均匀强化;未见异常密度影;未见阳性结石影。肾盂肾盏及近端输尿管未见扩张积水及破坏。腹膜后未见异常增大的淋巴结影。附见肝脏多发血管瘤;肝右叶小囊肿。
144
+ 生成一份对应的诊断意见:
145
+ 左侧肾上腺稍增粗。附见肝脏多发血管瘤;肝右叶小囊肿。请结合临床病史及其他相关检查;随访。
146
+
147
+ $
148
+ ```
149
+
150
+ In addition, an csv file of the following structure will be generated at `samples/generated-output-endocrine.csv`, which has the following structure:
151
+
152
+ ```
153
+ INSTRUCTION,RESPONSE,GENERATED
154
+ [report 1],[physician advice 1],[generated advice 1]
155
+ [report 2],[physician advice 2],[generated advice 2]
156
+ ...
157
+ [report n],[physician advice n],[generated advice n]
158
+ ```
159
+
160
+ Users may compare `samples/generated-output-endocrine.csv` with the sample file `samples/sample-output-endocrine.csv`.
chatbot.py ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) Microsoft Corporation.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # DeepSpeed Team
5
+
6
+ import argparse
7
+ import json
8
+ import logging
9
+ import os
10
+ import re
11
+
12
+ import pandas as pd
13
+ import transformers # noqa: F401
14
+ from transformers import AutoConfig, AutoTokenizer, BloomForCausalLM, pipeline, set_seed
15
+
16
+
17
+ def parse_args():
18
+ parser = argparse.ArgumentParser()
19
+ parser.add_argument(
20
+ "--path",
21
+ type=str,
22
+ help="Directory containing trained actor model"
23
+ )
24
+ parser.add_argument(
25
+ "--max_new_tokens",
26
+ type=int,
27
+ default=512,
28
+ help="Maximum new tokens to generate per response",
29
+ )
30
+ parser.add_argument(
31
+ "--in_csv",
32
+ type=str,
33
+ help="Path to the input csv file",
34
+ )
35
+ parser.add_argument(
36
+ "--out_csv",
37
+ type=str,
38
+ help="Path to the output csv file",
39
+ )
40
+ args = parser.parse_args()
41
+ return args
42
+
43
+
44
+ def get_generator(path):
45
+ # if os.path.exists(path):
46
+ # # Locally tokenizer loading has some issue, so we need to force download
47
+ # model_json = os.path.join(path, "config.json")
48
+ # if os.path.exists(model_json):
49
+ # model_json_file = json.load(open(model_json))
50
+ # model_name = model_json_file["_name_or_path"]
51
+ # tokenizer = AutoTokenizer.from_pretrained(model_name,
52
+ # fast_tokenizer=True)
53
+ # else:
54
+ # tokenizer = AutoTokenizer.from_pretrained(path, fast_tokenizer=True)
55
+
56
+ tokenizer = AutoTokenizer.from_pretrained(path, fast_tokenizer=True)
57
+
58
+ tokenizer.pad_token = tokenizer.eos_token
59
+
60
+ model_config = AutoConfig.from_pretrained(path)
61
+ model = BloomForCausalLM.from_pretrained(path,
62
+ from_tf=bool(".ckpt" in path),
63
+ config=model_config).half()
64
+
65
+ model.config.end_token_id = tokenizer.eos_token_id
66
+ model.config.pad_token_id = model.config.eos_token_id
67
+ model.resize_token_embeddings(len(tokenizer))
68
+ generator = pipeline("text-generation",
69
+ model=model,
70
+ tokenizer=tokenizer,
71
+ device="cuda:0")
72
+ return generator
73
+
74
+
75
+ def get_user_input(user_input):
76
+ tmp = input("Enter input (type 'quit' to exit, 'clear' to clean memory): ")
77
+ new_inputs = f"Human: {tmp}\n Assistant: "
78
+ user_input += f" {new_inputs}"
79
+ return user_input, tmp == "quit", tmp == "clear"
80
+
81
+
82
+ def get_model_response(generator, user_input, max_new_tokens):
83
+ response = generator(user_input, max_new_tokens=max_new_tokens)
84
+ return response
85
+
86
+
87
+ def process_response(response, num_rounds):
88
+ output = str(response[0]["generated_text"])
89
+ output = output.replace("<|endoftext|></s>", "")
90
+ all_positions = [m.start() for m in re.finditer("Human: ", output)]
91
+ place_of_second_q = -1
92
+ if len(all_positions) > num_rounds:
93
+ place_of_second_q = all_positions[num_rounds]
94
+ if place_of_second_q != -1:
95
+ output = output[0:place_of_second_q]
96
+ return output
97
+
98
+
99
+ def main(args):
100
+ generator = get_generator(args.path)
101
+ set_seed(42)
102
+
103
+ def process_response_ch(response):
104
+ output = str(response[0]["generated_text"])
105
+ output = output[output.find("生成一份对应的诊断意见:") + 12:output.find("<|endoftext|>")].replace(" ", "")
106
+ end = output.find("生成一份对应的诊断意见:")
107
+ if end != -1:
108
+ output = output[:end]
109
+ return output
110
+
111
+ if args.in_csv is not None:
112
+ csv = pd.read_csv(args.in_csv, encoding="gbk")
113
+ gen = []
114
+ n_instr = 0
115
+ for instr in csv["INSTRUCTION"]:
116
+ n_instr += 1
117
+ print("-" * 20 + f" Instruction {n_instr} " + "-" * 20)
118
+ user_input = f"根据下面一段影像描述:{instr}\n 生成一份对应的诊断意见:"
119
+ response = get_model_response(generator, user_input,
120
+ args.max_new_tokens)
121
+ output = process_response_ch(response)
122
+ gen.append(output)
123
+ print(user_input + "\n" + output + "\n")
124
+ csv["GENERATED"] = gen
125
+ csv.to_csv(args.out_csv, encoding="gbk", index=False)
126
+ else:
127
+ while True:
128
+ tmp = input("Enter input (type 'quit' to exit): ")
129
+ if tmp == "quit":
130
+ break
131
+ if tmp == "clear":
132
+ print("-" * 40 + "\n(Context preservation is currently disabled. 'clear' takes no effect.)\n")
133
+ continue
134
+ user_input = f"根据下面一段影像描述:{tmp}\n 生成一份对应的诊断意见:"
135
+ response = get_model_response(generator, user_input,
136
+ args.max_new_tokens)
137
+ output = process_response_ch(response)
138
+ print("-" * 40 + "\n" + user_input + "\n" + output + "\n")
139
+
140
+ # user_input = ""
141
+ # num_rounds = 0
142
+ # while True:
143
+ # num_rounds += 1
144
+ # user_input, quit, clear = get_user_input(user_input)
145
+
146
+ # if quit:
147
+ # break
148
+ # if clear:
149
+ # user_input, num_rounds = "", 0
150
+ # continue
151
+
152
+ # response = get_model_response(generator, user_input,
153
+ # args.max_new_tokens)
154
+ # output = process_response(response, num_rounds)
155
+
156
+ # print("-" * 30 + f" Round {num_rounds} " + "-" * 30)
157
+ # print(f"{output}")
158
+ # user_input = f"{output}\n\n"
159
+
160
+
161
+ if __name__ == "__main__":
162
+ # Silence warnings about `max_new_tokens` and `max_length` being set
163
+ logging.getLogger("transformers").setLevel(logging.ERROR)
164
+
165
+ args = parse_args()
166
+ main(args)
167
+
168
+ # Example:
169
+ """
170
+ Human: what is internet explorer?
171
+ Assistant:
172
+ Internet Explorer is an internet browser developed by Microsoft. It is primarily used for browsing the web, but can also be used to run some applications. Internet Explorer is often considered the best and most popular internet browser currently available, though there are many other options available.
173
+ Human: what is edge?
174
+ Assistant:
175
+ Edge is a newer version of the Microsoft internet browser, developed by Microsoft. It is focused on improving performance and security, and offers a more modern user interface. Edge is currently the most popular internet browser on the market, and is also used heavily by Microsoft employees.
176
+ """
samples/sample-input-endocrine.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ INSTRUCTION,RESPONSE
2
+ ����������岿����СԼΪ17.8mm��15.7mm��ڣ��ܶȲ����ȣ����ڿɼ���Ƭ״֬���ܶȼ����״�ƻ���Ҳ�������δ�������쳣������ʵ�ʼ����ܶ������ʵ��δ���쳣�ܶ�Ӱ��˫����������������Ĥ����ܰͽ���ʾ��������ʵ���ܶȼ��͡�,����������岿��ڰ�ƻ�������С���ܶ������֬���Ρ������ٴ�����ؼ�飻���
3
+ ��������������֣��Ҳ������ٴ�С����̬���ܶ�δ�������쳣��˫��������δ�������쳣ǿ����������˫����̬��Сλ������������ǿ����δ���쳣�ܶ�Ӱ��δ�����Խ�ʯӰ��������յ�����������δ�����Ż�ˮ���ƻ�����Ĥ��δ���쳣������ܰͽ�Ӱ����������෢Ѫ����������ҶС���ס�,��������������֡���������෢Ѫ����������ҶС���ס������ٴ���ʷ��������ؼ�飻��á�
samples/sample-input-hepatobiliary.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ INSTRUCTION,RESPONSE
2
+ ��Ҷ�����г������������ù��У���������ǻ������������Һ���϶����������Ҷ���ܶ�Ӱ������δ�������쳣��Ƣ����̬��С������δ���쳣�ܶ�Ӱ��������̬��С������δ���쳣�ܶ�Ӱ��˫�����ܶ�Ӱ�����������Ÿ�������������������δ���쳣�ܶ�Ӱ����Ĥ��෢С�ܰͽ�Ӱ�����᳦С��״��ͻ��Ӱ��,��Ҷ�����г�������������ǻ������������Һ���϶�������Ρ��������ܶ�Ӱ�����������Ÿ����������᳦���ҡ������ٴ���������ؼ�飻���
3
+ ������̬��С��������Ҷ�ɼ�СԲ�ε��ܶ�Ӱ������λ��S8��Լ13mm��С�����Ҽ����Ӱ��������̬��С������δ���쳣�ܶ�Ӱ��Ƣ��̬��С������δ���쳣�ܶ�Ӱ������δ���쳣�������ɼ���СԲ�ε��ܶ�Ӱ��˫��������δ�������쳣����Ĥ��δ���쳣������ܰͽ�Ӱ��,���ҽ�ʯ������ҶС���ܶ����Ҫʱ��ǿ��顣����С���ܶ�Ӱ�������ٴ���������ؼ�飻���
samples/sample-input-pancreatic.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ INSTRUCTION,RESPONSE
2
+ 1.�����ʵ�ԣ��ܶȣ��ͣ���С��2.8*1.6cm����λ�����岿��������ǿɨ�������ӳٽ�����ǿ������������ʵ��ή���鲻�����ӳ�ǿ�����ȹܣ��жϰ��������ŵ��ܣ�������������2.����SMA������������ǻ�ɣ���-����CHA�����������������죺��ǻ�ɡ���ϵĤ�϶������ɣ�����ֲ��Ӵ�Ƣ����3.����MPV����������SMV��������������ֲ��ۼ�Ƣ��������ǻ��խ4.���������III��V�οɼ����ܶ����ǿɨ���Եǿ����V�β�����С���ڵ������š������ܰͽ᣺���ܡ���Ĥ��෢�ܰͽ���ʾ�����ɼ�СԲ�ε��ܶ���ǿ��Ӱ��˫���������Դ֣����������ܱڻ�ϰ߿��γɡ�,1.���岿�����ٰ��������������ף��ۼ���ǻѪ�ܣ�����������ǻ�ɷ������죩����III��V��ת�������ܣ����ܡ���Ĥ��෢�ܰͽ���ʾ��2.����С���ף�˫���������Դ֣����������ܱڻ�ϰ߿��γɡ������ٴ���������飻���
3
+ 1.�����ʵ�ԣ��ܶȣ��ͣ���С��5.0*4.0cm����λ����ͷ����������ǿɨ�������ӳٽ�����ǿ������ͷ��Χ�����������ȹܣ�δ���������ŵ��ܣ����ܹ����۰����θ����⵨������2.����SMA������Լ1/2�ܣ���ǻ�ɣ���-����CHA�����������������죺������3.����MPV����������SMV������4.��������ڽ���֯�����������ۼ�ʮ��ָ��ˮƽ�������ܰͽ᣺���ܡ���Ĥ�󡢳�ϵĤ�����෢�ܰͽ���ʾ�����ܶȼ��ͣ������ɼ�СԲ�ε��ܶ���ǿ��Ӱ������ʾƢ�༰˫��������δ�������쳣��,1.��ͷ�������ٰ����λ�������裻�ۼ�ʮ��ָ������ϵĤ�϶����������ܡ���Ĥ�󡢳�ϵĤ�����෢�ܰͽ���ʾ����ͷ��Χ����������2.֬���Σ�����С���ף������ٴ���������飻���
samples/sample-output-endocrine.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ INSTRUCTION,RESPONSE,GENERATED
2
+ 左侧肾上腺体部见大小约为17.8mm×15.7mm结节;密度不均匀;其内可见斑片状脂肪密度及结节状钙化灶。右侧肾上腺未见明显异常。右肾实质见低密度灶。左肾实质未见异常密度影。双肾轮廓不光整。腹膜后见淋巴结显示。附见肝实质密度减低。,左侧肾上腺体部结节伴钙化。右肾小低密度灶。附见脂肪肝。请结合临床及相关检查;随诊。,左侧肾上腺体部结节;右肾低密度灶;拟复杂囊肿。附见脂肪肝。请结合临床及其他相关检查;随诊。
3
+ 左侧肾上腺稍增粗;右侧肾上腺大小、形态、密度未见明显异常;双侧肾上腺未见明显异常强化区。所见双肾形态大小位置正常;均匀强化;未见异常密度影;未见阳性结石影。肾盂肾盏及近端输尿管未见扩张积水及破坏。腹膜后未见异常增大的淋巴结影。附见肝脏多发血管瘤;肝右叶小囊肿。,左侧肾上腺稍增粗。附见肝脏多发血管瘤;肝右叶小囊肿。请结合临床病史及其他相关检查;随访。,左侧肾上腺稍增粗。附见肝脏多发血管瘤;肝右叶小囊肿。请结合临床病史及其他相关检查;随访。
samples/sample-output-hepatobiliary.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ INSTRUCTION,RESPONSE,GENERATED
2
+ 肝叶部分切除术;引流管置管中;术区及腹腔少许渗出、积液;较多积气。肝右叶低密度影。胆囊未见明显异常。脾脏形态大小正常;未见异常密度影。胰腺形态大小正常;未见异常密度影。双肾低密度影。两侧肾周桥隔稍增厚。两侧肾上腺区未见异常密度影。腹膜后多发小淋巴结影。升结肠小囊状带突起影。,肝叶部分切除术;术区及腹腔少许渗出、积液;较多积气。肝、两肾低密度影。两侧肾周桥隔稍增厚。升结肠憩室。请结合临床及其他相关检查;随诊。,肝叶部分切除术;术区及腹腔少许渗出、积液;较多积气。肝右叶低密度影。双肾低密度影。两侧肾周桥隔稍增厚。升结肠小囊状带突起影。腹膜后多发小淋巴结影。请结合临床及其他相关检查;随诊。
3
+ 肝脏形态大小正常;右叶可见小圆形低密度影;大者位于S8;约13mm大小。胆囊见结节影。胰腺形态大小正常;未见异常密度影。脾形态大小正常;未见异常密度影。两肾未见异常、左肾可见性小圆形低密度影。双侧肾上腺未见明显异常。腹膜后未见异常增大的淋巴结影。,胆囊结石。肝右叶小低密度灶;必要时增强检查。左肾小低密度影。请结合临床及其他相关检查;随诊。,肝右叶小囊性灶;胆囊结石;左肾小囊性灶。请结合临床及其他相关检查;随诊。
samples/sample-output-pancreatic.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ INSTRUCTION,RESPONSE,GENERATED
2
+ 1.病灶:囊实性;密度:低;大小:2.8*1.6cm;部位:胰体部;病灶增强扫描呈轻度延迟渐进性强化;上游胰腺实质萎缩伴不均匀延迟强化。胰管:中断伴上游扩张胆管:不伴上游扩张2.动脉SMA:(-);腹腔干:(-);CHA:(-);动脉变异:腹腔干、肠系膜上动脉共干;病灶局部接触脾动脉3.静脉MPV:(-);SMV:(-);病灶局部累及脾静脉;管腔狭窄4.胰外情况肝III、V段可见低密度灶;增强扫描边缘强化;V段病灶旁小肝内胆管扩张。区域淋巴结:胰周、腹膜后多发淋巴结显示右肾可见小圆形低密度无强化影;双侧肾上腺稍粗;腹主动脉管壁混合斑块形成。,1.胰体部导管腺癌伴阻塞性胰腺炎;累及腹腔血管(如上述;腹腔干发育变异);肝III、V段转移瘤可能;胰周、腹膜后多发淋巴结显示;2.右肾小囊肿;双侧肾上腺稍粗;腹主动脉管壁混合斑块形成。请结合临床及其他检查;随诊。,胰体部导管腺癌伴阻塞性胰腺炎;累及腹腔血管(如上述);胰周、腹膜后多发淋巴结显示;右肾小囊肿;双侧肾上腺稍粗;腹主动脉管壁混合斑块形成;请结合临床及其他检查;随诊。
3
+ 1.病灶:囊实性;密度:低;大小:5.0*4.0cm;部位:胰头部;病灶增强扫描呈轻度延迟渐进性强化。胰头周围少许渗出。胰管:未见明显扩张胆管:胆总管受累伴上游肝内外胆管扩张2.动脉SMA:包绕约1/2周;腹腔干:(-);CHA:(-);动脉变异:(-)3.静脉MPV:(-);SMV:闭塞4.胰外情况邻近组织脏器:病灶累及十二指肠水平段区域淋巴结:胰周、腹膜后、肠系膜根部多发淋巴结显示肝脏密度减低;右肾可见小圆形低密度无强化影;余所示脾脏及双侧肾上腺未见明显异常。,1.胰头部导管腺癌伴低位胆道梗阻;累及十二指肠、肠系膜上动静脉;胰周、腹膜后、肠系膜根部多发淋巴结显示;胰头周围少许渗出;2.脂肪肝;右肾小囊肿;请结合临床及其他检查;随诊。,胰头部导管腺癌伴低位胆道梗阻;累及十二指肠、肠系膜上动静脉;胰周、腹膜后、肠系膜根部多发淋巴结显示;脂肪肝;右肾小囊肿;请结合临床及其他检查;随诊。