Khushter's picture
update app.py
2c5b3c4
raw
history blame
No virus
473 Bytes
import streamlit as st
from transformers import pipeline
sentiment_pipeline = pipeline("sentiment-analysis")
st.title("Financial Sentiment Analysis Using HuggingFace")
st.write("Enter a Sentence to Analyze the Sentiment:")
user_input = st.text_input("")
if user_input:
result = sentiment_pipeline(user_input)
sentiment = result[0]["label"]
confidence = result[0]["score"]
st.write(f"Sentiment: {sentiment}")
st.write(f"Confidence: {confidence:.2f}")