[AI医学] llm-medical-data:用于大模型微调训练的医疗数据集

关键词: 医疗数据集,大模型微调训练

开源项目:llm-medical-data 用于大模型微调训练的医疗数据集

项目地址https://github.com/donote/llm-medical-data

该项目主要参考了几篇关于医学领域大模型的论文或项目中的医疗大模型微调项目,收集整理项目涉及到的微调样本数据,数据说明如下:

1. chinese_medical_dialogue_data

源地址:https://github.com/Toyhom/Chinese-medical-dialogue-data

  • 文件名及对应的样本量:
文件名样本量
IM_内科.csv307,596
andriatria_男科.csv113,877
obgyn_妇产科.csv229,706
oncology_肿瘤科.csv96,627
pediatric_儿科.csv117,099
surgical_外科.csv149,576
  • 数据格式:utf8编码,csv格式,具体见样例chinese_medical_dialogue_data/sample_h100.csv

2. huatuo_llama_med_chinese_data

源地址:https://github.com/SCIR-HI/Huatuo-Llama-Med-Chinese

  • 文件名及对应的样本量:
文件名样本量
liver_cancer.json1,000
llama_data.json8,568
  • 数据格式:utf8编码,json格式,符合standford-alpaca指令微调样本格式
{
    "instruction":" <user>: 我听说免疫疗法是治疗晚期肝癌的一种很有效的方法,真的吗? <bot>: 是的,免疫疗法是一种新兴的治疗方法,它可以提高人体免疫系统对癌细胞的反应能力。对于晚期肝癌患者,免疫疗法已证明具有很高的治疗效果。 <user>: 但是,这是否适用于所有的肝癌患者?",
    "input":""
    "output":"不是所有的肝癌患者都适合进行免疫疗法。根据患者的临床表现和病情,医生会对患者进行评估,从而选择最适合的治疗方案。",
}

3. medicalgpt_data

源地址:https://github.com/MediaBrain-SJTU/MedicalGPT-zh

项目未提供微调数据,但给出了微调数据生成脚本和种子数据文件,添加openai api key后可自行生成微调样本数据。

pip install -r medicalgpt_data/requirements.txt

book_based_question_generation.pydialogue_generation.py中增加openai api key:

### add your openai key list, more key can generate data faster
api_keys=[]

在medicalgpt_data下面执行对应的样本生成脚本即可,格式参考样例文件:book_based_qa.jsondialogue_task.json

4. doctorchat_data

源地址:https://github.com/Kent0n-Li/ChatDoctor

  • 文件名及对应的样本量:
文件名样本量
GenMedGPT-5k.json2,354
iCliniq.json7342
HealthCareMagic-100k.json24,665

GenMedGPT-5k为chatGPT生成的医患对话,iCliniqHealthCareMagic-100k为在线站点真实对话。

  • 数据格式:符合standford-alpaca样本格式json描述
{
	"instruction": "If you are a doctor, please answer the medical questions based on the patient's description.",
   "input": "Doctor, I have been experiencing sudden and frequent panic attacks. I don't know what to do.",
   "output": "Well, based on what you're telling me, it sounds like you may be suffering from panic disorder. The best course of action is to start with psychotherapy and mental health counseling. Additionally, we should conduct an electrocardiogram to make sure that there are no physical issues causing your panic attacks. We will also need to perform a depression screen and a toxicology screen to rule out any other underlying causes. Finally, I would recommend a comprehensive psychological and psychiatric evaluation and therapy to help manage your symptoms."
}

5. opengpt_data

项目地址:https://github.com/CogStack/opengpt

  • 文件名及对应的样本量:
文件名类型样本量
prepared_generated_data_for_nhs_uk_qa.csvQA24,665
prepared_generated_data_for_nhs_uk_conversations.csv对话2,354
prepared_generated_data_for_medical_tasks.csv任务4,688

使用chatGPT对NHS站点数据生成的样本,生成样本的promptsprompts dataset

  • 数据格式:csv格式,text<|user|><|ai|>对应了standford-alpaca样本格式中的inputoutput
text,raw_data_id
"<|user|> What is high blood pressure? <|eos|> <|ai|> High blood pressure is a condition where the force at which your heart pumps blood around your body is high. It is recorded with 2 numbers, the systolic pressure and the diastolic pressure, both measured in millimetres of mercury (mmHg).
References:
- https://www.nhs.uk/conditions/Blood-pressure-(high)/Pages/Introduction.aspx <|eos|> <|eod|>",0

----------END----------

同步更新到:AI加油站

### 大语言模型中的角色扮演功能 大语言模型(LLM),如GLM-4,具备强大的自然语言处理能力,可以模拟不同场景下的对话交流,实现高度逼真的角色扮演效果[^1]。通过预训练微调技术,这些模型能够理解并回应各种类型的输入,从而创建互动式的用户体验。 #### 实现机制 为了使LLM更好地完成角色扮演任务,通常会采用特定领域知识库进行增强学习。例如,在医疗咨询场景中,医生角色可以通过集成医学专业知识图谱来提高诊断准确性;而在教育辅导方面,则可利用教学资源优化解答质量。此外,借助外部API接口接入实时数据源也是提升性能的有效手段之一。 ```python def role_play_as_doctor(user_input): # 加载医学专业术语词典和其他辅助资料 medical_knowledge_base = load_medical_data() response = generate_response_based_on_context( user_input=user_input, knowledge_base=medical_knowledge_base ) return format_output(response) # 用户提问:“我最近总是感觉疲劳乏力。” print(role_play_as_doctor("I've been feeling tired lately.")) ``` 这种基于上下文感知的角色扮演不仅限于人类身份,还可以扩展到虚拟助手、客服代表等多个应用场景之中。对于那些需要频繁交互的服务行业来说,这样的解决方案无疑提供了极大的便利性和效率增益。 然而值得注意的是,尽管大型语言模型拥有出色的模仿能力,但在实际应用过程中仍然存在一些局限性。比如由于其庞大的规模而导致较高的运算开销问题就十分突出——这可能会影响某些低功耗设备上的表现[^2]。 #### 应用实例 在具体实践中,已经有许多成功的案例展示了如何有效运用LLM来进行角色扮演: - **在线问诊平台**:患者可以直接向AI描述症状,获得初步建议; - **游戏NPC设计**:创造更加生动有趣的游戏世界; - **客户服务聊天机器人**:提供7×24小时不间断的支持服务。 综上所述,随着技术不断发展进步,未来我们可以期待看到更多创新性的角色扮演方式被开发出来,并广泛应用于各个领域当中。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值