wzkariampuzha commited on
Commit
0416a61
1 Parent(s): 7ce5b82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -5
app.py CHANGED
@@ -5,6 +5,26 @@ import extract_abs
5
  #pd.set_option('display.max_colwidth', None)
6
  import streamlit as st
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  #LSTM RNN Epi Classifier Model
9
  classify_model_vars = classify_abs.init_classify_model()
10
 
@@ -15,11 +35,23 @@ GARD_dict, max_length = extract_abs.load_GARD_diseases()
15
  NER_pipeline, entity_classes = extract_abs.init_NER_pipeline()
16
 
17
  #max_results is Maximum number of PubMed ID's to retrieve BEFORE filtering
 
 
 
 
 
 
 
 
 
 
 
18
 
19
  #filtering options are 'strict','lenient'(default), 'none'
20
  if text:
21
- out = extract_abs.search_term_extraction(term, max_results, filtering,
22
- NER_pipeline, entity_classes,
23
- extract_diseases,GARD_dict, max_length,
24
- classify_model_vars)
25
- st.write(out)
 
 
5
  #pd.set_option('display.max_colwidth', None)
6
  import streamlit as st
7
 
8
+ ########## Title for the Web App ##########
9
+ st.title("Text Classification for Service Feedback")
10
+
11
+ #st.header(body, anchor=None)
12
+ #st.subheader(body, anchor=None)
13
+ #Anchor is for the URL, can be custom str
14
+
15
+ # https://docs.streamlit.io/library/api-reference/text/st.markdown
16
+
17
+
18
+
19
+
20
+ ########## Create Input field ##########
21
+ disease_or_gard_id = st.text_input('Input a rare disease term or a GARD ID.', 'Fellman syndrome')
22
+
23
+
24
+ # st.code(body, language="python")
25
+
26
+
27
+
28
  #LSTM RNN Epi Classifier Model
29
  classify_model_vars = classify_abs.init_classify_model()
30
 
 
35
  NER_pipeline, entity_classes = extract_abs.init_NER_pipeline()
36
 
37
  #max_results is Maximum number of PubMed ID's to retrieve BEFORE filtering
38
+ max_results = st.sidebar.number_input(label, min_value=1, max_value=None, value=50)
39
+ # https://docs.streamlit.io/library/api-reference/widgets/st.number_input
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(
44
+ "What type of filtering would you like?",
45
+ ('Strict', 'Lenient', 'None'))
46
+
47
+ extract_diseases = st.sidebar.checkbox("Extract Rare Diseases", value=False, key=None, help=None, on_change=None, args=None, kwargs=None, *, disabled=False)
48
+ # https://docs.streamlit.io/library/api-reference/widgets/st.checkbox
49
 
50
  #filtering options are 'strict','lenient'(default), 'none'
51
  if text:
52
+ df = extract_abs.search_term_extraction(disease_or_gard_id, max_results, filtering,
53
+ NER_pipeline, entity_classes,
54
+ extract_diseases,GARD_dict, max_length,
55
+ classify_model_vars)
56
+ st.dataframe(df)
57
+ #st.dataframe(data=None, width=None, height=None)