Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,10 @@ from datetime import datetime as dt
|
|
8 |
from codetiming import Timer
|
9 |
import streamlit as st
|
10 |
|
|
|
|
|
|
|
|
|
11 |
from digestor import Digestor
|
12 |
from source import Source
|
13 |
from scrape_sources import NPRLite, CNNText, stub
|
@@ -232,3 +236,30 @@ with st.form(key='columns_in_form'):
|
|
232 |
st.success(f"""Digest completed in {digestor.timer.timers['digest_time']} seconds.""")
|
233 |
|
234 |
"st.session_state object:", st.session_state
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
from codetiming import Timer
|
9 |
import streamlit as st
|
10 |
|
11 |
+
import numpy as np
|
12 |
+
import pandas as pd
|
13 |
+
from matplotlib import pyplot as plt
|
14 |
+
|
15 |
from digestor import Digestor
|
16 |
from source import Source
|
17 |
from scrape_sources import NPRLite, CNNText, stub
|
|
|
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 = [2200, 875, 234, 300, 344, 419, 705, 400, 500, 230]
|
245 |
+
test_scores = [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 |
+
plt.show()
|