Spaces:
Sleeping
Sleeping
EmreYY20
commited on
Commit
·
7fbb920
1
Parent(s):
6f823ae
update
Browse files
app.py
CHANGED
|
@@ -60,27 +60,27 @@ def main():
|
|
| 60 |
return
|
| 61 |
|
| 62 |
# Perform extractive summarization
|
|
|
|
| 63 |
if radio_selection == "Extractive":
|
| 64 |
# Perform extractive summarization
|
| 65 |
summary = summarize_with_textrank(file_content)
|
| 66 |
st.session_state.summary = summary
|
| 67 |
-
# Calculate overlap
|
| 68 |
-
overlap = calculate_overlap(file_content, summary)
|
| 69 |
-
st.session_state.overlap = overlap
|
| 70 |
|
| 71 |
# Perform extractive summarization
|
| 72 |
if radio_selection == "Abstractive":
|
| 73 |
None
|
| 74 |
-
|
| 75 |
-
#st.session_state.summary = summary
|
| 76 |
|
| 77 |
# Right column: Displaying text after pressing 'Summarize'
|
| 78 |
with col3:
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
|
|
|
| 84 |
|
| 85 |
if __name__ == "__main__":
|
| 86 |
main()
|
|
|
|
| 60 |
return
|
| 61 |
|
| 62 |
# Perform extractive summarization
|
| 63 |
+
summary = ""
|
| 64 |
if radio_selection == "Extractive":
|
| 65 |
# Perform extractive summarization
|
| 66 |
summary = summarize_with_textrank(file_content)
|
| 67 |
st.session_state.summary = summary
|
| 68 |
+
# Calculate and reset overlap
|
| 69 |
+
st.session_state.overlap = calculate_overlap(file_content, summary)
|
|
|
|
| 70 |
|
| 71 |
# Perform extractive summarization
|
| 72 |
if radio_selection == "Abstractive":
|
| 73 |
None
|
| 74 |
+
|
|
|
|
| 75 |
|
| 76 |
# Right column: Displaying text after pressing 'Summarize'
|
| 77 |
with col3:
|
| 78 |
+
st.write("Summary:")
|
| 79 |
+
if st.session_state.get('summary'):
|
| 80 |
+
st.write(st.session_state.summary)
|
| 81 |
+
if radio_selection == "Extractive" and st.session_state.get('overlap') is not None:
|
| 82 |
+
st.write(f"Overlap with Original Text: {st.session_state.overlap:.2f}%")
|
| 83 |
+
|
| 84 |
|
| 85 |
if __name__ == "__main__":
|
| 86 |
main()
|