UjjwalVIT commited on
Commit
6177ad7
1 Parent(s): 48beee2
Files changed (1) hide show
  1. app.py +18 -12
app.py CHANGED
@@ -42,22 +42,28 @@ def main():
42
  c1, c2 = st.columns(2)
43
 
44
  with c1:
 
45
  with st.expander("LexRank Summary"):
46
- summary = sumy_summarizer(raw_text)
47
- document_len={"Original":len(raw_text),
 
48
  "Summary":len(summary)
49
  }
50
- st.write(document_len)
51
- st.write(summary)
52
- st.info("Rouge Score")
53
- score=evaluate_summary(summary,raw_text)
54
- st.write(score.T)
55
- st.subheader(" ")
56
- score['metrics']=score.index
57
- c=at.Chart(score).mark_bar().encode(
58
  x='metrics',y='rouge-1'
59
- )
60
- st.altair_chart(c)
 
 
 
 
61
 
62
  with c2:
63
  with st.expander("TextRank Summary"):
 
42
  c1, c2 = st.columns(2)
43
 
44
  with c1:
45
+
46
  with st.expander("LexRank Summary"):
47
+ try:
48
+ summary = sumy_summarizer(raw_text)
49
+ document_len={"Original":len(raw_text),
50
  "Summary":len(summary)
51
  }
52
+ st.write(document_len)
53
+ st.write(summary)
54
+ st.info("Rouge Score")
55
+ score=evaluate_summary(summary,raw_text)
56
+ st.write(score.T)
57
+ st.subheader(" ")
58
+ score['metrics']=score.index
59
+ c=at.Chart(score).mark_bar().encode(
60
  x='metrics',y='rouge-1'
61
+ )
62
+ st.altair_chart(c)
63
+ catch:
64
+ st.warning('Insufficient data')
65
+
66
+
67
 
68
  with c2:
69
  with st.expander("TextRank Summary"):