Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,27 +4,23 @@ import pandas as pd
|
|
4 |
from transformers import pipeline
|
5 |
import streamlit as st
|
6 |
|
|
|
7 |
def app():
|
8 |
st.title("Text Summarization π€")
|
9 |
|
10 |
st.markdown("This is a Web application that Summarizes Text π")
|
11 |
text=st.text_area('Enter Text')
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
summarizer= facebook_bart_model()
|
17 |
-
|
18 |
-
def text_summarizer(text):
|
19 |
-
a = summarizer(text, max_length=450, min_length=150, do_sample=False)
|
20 |
-
return a[0]['summary_text']
|
21 |
|
22 |
|
23 |
# Check to see if a file has been uploaded
|
24 |
if text:
|
25 |
st.success("Summarizing Text, Please wait...")
|
26 |
# If it has then do the following:
|
27 |
-
out=text
|
28 |
st.json(out)
|
29 |
|
30 |
|
|
|
4 |
from transformers import pipeline
|
5 |
import streamlit as st
|
6 |
|
7 |
+
|
8 |
def app():
|
9 |
st.title("Text Summarization π€")
|
10 |
|
11 |
st.markdown("This is a Web application that Summarizes Text π")
|
12 |
text=st.text_area('Enter Text')
|
13 |
+
|
14 |
+
summarizer = pipeline("summarization", model="google/bigbird-pegasus-large-bigpatent")
|
15 |
+
|
16 |
+
pipe=summarizer(text,min_length=100, max_length=400)
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
|
19 |
# Check to see if a file has been uploaded
|
20 |
if text:
|
21 |
st.success("Summarizing Text, Please wait...")
|
22 |
# If it has then do the following:
|
23 |
+
out=pipe(text)
|
24 |
st.json(out)
|
25 |
|
26 |
|