SentimentBuddy / app.py
sifujohn's picture
Update app.py
0d1fa79 verified
raw
history blame contribute delete
492 Bytes
#import necessary libraries
import streamlit as st
from transformers import pipeline
#give a title to app
name = st.title ('Check the sentiment of your words/email before sending it outπŸ˜ŽπŸ˜­πŸ˜πŸ˜”β€οΈ')
#buidling a sentiment pipeline
pipe = pipeline('sentiment-analysis', model = 'SamLowe/roberta-base-go_emotions')
#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)