Another-space / app.py
frankiePizza's picture
Update app.py
45c6b2d verified
raw
history blame contribute delete
606 Bytes
import streamlit as st
from transformers import pipeline
sentiment = pipeline("sentiment-analysis")
text_generator = pipeline("text-generation")
st.title("Sentiment Analysis and Text Generation")
# For sentiment analysis
sentiment_text = st.text_area("Enter some text for sentiment analysis:")
if sentiment_text:
sentiment_result = sentiment(sentiment_text)
st.write(sentiment_result)
# For text generation
generator_text = st.text_area("Enter prompt for text generation:")
if generator_text:
generation_result = text_generator(generator_text, max_length=50)
st.write(generation_result)