wzkariampuzha commited on
Commit
1656abd
1 Parent(s): 5f6a009

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -23
app.py CHANGED
@@ -8,7 +8,7 @@ import extract_abs
8
  import streamlit as st
9
 
10
  ########## Title for the Web App ##########
11
- st.title("Epidemiology Extraction Pipeline for Rare Diseases")
12
 
13
  #st.header(body, anchor=None)
14
  #st.subheader(body, anchor=None)
@@ -16,41 +16,50 @@ st.title("Epidemiology Extraction Pipeline for Rare Diseases")
16
 
17
  # https://docs.streamlit.io/library/api-reference/text/st.markdown
18
 
19
- ########## Create Input field ##########
20
- disease_or_gard_id = st.text_input('Input a rare disease term or a GARD ID.', 'Fellman syndrome')
21
-
22
- # st.code(body, language="python")
23
 
 
 
 
 
 
 
 
 
 
 
24
 
 
 
 
 
 
 
 
 
25
 
26
  # st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)
27
  # https://docs.streamlit.io/library/api-reference/widgets/st.radio
28
- filtering = st.sidebar.radio(
29
- "What type of filtering would you like?",
30
- ('Strict', 'Lenient', 'None'))
31
 
32
- extract_diseases = st.sidebar.checkbox("Extract Rare Diseases", value=False)
33
  # https://docs.streamlit.io/library/api-reference/widgets/st.checkbox
34
 
35
  #LSTM RNN Epi Classifier Model
36
- with st.spinner('Loading Epidemiology Classification Model...'):
37
- classify_model_vars = classify_abs.init_classify_model()
38
- st.success('Epidemiology Classification Model Loaded!')
39
 
40
  #GARD Dictionary - For filtering and exact match disease/GARD ID identification
41
- with st.spinner('Loading GARD Rare Disease Dictionary...'):
42
- GARD_dict, max_length = extract_abs.load_GARD_diseases()
43
- st.success('GARD Rare Disease Dictionary Loaded!')
44
-
45
 
46
  #BioBERT-based NER pipeline, open `entities` to see
47
- with st.spinner('Loading Epidemiology Extraction Model...'):
48
- NER_pipeline, entity_classes = extract_abs.init_NER_pipeline()
49
- st.success('Epidemiology Extraction Model Loaded!')
50
 
51
- #max_results is Maximum number of PubMed ID's to retrieve BEFORE filtering
52
- max_results = st.sidebar.number_input(label, min_value=1, max_value=None, value=50)
53
- # https://docs.streamlit.io/library/api-reference/widgets/st.number_input
54
 
55
  #filtering options are 'strict','lenient'(default), 'none'
56
  if text:
@@ -59,4 +68,6 @@ if text:
59
  extract_diseases,GARD_dict, max_length,
60
  classify_model_vars)
61
  st.dataframe(df)
62
- #st.dataframe(data=None, width=None, height=None)
 
 
 
8
  import streamlit as st
9
 
10
  ########## Title for the Web App ##########
11
+ st.title("Epidemiology Extraction Pipeline for Rare Diseases by the National Center for Advancing Translational Sciences (NIH/NCATS)")
12
 
13
  #st.header(body, anchor=None)
14
  #st.subheader(body, anchor=None)
 
16
 
17
  # https://docs.streamlit.io/library/api-reference/text/st.markdown
18
 
19
+ col1, col2 = st.columns(2)
 
 
 
20
 
21
+ with col1:
22
+ st.header("Rare ")
23
+ disease_or_gard_id = st.text_input('Input a rare disease term or a GARD ID.', 'Fellman syndrome')
24
+
25
+ with col2:
26
+ filtering = st.radio("What type of filtering would you like?",('Strict', 'Lenient', 'None'))
27
+ extract_diseases = st.checkbox("Extract Rare Diseases", value=False)
28
+ #max_results is Maximum number of PubMed ID's to retrieve BEFORE filtering
29
+ max_results = st.sidebar.number_input(label, min_value=1, max_value=None, value=50)
30
+ # https://docs.streamlit.io/library/api-reference/widgets/st.number_input
31
 
32
+ with col1:
33
+ with st.spinner('Loading Epidemiology Models and Dependencies...'):
34
+ classify_model_vars = classify_abs.init_classify_model()
35
+ st.success('Epidemiology Classification Model Loaded!')
36
+ NER_pipeline, entity_classes = extract_abs.init_NER_pipeline()
37
+ st.success('Epidemiology Extraction Model Loaded!')
38
+ GARD_dict, max_length = extract_abs.load_GARD_diseases()
39
+ st.success('All Models and Dependencies Loaded!')
40
 
41
  # st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)
42
  # https://docs.streamlit.io/library/api-reference/widgets/st.radio
43
+ #filtering = st.sidebar.radio("What type of filtering would you like?",('Strict', 'Lenient', 'None'))
 
 
44
 
45
+ #extract_diseases = st.sidebar.checkbox("Extract Rare Diseases", value=False)
46
  # https://docs.streamlit.io/library/api-reference/widgets/st.checkbox
47
 
48
  #LSTM RNN Epi Classifier Model
49
+ #with st.spinner('Loading Epidemiology Classification Model...'):
50
+ # classify_model_vars = classify_abs.init_classify_model()
51
+ #st.success('Epidemiology Classification Model Loaded!')
52
 
53
  #GARD Dictionary - For filtering and exact match disease/GARD ID identification
54
+ #with st.spinner('Loading GARD Rare Disease Dictionary...'):
55
+ # GARD_dict, max_length = extract_abs.load_GARD_diseases()
56
+ #st.success('GARD Rare Disease Dictionary Loaded!')
 
57
 
58
  #BioBERT-based NER pipeline, open `entities` to see
59
+ #with st.spinner('Loading Epidemiology Extraction Model...'):
60
+ # NER_pipeline, entity_classes = extract_abs.init_NER_pipeline()
61
+ #st.success('Epidemiology Extraction Model Loaded!')
62
 
 
 
 
63
 
64
  #filtering options are 'strict','lenient'(default), 'none'
65
  if text:
 
68
  extract_diseases,GARD_dict, max_length,
69
  classify_model_vars)
70
  st.dataframe(df)
71
+ #st.dataframe(data=None, width=None, height=None)
72
+
73
+ # st.code(body, language="python")