SentimentBuddy / app.py
sifujohn's picture
code update
cc2d8c4 verified
raw
history blame
478 Bytes
#import necessary libraries
import streamlit as st
from transformers import pipeline
#buidling a sentiment pipeline
pipe = pipeline('sentiment-analysis', model = 'SamLowe/roberta-base-go_emotions')
#give a title to app
st.title ('Check the sentiment of your email before sending it outπŸ˜ŽπŸ˜­πŸ˜πŸ˜”β€οΈ')
#text field for user to input data
text = st.text_area('Enter given text here')
# output formated in json format
if text:
out = pipe(text)
st.json(out)