Spaces:
Build error
Build error
| import streamlit as st | |
| from transformers import pipeline | |
| # Load sentiment analysis model | |
| analyzer = pipeline('sentiment-analysis') | |
| # Streamlit UI | |
| text = st.text_area('Enter some text for sentiment analysis:') | |
| if text: | |
| result = analyzer(text)[0] | |
| st.write(f"**Label:** {result['label']} \n**Confidence:** {result['score']:.2f}") | |