UjjwalVIT commited on
Commit
59d083c
1 Parent(s): 163e67a

added_try_except

Browse files
Files changed (1) hide show
  1. app.py +15 -11
app.py CHANGED
@@ -112,22 +112,26 @@ def main():
112
 
113
  st.subheader("T5 Sumarization")
114
  with st.expander("T5 Summary"):
115
- T5_sum = T5_summary(raw_text)
116
- document_len={"Original":len(raw_text),
 
117
  "Summary":len(summary)
118
  }
119
- st.write(document_len)
120
- st.write(T5_sum)
121
- st.info("Rouge Score")
122
- score=evaluate_summary(T5_sum,raw_text)
123
- st.write(score.T)
124
- st.subheader(" ")
125
- score['metrics']=score.index
126
- c=at.Chart(score).mark_bar().encode(
127
  x='metrics',y='rouge-1'
128
  )
129
- st.altair_chart(c)
 
 
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()