File size: 3,312 Bytes
f3d3fa0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1795aa2
 
f3d3fa0
 
 
 
 
 
 
 
 
 
 
 
 
 
2e5d994
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f3d3fa0
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
license: apache-2.0
language:
- zh
base_model:
- Qwen/Qwen2.5-7B-Instruct
pipeline_tag: feature-extraction
tags:
- structuring
- EHR
- medical
- IE
---
# Model Card for GENIE


## Model Details

Model Size: 8B (English) / 7B (Chinese)

Max Tokens: 8192

Base model: Llama 3.1 8B (English) / Qwen 2.5 7B (Chinese)

### Model Description

GENIE (Generative Note Information Extraction, 中文名:病历精灵) is an end-to-end model designed to structure free text from electronic health records (EHRs). It processes EHRs in a single pass, extracting biomedical named entities along with their assertion statuses, body locations, modifiers, values, units, and intended purposes, outputting this information in a structured JSON format. This streamlined approach simplifies traditional natural language processing workflows by replacing all the analysis components with a single model, making the system easier to maintain while leveraging the advanced analytical capabilities of large language models (LLMs). Comparing with general-purpose LLMs, GENIE does not require prompt engineering or few-shot examples. Additionally, it generates all relevant attributes in one pass, significantly reducing both runtime and operational costs.
GENIE is co-developed by the groups of Sheng Yu (https://www.stat.tsinghua.edu.cn/teachers/shengyu/), Tianxi Cai (https://dbmi.hms.harvard.edu/people/tianxi-cai), and Isaac Kohane (https://dbmi.hms.harvard.edu/people/isaac-kohane).


## Usage

```python
from vllm import LLM, SamplingParams

PROMPT_TEMPLATE = "Human:\n{query}\n\n Assistant:"
sampling_params = SamplingParams(temperature=temperature, max_tokens=max_new_token)
EHR = ['xxxxx1','xxxxx2']
texts = [PROMPT_TEMPLATE.format(query=k) for k in EHR]
output = model.generate(texts, sampling_params)
```

# An example

Input:
```python
EHR = ['慢性乙型肝炎病史10余年,曾有肝功能异常,中医治疗后好转;1年余前查HBsAg转阴,但肝脏病理提示病毒性肝炎伴肝纤维化(G1S3-4)']
```

Output:
```python
res = [
 { "术语": "慢性乙型肝炎",
 "语义类型": "疾病、综合征、病理功能",
 "叙述状态": "存在",
 "身体部位": "无",
 "数值": "NA",
 "单位": "NA",
 "修饰词": "无" },
 { "术语": "肝功能异常",
 "语义类型": "症状、体征、临床所见",
 "叙述状态": "存在",
 "身体部位": "无",
 "数值": "NA",
 "单位": "NA",
 "修饰词": "无" },
 { "术语": "HBsAg",
 "语义类型": "化学物质、药物",
 "叙述状态": "不存在",
 "身体部位": "NA",
 "数值": "无",
 "单位": "NA",
 "修饰词": "NA" },
{ "术语": "肝脏病理",
 "语义类型": "诊断操作",
 "叙述状态": "存在",
 "身体部位": "无",
 "数值": "无",
 "单位": "NA",
 "修饰词": "NA" },
 { "术语": "病毒性肝炎",
 "语义类型": "疾病、综合征、病理功能",
 "叙述状态": "存在",
 "身体部位": "无",
 "数值": "NA",
 "单位": "NA",
 "修饰词": "无" },
 { "术语": "肝纤维化",
 "语义类型": "疾病、综合征、病理功能",
 "叙述状态": "存在",
 "身体部位": "无",
 "数值": "NA",
 "单位": "NA",
 "修饰词": "无" },
]
```



## Citation [optional]

If you find our paper or models helpful, please consider cite: (to be released)

**BibTeX:**

[More Information Needed]