MedLIFE-PCa: 面向前列腺癌生活方式管理场景的医学人文对话生成模型
📄 项目简介
MedLIFE-PCa 是一个基于 Baichuan2-7B-chat 应用 LoRA 微调经 LLaMA-Factory 架构训练而成的中英文医学对话生成模型。它面向前列腺癌患者的生活方式管理需求,展现了职业医学知识和人文关怀的组合性交互特征。
🤖 基础模型信息
- 基础模型:Baichuan2-7B-Chat
- 微调方式:LoRA (rank=8, 使用 bf16)
- 训练架构:LLaMA-Factory (v0.7.0)
- 训练数据:基于系统纳入的2214篇文献构建了面向前列腺癌生活方式场景的训练数据集,包括营养管理、体力活动、体重管控、药物从实性、心理支持等场景 表2.MedLIFE-Pca-Train数据集的数据构成 |数据集名称 |类型数据量 | 描述 | |预训练数据集 |文本数据 |2214 篇文献 包含 2211 篇研究文章与 3 篇前列腺癌生活方式相关临床指南,用于领域继续预训练 | |单轮对话数据集 |医疗对话 |42,670 组 基于知识库生成的单轮患者问答,覆盖饮食营养、体力活动、体重管理、心理支持、药物依从等主题 | |多轮对话数据集 |多轮医疗对话| 3,008 组 结合上下文语境扩展生成的连续问答数据,模拟患者在生活方式管理过程中的多轮互动情境 |
注:根据随机抽样100条问答对进行人工评分
📚 训练数据生成流程
将已生成的问题和区域化知识片段进行 prompt 拼接,通过模型生成给出答案。生成进程中模型被指示优先引用专业术语和指南意见,并清晰标明知识来源,以确保答案的医学准确性、可解释性和上下文连谱性。
所有问答对通过统一 JSON 格式保存,用于作为相同类型的盈得导入,保证格式统一、组织程度高、可重复性强。
同时,为了保障训练数据的质量与安全,引入人工评估机制对部分样本进行检查,并通过关键术语迁渡和格式校验规则删除存在医学误差、逻辑矛盾或语言异常的问答对。
📂 文件结构
├── adapter_model.bin # LoRA 微调权重
├── config.json # 模型配置文件
├── tokenizer_config.json # 分词器配置
├── special_tokens_map.json # 特殊符号映射
├── README.md # 详细说明
🔧 使用示例
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("your-username/MedLIFE-PCa")
tokenizer = AutoTokenizer.from_pretrained("your-username/MedLIFE-PCa")
prompt = "前列腺癌患者是否可以运动?"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
🚫 使用限制
- 本模型仅用于科研与教学相关场景,不应用于实际医疗诊断或倡导
- 如需商业化使用,请联系项目负责人
📧 联系方式
- 项目负责人:[Fangyuan Jiang_[email protected]]
- 所属单位:南通大学医学院
🌟 致谢
协议
社区使用 Baichuan 2 模型需要遵循 Apache 2.0 和《Baichuan 2 模型社区许可协议》。Baichuan 2 模型支持商业用途,如果您计划将 Baichuan 2 模型或其衍生品用于商业目的,请您确认您的主体符合以下情况:
- 您或您的关联方的服务或产品的日均用户活跃量(DAU)低于100万。
- 您或您的关联方不是软件服务提供商、云服务提供商。
- 您或您的关联方不存在将授予您的商用许可,未经百川许可二次授权给其他第三方的可能。
在符合以上条件的前提下,您需要通过以下联系邮箱 [email protected] ,提交《Baichuan 2 模型社区许可协议》要求的申请材料。审核通过后,百川将特此授予您一个非排他性、全球性、不可转让、不可再许可、可撤销的商用版权许可。
The community usage of Baichuan 2 model requires adherence to Apache 2.0 and Community License for Baichuan2 Model. The Baichuan 2 model supports commercial use. If you plan to use the Baichuan 2 model or its derivatives for commercial purposes, please ensure that your entity meets the following conditions:
- The Daily Active Users (DAU) of your or your affiliate's service or product is less than 1 million.
- Neither you nor your affiliates are software service providers or cloud service providers.
- There is no possibility for you or your affiliates to grant the commercial license given to you, to reauthorize it to other third parties without Baichuan's permission.
Upon meeting the above conditions, you need to submit the application materials required by the Baichuan 2 Model Community License Agreement via the following contact email: [email protected]. Once approved, Baichuan will hereby grant you a non-exclusive, global, non-transferable, non-sublicensable, revocable commercial copyright license.
- Downloads last month
- -