added_try_except
Browse files
app.py
CHANGED
@@ -112,22 +112,26 @@ def main():
|
|
112 |
|
113 |
st.subheader("T5 Sumarization")
|
114 |
with st.expander("T5 Summary"):
|
115 |
-
|
116 |
-
|
|
|
117 |
"Summary":len(summary)
|
118 |
}
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
x='metrics',y='rouge-1'
|
128 |
)
|
129 |
-
|
|
|
|
|
130 |
|
|
|
131 |
|
132 |
elif choice=='Text-Analysis':
|
133 |
text_analysis()
|
|
|
112 |
|
113 |
st.subheader("T5 Sumarization")
|
114 |
with st.expander("T5 Summary"):
|
115 |
+
try:
|
116 |
+
T5_sum = T5_summary(raw_text)
|
117 |
+
document_len={"Original":len(raw_text),
|
118 |
"Summary":len(summary)
|
119 |
}
|
120 |
+
st.write(document_len)
|
121 |
+
st.write(T5_sum)
|
122 |
+
st.info("Rouge Score")
|
123 |
+
score=evaluate_summary(T5_sum,raw_text)
|
124 |
+
st.write(score.T)
|
125 |
+
st.subheader(" ")
|
126 |
+
score['metrics']=score.index
|
127 |
+
c=at.Chart(score).mark_bar().encode(
|
128 |
x='metrics',y='rouge-1'
|
129 |
)
|
130 |
+
st.altair_chart(c)
|
131 |
+
except:
|
132 |
+
st.warning('Insufficient data')
|
133 |
|
134 |
+
|
135 |
|
136 |
elif choice=='Text-Analysis':
|
137 |
text_analysis()
|