Medical Question Answering Pipeline(flan_t5)

Description

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

Copy S3 URI

How to use


from sparknlp.pretrained import PretrainedPipeline

qa_pipeline = PretrainedPipeline("flan_t5_base_jsl_qa_pipeline", "en", "clinical/models")

context = """The visual indexing theory proposed by Zenon Pylyshyn (Cognition, 32, 65-97, 1989) predicts that visual attention mechanisms are employed when mental images are projected onto a visual scene."""

question = """What is the effect of directing attention on memory?"""

result = qa_pipeline.fullAnnotate([question], [context])


import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline

val qa_pipeline = PretrainedPipeline("flan_t5_base_jsl_qa_pipeline", "en", "clinical/models")

val context = """The visual indexing theory proposed by Zenon Pylyshyn (Cognition, 32, 65-97, 1989) predicts that visual attention mechanisms are employed when mental images are projected onto a visual scene."""

val question = """What is the effect of directing attention on memory?"""

val result = qa_pipeline.fullAnnotate([question], [context])

Results

The effect of directing attention on memory is that it can help to improve memory retention and recall. It can help to reduce the amount of time spent on tasks, such as focusing on one task at a time, or focusing on 

Model Information

Model Name: flan_t5_base_jsl_qa_pipeline
Type: pipeline
Compatibility: Healthcare NLP 5.2.0+
License: Licensed
Edition: Official
Language: en
Size: 928.7 MB

Included Models

  • MultiDocumentAssembler
  • MedicalQuestionAnswering