Sentiment_Tweet / app.py
VIOLET21's picture
Create app.py
6aa08d9 verified
raw
history blame contribute delete
629 Bytes
import streamlit as st
from transformers import pipeline
st.set_page_config(page_title="Indonesian Tweet Sentiment", layout="centered")
st.title("🇮🇩 Tweet Sentiment Analyzer (Indo)")
model = pipeline("text-classification", model="VIOLET21/sentiment-bert-tweetx")
text = st.text_area("Masukkan teks tweet:", height=150)
if st.button("Analisa Sentimen"):
if not text.strip():
st.warning("Masukkan teks terlebih dahulu.")
else:
with st.spinner("Menganalisis..."):
output = model(text)[0]
st.success(f"**Label:** {output['label']} \n\n**Confidence:** {output['score']:.2f}")