Skip to content

Commit 1f69cee

Browse files
authored
update md card (#1163)
1 parent 12be343 commit 1f69cee

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

docs/_posts/Ahmetemintek/2024-04-17-sbiobertresolve_umls_findings_en.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ use_language_switcher: "Python-Scala-Java"
1818

1919
## Description
2020

21-
This model maps clinical entities and concepts to 4 major categories of UMLS CUI codes using `sbiobert_base_cased_mli` Sentence Bert Embeddings. It has a faster load time, with a speedup of about 6X when compared to previous versions. Also, the load process now is more memory friendly meaning that the maximum memory required during load time is smaller, reducing the chances of OOM exceptions, and thus relaxing hardware requirements.
22-
23-
This model returns CUI (concept unique identifier) codes from clinical findings for the 2023AB release of the Unified Medical Language System® (UMLS) Knowledge Sources: https://www.nlm.nih.gov/research/umls/index.html
21+
This model maps clinical findings to their corresponding UMLS CUI codes using `sbiobert_base_cased_mli` Sentence Bert Embeddings.
2422

2523
## Predicted Entities
2624

@@ -38,6 +36,7 @@ This model returns CUI (concept unique identifier) codes from clinical findings
3836

3937
<div class="tabs-box" markdown="1">
4038
{% include programmingLanguageSelectScalaPythonNLU.html %}
39+
4140
```python
4241
document_assembler = DocumentAssembler()\
4342
.setInputCol('text')\
@@ -75,7 +74,17 @@ resolver = SentenceEntityResolverModel.pretrained("sbiobertresolve_umls_findings
7574
.setOutputCol("resolution")\
7675
.setDistanceFunction("EUCLIDEAN")
7776

78-
pipeline = Pipeline(stages = [document_assembler, sentence_detector, tokenizer, word_embeddings, ner_model, ner_model_converter, chunk2doc, sbert_embedder, resolver])
77+
pipeline = Pipeline(stages = [
78+
document_assembler,
79+
sentence_detector,
80+
tokenizer,
81+
word_embeddings,
82+
ner_model,
83+
ner_model_converter,
84+
chunk2doc,
85+
sbert_embedder,
86+
resolver
87+
])
7988

8089
data = spark.createDataFrame([["""A 28-year-old female with a history of gestational diabetes mellitus diagnosed eight years prior to presentation and subsequent type two diabetes mellitus (T2DM), one prior episode of HTG-induced pancreatitis three years prior to presentation, associated with an acute hepatitis, and obesity with a BMI of 33.5 kg/m2, presented with a one-week history of polyuria, polydipsia, poor appetite, and vomiting."""]]).toDF("text")
8190

@@ -108,7 +117,9 @@ val ner_model_converter = new NerConverterInternal()
108117
.setInputCols(Array("sentence", "token", "clinical_ner"))
109118
.setOutputCol("ner_chunk")
110119

111-
val chunk2doc = Chunk2Doc().setInputCols("ner_chunk").setOutputCol("ner_chunk_doc")
120+
val chunk2doc = Chunk2Doc()
121+
.setInputCols("ner_chunk")
122+
.setOutputCol("ner_chunk_doc")
112123

113124
val sbert_embedder = BertSentenceEmbeddings
114125
.pretrained("sbiobert_base_cased_mli", "en","clinical/models")
@@ -121,7 +132,17 @@ val resolver = SentenceEntityResolverModel
121132
.setOutputCol("resolution")
122133
.setDistanceFunction("EUCLIDEAN")
123134

124-
val p_model = new Pipeline().setStages(Array(document_assembler, sentence_detector, tokenizer, word_embeddings, ner_model, ner_model_converter, chunk2doc, sbert_embedder, resolver))
135+
val p_model = new Pipeline().setStages(Array(
136+
document_assembler,
137+
sentence_detector,
138+
tokenizer,
139+
word_embeddings,
140+
ner_model,
141+
ner_model_converter,
142+
chunk2doc,
143+
sbert_embedder,
144+
resolver
145+
))
125146

126147
val data = Seq("A 28-year-old female with a history of gestational diabetes mellitus diagnosed eight years prior to presentation and subsequent type two diabetes mellitus (T2DM), one prior episode of HTG-induced pancreatitis three years prior to presentation, associated with an acute hepatitis, and obesity with a BMI of 33.5 kg/m2, presented with a one-week history of polyuria, polydipsia, poor appetite, and vomiting.").toDF("text")
127148

0 commit comments

Comments
 (0)