starmpcc commited on
Commit
464ffda
·
verified ·
1 Parent(s): 2579994

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +144 -3
README.md CHANGED
@@ -1,3 +1,144 @@
1
- ---
2
- license: cc-by-nc-sa-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-sa-4.0
3
+ datasets:
4
+ - starmpcc/Asclepius-Synthetic-Clinical-Notes
5
+ language:
6
+ - en
7
+ pipeline_tag: text2text-generation
8
+ tags:
9
+ - medical
10
+ ---
11
+ # Model Card for Model ID
12
+
13
+ <!-- Provide a quick summary of what the model is/does. -->
14
+
15
+ This is an official model checkpoint for Asclepius-Mixtral-8B-v0.3 [(arxiv)](https://arxiv.org/abs/2309.00237).
16
+ This model is an enhanced version of Asclepius-7B, by replacing the base model with Mixtral-8B-v0.3 and increasing the max sequence length to 8192.
17
+
18
+ ## UPDATE
19
+ ### 2024.01.10
20
+ - Asclepius-R, the variant of Asclepius that trained on MIMIC-III discharge summaries, is now available on [Physionet](https://physionet.org/content/asclepius-r/1.0.0/)!
21
+
22
+ ## Model Details
23
+
24
+ ### Model Description
25
+
26
+ <!-- Provide a longer summary of what this model is. -->
27
+
28
+
29
+
30
+ - **Model type:** Clinical LLM (Large Language Model)
31
+ - **Language(s) (NLP):** English
32
+ - **License:** CC-BY-NC-SA 4.0
33
+ - **Finetuned from model [optional]:** Mixtral-8B-v0.3
34
+
35
+ ### Model Sources [optional]
36
+
37
+ <!-- Provide the basic links for the model. -->
38
+
39
+ - **Repository:** https://github.com/starmpcc/Asclepius
40
+ - **Paper:** https://arxiv.org/abs/2309.00237
41
+ - **Data:** https://huggingface.co/datasets/starmpcc/Asclepius-Synthetic-Clinical-Notes
42
+
43
+ ## Uses
44
+
45
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
46
+ This model can perform below 8 clinical NLP tasks, with clincal notes.
47
+ - Named Entity Recognition
48
+ - Abbreviation Expansion
49
+ - Relation Extraction
50
+ - Temporal Information Extraction
51
+ - Coreference Resolution
52
+ - Paraphrasing
53
+ - Summarization
54
+ - Question Answering
55
+
56
+ ### Direct Use
57
+
58
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
59
+
60
+ [More Information Needed]
61
+
62
+ ### Downstream Use [optional]
63
+
64
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
65
+
66
+ [More Information Needed]
67
+
68
+ ### Out-of-Scope Use
69
+
70
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
71
+
72
+ ONLY USE THIS MODEL FOR RESEARCH PURPOSE!!
73
+
74
+ ## How to Get Started with the Model
75
+
76
+ ```python
77
+ prompt = """You are an intelligent clinical languge model.
78
+ Below is a snippet of patient's discharge summary and a following instruction from healthcare professional.
79
+ Write a response that appropriately completes the instruction.
80
+ The response should provide the accurate answer to the instruction, while being concise.
81
+
82
+ [Discharge Summary Begin]
83
+ {note}
84
+ [Discharge Summary End]
85
+
86
+ [Instruction Begin]
87
+ {question}
88
+ [Instruction End]
89
+ """
90
+
91
+ from transformers import AutoTokenizer, AutoModelForCausalLM
92
+ tokenizer = AutoTokenizer.from_pretrained("starmpcc/Asclepius-Mixtral-8B-v0.3", use_fast=False)
93
+ model = AutoModelForCausalLM.from_pretrained("starmpcc/Asclepius-Mixtral-8B-v0.3")
94
+
95
+ note = "This is a sample note"
96
+ question = "What is the diagnosis?"
97
+
98
+ model_input = prompt.format(note=note, question=question)
99
+ input_ids = tokenizer(model_input, return_tensors="pt").input_ids
100
+ output = model.generate(input_ids)
101
+ print(tokenizer.decode(output[0]))
102
+ ```
103
+
104
+ ## Training Details
105
+
106
+ ### Training Data
107
+
108
+ <!-- This should link to a Data Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
109
+
110
+ https://huggingface.co/datasets/starmpcc/Asclepius-Synthetic-Clinical-Notes
111
+
112
+ ### Training Procedure
113
+
114
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
115
+ - Initial training was conducted using causal language modeling on synthetic clinical notes.
116
+ - It was then fine-tuned with clinical instruction-response pairs.
117
+ - For a comprehensive overview of our methods, our upcoming paper will serve as a resource.
118
+
119
+ #### Training Hyperparameters
120
+
121
+ - We followed config used in [Stanford Alpaca](https://github.com/tatsu-lab/stanford_alpaca)
122
+ -
123
+ #### Speeds, Sizes, Times
124
+
125
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
126
+ - Pre-Training (1 epoch): 2h 59m with 4x A100 80G
127
+ - Instruction Fine-Tuning (3 epoch): 30h 41m with 4x A100 80G
128
+
129
+
130
+
131
+ ## Citation
132
+
133
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
134
+
135
+ **BibTeX:**
136
+
137
+ ```
138
+ @article{kweon2023publicly,
139
+ title={Publicly Shareable Clinical Large Language Model Built on Synthetic Clinical Notes},
140
+ 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},
141
+ journal={arXiv preprint arXiv:2309.00237},
142
+ year={2023}
143
+ }
144
+ ```