File size: 565 Bytes
87ab50c
 
 
 
 
 
 
 
b9869e4
87ab50c
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import streamlit as st
from transformers import pipeline

# Load the sentiment analysis pipeline
classifier = pipeline("text-generation")

# Streamlit app
def main():
    st.title("Text Generation App")

    # User input
    user_input = st.text_input("Enter a sentence:")

    if user_input:
        # Perform sentiment analysis
        result = classifier(user_input)
        st.write(result)
        # Display results
        #st.write("Sentiment:", result[0]['label'])
        #st.write("Confidence:", result[0]['score'])

if __name__ == "__main__":
    main()