jaydeepkum commited on
Commit
e8c6b8e
1 Parent(s): 426ef32
Files changed (1) hide show
  1. app.py +33 -7
app.py CHANGED
@@ -1,11 +1,37 @@
1
  import gradio as gr
2
 
3
- def ner(text):
4
- api = gr.Interface.load("ugaray96/biobert_ncbi_disease_ner", src='models')
5
- spans = api(text)
6
- replaced_spans = [(key, None) if value=='No Disease' else (key, value) for (key, value) in spans]
7
- return replaced_spans
 
 
 
 
 
8
 
9
- interface = gr.Interface(ner, inputs=gr.Textbox(label="Input", value="Patient is 50 yo M experienced a right bundle branch block (RBBB) yet tests for arrythmia found no results and heart health. Top goals."), outputs="highlightedtext")
 
 
 
 
 
 
 
 
 
10
 
11
- interface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ context = "What should be documented in a care plan?\n"
4
+ context = context + "Regardless of what your preferences are, your care plan should include:\n"
5
+ context = context + "What your assessed care needs are.\n"
6
+ context = context + "What type of support you should receive.\n"
7
+ context = context + "Your desired outcomes.\n"
8
+ context = context + "Who should provide care.\n"
9
+ context = context + "When care and support should be provided.\n"
10
+ context = context + "Records of care provided.\n"
11
+ context = context + "Your wishes and personal preferences.\n"
12
+ context = context + "The costs of the services.\n"
13
 
14
+ context = context + "Dimensions\n"
15
+ context = context + "1-Ontology of Plan\n"
16
+ context = context + "2-Problems as evidenced by Signs of Systems\n"
17
+ context = context + "3-Assessment of Needs\n"
18
+ context = context + "4-Questions about problems faced\n"
19
+ context = context + "5-Goals for long and short term improvements\n"
20
+ context = context + "6-Knowledge-Behavior-Status Quality Measures\n"
21
+ context = context + "7-Intervention List of Options\n"
22
+ context = context + "8-Quality Measures\n"
23
+ context = context + "9-Pathways Available\n"
24
 
25
+ with open('WritingCarePlans.txt', 'r') as file:
26
+ context = file.read()
27
+
28
+ question = "What should be documented in a care plan?"
29
+
30
+ gr.Interface.load(
31
+ "huggingface/deepset/roberta-base-squad2",
32
+ theme="default",
33
+ css=".footer{display:none !important}",
34
+ inputs=[gr.inputs.Textbox(lines=12, default=context, label="Context paragraph"), gr.inputs.Textbox(lines=3, default=question, label="Question")],
35
+ outputs=[gr.outputs.Textbox(label="Answer"), gr.outputs.Textbox(label="Score")],
36
+ title=None,
37
+ description="Provide your own paragraph and ask any question about the text. How well does the model answer?").launch()