Pipeline to Detect posology entities (biobert)

Description

This pretrained pipeline is built on the top of ner_posology_biobert model.

Predicted Entities

DOSAGE, DRUG, DURATION, FORM, FREQUENCY, ROUTE, STRENGTH

Copy S3 URI

How to use

from sparknlp.pretrained import PretrainedPipeline

pipeline = PretrainedPipeline("ner_posology_biobert_pipeline", "en", "clinical/models")

text = '''The patient was prescribed 1 capsule of Advil 10 mg for 5 days and magnesium hydroxide 100mg/1ml suspension PO. 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.'''

result = pipeline.fullAnnotate(text)
import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline

val pipeline = new PretrainedPipeline("ner_posology_biobert_pipeline", "en", "clinical/models")

val text = "The patient was prescribed 1 capsule of Advil 10 mg for 5 days and magnesium hydroxide 100mg/1ml suspension PO. 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."

val result = pipeline.fullAnnotate(text)
import nlu
nlu.load("en.med_ner.posology_biobert.pipeline").predict("""The patient was prescribed 1 capsule of Advil 10 mg for 5 days and magnesium hydroxide 100mg/1ml suspension PO. 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.""")

Results

|    | ner_chunk           |   begin |   end | ner_label   |   confidence |
|---:|:--------------------|--------:|------:|:------------|-------------:|
|  0 | 1                   |      27 |    27 | DOSAGE      |     0.9993   |
|  1 | capsule             |      29 |    35 | FORM        |     0.9998   |
|  2 | Advil               |      40 |    44 | DRUG        |     0.9999   |
|  3 | 10 mg               |      46 |    50 | STRENGTH    |     0.98145  |
|  4 | for 5 days          |      52 |    61 | DURATION    |     0.998833 |
|  5 | magnesium hydroxide |      67 |    85 | DRUG        |     0.82655  |
|  6 | 100mg/1ml           |      87 |    95 | STRENGTH    |     0.9391   |
|  7 | PO                  |     108 |   109 | ROUTE       |     1        |
|  8 | 40 units            |     179 |   186 | DOSAGE      |     0.87745  |
|  9 | insulin glargine    |     191 |   206 | DRUG        |     0.9817   |
| 10 | at night            |     208 |   215 | FREQUENCY   |     0.8641   |
| 11 | 12 units            |     218 |   225 | DOSAGE      |     0.9533   |
| 12 | insulin lispro      |     230 |   243 | DRUG        |     0.9476   |
| 13 | with meals          |     245 |   254 | FREQUENCY   |     0.82125  |
| 14 | metformin           |     261 |   269 | DRUG        |     0.9999   |
| 15 | 1000 mg             |     271 |   277 | STRENGTH    |     0.91255  |
| 16 | two times a day     |     279 |   293 | FREQUENCY   |     0.9969   |

Model Information

Model Name: ner_posology_biobert_pipeline
Type: pipeline
Compatibility: Healthcare NLP 4.3.0+
License: Licensed
Edition: Official
Language: en
Size: 422.2 MB

Included Models

  • DocumentAssembler
  • SentenceDetectorDLModel
  • TokenizerModel
  • BertEmbeddings
  • MedicalNerModel
  • NerConverterInternalModel