forked from BardiaKh/RadPrompter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path05_JSON-Prefill.toml
More file actions
88 lines (72 loc) · 3.2 KB
/
05_JSON-Prefill.toml
File metadata and controls
88 lines (72 loc) · 3.2 KB
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
[METADATA]
version = 0.1
description = "A sample prompt for RadPrompter"
[PROMPTS]
system_prompt = "You are a helpful assistant that has 20 years of experience in reading radiology reports and extracting data elements."
user_prompt_intro = """
{{intro_prompt}}
"""
user_prompt_no_cot = """
I want you to extract the following data element from the report:
{{hint}}
Your final answer elements in a valid JSON format and is between <json> and </json> tags:
<json>
{
"{{variable_name}}": "answer"
}
</json>
"""
assistant_response_template = """
<json>
{
"{{variable_name}}" : \""""
[CONSTRUCTOR]
system = "rdp(system_prompt)"
user = "rdp(user_prompt_intro + user_prompt_no_cot)"
response_templates = "rdp(assistant_response_template)"
stop_tags = "</json>"
[SCHEMAS]
[SCHEMAS.PulmonaryEmbolism]
variable_name = "Pulmonary Embolism"
intro_prompt = """
Carefully review the provided chest CT report (in the <report> tag). Ensure that each data element is accurately captured.
Here is the report:
<report>
{{report}}
</report>
Please pay attention to the following details:
- Your attention to detail is crucial for maintaining the integrity of the medical records.
- You should not confabulate information, and if something is not mentioned, you should assume that it is `Absent` unless otherwise stated.
- The report may contain additional information that is not relevant to the requested data elements. Please ignore that information.
- We are interested at findings at the time of scan, not the previous ones, so only consider the impression and findings sections of the report.
- Do not print anything else other than the provided output format.
"""
type = "select"
options = ["Present", "Absent"]
hint = """"Indicate `Present` if the report explicitly mentions the patient has pulmonary embolism in their CT scan.
Indicate `Absent` if pulmonary embolism is not seen or if a previously observed pulmonary embolism is mentioned as resolved."""
show_options_in_hint = true
[SCHEMAS.Laterality]
variable_name = "Laterality"
intro_prompt = ""
type = "select"
options = ["Left", "Right", "Bilateral", "Not Mentioned"]
hint = """
Indicate `Left` if the report explicitly mentions the patient has a left-sided pulmonary embolism in their CT scan.
Indicate `Right` if the report explicitly mentions the patient has a right-sided pulmonary embolism in their CT scan.
Indicate `Bilateral` if the report explicitly mentions the patient has a bilateral pulmonary embolism in their CT scan or if patient has both left and right sided pulmonary embolism.
Indicate `Not Mentioned` if side of pulmonary embolism is not mentioned.
"""
show_options_in_hint = true
[SCHEMAS.Acuity]
variable_name = "Acuity"
intro_prompt = ""
type = "select"
options = ["Acute", "Chronic", "Mixed", "Not Mentioned"]
hint = """
Indicate `Acute` if the report explicitly mentions the patient has an acute pulmonary embolism in their CT scan.
Indicate `Chronic` if the report explicitly mentions the patient has a chronic pulmonary embolism in their CT scan.
Indicate `Mixed` if the report explicitly mentions the patient has a acute on chronic pulmonary embolism in their CT scan.
Indicate `Not Mentioned` if acuity of pulmonary embolism is not mentioned.
"""
show_options_in_hint = true