elliealbertson commited on
Commit
33a7aea
·
1 Parent(s): 1162623

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,5 +1,6 @@
1
 
2
  from transformers import BertTokenizer, BertForSequenceClassification
 
3
  import gradio as gr
4
 
5
  model_path = 'elliealbertson/identifying_pregnancy_clinical_notes'
@@ -35,8 +36,8 @@ def predict(text):
35
  return error_message
36
 
37
  with gr.Blocks() as interface:
38
- gr.Markdown("<h1 align='center'>Identifying Pregnancy in Clinical Notes</h1>")
39
- gr.Markdown("<p align='center'>Use this app to classify a clinical note as discussing or not discussing the patient's pregnancy.</p>")
40
  with gr.Row():
41
  with gr.Column():
42
  inputs = gr.Textbox(label='Input a clinical note here:', lines=4)
@@ -45,6 +46,6 @@ with gr.Blocks() as interface:
45
  with gr.Column():
46
  outputs=gr.Textbox(label="Does the note discuss the patient's pregnancy?", lines=4)
47
  button.click(fn=predict, inputs=inputs, outputs=outputs, queue=False)
48
- gr.Markdown("<p align='center'>Model fine-tuned from <a href='https://huggingface.co/emilyalsentzer/Bio_ClinicalBERT' target='_blank'> Bio+ClinicalBERT </a>.</p>")
49
 
50
  interface.launch()
 
1
 
2
  from transformers import BertTokenizer, BertForSequenceClassification
3
+ import torch
4
  import gradio as gr
5
 
6
  model_path = 'elliealbertson/identifying_pregnancy_clinical_notes'
 
36
  return error_message
37
 
38
  with gr.Blocks() as interface:
39
+ gr.HTML("<div style='text-align:center;'><div><h1>Identifying Pregnancy in Clinical Notes</h1></div>")
40
+ gr.HTML("<p align='center'>Use this app to classify a clinical note as discussing or not discussing the patient's pregnancy.</p>")
41
  with gr.Row():
42
  with gr.Column():
43
  inputs = gr.Textbox(label='Input a clinical note here:', lines=4)
 
46
  with gr.Column():
47
  outputs=gr.Textbox(label="Does the note discuss the patient's pregnancy?", lines=4)
48
  button.click(fn=predict, inputs=inputs, outputs=outputs, queue=False)
49
+ gr.HTML("<p align='center'>Model fine-tuned from <a href='https://huggingface.co/emilyalsentzer/Bio_ClinicalBERT' target='_blank'> Bio+ClinicalBERT </a>.</p>")
50
 
51
  interface.launch()