| import streamlit as st | |
| from transformers import pipeline | |
| st.title("Classificador de Sentimentos (Streamlit)") | |
| clf = pipeline("sentiment-analysis") | |
| texto = st.text_input("Digite um texto em inglês") | |
| if st.button("Analisar"): | |
| if not texto.strip(): | |
| st.warning("Digite um texto.") | |
| else: | |
| r = clf(texto)[0] | |
| label = "Positivo" if "POS" in r["label"].upper() else "Negativo" | |
| st.success(f"{label} | Confiança: {r['score']:.2f}") | |