File size: 1,319 Bytes
8cc757b
32a276c
8cc757b
03c65d9
8cc757b
7310c03
03c65d9
32a276c
03c65d9
be683a5
 
03c65d9
78f41eb
0b6ce8b
d064c8c
 
03c65d9
f67b05c
03c65d9
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from transformers import pipeline

qa_model = pipeline("question-answering",'a-ware/bart-squadv2')

def fetch_answer(question, context ):
    return qa_model(question = question, context = context)['answer']

demo = gr.Interface(
    title='Question Answering System from Clinical Notes',
    description="""Physicians frequently seek answers to questions from a patient’s EHR to support clinical decision-making.​ It is not too hard to imagine a future where a physician interacts with an EHR system and asks it complex questions and expects precise answers with adequate context from a patient’s past clinical notes. ​Central to such a world is a medical question answering system that processes natural language questions asked by physicians and finds answers to the questions from all sources in a patient’s record.""",
    fn=fetch_answer,
    #take input as real time audio and use OPENAPI whisper for S2T
    #clinical note upload as file (.This is an example of simple text. or doc/docx file)
    inputs=[gr.Textbox(lines=2, label='Question', show_label=True, placeholder="What is age of patient ?"),
            gr.Textbox(lines=10, label='Clinical Note', show_label=True, placeholder="The patient is a 71 year old male...")],
    outputs="text",
    examples='.'
)
demo.launch()