🚀 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}
}