-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
31 lines (26 loc) · 1.01 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# import streamlit and ntlk
import streamlit as st
import nltk
from src.t5_api import t5_summary
from src.tf_idf import run_summarization as tf_idf_summarization
from src.word_freq import run_summarization as run_summarization_wf
if __name__ == "__main__":
nltk.download('punkt')
nltk.download('stopwords')
st.title("Text Summarization")
text = st.text_area("Paste your text here")
summarization_method = st.selectbox(
"Select summarization method",
["T5-Transformer", "TF-IDF", "Word Frequency"])
if st.button("Get Summary"):
if summarization_method == "T5-Transformer":
summary = t5_summary(text)
elif summarization_method == "TF-IDF":
summary = tf_idf_summarization(text)
elif summarization_method == "Word Frequency":
summary = run_summarization_wf(text)
st.success(summary)
st.markdown("---")
st.markdown(
"Created by Aman Matta, Avinal Kumar, Harsimranjeet Saini and Pooja Nehra"
)