Mark Gandolfo
rename to app.py
a4fd25f
raw
history blame
451 Bytes
import torch
from transformers import pipeline
import streamlit as st
sentiment_pipeline = pipeline("sentiment-analysis")
st.title("Sentiment Analysis")
sentance = st.text_input("Enter a sentance to analyse")
st.button("submit")
if st.button:
result = sentiment_pipeline(sentance)
sentiment = result[0]['label']
confidence = result[0]['score']
st.write(f"Sentiment: {sentiment}")
st.write(f"Confidence: {confidence}")