ajitrajasekharan commited on
Commit
77d733c
·
1 Parent(s): 314c280

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -89,6 +89,11 @@ def run_test(sent,top_k,model_name):
89
  if start is not None:
90
  st.text(f"prediction took {time.time() - start:.2f}s")
91
 
 
 
 
 
 
92
 
93
  st.markdown("<h3 style='text-align: center;'>Qualitative evaluation of any pretrained BERT model</h3>", unsafe_allow_html=True)
94
  st.markdown("""
@@ -110,9 +115,7 @@ print(top_k)
110
  try:
111
 
112
  model_name = st.sidebar.selectbox(label='Select Model to Apply', options=['ajitrajasekharan/biomedical', 'bert-base-cased','bert-large-cased','microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext','allenai/scibert_scivocab_cased','dmis-lab/biobert-v1.1'], index=0, key = "model_name")
113
- option = st.selectbox(
114
- 'Choose any of these sentences or type any text below',
115
- ('', "[MASK] who lives in New York and works for XCorp suffers from Parkinson's", "Lou Gehrig who lives in [MASK] and works for XCorp suffers from Parkinson's","'Lou Gehrig who lives in New York and works for [MASK] suffers from Parkinson's'","'Lou Gehrig who lives in New York and works for XCorp suffers from [MASK]'","[MASK] who lives in New York and works for XCorp suffers from Lou Gehrig's", "Parkinson who lives in [MASK] and works for XCorp suffers from Lou Gehrig's","Parkinson who lives in New York and works for [MASK] suffers from Lou Gehrig's","Parkinson who lives in New York and works for XCorp suffers from [MASK]","Lou Gehrig","Parkinson","Lou Gehrigh's is a [MASK]","Parkinson is a [MASK]","New York is a [MASK]","New York","XCorp","XCorp is a [MASK]","acute lymphoblastic leukemia","acute lymphoblastic leukemia is a [MASK]"))
116
  input_text = st.text_input("Enter text below", "")
117
  custom_model_name = st.text_input("Model not listed on left? Type the model name (fill-mask BERT models only)", "")
118
  if (len(custom_model_name) > 0):
 
89
  if start is not None:
90
  st.text(f"prediction took {time.time() - start:.2f}s")
91
 
92
+ def init_selectbox():
93
+ option = st.selectbox(
94
+ 'Choose any of these sentences or type any text below',
95
+ ('', "[MASK] who lives in New York and works for XCorp suffers from Parkinson's", "Lou Gehrig who lives in [MASK] and works for XCorp suffers from Parkinson's","'Lou Gehrig who lives in New York and works for [MASK] suffers from Parkinson's'","'Lou Gehrig who lives in New York and works for XCorp suffers from [MASK]'","[MASK] who lives in New York and works for XCorp suffers from Lou Gehrig's", "Parkinson who lives in [MASK] and works for XCorp suffers from Lou Gehrig's","Parkinson who lives in New York and works for [MASK] suffers from Lou Gehrig's","Parkinson who lives in New York and works for XCorp suffers from [MASK]","Lou Gehrig","Parkinson","Lou Gehrigh's is a [MASK]","Parkinson is a [MASK]","New York is a [MASK]","New York","XCorp","XCorp is a [MASK]","acute lymphoblastic leukemia","acute lymphoblastic leukemia is a [MASK]"))
96
+ return option
97
 
98
  st.markdown("<h3 style='text-align: center;'>Qualitative evaluation of any pretrained BERT model</h3>", unsafe_allow_html=True)
99
  st.markdown("""
 
115
  try:
116
 
117
  model_name = st.sidebar.selectbox(label='Select Model to Apply', options=['ajitrajasekharan/biomedical', 'bert-base-cased','bert-large-cased','microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext','allenai/scibert_scivocab_cased','dmis-lab/biobert-v1.1'], index=0, key = "model_name")
118
+ option = init_selectbox()
 
 
119
  input_text = st.text_input("Enter text below", "")
120
  custom_model_name = st.text_input("Model not listed on left? Type the model name (fill-mask BERT models only)", "")
121
  if (len(custom_model_name) > 0):