UjjwalVIT commited on
Commit
48beee2
1 Parent(s): 2f5dec2
Files changed (1) hide show
  1. app.py +30 -22
app.py CHANGED
@@ -61,15 +61,39 @@ def main():
61
 
62
  with c2:
63
  with st.expander("TextRank Summary"):
64
- text_summary=sumy_text_summarizer(raw_text)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  document_len={"Original":len(raw_text),
66
  "Summary":len(summary)
67
  }
68
  st.write(document_len)
69
- st.write(text_summary)
70
-
71
  st.info("Rouge Score")
72
- score=evaluate_summary(text_summary,raw_text)
73
  st.write(score.T)
74
  st.subheader(" ")
75
  score['metrics']=score.index
@@ -77,24 +101,8 @@ def main():
77
  x='metrics',y='rouge-1'
78
  )
79
  st.altair_chart(c)
80
-
81
- st.subheader("Bart Sumary")
82
- with st.expander("Bart Summary"):
83
- bart_summ = bart_summary(raw_text)
84
- document_len={"Original":len(raw_text),
85
- "Summary":len(summary)
86
- }
87
- st.write(document_len)
88
- st.write(bart_summ)
89
- st.info("Rouge Score")
90
- score=evaluate_summary(bart_summ,raw_text)
91
- st.write(score.T)
92
- st.subheader(" ")
93
- score['metrics']=score.index
94
- c=at.Chart(score).mark_bar().encode(
95
- x='metrics',y='rouge-1'
96
- )
97
- st.altair_chart(c)
98
 
99
  st.subheader("T5 Sumarization")
100
  with st.expander("T5 Summary"):
 
61
 
62
  with c2:
63
  with st.expander("TextRank Summary"):
64
+ try:
65
+ text_summary=sumy_text_summarizer(raw_text)
66
+ document_len={"Original":len(raw_text),
67
+ "Summary":len(summary)
68
+ }
69
+ st.write(document_len)
70
+ st.write(text_summary)
71
+
72
+ st.info("Rouge Score")
73
+ score=evaluate_summary(text_summary,raw_text)
74
+ st.write(score.T)
75
+ st.subheader(" ")
76
+ score['metrics']=score.index
77
+ c=at.Chart(score).mark_bar().encode(
78
+ x='metrics',y='rouge-1'
79
+ )
80
+ st.altair_chart(c)
81
+
82
+ except:
83
+ st.warning('Insufficient data')
84
+
85
+
86
+ st.subheader("Bart Sumary")
87
+ with st.expander("Bart Summary"):
88
+ try:
89
+ bart_summ = bart_summary(raw_text)
90
  document_len={"Original":len(raw_text),
91
  "Summary":len(summary)
92
  }
93
  st.write(document_len)
94
+ st.write(bart_summ)
 
95
  st.info("Rouge Score")
96
+ score=evaluate_summary(bart_summ,raw_text)
97
  st.write(score.T)
98
  st.subheader(" ")
99
  score['metrics']=score.index
 
101
  x='metrics',y='rouge-1'
102
  )
103
  st.altair_chart(c)
104
+ except:
105
+ st.warning('Insufficient data')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
  st.subheader("T5 Sumarization")
108
  with st.expander("T5 Summary"):