test basic extractive summarizer
Browse files
app.py
CHANGED
@@ -2,5 +2,21 @@ import streamlit as st
|
|
2 |
|
3 |
|
4 |
if __name__ == "__main__":
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
|
4 |
if __name__ == "__main__":
|
5 |
+
# adding modules to path
|
6 |
+
import sys
|
7 |
+
sys.path.append("../extractive_summarizer")
|
8 |
+
st.title("Text Summarizer π")
|
9 |
+
st.write("This is a test statement")
|
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 import Summarizer
|
16 |
+
|
17 |
+
# init model
|
18 |
+
model = Summarizer()
|
19 |
+
summarized_text = model(inp_text, num_sentences=5)
|
20 |
+
|
21 |
+
st.subheader("Summarized text")
|
22 |
+
st.markdown(summarized_text)
|
{summarizer β extractive_summarizer}/bert_parent.py
RENAMED
File without changes
|
{summarizer β extractive_summarizer}/cluster_features.py
RENAMED
File without changes
|
{summarizer β extractive_summarizer}/model_processors.py
RENAMED
File without changes
|
{summarizer β extractive_summarizer}/sentence_handler.py
RENAMED
File without changes
|