File size: 339 Bytes
00997c5
 
 
e05fccc
7f090f9
e05fccc
 
 
00997c5
 
e05fccc
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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}")