APJ23's picture
Update app.py
753561a
raw
history blame contribute delete
716 Bytes
from transformers import pipeline as Tpipe
import streamlit as st
st.title("Text-To-Sentiment-Analysis")
Text_arr=["Hello my name is Alex.","You gotta do way better than that.","That's super cool.","I don't care!","I Hate you!","It's whatever."]
pipe = Tpipe("sentiment-analysis")
print(Text_arr)
st.markdown("This is a binary classification sentiment analysis program where it determine the sentiment of a given phrase")
st.markdown("POSITIVE: Good")
st.markdown("NEGATIVE: Bad")
if st.button("Press the button to test"):
for text in Text_arr:
labels=pipe(text)[0]["label"]
score=pipe(text)[0]["score"]
st.text(f"The text \"{text}\" is labeled {labels} with a score of {score} being accurate")