Skip to content

Commit

Permalink
updated md cards (#860)
Browse files Browse the repository at this point in the history
  • Loading branch information
akrztrk authored Jan 11, 2024
1 parent 5d2f7df commit 7291d59
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ nlu.load("en.explain_dco.clinical_medication.pipeline").predict("""The patient i
## Results

```bash
# ner_chunk
+----+----------------+------------+
| | chunks | entities |
|---:|:---------------|:-----------|
Expand All @@ -84,15 +85,17 @@ nlu.load("en.explain_dco.clinical_medication.pipeline").predict("""The patient i
| 10 | at bedtime | FREQUENCY |
+----+----------------+------------+

+----+----------+------------+-------------+
| | chunks | entities | assertion |
|---:|:---------|:-----------|:------------|
| 0 | insulin | DRUG | Present |
| 1 | Bactrim | DRUG | Past |
| 2 | Fragmin | DRUG | Planned |
| 3 | Lantus | DRUG | Planned |
+----+----------+------------+-------------+

# assertion
+---+---------+----------+-----------+
| | chunks | entities | assertion |
|--:|--------:|---------:|----------:|
| 0 | insulin | DRUG | Family |
| 1 | Bactrim | DRUG | Past |
| 2 | Fragmin | DRUG | Planned |
| 3 | Lantus | DRUG | Past |
+---+---------+----------+-----------+

# relation
+----------------+-----------+------------+-----------+----------------+
| relation | entity1 | chunk1 | entity2 | chunk2 |
|:---------------|:----------|:-----------|:----------|:---------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@ nlu.load("en.relation.bodypart_proceduretest.pipeline").predict("""TECHNIQUE IN
## Results

```bash
| index | relations | entity1 | entity1_begin | entity1_end | chunk1 | entity2 | entity2_end | entity2_end | chunk2 | confidence |
|-------|-----------|------------------------------|---------------|-------------|--------|---------|-------------|-------------|---------------------|------------|
| 0 | 1 | External_body_part_or_region | 94 | 98 | chest | Test | 117 | 135 | portable ultrasound | 1.0 |
| | sentence | entity1_begin | entity1_end | chunk1 | entity1 | entity2_begin | entity2_end | chunk2 | entity2 | relation | confidence |
|--:|---------:|--------------:|------------:|---------------------:|-----------------------------:|--------------:|------------:|--------------------:|-----------------------------:|---------:|-----------:|
| 0 | 0 | 0 | 19 | TECHNIQUE IN DETAIL: | Section_Header | 78 | 87 | his mother | Gender | 1 | 0.9999987 |
| 1 | 0 | 0 | 19 | TECHNIQUE IN DETAIL: | Section_Header | 94 | 98 | chest | External_body_part_or_region | 1 | 0.9999529 |
| 2 | 0 | 0 | 19 | TECHNIQUE IN DETAIL: | Section_Header | 117 | 135 | portable ultrasound | Test | 1 | 0.9999838 |
| 3 | 0 | 78 | 87 | his mother | Gender | 94 | 98 | chest | External_body_part_or_region | 1 | 1.0 |
| 4 | 0 | 78 | 87 | his mother | Gender | 117 | 135 | portable ultrasound | Test | 1 | 0.9999982 |
| 5 | 0 | 94 | 98 | chest | External_body_part_or_region | 117 | 135 | portable ultrasound | Test | 1 | 1.0 |
```

{:.model-param}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use_language_switcher: "Python-Scala-Java"

## Description

This model is a modified version of Flan-T5 (LLM) based summarization model that is finetuned with biomedical datasets (Pubmed abstracts) by John Snow Labs.  It can generate summaries up to 512 tokens given an input text (max 1024 tokens).
This model is a modified version of LLM based summarization model that is finetuned with biomedical datasets (Pubmed abstracts) by John Snow Labs.  It can generate summaries up to 512 tokens given an input text (max 1024 tokens).

{:.btn-box}
[Live Demo](https://demo.johnsnowlabs.com/healthcare/BIOMEDICAL_TEXT_SUMMARIZATION/){:.button.button-orange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use_language_switcher: "Python-Scala-Java"

## Description

This model is a modified version of Flan-T5 (LLM) based summarization model that is finetuned with medical questions exchanged in clinical mediums (clinic, email, call center etc.) by John Snow Labs.  It can generate summaries up to 512 tokens given an input text (max 1024 tokens).
This model is a modified version of LLM based summarization model that is finetuned with medical questions exchanged in clinical mediums (clinic, email, call center etc.) by John Snow Labs.  It can generate summaries up to 512 tokens given an input text (max 1024 tokens).

{:.btn-box}
[Live Demo](https://demo.johnsnowlabs.com/healthcare/MEDICAL_TEXT_SUMMARIZATION_QA/){:.button.button-orange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use_language_switcher: "Python-Scala-Java"

## Description

This model is a modified version of Flan-T5 (LLM) based summarization model that is finetuned with custom dataset by John Snow Labs to avoid using clinical jargon on the summaries. It can generate summaries up to 512 tokens given an input text (max 1024 tokens).
This model is a modified version of LLM based summarization model that is finetuned with custom dataset by John Snow Labs to avoid using clinical jargon on the summaries. It can generate summaries up to 512 tokens given an input text (max 1024 tokens).

## Predicted Entities

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use_language_switcher: "Python-Scala-Java"

## Description

This model is a modified version of Flan-T5 (LLM) based summarization model that is finetuned with custom dataset by John Snow Labs to avoid using clinical jargon on the summaries. It can generate summaries up to 512 tokens given an input text (max 1024 tokens).
This model is a modified version of LLM based summarization model that is finetuned with custom dataset by John Snow Labs to avoid using clinical jargon on the summaries. It can generate summaries up to 512 tokens given an input text (max 1024 tokens).

## Predicted Entities

Expand All @@ -37,6 +37,7 @@ This model is a modified version of Flan-T5 (LLM) based summarization model that

<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}

```python
document_assembler = DocumentAssembler()\
.setInputCol("text")\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,16 @@ nlu.load("en.relation.date_test_result.pipeline").predict("""He was advised ches
## Results

```bash
| index | relations | entity1 | chunk1 | entity2 | chunk2 |
|-------|--------------|--------------|---------------------|--------------|---------|
| 0 | O | TEST | chest X-ray | MEASUREMENTS | 93% |
| 1 | O | TEST | CT scan | MEASUREMENTS | 93% |
| 2 | is_result_of | TEST | SpO2 | MEASUREMENTS | 93% |
| | sentence | entity1_begin | entity1_end | chunk1 | entity1 | entity2_begin | entity2_end | chunk2 | entity2 | relation | confidence |
|--:|---------:|--------------:|------------:|------------:|--------:|--------------:|------------:|------------:|------------:|--------------:|-----------:|
| 0 | 0 | 0 | 1 | He | Gender | 15 | 25 | chest X-ray | Test | is_finding_of | 0.9991597 |
| 1 | 0 | 0 | 1 | He | Gender | 30 | 36 | CT scan | Test | is_finding_of | 1.0 |
| 2 | 0 | 15 | 25 | chest X-ray | Test | 30 | 36 | CT scan | Test | is_finding_of | 1.0 |
| 3 | 0 | 30 | 36 | CT scan | Test | 53 | 55 | his | Gender | is_finding_of | 1.0 |
| 4 | 0 | 30 | 36 | CT scan | Test | 57 | 60 | SpO2 | Test | is_finding_of | 1.0 |
| 5 | 0 | 53 | 55 | his | Gender | 57 | 60 | SpO2 | Test | is_date_of | 0.98956 |
| 6 | 0 | 53 | 55 | his | Gender | 75 | 77 | 93% | Test_Result | is_date_of | 0.9999974 |
| 7 | 0 | 57 | 60 | SpO2 | Test | 75 | 77 | 93% | Test_Result | is_result_of | 0.92868817 |
```

{:.model-param}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ nlu.load("en.icd10cm_resolver.pipeline").predict("""A 28-year-old female with a
## Results

```bash
|chunk |ner_chunk|icd10cm_code|
+-----------------------------+---------+------------+
|gestational diabetes mellitus|PROBLEM |O24.919 |
|anisakiasis |PROBLEM |B81.0 |
|fetal and neonatal hemorrhage|PROBLEM |P545 |
| | chunks | entities | icd10cm_code |
|--:|------------------------------:|---------:|-------------:|
| 0 | gestational diabetes mellitus | PROBLEM | O24.919 |
| 1 | anisakiasis | PROBLEM | B81.0 |
| 2 | fetal and neonatal hemorrhage | PROBLEM | P549 |
```

{:.model-param}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ This pipeline includes Named-Entity Recognition and Assertion Status models to e

<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}

```python
from sparknlp.pretrained import PretrainedPipeline

Expand Down Expand Up @@ -112,11 +113,11 @@ nlu.load("en.oncology_therpay.pipeline").predict("""The patient underwent a mast

******************** assertion_oncology_treatment_binary_wip results ********************

| chunk | ner_label | assertion |
|:-----------------|:---------------|:----------------|
| mastectomy | Cancer_Surgery | Present_Or_Past |
| adriamycin | Chemotherapy | Present_Or_Past |
| cyclophosphamide | Chemotherapy | Present_Or_Past |
| | chunks | entities | assertion |
|--:|-----------------:|---------------:|----------:|
| 0 | mastectomy | Cancer_Surgery | Past |
| 1 | adriamycin | Chemotherapy | Present |
| 2 | cyclophosphamide | Chemotherapy | Present |
```

{:.model-param}
Expand Down
24 changes: 20 additions & 4 deletions docs/_posts/murat-gunay/2020-09-01-posology_re.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,16 @@ reModel = RelationExtractionModel()\
.setOutputCol("relations")\
.setMaxSyntacticDistance(4)

pipeline = Pipeline(stages=[document_assembler, sentence_detector, tokenizer, words_embedder, pos_tagger, ner_tagger, ner_chunker, dependency_parser, reModel])
pipeline = Pipeline(stages=[
document_assembler,
sentence_detector,
tokenizer,
words_embedder,
pos_tagger,
ner_tagger,
ner_chunker,
dependency_parser,
reModel])

empty_data = spark.createDataFrame([[""]]).toDF("text")

Expand All @@ -84,7 +93,6 @@ model = pipeline.fit(empty_data)
light_pipeline = LightPipeline(model)

result = light_pipeline.fullAnnotate("The patient was prescribed 1 unit of Advil for 5 days after meals. The patient was also given 1 unit of Metformin daily. He was seen by the endocrinology service and she was discharged on 40 units of insulin glargine at night, 12 units of insulin lispro with meals, and metformin 1000 mg two times a day.")

```

```scala
Expand Down Expand Up @@ -130,15 +138,23 @@ val re_Model = RelationExtractionModel()
.setOutputCol("relations")
.setMaxSyntacticDistance(4)

val pipeline = new Pipeline().setStages(Array(document_assembler, sentence_detector, tokenizer, words_embedder, pos_tagger, ner_tagger, ner_chunker, dependecy_parser, re_Model))
val pipeline = new Pipeline().setStages(Array(
document_assembler,
sentence_detector,
tokenizer,
words_embedder,
pos_tagger,
ner_tagger,
ner_chunker,
dependecy_parser,
re_Model))

val data = Seq("The patient was prescribed 1 unit of Advil for 5 days after meals. The patient was also given 1 unit of Metformin daily. He was seen by the endocrinology service and she was discharged on 40 units of insulin glargine at night, 12 units of insulin lispro with meals, and metformin 1000 mg two times a day.").toDS.toDF("text")

val result = pipeline.fit(data).transform(data)
```
</div>

{:.h2_title}
## Results

```bash
Expand Down

0 comments on commit 7291d59

Please sign in to comment.