🚀 Asclepius-Llama3-8B模型卡片
这是Asclepius-Llama3-8B的官方模型检查点(arxiv)。该模型是Asclepius-7B的增强版本,通过将基础模型替换为Llama-3,并将最大序列长度增加到8192。
🚀 快速开始
prompt = """You are an intelligent clinical languge model.
Below is a snippet of patient's discharge summary and a following instruction from healthcare professional.
Write a response that appropriately completes the instruction.
The response should provide the accurate answer to the instruction, while being concise.
[Discharge Summary Begin]
{note}
[Discharge Summary End]
[Instruction Begin]
{question}
[Instruction End]
"""
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("starmpcc/Asclepius-Llama3-8B", use_fast=False)
model = AutoModelForCausalLM.from_pretrained("starmpcc/Asclepius-Llama3-8B")
note = "This is a sample note"
question = "What is the diagnosis?"
model_input = prompt.format(note=note, question=question)
input_ids = tokenizer(model_input, return_tensors="pt").input_ids
output = model.generate(input_ids)
print(tokenizer.decode(output[0]))
✨ 主要特性
- 该模型是Asclepius-7B的增强版本,将基础模型替换为Llama-3,并增加了最大序列长度。
- 可以执行8种临床NLP任务,包括命名实体识别、缩写扩展、关系提取等。
📦 安装指南
文档未提及安装步骤,暂不提供。
💻 使用示例
基础用法
prompt = """You are an intelligent clinical languge model.
Below is a snippet of patient's discharge summary and a following instruction from healthcare professional.
Write a response that appropriately completes the instruction.
The response should provide the accurate answer to the instruction, while being concise.
[Discharge Summary Begin]
{note}
[Discharge Summary End]
[Instruction Begin]
{question}
[Instruction End]
"""
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("starmpcc/Asclepius-Llama3-8B", use_fast=False)
model = AutoModelForCausalLM.from_pretrained("starmpcc/Asclepius-Llama3-8B")
note = "This is a sample note"
question = "What is the diagnosis?"
model_input = prompt.format(note=note, question=question)
input_ids = tokenizer(model_input, return_tensors="pt").input_ids
output = model.generate(input_ids)
print(tokenizer.decode(output[0]))
高级用法
文档未提及高级用法示例,暂不提供。
📚 详细文档
模型详情
模型描述
- 模型类型:临床大语言模型(Clinical LLM)
- 语言(NLP):英语
- 许可证:CC-BY-NC-SA 4.0
- 微调基础模型:Llama3-8B
模型来源
- 仓库:https://github.com/starmpcc/Asclepius
- 论文:https://arxiv.org/abs/2309.00237
- 数据:https://huggingface.co/datasets/starmpcc/Asclepius-Synthetic-Clinical-Notes
用途
该模型可以结合临床笔记执行以下8种临床NLP任务:
- 命名实体识别
- 缩写扩展
- 关系提取
- 时间信息提取
- 共指消解
- 释义
- 摘要生成
- 问答
直接使用
[需要更多信息]
下游使用
[需要更多信息]
超出适用范围的使用
仅用于研究目的!
更新信息
2024.01.10
Asclepius-R,即Asclepius在MIMIC-III出院小结上训练的变体,现已在Physionet上可用!
🔧 技术细节
训练数据
https://huggingface.co/datasets/starmpcc/Asclepius-Synthetic-Clinical-Notes
训练过程
- 初始训练使用因果语言建模在合成临床笔记上进行。
- 然后使用临床指令 - 响应对进行微调。
- 关于我们方法的全面概述,我们即将发表的论文将作为参考资源。
训练超参数
速度、大小、时间
- 预训练(1个epoch):使用4个A100 80G GPU,耗时2小时59分钟。
- 指令微调(3个epoch):使用4个A100 80G GPU,耗时30小时41分钟。
📄 许可证
该模型使用CC-BY-NC-SA 4.0许可证。
📖 引用
BibTeX:
@article{kweon2023publicly,
title={Publicly Shareable Clinical Large Language Model Built on Synthetic Clinical Notes},
author={Kweon, Sunjun and Kim, Junu and Kim, Jiyoun and Im, Sujeong and Cho, Eunbyeol and Bae, Seongsu and Oh, Jungwoo and Lee, Gyubok and Moon, Jong Hak and You, Seng Chan and others},
journal={arXiv preprint arXiv:2309.00237},
year={2023}
}