Sentence Entity Resolver for CVX

Description

This model maps vaccine entities to CVX codes using sbiobert_base_cased_mli Sentence Bert Embeddings. Additionally, this model returns status of the vaccine (Active/Inactive/Pending/Non-US) in all_k_aux_labels column.

Predicted Entities

CVX Code, Status

Open in Colab Copy S3 URI

How to use

documentAssembler = DocumentAssembler()\
 .setInputCol("text")\
 .setOutputCol("ner_chunk")

sbert_embedder = BertSentenceEmbeddings.pretrained("sbiobert_base_cased_mli", "en", "clinical/models")\
 .setInputCols(["ner_chunk"])\
 .setOutputCol("sbert_embeddings")

cvx_resolver = SentenceEntityResolverModel.pretrained("sbiobertresolve_cvx", "en", "clinical/models")\
 .setInputCols(["sbert_embeddings"])\
 .setOutputCol("cvx_code")\
 .setDistanceFunction("EUCLIDEAN")

pipelineModel = PipelineModel( stages = [ documentAssembler, sbert_embedder, cvx_resolver ])

light_model = LightPipeline(pipelineModel)

result = light_model.fullAnnotate(["Sinovac", "Moderna", "BIOTHRAX"])
val documentAssembler = new DocumentAssembler()
 .setInputCol("text")
 .setOutputCol("ner_chunk")

val sbert_embedder = BertSentenceEmbeddings.pretrained("sbiobert_base_cased_mli", "en","clinical/models")
 .setInputCols(Array("ner_chunk"))
 .setOutputCol("sbert_embeddings")

val cvx_resolver = SentenceEntityResolverModel.pretrained("sbiobertresolve_cvx", "en", "clinical/models")
 .setInputCols(Array("sbert_embeddings"))
 .setOutputCol("cvx_code")
 .setDistanceFunction("EUCLIDEAN")

val cvx_pipelineModel = new PipelineModel().setStages(Array(documentAssembler, sbert_embedder, cvx_resolver))

val light_model = LightPipeline(cvx_pipelineModel)

val result = light_model.fullAnnotate(Array("Sinovac", "Moderna", "BIOTHRAX"))
import nlu
nlu.load("en.resolve.cvx").predict("""Put your text here.""")

Results

+----------+--------+-------------------------------------------------------+--------+
 |ner_chunk |cvx_code|resolved_text                                          |Status  |
 +----------+--------+-------------------------------------------------------+--------+
 |Sinovac   |511     |COVID-19 IV Non-US Vaccine (CoronaVac, Sinovac)        |Non-US  |
 |Moderna   |227     |COVID-19, mRNA, LNP-S, PF, pediatric 50 mcg/0.5 mL dose|Inactive|
 |BIOTHRAX  |24      |anthrax                                                |Active  |
 +----------+--------+-------------------------------------------------------+--------+

Model Information

Model Name: sbiobertresolve_cvx
Compatibility: Healthcare NLP 4.2.1+
License: Licensed
Edition: Official
Input Labels: [bert_embeddings]
Output Labels: [cvx_code]
Language: en
Size: 1.6 MB
Case sensitive: false