File size: 688 Bytes
2e55c56
 
 
ce10a36
2e55c56
c527a10
 
 
 
 
8bf4727
2c5b3c4
c527a10
b20f47d
 
c527a10
 
 
 
 
 
a67b893
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Finacial Sentiment Analysis Using Huggingface App
# Team Name :- Free Thinkers
# Authors:- Lalit Chaudhary and Khushter Kaifi
# Update On- 2 Jan 2024

import streamlit as st
from transformers import pipeline

sentiment_pipeline = pipeline("sentiment-analysis")

st.title("Financial Sentiment Analysis Using HuggingFace \n Team Name:- Free Thinkers")
st.write("Enter a Sentence to Analyze the Sentiment:")
user_input = st.text_input("")
st.write("Press the Enter key")

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:.2%}")