wzkariampuzha commited on
Commit
f2852e3
1 Parent(s): 3ed57d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -17
app.py CHANGED
@@ -8,14 +8,14 @@ import extract_abs
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)
15
  #Anchor is for the URL, can be custom str
16
 
17
  # https://docs.streamlit.io/library/api-reference/text/st.markdown
18
-
19
  col1, col2 = st.columns(2)
20
 
21
  with col1:
@@ -26,7 +26,7 @@ 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:
@@ -37,29 +37,43 @@ with col1:
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:
@@ -71,4 +85,4 @@ if text:
71
  st.balloons()
72
  #st.dataframe(data=None, width=None, height=None)
73
 
74
- # st.code(body, language="python")
 
8
  import streamlit as st
9
 
10
  ########## Title for the Web App ##########
11
+ st.title("Epidemiology Extraction Pipeline for Rare Diseases")
12
+ st.subheader("by the National Center for Advancing Translational Sciences (NIH/NCATS)")
13
  #st.header(body, anchor=None)
14
  #st.subheader(body, anchor=None)
15
  #Anchor is for the URL, can be custom str
16
 
17
  # https://docs.streamlit.io/library/api-reference/text/st.markdown
18
+ '''
19
  col1, col2 = st.columns(2)
20
 
21
  with col1:
 
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.number_input("Maximum number of articles to find in PubMed", min_value=1, max_value=None, value=50)
30
  # https://docs.streamlit.io/library/api-reference/widgets/st.number_input
31
 
32
  with col1:
 
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
 
42
+ #max_results is Maximum number of PubMed ID's to retrieve BEFORE filtering
43
+ max_results = st.sidebar.number_input("Maximum number of articles to find in PubMed", min_value=1, max_value=None, value=50)
44
+ # https://docs.streamlit.io/library/api-reference/widgets/st.number_input
45
+
46
  # st.radio(label, options, index=0, format_func=special_internal_function, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)
47
  # https://docs.streamlit.io/library/api-reference/widgets/st.radio
48
+ filtering = st.sidebar.radio("What type of filtering would you like?",('Strict', 'Lenient', 'None'))
49
 
50
+ extract_diseases = st.sidebar.checkbox("Extract Rare Diseases", value=False)
51
  # https://docs.streamlit.io/library/api-reference/widgets/st.checkbox
52
 
53
+ with st.spinner('Loading Epidemiology Models and Dependencies...'):
54
+ classify_model_vars = classify_abs.init_classify_model()
55
+ st.success('Epidemiology Classification Model Loaded!')
56
+ NER_pipeline, entity_classes = extract_abs.init_NER_pipeline()
57
+ st.success('Epidemiology Extraction Model Loaded!')
58
+ GARD_dict, max_length = extract_abs.load_GARD_diseases()
59
+ st.success('All Models and Dependencies Loaded!')
60
+
61
+ '''
62
  #LSTM RNN Epi Classifier Model
63
+ with st.spinner('Loading Epidemiology Classification Model...'):
64
+ classify_model_vars = classify_abs.init_classify_model()
65
+ st.success('Epidemiology Classification Model Loaded!')
66
 
67
  #GARD Dictionary - For filtering and exact match disease/GARD ID identification
68
+ with st.spinner('Loading GARD Rare Disease Dictionary...'):
69
+ GARD_dict, max_length = extract_abs.load_GARD_diseases()
70
+ st.success('GARD Rare Disease Dictionary Loaded!')
71
 
72
  #BioBERT-based NER pipeline, open `entities` to see
73
+ with st.spinner('Loading Epidemiology Extraction Model...'):
74
+ NER_pipeline, entity_classes = extract_abs.init_NER_pipeline()
75
+ st.success('Epidemiology Extraction Model Loaded!')
76
+ '''
77
 
78
  #filtering options are 'strict','lenient'(default), 'none'
79
  if text:
 
85
  st.balloons()
86
  #st.dataframe(data=None, width=None, height=None)
87
 
88
+ # st.code(body, language="python")