wzkariampuzha commited on
Commit
847adc5
1 Parent(s): 38efeba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -51
app.py CHANGED
@@ -9,46 +9,14 @@ 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:
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.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:
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
 
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()
@@ -58,24 +26,8 @@ with st.spinner('Loading Epidemiology Models and Dependencies...'):
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:
80
  df = extract_abs.search_term_extraction(disease_or_gard_id, max_results, filtering,
81
  NER_pipeline, entity_classes,
 
9
 
10
  ########## Title for the Web App ##########
11
  st.title("Epidemiology Extraction Pipeline for Rare Diseases")
12
+ st.subheader("National Center for Advancing Translational Sciences (NIH/NCATS)")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  #max_results is Maximum number of PubMed ID's to retrieve BEFORE filtering
15
  max_results = st.sidebar.number_input("Maximum number of articles to find in PubMed", min_value=1, max_value=None, value=50)
16
+
 
 
 
17
  filtering = st.sidebar.radio("What type of filtering would you like?",('Strict', 'Lenient', 'None'))
18
 
19
  extract_diseases = st.sidebar.checkbox("Extract Rare Diseases", value=False)
 
20
 
21
  with st.spinner('Loading Epidemiology Models and Dependencies...'):
22
  classify_model_vars = classify_abs.init_classify_model()
 
26
  GARD_dict, max_length = extract_abs.load_GARD_diseases()
27
  st.success('All Models and Dependencies Loaded!')
28
 
29
+ GARD_Disease_Id = st.text_input("Input a rare disease term or GARD ID.", value="Fellman syndrome")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
 
31
  if text:
32
  df = extract_abs.search_term_extraction(disease_or_gard_id, max_results, filtering,
33
  NER_pipeline, entity_classes,