Spaces:
Runtime error
Runtime error
added button to toggle summarize
Browse files
app.py
CHANGED
@@ -6,17 +6,17 @@ if __name__ == "__main__":
|
|
6 |
import sys
|
7 |
sys.path.append("../extractive_summarizer")
|
8 |
st.title("Text Summarizer π")
|
9 |
-
st.
|
10 |
|
11 |
inp_text = st.text_input("Enter the text here")
|
12 |
-
summarize_type = st.sidebar.selectbox("Summarization type", options=["Extractive", "Abstractive"])
|
13 |
|
14 |
if summarize_type == "Extractive":
|
15 |
from extractive_summarizer.model_processors import Summarizer
|
16 |
|
17 |
# init model
|
18 |
model = Summarizer()
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
6 |
import sys
|
7 |
sys.path.append("../extractive_summarizer")
|
8 |
st.title("Text Summarizer π")
|
9 |
+
summarize_type = st.sidebar.selectbox("Summarization type", options=["Extractive", "Abstractive"])
|
10 |
|
11 |
inp_text = st.text_input("Enter the text here")
|
|
|
12 |
|
13 |
if summarize_type == "Extractive":
|
14 |
from extractive_summarizer.model_processors import Summarizer
|
15 |
|
16 |
# init model
|
17 |
model = Summarizer()
|
18 |
+
summarize = st.button("Summarize")
|
19 |
+
if summarize:
|
20 |
+
st.subheader("Summarized text")
|
21 |
+
summarized_text = model(inp_text, num_sentences=5)
|
22 |
+
st.info(summarized_text)
|