Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,20 +5,20 @@ from transformers import pipeline
|
|
5 |
import streamlit as st
|
6 |
|
7 |
def app():
|
8 |
-
st.title("
|
9 |
|
10 |
-
st.markdown("This is a Web application that Summarizes Text π")
|
11 |
upload_file = st.file_uploader('Upload a file containing Text data')
|
12 |
button = st.button("Summarize")
|
13 |
|
14 |
st.cache(allow_output_mutation=True)
|
15 |
-
def
|
16 |
-
summarizer = pipeline("summarization", model="
|
17 |
return summarizer
|
18 |
-
summarizer=
|
19 |
|
20 |
def text_summarizer(text):
|
21 |
-
a = summarizer(text, max_length=
|
22 |
return a[0]['summary_text']
|
23 |
|
24 |
|
|
|
5 |
import streamlit as st
|
6 |
|
7 |
def app():
|
8 |
+
st.title("Patent Document Summarization π€")
|
9 |
|
10 |
+
st.markdown("This is a Web application that Summarizes Patent Text π")
|
11 |
upload_file = st.file_uploader('Upload a file containing Text data')
|
12 |
button = st.button("Summarize")
|
13 |
|
14 |
st.cache(allow_output_mutation=True)
|
15 |
+
def model():
|
16 |
+
summarizer = pipeline("summarization", model="google/bigbird-pegasus-large-bigpatent")
|
17 |
return summarizer
|
18 |
+
summarizer= model()
|
19 |
|
20 |
def text_summarizer(text):
|
21 |
+
a = summarizer(text, max_length=450, min_length=150, do_sample=False)
|
22 |
return a[0]['summary_text']
|
23 |
|
24 |
|