File size: 574 Bytes
d63e292
 
 
7edbc24
 
 
d63e292
7edbc24
d63e292
 
 
 
 
 
 
 
 
 
75a1925
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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.")