Spaces:
Build error
Build error
| 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.") | |