CoolFace
Apppublic

deepamar/textgeneration

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes
app.py24 linesDownload Raw Back to root
1import streamlit as st2from transformers import pipeline3 4# Load the sentiment analysis pipeline5classifier = pipeline("text-generation")6 7# Streamlit app8def main():9    st.title("Text Generation App")10 11    # User input12    user_input = st.text_input("Enter a sentence:")13 14    if user_input:15        # Perform sentiment analysis16        result = classifier(user_input)17        st.write(result)18        # Display results19        #st.write("Sentiment:", result[0]['label'])20        #st.write("Confidence:", result[0]['score'])21 22if __name__ == "__main__":23    main()24