Jayabaskar's picture
Update app.py
7edbc24 verified
raw
history blame contribute delete
574 Bytes
import streamlit as st
from transformers import pipeline
Load model from Hugging Face
def load_model():
return pipeline("text-classification", model="Jayabaskar/Fintuned") # Use your uploaded model
model = load_model()
st.title("Twitter Sentiment Analysis")
text = st.text_area("Enter a tweet:")
if st.button("Analyze"):
if text.strip():
with st.spinner("Analyzing..."):
result = model(text)
st.success(f"**Sentiment:** {result[0]['label']} (Score: {result[0]['score']:.2f})")
else:
st.warning("Please enter some text.")