wzkariampuzha commited on
Commit
8f768aa
1 Parent(s): 388fbdd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -39,22 +39,21 @@ extract_diseases = st.sidebar.checkbox("Extract Rare Diseases", value=False)
39
  @st.cache(suppress_st_warning=True)
40
  def load_models():
41
  global classify_model_vars, NER_pipeline, entity_classes, GARD_dict, max_length
42
-
43
- with st.spinner('Loading Epidemiology Models and Dependencies...'):
44
- classify_model_vars = classify_abs.init_classify_model()
45
- NER_pipeline, entity_classes = extract_abs.init_NER_pipeline()
46
- GARD_dict, max_length = extract_abs.load_GARD_diseases()
47
- st.success('All Models and Dependencies Loaded!')
 
48
 
49
- load_models()
50
-
51
- disease_or_gard_id = st.text_input("Input a rare disease term or GARD ID.", value="Fellman syndrome")
52
 
53
  if disease_or_gard_id:
54
  df = extract_abs.streamlit_extraction(disease_or_gard_id, max_results, filtering,
55
- NER_pipeline, entity_classes,
56
- extract_diseases,GARD_dict, max_length,
57
- classify_model_vars)
58
  st.dataframe(df)
59
  st.balloons()
60
  #st.dataframe(data=None, width=None, height=None)
 
39
  @st.cache(suppress_st_warning=True)
40
  def load_models():
41
  global classify_model_vars, NER_pipeline, entity_classes, GARD_dict, max_length
42
+ classify_model_vars = classify_abs.init_classify_model()
43
+ NER_pipeline, entity_classes = extract_abs.init_NER_pipeline()
44
+ GARD_dict, max_length = extract_abs.load_GARD_diseases()
45
+
46
+ with st.spinner('Loading Epidemiology Models and Dependencies...'):
47
+ load_models()
48
+ st.success('All Models and Dependencies Loaded!')
49
 
50
+ disease_or_gard_id = st.text_input("Input a rare disease term or GARD ID.")
 
 
51
 
52
  if disease_or_gard_id:
53
  df = extract_abs.streamlit_extraction(disease_or_gard_id, max_results, filtering,
54
+ NER_pipeline, entity_classes,
55
+ extract_diseases,GARD_dict, max_length,
56
+ classify_model_vars)
57
  st.dataframe(df)
58
  st.balloons()
59
  #st.dataframe(data=None, width=None, height=None)