Spaces:
Sleeping
Sleeping
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) |