Spaces:
Runtime error
Runtime error
ambujraj2001
commited on
Commit
•
8b7d84d
1
Parent(s):
bf484fe
files added
Browse files- .gitattributes +1 -0
- NextSentencePrediction.jpg +0 -0
- app.py +33 -0
- bert.sav +3 -0
- requirements.txt +1 -0
.gitattributes
CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*.sav filter=lfs diff=lfs merge=lfs -text
|
NextSentencePrediction.jpg
ADDED
app.py
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pickle
|
3 |
+
from PIL import Image
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
with st.sidebar:
|
8 |
+
st.subheader('Text Summarization Using BERT')
|
9 |
+
st.divider()
|
10 |
+
st.write('This is a text summarization app using BERT. It is a state of the art model for text summarization. It is a pretrained model which is trained on a large dataset of news articles. It can be used for summarizing any text. It is a very powerful model and is very fast. It is also very accurate.')
|
11 |
+
image = Image.open('NextSentencePrediction.jpg')
|
12 |
+
st.image(image, caption='Bert Model')
|
13 |
+
st.code('App Built by Ambuj Raj',language='python')
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
def summary(txt):
|
18 |
+
with st.spinner('Summarizing...'):
|
19 |
+
loaded_model = pickle.load(open('bert.sav', 'rb'))
|
20 |
+
summary = loaded_model(txt, min_length=50)
|
21 |
+
st.success('Your Summary is ready and is given below ⬇️')
|
22 |
+
st.caption(summary)
|
23 |
+
|
24 |
+
st.title('Text Summarization Using BERT')
|
25 |
+
st.divider()
|
26 |
+
txt = st.text_area('Enter the Text to extract Summary', '''''')
|
27 |
+
if st.button('Summarize'):
|
28 |
+
summary(txt)
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
|
bert.sav
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9ded2c906eeb91f7685021fff34062eaafa6dd3389a28df9e968d8639ab37d32
|
3 |
+
size 1341515428
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
streamlit=1.21.0
|