green commited on
Commit
cef16b3
1 Parent(s): 7850b5a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -35
app.py CHANGED
@@ -230,40 +230,37 @@ with st.form(key='columns_in_form'):
230
  st.write("Your digest is ready:\n")
231
  st.write(digestor.text)
232
  st.write(f"""Text approximately {len(digestor.text.split(" ") )} words.""")
233
- st.write(f"""Number of articles summarized: {len(outdata['summaries'].keys())}""")
234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
 
236
- st.success(f"""Digest completed in {digestor.timer.timers['digest_time']} seconds.""")
237
-
238
- "st.session_state object:", st.session_state
239
-
240
-
241
-
242
- # Summarize the findings for all models
243
- labels = [1,2,3,4,5,6,7,8,9,10,11]
244
- training_scores = [1000, 2200, 875, 234, 300, 344, 419, 705, 400, 500, 230]
245
- test_scores = [388, 41, 100, 400, 344, 123, 600, 433, 133, 56, 89]
246
-
247
- x = np.arange(len(labels)) # the label locations
248
- width = 0.35 # the width of the bars
249
-
250
- fig, ax = plt.subplots(figsize=(14,8))
251
- rects1 = ax.bar(x - width/2, training_scores, width, color='lightgreen',zorder=0)
252
- rects2 = ax.bar(x + width/2, test_scores, width, color='lightblue',zorder=0)
253
-
254
- rects3 = ax.bar(x - width/2, training_scores, width, color='none',edgecolor='black', hatch='XX', lw=1.25,zorder=1)
255
- rects4 = ax.bar(x + width/2, test_scores, width, color='none',edgecolor='black', hatch='xx', lw=1.25,zorder=1)
256
-
257
- # Add some text for labels, title and custom x-axis tick labels, etc.
258
- ax.set_ylabel('Original Length')
259
- ax.set_xticks(x)
260
- ax.set_yticks([i for i in range(0,2500,250)])
261
- ax.set_xticklabels(labels)
262
- ax.set_xlabel('Summarized Length')
263
-
264
- plt.title('Original to Summarized Lengths in Space-Separated Tokens')
265
- #ax.hist(arr, bins=20)
266
- st.pyplot(fig)
267
-
268
- #tc = pd.DataFrame({'train':training_scores,'test':test_scores})
269
- #st.bar_chart(tc)
 
230
  st.write("Your digest is ready:\n")
231
  st.write(digestor.text)
232
  st.write(f"""Text approximately {len(digestor.text.split(" ") )} words.""")
233
+ st.write(f"""Number of articles summarized: {outdata['article_count']}""")
234
 
235
+
236
+ st.success(f"""Digest completed in {digestor.timer.timers['digest_time']} seconds.""")
237
+
238
+ st.write("Here's some stats about the summarization:\n")
239
+
240
+ # Summarize the findings for all models
241
+ labels = [i for i in range(outdata['article_count'])]
242
+ original_length = [i.original_length for i in outdata['summaries']]
243
+ summarized_length = [i.summary_length for i in outdata['summaries']]
244
+ x = np.arange(len(labels)) # the label locations
245
+ width = 0.35 # the width of the bars
246
+
247
+ fig, ax = plt.subplots(figsize=(14,8))
248
+ rects1 = ax.bar(x - width/2, original_length, width, color='lightgreen',zorder=0)
249
+ rects2 = ax.bar(x + width/2, summarized_length, width, color='lightblue',zorder=0)
250
+
251
+ rects3 = ax.bar(x - width/2, original_length, width, color='none',edgecolor='black', hatch='XX', lw=1.25,zorder=1)
252
+ rects4 = ax.bar(x + width/2, summarized_length, width, color='none',edgecolor='black', hatch='xx', lw=1.25,zorder=1)
253
+
254
+ # Add some text for labels, title and custom x-axis tick labels, etc.
255
+ ax.set_ylabel('Original Length')
256
+ ax.set_xticks(x)
257
+ ax.set_yticks([i for i in range(0,2500,250)])
258
+ ax.set_xticklabels(labels)
259
+ ax.set_xlabel('Summarized Length')
260
+
261
+ plt.title('Original to Summarized Lengths in Space-Separated Tokens')
262
+ #ax.hist(arr, bins=20)
263
+ st.pyplot(fig)
264
 
265
+
266
+ "st.session_state object:", st.session_state