Skip to content

Commit c97fd31

Browse files
authored
update md cards (#1126)
* update md cards * Update 2021-07-15-explain_clinical_doc_ade_en.md
1 parent 4c0e016 commit c97fd31

File tree

2 files changed

+44
-50
lines changed

2 files changed

+44
-50
lines changed

docs/_posts/C-K-Loan/2023-06-17-explain_clinical_doc_medication_en.md

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ from sparknlp.pretrained import PretrainedPipeline
4040

4141
pipeline = PretrainedPipeline("explain_clinical_doc_medication", "en", "clinical/models")
4242

43-
text = '''The patient is a 30-year-old female with a long history of insulin dependent diabetes, type 2. She received a course of Bactrim for 14 days for UTI. She was prescribed 5000 units of Fragmin subcutaneously daily, and along with Lantus 40 units subcutaneously at bedtime.'''
43+
text = '''The patient is a 30-year-old female with an insulin dependent diabetes, type 2. She received a course of Bactrim for 14 days for UTI. She was prescribed 5000 units of Fragmin subcutaneously daily, and along with Lantus 40 units subcutaneously at bedtime.'''
4444

4545
result = pipeline.fullAnnotate(text)
4646
```
@@ -49,7 +49,7 @@ import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline
4949

5050
val pipeline = new PretrainedPipeline("explain_clinical_doc_medication", "en", "clinical/models")
5151

52-
val text = "The patient is a 30-year-old female with a long history of insulin dependent diabetes, type 2. She received a course of Bactrim for 14 days for UTI. She was prescribed 5000 units of Fragmin subcutaneously daily, and along with Lantus 40 units subcutaneously at bedtime."
52+
val text = "The patient is a 30-year-old female with an insulin dependent diabetes, type 2. She received a course of Bactrim for 14 days for UTI. She was prescribed 5000 units of Fragmin subcutaneously daily, and along with Lantus 40 units subcutaneously at bedtime."
5353

5454
val result = pipeline.fullAnnotate(text)
5555
```
@@ -58,7 +58,7 @@ val result = pipeline.fullAnnotate(text)
5858
{:.nlu-block}
5959
```python
6060
import nlu
61-
nlu.load("en.explain_dco.clinical_medication.pipeline").predict("""The patient is a 30-year-old female with a long history of insulin dependent diabetes, type 2. She received a course of Bactrim for 14 days for UTI. She was prescribed 5000 units of Fragmin subcutaneously daily, and along with Lantus 40 units subcutaneously at bedtime.""")
61+
nlu.load("en.explain_dco.clinical_medication.pipeline").predict("""The patient is a 30-year-old female with an insulin dependent diabetes, type 2. She received a course of Bactrim for 14 days for UTI. She was prescribed 5000 units of Fragmin subcutaneously daily, and along with Lantus 40 units subcutaneously at bedtime.""")
6262
```
6363

6464
</div>
@@ -69,44 +69,41 @@ nlu.load("en.explain_dco.clinical_medication.pipeline").predict("""The patient i
6969

7070
```bash
7171
# ner_chunk
72-
+----+----------------+------------+
73-
| | chunks | entities |
74-
|---:|:---------------|:-----------|
75-
| 0 | insulin | DRUG |
76-
| 1 | Bactrim | DRUG |
77-
| 2 | for 14 days | DURATION |
78-
| 3 | 5000 units | DOSAGE |
79-
| 4 | Fragmin | DRUG |
80-
| 5 | subcutaneously | ROUTE |
81-
| 6 | daily | FREQUENCY |
82-
| 7 | Lantus | DRUG |
83-
| 8 | 40 units | DOSAGE |
84-
| 9 | subcutaneously | ROUTE |
85-
| 10 | at bedtime | FREQUENCY |
86-
+----+----------------+------------+
72+
73+
| | ner_chunk | begin | end | ner_label |
74+
|---:|---------------:|------:|----:|----------:|
75+
| 0 | insulin | 44 | 50 | DRUG |
76+
| 1 | Bactrim | 105 | 111 | DRUG |
77+
| 2 | for 14 days | 113 | 123 | DURATION |
78+
| 3 | 5000 units | 153 | 162 | DOSAGE |
79+
| 4 | Fragmin | 167 | 173 | DRUG |
80+
| 5 | subcutaneously | 176 | 189 | ROUTE |
81+
| 6 | daily | 191 | 195 | FREQUENCY |
82+
| 7 | Lantus | 213 | 218 | DRUG |
83+
| 8 | 40 units | 220 | 227 | DOSAGE |
84+
| 9 | subcutaneously | 229 | 242 | ROUTE |
85+
| 10 | at bedtime | 244 | 253 | FREQUENCY |
8786

8887
# assertion
89-
+---+---------+----------+-----------+
88+
9089
| | chunks | entities | assertion |
9190
|--:|--------:|---------:|----------:|
92-
| 0 | insulin | DRUG | Family |
91+
| 0 | insulin | DRUG | Present |
9392
| 1 | Bactrim | DRUG | Past |
9493
| 2 | Fragmin | DRUG | Planned |
9594
| 3 | Lantus | DRUG | Past |
96-
+---+---------+----------+-----------+
9795

9896
# relation
99-
+----------------+-----------+------------+-----------+----------------+
100-
| relation | entity1 | chunk1 | entity2 | chunk2 |
101-
|:---------------|:----------|:-----------|:----------|:---------------|
102-
| DRUG-DURATION | DRUG | Bactrim | DURATION | for 14 days |
103-
| DOSAGE-DRUG | DOSAGE | 5000 units | DRUG | Fragmin |
104-
| DRUG-ROUTE | DRUG | Fragmin | ROUTE | subcutaneously |
105-
| DRUG-FREQUENCY | DRUG | Fragmin | FREQUENCY | daily |
106-
| DRUG-DOSAGE | DRUG | Lantus | DOSAGE | 40 units |
107-
| DRUG-ROUTE | DRUG | Lantus | ROUTE | subcutaneously |
108-
| DRUG-FREQUENCY | DRUG | Lantus | FREQUENCY | at bedtime |
109-
+----------------+-----------+------------+-----------+----------------+
97+
98+
| | relation | entity1 | chunk1 | entity2 | chunk2 |
99+
|--:|---------------:|--------:|-----------:|----------:|---------------:|
100+
| 0 | DRUG-DURATION | DRUG | Bactrim | DURATION | for 14 days |
101+
| 1 | DOSAGE-DRUG | DOSAGE | 5000 units | DRUG | Fragmin |
102+
| 2 | DRUG-ROUTE | DRUG | Fragmin | ROUTE | subcutaneously |
103+
| 3 | DRUG-FREQUENCY | DRUG | Fragmin | FREQUENCY | daily |
104+
| 4 | DRUG-DOSAGE | DRUG | Lantus | DOSAGE | 40 units |
105+
| 5 | DRUG-ROUTE | DRUG | Lantus | ROUTE | subcutaneously |
106+
| 6 | DRUG-FREQUENCY | DRUG | Lantus | FREQUENCY | at bedtime |
110107
```
111108

112109
{:.model-param}

docs/_posts/HashamUlHaq/2021-07-15-explain_clinical_doc_ade_en.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,47 +38,44 @@ A pipeline for Adverse Drug Events (ADE) with `ner_ade_biobert`, `assertion_dl_b
3838
```python
3939
pipeline = PretrainedPipeline('explain_clinical_doc_ade', 'en', 'clinical/models')
4040

41-
res = pipeline.fullAnnotate("""Been taking Lipitor for 15 years , have experienced severe fatigue a lot!!! . Doctor moved me to voltaren 2 months ago , so far , have only experienced cramps""")
41+
res = pipeline.fullAnnotate("""Been taking Lipitor for 3 months, have experienced severe fatigue a lot!!!, have only experienced cramps so far, after Doctor moved me to voltaren 2 months ago.""")
4242

4343

4444
```
4545
```scala
4646
val era_pipeline = new PretrainedPipeline("explain_clinical_doc_ade", "en", "clinical/models")
4747

48-
val result = era_pipeline.fullAnnotate("""Been taking Lipitor for 15 years , have experienced severe fatigue a lot!!! . Doctor moved me to voltaren 2 months ago , so far , have only experienced cramps""")(0)
48+
val result = era_pipeline.fullAnnotate("""Been taking Lipitor for 3 months, have experienced severe fatigue a lot!!!, I have only experienced cramps so far, after Doctor moved me to voltaren 2 months ago.""")(0)
4949

5050
```
5151

5252

5353
{:.nlu-block}
5454
```python
5555
import nlu
56-
nlu.load("en.explain_doc.clinical_ade").predict("""Been taking Lipitor for 15 years , have experienced severe fatigue a lot!!! . Doctor moved me to voltaren 2 months ago , so far , have only experienced cramps""")
56+
nlu.load("en.explain_doc.clinical_ade").predict("""Been taking Lipitor for 3 months, have experienced severe fatigue a lot!!! , I have only experienced cramps so far, after Doctor moved me to voltaren 2 months ago.""")
5757
```
5858

5959
</div>
6060

6161
## Results
6262

6363
```bash
64+
Assertion:
6465

65-
Class: True
66-
67-
NER_Assertion:
68-
| | chunk | entitiy | assertion |
69-
|----|-------------------------|------------|-------------|
70-
| 0 | Lipitor | DRUG | - |
71-
| 1 | severe fatigue | ADE | Conditional |
72-
| 2 | voltaren | DRUG | - |
73-
| 3 | cramps | ADE | Conditional |
66+
| | chunks | entities | assertion |
67+
|--:|---------------:|---------:|----------:|
68+
| 0 | Lipitor | DRUG | Past |
69+
| 1 | severe fatigue | ADE | Past |
70+
| 2 | cramps | ADE | Present |
71+
| 3 | voltaren | DRUG | Past |
7472

7573
Relations:
76-
| | chunk1 | entitiy1 | chunk2 | entity2 | relation |
77-
|----|-------------------------------|------------|-------------|---------|----------|
78-
| 0 | severe fatigue | ADE | Lipitor | DRUG | 1 |
79-
| 1 | cramps | ADE | Lipitor | DRUG | 0 |
80-
| 2 | severe fatigue | ADE | voltaren | DRUG | 0 |
81-
| 3 | cramps | ADE | voltaren | DRUG | 1 |
74+
75+
| | relation | entity1 | chunk1 | entity2 | chunk2 |
76+
|--:|---------:|--------:|--------:|--------:|---------------:|
77+
| 0 | 1 | DRUG | Lipitor | ADE | severe fatigue |
78+
| 1 | 0 | ADE | cramps | DRUG | voltaren |
8279

8380
```
8481

0 commit comments

Comments
 (0)