EmreYY20 commited on
Commit
e081c2e
1 Parent(s): 0f4d5d5

add blanc metric

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -1,6 +1,10 @@
1
  import streamlit as st
2
  import PyPDF2
3
- from extractive_model import summarize_with_textrank # Renamed function
 
 
 
 
4
 
5
  # Set page to wide mode
6
  st.set_page_config(layout="wide")
@@ -47,6 +51,9 @@ def main():
47
  if radio_selection == "Extractive":
48
  summary = summarize_with_textrank(file_content)
49
  st.session_state.summary = summary
 
 
 
50
 
51
  # Perform extractive summarization
52
  if radio_selection == "Abstractive":
@@ -59,6 +66,7 @@ def main():
59
  st.write("Summary:")
60
  if 'summary' in st.session_state:
61
  st.write(st.session_state.summary)
 
62
 
63
  if __name__ == "__main__":
64
  main()
 
1
  import streamlit as st
2
  import PyPDF2
3
+ from extractive_model import summarize_with_textrank
4
+ from blanc import BlancHelp
5
+
6
+ # Initialize BLANC
7
+ blanc_help = BlancHelp()
8
 
9
  # Set page to wide mode
10
  st.set_page_config(layout="wide")
 
51
  if radio_selection == "Extractive":
52
  summary = summarize_with_textrank(file_content)
53
  st.session_state.summary = summary
54
+ # Perform BLANC evaluation
55
+ blanc_help_score = blanc_help.eval_once(file_content, st.session_state.summary)
56
+ st.session_state.blanc_help = blanc_help_score
57
 
58
  # Perform extractive summarization
59
  if radio_selection == "Abstractive":
 
66
  st.write("Summary:")
67
  if 'summary' in st.session_state:
68
  st.write(st.session_state.summary)
69
+ st.write(f"BLANC-Help: {st.session_state.blanc_help}")
70
 
71
  if __name__ == "__main__":
72
  main()