File size: 606 Bytes
289bf21
 
 
b4a4e9d
 
289bf21
45c6b2d
6cff188
45c6b2d
 
1084ba0
45c6b2d
 
6cff188
45c6b2d
 
5243839
45c6b2d
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)