green commited on
Commit
83d299f
1 Parent(s): 2cb0d87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -60,7 +60,7 @@ def initialize(limit, rando, use_cache=True):
60
  cluster_data.append(c_data)
61
  cluster_meta.append(article_meta(data_source.source_name, c_meta))
62
  st.session_state[data_source.source_name] = f"Number of articles from source: {c_meta}"
63
- st.write("Finished acquiring current headlines....\nmoving on to clustering...")
64
  cluster_data = cluster_data[0] + cluster_data[1]
65
  # NER
66
  # iterate the list of namedtuples,
@@ -98,7 +98,6 @@ def perform_ner(tup:namedtuple('article',['link','hed','entities', 'source']), c
98
 
99
 
100
  def ner_query(payload):
101
- print("making a query....")
102
  data = json.dumps(payload)
103
  response = requests.request("POST", NER_API_URL, headers=headers, data=data)
104
  return json.loads(response.content.decode("utf-8"))
@@ -163,7 +162,7 @@ LIMIT = 20 # Controls time and number of clusters.
163
  USE_CACHE = True
164
 
165
  if not USE_CACHE:
166
- print("NOT USING CACHE--ARE YOU GATHERING DATA?")
167
  if LIMIT is not None:
168
  print(f"LIMIT: {LIMIT}")
169
 
@@ -201,9 +200,9 @@ with st.form(key='columns_in_form'):
201
  selections.append(col.selectbox(f'Make a Selection', choices, key=i))
202
  submitted = st.form_submit_button('Submit')
203
  if submitted:
204
- st.write("Submitted")
205
  selections = [i for i in selections if i is not None]
206
- with st.spinner(text="Digesting...please wait, this will take a few moments...Maybe check some messages or start reading the latest papers on summarization with transformers...."):
207
  chosen = []
208
 
209
  for i in selections: # i is supposed to be a list of stubs, mostly one
 
60
  cluster_data.append(c_data)
61
  cluster_meta.append(article_meta(data_source.source_name, c_meta))
62
  st.session_state[data_source.source_name] = f"Number of articles from source: {c_meta}"
63
+
64
  cluster_data = cluster_data[0] + cluster_data[1]
65
  # NER
66
  # iterate the list of namedtuples,
 
98
 
99
 
100
  def ner_query(payload):
 
101
  data = json.dumps(payload)
102
  response = requests.request("POST", NER_API_URL, headers=headers, data=data)
103
  return json.loads(response.content.decode("utf-8"))
 
162
  USE_CACHE = True
163
 
164
  if not USE_CACHE:
165
+ print("NOT USING CACHE")
166
  if LIMIT is not None:
167
  print(f"LIMIT: {LIMIT}")
168
 
 
200
  selections.append(col.selectbox(f'Make a Selection', choices, key=i))
201
  submitted = st.form_submit_button('Submit')
202
  if submitted:
203
+ st.write("Submitted.\nWhat you'll see:\n\t•The links of the articles being summarized for you digest.\n\t•The digest.\n\t•A graph showing the reduction in articles lengths from original to summary, for each article.\n\t•Some probably issues with the summary.")
204
  selections = [i for i in selections if i is not None]
205
+ with st.spinner(text="Digesting...please wait, this will take a few moments...Maybe check some messages or start reading the latest papers on summarization with transformers....\n\nTransformers are so called because they make heavy use of mathematical transformations on the input data, in order to detect contextually related words or phrases in a sentence. \nThis project uses a checkpoint called distilbart-cnn-12-6, created by Sam Shleifer ()."):
206
  chosen = []
207
 
208
  for i in selections: # i is supposed to be a list of stubs, mostly one