File size: 325 Bytes
2a63e02
 
 
 
 
1fc1ae1
2a63e02
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import streamlit as st
from transformers import pipeline

pipe = pipeline('sentiment-analysis')
st.title("Hugging Face Sentiment Analysis Spaces Example")

st.subheader("Enter the text you'd like to analyze.")
text = st.text_input('Enter text') #text is stored in this variable

if text:
    out = pipe(text)
    st.json(out)