Medical Assertion MPNet Embedding ( oncology )

Description

This model is trained on a list of clinical and biomedical datasets curated in-house

Copy S3 URI

How to use

document_assembler = DocumentAssembler()\
    .setInputCol("text")\
    .setOutputCol("document")

mpnet_embedding = MPNetEmbeddings.pretrained("mpnet_embeddings_medical_assertion_oncology", "en", "clinical/models")\
    .setInputCols(["document"])\
    .setOutputCol("mpnet_embeddings")

pipeline = Pipeline().setStages([document_assembler, mpnet_embedding])

text = [
    ["I feel a bit drowsy after taking an insulin."],
    ["Peter Parker is a nice lad and lives in New York"]
]

data = spark.createDataFrame(text).toDF("text")

result = pipeline.fit(data).transform(data)


val document_assembler = new DocumentAssembler()
    .setInputCol("text")
    .setOutputCol("document")

val mpnet_embedding = MPNetEmbeddings.pretrained("mpnet_embeddings_medical_assertion_oncology", "en", "clinical/models")
    .setInputCols(Array("document"))
    .setOutputCol("mpnet_embeddings")

val pipeline = new Pipeline().setStages(Array(document_assembler, mpnet_embedding))

val result = pipeline.fit(data).transform(data)

Results

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|                                                                                                                                                                                     assertion_embedding|
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|[{sentence_embeddings, 0, 43, I feel a bit drowsy after taking an insulin., {sentence -> 0}, [-0.030117756, -0.06916913, 0.01004766, 0.0070122266, -0.009609902, -0.07718129, -0.069940895, 0.1486813...|
|[{sentence_embeddings, 0, 47, Peter Parker is a nice lad and lives in New York, {sentence -> 0}, [-0.010607893, -0.06711012, 0.0058346647, 0.010627323, -4.902818E-4, -0.07712458, -0.036254555, 0.12...|
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Model Information

Model Name: mpnet_embeddings_medical_assertion_oncology
Compatibility: Healthcare NLP 5.3.2+
License: Licensed
Edition: Official
Input Labels: [document]
Output Labels: [assertion_embedding]
Language: en
Size: 406.9 MB
Case sensitive: false