Skip to content

Commit 4a565a7

Browse files
authored
Created md cars for the LLM models (#1402)
1 parent b8b752e commit 4a565a7

9 files changed

+1032
-0
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
layout: model
3+
title: JSL_MedM_v2 (LLM - q16)
4+
author: John Snow Labs
5+
name: jsl_medm_q16_v2
6+
date: 2024-08-21
7+
tags: [en, licensed, clinical, medical, llm, ner]
8+
task: [Summarization, Question Answering, Named Entity Recognition]
9+
language: en
10+
edition: Healthcare NLP 5.4.0
11+
spark_version: 3.0
12+
supported: true
13+
annotator: LLMLoader
14+
article_header:
15+
type: cover
16+
use_language_switcher: "Python-Scala-Java"
17+
---
18+
19+
## Description
20+
21+
This LLM model is trained to extract and link entities in a document. Users needs to define an input schema as explained in the example section. Drug is defined as a list which tells the model that there could be multiple drugs in the document and it has to extract all of them. Each drug has properties like name and reaction. Since “name” is only one, it is a string, but there could be multiple reactions, hence it is a list. Similarly, users can define any schema for any type of entity.
22+
23+
24+
## Predicted Entities
25+
26+
27+
28+
29+
{:.btn-box}
30+
<button class="button button-orange" disabled>Live Demo</button>
31+
<button class="button button-orange" disabled>Open in Colab</button>
32+
[Download](){:.button.button-orange.button-orange-trans.arr.button-icon.hidden}
33+
[Copy S3 URI](){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3}
34+
35+
## How to use
36+
37+
38+
39+
<div class="tabs-box" markdown="1">
40+
{% include programmingLanguageSelectScalaPythonNLU.html %}
41+
42+
```python
43+
from sparknlp_jsl.llm import LLMLoader
44+
45+
llm_loader_pretrained = LLMLoader(spark).pretrained("jsl_medm_q16_v2", "en", "clinical/models")
46+
47+
prompt = """
48+
A 23-year-old pregnant woman at 22 weeks gestation presents with burning upon urination. She states it started 1 day ago and has been worsening despite drinking more water and taking cranberry extract. She otherwise feels well and is followed by a doctor for her pregnancy. Her temperature is 97.7°F (36.5°C), blood pressure is 122/77 mmHg, pulse is 80/min, respirations are 19/min, and oxygen saturation is 98% on room air. Physical exam is notable for an absence of costovertebral angle tenderness and a gravid uterus.
49+
Which of the following is the best treatment for this patient?
50+
A: Ampicillin
51+
B: Ceftriaxone
52+
C: Ciprofloxacin
53+
D: Doxycycline
54+
E: Nitrofurantoin
55+
"""
56+
57+
response = llm_loader_pretrained.generate(prompt)
58+
59+
```
60+
```scala
61+
import com.johnsnowlabs.ml.gguf.LLMLoader
62+
import com.johnsnowlabs.nlp.SparkAccessor.spark
63+
64+
val llmLoader = new LLMLoader().setSparkSession(spark).pretrained("jsl_medm_q16_v2", "en", "clinical/models")
65+
66+
val prompt = """
67+
A 23-year-old pregnant woman at 22 weeks gestation presents with burning upon urination. She states it started 1 day ago and has been worsening despite drinking more water and taking cranberry extract. She otherwise feels well and is followed by a doctor for her pregnancy. Her temperature is 97.7°F (36.5°C), blood pressure is 122/77 mmHg, pulse is 80/min, respirations are 19/min, and oxygen saturation is 98% on room air. Physical exam is notable for an absence of costovertebral angle tenderness and a gravid uterus.
68+
Which of the following is the best treatment for this patient?
69+
A: Ampicillin
70+
B: Ceftriaxone
71+
C: Ciprofloxacin
72+
D: Doxycycline
73+
E: Nitrofurantoin
74+
"""
75+
76+
val response = llmLoader.generate(prompt)
77+
78+
```
79+
</div>
80+
81+
## Results
82+
83+
```bash
84+
"""The correct answer is E: Nitrofurantoin.
85+
86+
The patient is presenting with symptoms of urinary tract infection (UTI), which is common during pregnancy. Nitrofurantoin is a first-line antibiotic for uncomplicated UTI during pregnancy. It is safe and effective in treating UTI during pregnancy and has been used for many years without any adverse effects on the fetus.
87+
"""
88+
```
89+
90+
{:.model-param}
91+
## Model Information
92+
93+
{:.table-model}
94+
|---|---|
95+
|Model Name:|jsl_medm_q16_v2|
96+
|Compatibility:|Healthcare NLP 5.4.0+|
97+
|License:|Licensed|
98+
|Edition:|Official|
99+
|Language:|en|
100+
|Size:|5.7 GB|
101+
102+
103+
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
layout: model
3+
title: JSL_MedM_v2 (LLM - q8)
4+
author: John Snow Labs
5+
name: jsl_medm_q8_v2
6+
date: 2024-08-21
7+
tags: [en, licensed, clinical, medical, llm, ner]
8+
task: [Summarization, Question Answering, Named Entity Recognition]
9+
language: en
10+
edition: Healthcare NLP 5.4.0
11+
spark_version: 3.0
12+
supported: true
13+
annotator: LLMLoader
14+
article_header:
15+
type: cover
16+
use_language_switcher: "Python-Scala-Java"
17+
---
18+
19+
## Description
20+
21+
This LLM model is trained to extract and link entities in a document. Users needs to define an input schema as explained in the example section. Drug is defined as a list which tells the model that there could be multiple drugs in the document and it has to extract all of them. Each drug has properties like name and reaction. Since “name” is only one, it is a string, but there could be multiple reactions, hence it is a list. Similarly, users can define any schema for any type of entity.
22+
23+
24+
## Predicted Entities
25+
26+
27+
28+
29+
{:.btn-box}
30+
<button class="button button-orange" disabled>Live Demo</button>
31+
<button class="button button-orange" disabled>Open in Colab</button>
32+
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/clinical/models/jsl_meds_ner_zs_q16_v2_en_5.4.0_3.0_1720040078717.zip){:.button.button-orange.button-orange-trans.arr.button-icon.hidden}
33+
[Copy S3 URI](s3://auxdata.johnsnowlabs.com/clinical/models/jsl_meds_ner_zs_q16_v2_en_5.4.0_3.0_1720040078717.zip){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3}
34+
35+
## How to use
36+
37+
38+
39+
<div class="tabs-box" markdown="1">
40+
{% include programmingLanguageSelectScalaPythonNLU.html %}
41+
42+
```python
43+
from sparknlp_jsl.llm import LLMLoader
44+
45+
llm_loader_pretrained = LLMLoader(spark).pretrained("jsl_medm_q8_v2", "en", "clinical/models")
46+
47+
prompt = """
48+
A 23-year-old pregnant woman at 22 weeks gestation presents with burning upon urination. She states it started 1 day ago and has been worsening despite drinking more water and taking cranberry extract. She otherwise feels well and is followed by a doctor for her pregnancy. Her temperature is 97.7°F (36.5°C), blood pressure is 122/77 mmHg, pulse is 80/min, respirations are 19/min, and oxygen saturation is 98% on room air. Physical exam is notable for an absence of costovertebral angle tenderness and a gravid uterus.
49+
Which of the following is the best treatment for this patient?
50+
A: Ampicillin
51+
B: Ceftriaxone
52+
C: Ciprofloxacin
53+
D: Doxycycline
54+
E: Nitrofurantoin
55+
"""
56+
57+
response = llm_loader_pretrained.generate(prompt)
58+
59+
```
60+
```scala
61+
import com.johnsnowlabs.ml.gguf.LLMLoader
62+
import com.johnsnowlabs.nlp.SparkAccessor.spark
63+
64+
val llmLoader = new LLMLoader().setSparkSession(spark).pretrained("jsl_medm_q8_v2", "en", "clinical/models")
65+
66+
val prompt = """
67+
A 23-year-old pregnant woman at 22 weeks gestation presents with burning upon urination. She states it started 1 day ago and has been worsening despite drinking more water and taking cranberry extract. She otherwise feels well and is followed by a doctor for her pregnancy. Her temperature is 97.7°F (36.5°C), blood pressure is 122/77 mmHg, pulse is 80/min, respirations are 19/min, and oxygen saturation is 98% on room air. Physical exam is notable for an absence of costovertebral angle tenderness and a gravid uterus.
68+
Which of the following is the best treatment for this patient?
69+
A: Ampicillin
70+
B: Ceftriaxone
71+
C: Ciprofloxacin
72+
D: Doxycycline
73+
E: Nitrofurantoin
74+
"""
75+
76+
val response = llmLoader.generate(prompt)
77+
78+
```
79+
</div>
80+
81+
## Results
82+
83+
```bash
84+
"""The correct answer is E: Nitrofurantoin.
85+
86+
The patient is presenting with symptoms of urinary tract infection (UTI), which is common during pregnancy. Nitrofurantoin is a first-line antibiotic for uncomplicated UTI during pregnancy. It is safe and effective in treating UTI during pregnancy and has been used for many years without any adverse effects on the fetus.
87+
"""
88+
```
89+
90+
{:.model-param}
91+
## Model Information
92+
93+
{:.table-model}
94+
|---|---|
95+
|Model Name:|jsl_medm_q8_v2|
96+
|Compatibility:|Healthcare NLP 5.4.0+|
97+
|License:|Licensed|
98+
|Edition:|Official|
99+
|Language:|en|
100+
|Size:|5.7 GB|
101+
102+
103+
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
layout: model
3+
title: JSL_MedM_v2 (LLM - q4)
4+
author: John Snow Labs
5+
name: jsl_medm_q4_v2
6+
date: 2024-08-21
7+
tags: [en, licensed, clinical, medical, llm, ner]
8+
task: [Summarization, Question Answering, Named Entity Recognition]
9+
language: en
10+
edition: Healthcare NLP 5.4.0
11+
spark_version: 3.0
12+
supported: true
13+
annotator: LLMLoader
14+
article_header:
15+
type: cover
16+
use_language_switcher: "Python-Scala-Java"
17+
---
18+
19+
## Description
20+
21+
This LLM model is trained to extract and link entities in a document. Users needs to define an input schema as explained in the example section. Drug is defined as a list which tells the model that there could be multiple drugs in the document and it has to extract all of them. Each drug has properties like name and reaction. Since “name” is only one, it is a string, but there could be multiple reactions, hence it is a list. Similarly, users can define any schema for any type of entity.
22+
23+
24+
## Predicted Entities
25+
26+
27+
28+
29+
{:.btn-box}
30+
<button class="button button-orange" disabled>Live Demo</button>
31+
<button class="button button-orange" disabled>Open in Colab</button>
32+
[Download](){:.button.button-orange.button-orange-trans.arr.button-icon.hidden}
33+
[Copy S3 URI](){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3}
34+
35+
## How to use
36+
37+
38+
39+
<div class="tabs-box" markdown="1">
40+
{% include programmingLanguageSelectScalaPythonNLU.html %}
41+
42+
```python
43+
from sparknlp_jsl.llm import LLMLoader
44+
45+
llm_loader_pretrained = LLMLoader(spark).pretrained("jsl_medm_q4_v2", "en", "clinical/models")
46+
47+
prompt = """
48+
A 23-year-old pregnant woman at 22 weeks gestation presents with burning upon urination. She states it started 1 day ago and has been worsening despite drinking more water and taking cranberry extract. She otherwise feels well and is followed by a doctor for her pregnancy. Her temperature is 97.7°F (36.5°C), blood pressure is 122/77 mmHg, pulse is 80/min, respirations are 19/min, and oxygen saturation is 98% on room air. Physical exam is notable for an absence of costovertebral angle tenderness and a gravid uterus.
49+
Which of the following is the best treatment for this patient?
50+
A: Ampicillin
51+
B: Ceftriaxone
52+
C: Ciprofloxacin
53+
D: Doxycycline
54+
E: Nitrofurantoin
55+
"""
56+
57+
response = llm_loader_pretrained.generate(prompt)
58+
59+
```
60+
```scala
61+
import com.johnsnowlabs.ml.gguf.LLMLoader
62+
import com.johnsnowlabs.nlp.SparkAccessor.spark
63+
64+
val llmLoader = new LLMLoader().setSparkSession(spark).pretrained("jsl_medm_q4_v2", "en", "clinical/models")
65+
66+
val prompt = """
67+
A 23-year-old pregnant woman at 22 weeks gestation presents with burning upon urination. She states it started 1 day ago and has been worsening despite drinking more water and taking cranberry extract. She otherwise feels well and is followed by a doctor for her pregnancy. Her temperature is 97.7°F (36.5°C), blood pressure is 122/77 mmHg, pulse is 80/min, respirations are 19/min, and oxygen saturation is 98% on room air. Physical exam is notable for an absence of costovertebral angle tenderness and a gravid uterus.
68+
Which of the following is the best treatment for this patient?
69+
A: Ampicillin
70+
B: Ceftriaxone
71+
C: Ciprofloxacin
72+
D: Doxycycline
73+
E: Nitrofurantoin
74+
"""
75+
76+
val response = llmLoader.generate(prompt)
77+
78+
```
79+
</div>
80+
81+
## Results
82+
83+
```bash
84+
"""The correct answer is E: Nitrofurantoin.
85+
86+
The patient is presenting with symptoms of urinary tract infection (UTI), which is common during pregnancy. Nitrofurantoin is a first-line antibiotic for uncomplicated UTI during pregnancy. It is safe and effective in treating UTI during pregnancy and has been used for many years without any adverse effects on the fetus.
87+
"""
88+
```
89+
90+
{:.model-param}
91+
## Model Information
92+
93+
{:.table-model}
94+
|---|---|
95+
|Model Name:|jsl_medm_q4_v2|
96+
|Compatibility:|Healthcare NLP 5.4.0+|
97+
|License:|Licensed|
98+
|Edition:|Official|
99+
|Language:|en|
100+
|Size:|5.7 GB|
101+
102+
103+

0 commit comments

Comments
 (0)