Spaces:
Runtime error
Runtime error
Commit ·
be8f085
1
Parent(s): 8132cb4
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,46 +47,3 @@ if st.button("Analyze"):
|
|
| 47 |
else:
|
| 48 |
st.warning("Please enter some text.")
|
| 49 |
|
| 50 |
-
|
| 51 |
-
# Set page layout and style
|
| 52 |
-
st.set_page_config(
|
| 53 |
-
page_title="summarizer",
|
| 54 |
-
layout="wide",
|
| 55 |
-
initial_sidebar_state="expanded",
|
| 56 |
-
)
|
| 57 |
-
st.markdown(
|
| 58 |
-
"""
|
| 59 |
-
<style>
|
| 60 |
-
.stTextInput > div > div > input {
|
| 61 |
-
background-color: #f5f5f5;
|
| 62 |
-
border-radius: 5px;
|
| 63 |
-
padding: 10px;
|
| 64 |
-
font-size: 16px;
|
| 65 |
-
}
|
| 66 |
-
.stButton > button:first-child {
|
| 67 |
-
background-color: #3366ff;
|
| 68 |
-
color: white;
|
| 69 |
-
font-size: 16px;
|
| 70 |
-
padding: 10px 20px;
|
| 71 |
-
border-radius: 5px;
|
| 72 |
-
border: none;
|
| 73 |
-
}
|
| 74 |
-
</style>
|
| 75 |
-
""",
|
| 76 |
-
unsafe_allow_html=True,
|
| 77 |
-
)
|
| 78 |
-
|
| 79 |
-
# Set up sentiment analysis pipeline
|
| 80 |
-
pipe = pipeline("summarization")
|
| 81 |
-
|
| 82 |
-
# Streamlit app
|
| 83 |
-
st.title("Summarization")
|
| 84 |
-
text = st.text_area("Enter text")
|
| 85 |
-
|
| 86 |
-
if st.button("Analyze"):
|
| 87 |
-
if text:
|
| 88 |
-
out = pipe(text)
|
| 89 |
-
st.subheader("Summarization Result:")
|
| 90 |
-
summary = summarizer(text, max_length=1500, min_length=80, do_sample=False)[0]["summary_text"]
|
| 91 |
-
else:
|
| 92 |
-
st.warning("Please enter some text.")
|
|
|
|
| 47 |
else:
|
| 48 |
st.warning("Please enter some text.")
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|