Spaces:
Sleeping
Sleeping
File size: 719 Bytes
662636f 23752c4 bfb2729 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import streamlit as st
import transformers
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("summarization", model="google/pegasus-xsum")
st.title("NLP APP")
option = st.sidebar.selectbox(
"Choose a task",
("Summarization", "Translation", "Emotion Detection", "Image Generation")
)
if option == "Summarization":
st.title("Text Summarization")
text = st.text_area("Enter text to summarize")
if st.button("Summarize"):
if text:
summary = summarizer(text)[0]["summary_text"]
st.write("Summary:", summary)
else:
st.write("Please enter text to summarize.")
else:
st.title("None") |