blazingbunny commited on
Commit
724a5a1
·
1 Parent(s): ac88083

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -1,4 +1,16 @@
1
  import streamlit as st
 
 
2
 
3
- x = st.slider('Select a value')
4
- st.write(x, 'squared is', x * x)
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
+ from summarizer import Summarizer
3
+ from pprint import pprint
4
 
5
+ st.title('BERT Summarizer')
6
+ uploaded_file = st.file_uploader("Choose a text file", type="txt")
7
+
8
+ if uploaded_file is not None:
9
+ data = uploaded_file.read().decode('utf-8')
10
+ data = data.replace('\n', '')
11
+ data = data.replace("\ufeff", "")
12
+
13
+ model = Summarizer()
14
+ result = model(data, min_length=60, max_length=500)
15
+ summarized_text = ''.join(result)
16
+ st.write(summarized_text)