Gladiator commited on
Commit
f39343a
β€’
1 Parent(s): 6516fab

test basic extractive summarizer

Browse files
app.py CHANGED
@@ -2,5 +2,21 @@ import streamlit as st
2
 
3
 
4
  if __name__ == "__main__":
5
- st.header("Streamlit 🀝 Colab")
6
- st.write("This is a test statement")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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