Clinical QA BioGPT (JSL - conditions)

Description

This model is based on BioGPT finetuned with questions related to various medical conditions. It’s less conversational, and more Q&A focused.

Predicted Entities

Download Copy S3 URI

How to use

document_assembler = DocumentAssembler() \
    .setInputCol("text") \
    .setOutputCol("documents")
    
gpt_qa = MedicalTextGenerator.pretrained("biogpt_chat_jsl_conditions", "en", "clinical/models")\
    .setInputCols("documents")\
    .setOutputCol("answer").setMaxNewTokens(100)
    
pipeline = Pipeline().setStages([document_assembler, gpt_qa])

data = spark.createDataFrame([["How to treat asthma ?"]]).toDF("text")

pipeline.fit(data).transform(data)

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

val summarizer  = MedicalTextGenerator.pretrained("biogpt_chat_jsl_conditions", "en", "clinical/models")
    .setInputCols("documents")
    .setOutputCol("answer").setMaxNewTokens(100)

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

val text = "How to treat asthma ?"

val data = Seq(Array(text)).toDS.toDF("text")

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

Results

question: How to treat asthma?. answer: The main treatments for asthma are reliever inhalers, which are small handheld devices that you put into your mouth or nose to help you breathe quickly, and preventer inhaler, a soft mist inhaler that lets you use your inhaler as often as you like. If you have severe asthma, your doctor may prescribe a long-acting bronchodilator, such as salmeterol or vilanterol, or a steroid inhaler. You'll usually need to take both types of inhaler at the same time.

Model Information

Model Name: biogpt_chat_jsl_conditions
Compatibility: Healthcare NLP 4.4.0+
License: Licensed
Edition: Official
Language: en
Size: 1.4 GB
Case sensitive: true