Update README.md
Browse files
README.md
CHANGED
|
@@ -39,11 +39,17 @@ findings_info =
|
|
| 39 |
"""
|
| 40 |
Description: PET CT WHOLE BODY
|
| 41 |
Radiologist: James
|
| 42 |
-
Findings:
|
| 43 |
-
|
|
|
|
|
|
|
| 44 |
"""
|
| 45 |
|
| 46 |
-
inputs = tokenizer(findings_info.replace('\n', ' '),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
input_ids = inputs.input_ids.to("cuda")
|
| 48 |
attention_mask = inputs.attention_mask.to("cuda")
|
| 49 |
outputs = model.generate(input_ids,
|
|
@@ -58,7 +64,9 @@ outputs = model.generate(input_ids,
|
|
| 58 |
no_repeat_ngram_size=3,
|
| 59 |
early_stopping=True
|
| 60 |
)
|
| 61 |
-
|
|
|
|
|
|
|
| 62 |
```
|
| 63 |
|
| 64 |
|
|
|
|
| 39 |
"""
|
| 40 |
Description: PET CT WHOLE BODY
|
| 41 |
Radiologist: James
|
| 42 |
+
Findings:
|
| 43 |
+
Head/Neck: xxx Chest: xxx Abdomen/Pelvis: xxx Extremities/Musculoskeletal: xxx
|
| 44 |
+
Indication:
|
| 45 |
+
The patient is a 60-year old male with a history of xxx
|
| 46 |
"""
|
| 47 |
|
| 48 |
+
inputs = tokenizer(findings_info.replace('\n', ' '),
|
| 49 |
+
padding="max_length",
|
| 50 |
+
truncation=True,
|
| 51 |
+
max_length=1024,
|
| 52 |
+
return_tensors="pt")
|
| 53 |
input_ids = inputs.input_ids.to("cuda")
|
| 54 |
attention_mask = inputs.attention_mask.to("cuda")
|
| 55 |
outputs = model.generate(input_ids,
|
|
|
|
| 64 |
no_repeat_ngram_size=3,
|
| 65 |
early_stopping=True
|
| 66 |
)
|
| 67 |
+
# get the generated impressions
|
| 68 |
+
output_str = tokenizer.decode(outputs,
|
| 69 |
+
skip_special_tokens=True)
|
| 70 |
```
|
| 71 |
|
| 72 |
|