carisackc commited on
Commit
c21acb2
·
1 Parent(s): c829a64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -26
app.py CHANGED
@@ -12,31 +12,6 @@ import en_ner_bc5cdr_md
12
 
13
  from streamlit.components.v1 import html
14
 
15
- def nav_page(page_name, timeout_secs=8):
16
- nav_script = """
17
- <script type="text/javascript">
18
- function attempt_nav_page(page_name, start_time, timeout_secs) {
19
- var links = window.parent.document.getElementsByTagName("a");
20
- for (var i = 0; i < links.length; i++) {
21
- if (links[i].href.toLowerCase().endsWith("/" + page_name.toLowerCase())) {
22
- links[i].click();
23
- return;
24
- }
25
- }
26
- var elasped = new Date() - start_time;
27
- if (elasped < timeout_secs * 1000) {
28
- setTimeout(attempt_nav_page, 100, page_name, start_time, timeout_secs);
29
- } else {
30
- alert("Unable to navigate to page '" + page_name + "' after " + timeout_secs + " second(s).");
31
- }
32
- }
33
- window.addEventListener("load", function() {
34
- attempt_nav_page("%s", new Date(), %d);
35
- });
36
- </script>
37
- """ % (page_name, timeout_secs)
38
- html(nav_script)
39
-
40
 
41
  # Store the initial value of widgets in session state
42
  if "visibility" not in st.session_state:
@@ -136,7 +111,7 @@ def visualize (run_text,output):
136
  text = ''
137
 
138
  #display(HTML(f'<h1>Summary - {title}</h1>'))
139
- for sentence in sentence_list:
140
  if sentence in best_sentences:
141
  text += ' ' + str(sentence).replace(sentence, f"<mark>{sentence}</mark>")
142
  else:
 
12
 
13
  from streamlit.components.v1 import html
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  # Store the initial value of widgets in session state
17
  if "visibility" not in st.session_state:
 
111
  text = ''
112
 
113
  #display(HTML(f'<h1>Summary - {title}</h1>'))
114
+ for sentence in run_text:
115
  if sentence in best_sentences:
116
  text += ' ' + str(sentence).replace(sentence, f"<mark>{sentence}</mark>")
117
  else: