Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,23 +5,19 @@ from transformers import pipeline
|
|
5 |
|
6 |
summarizer = pipeline("summarization", model="google/bigbird-pegasus-large-bigpatent"
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
# Check to see if a file has been uploaded
|
19 |
-
if summarize:
|
20 |
-
st.success("Summarizing Text, Please wait...")
|
21 |
-
# If it has then do the following:
|
22 |
-
result=summarizer(text,min_length=100, max_length=400)
|
23 |
-
st.header(result)
|
24 |
-
|
25 |
-
if __name__ == '__main__':
|
26 |
-
main()
|
27 |
-
|
|
|
5 |
|
6 |
summarizer = pipeline("summarization", model="google/bigbird-pegasus-large-bigpatent"
|
7 |
|
8 |
+
def summary():
|
9 |
+
# st.title("DOCUMENT SUMMARIZER")
|
10 |
+
html_temp = """
|
11 |
+
<div style ="background-color:cyan;padding:13px">
|
12 |
+
<h1 style ="color:black;text-align:center;">PATENT SUMMARIZER</h1>
|
13 |
+
</div>
|
14 |
+
"""
|
15 |
+
st.markdown(html_temp, unsafe_allow_html = True)
|
16 |
+
my_file=st.text_area("Paste Document content", placeholder="Paste here",height=60)
|
17 |
+
result =""
|
18 |
+
if st.button("Summarize"):
|
19 |
+
result = summarizer(my_file)
|
20 |
+
st.success(result)
|
21 |
|
22 |
+
|
23 |
+
summary()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|