Spaces:
Runtime error
Runtime error
File size: 401 Bytes
d68e365 f368ea0 d68e365 e13af06 d68e365 f368ea0 e13af06 f368ea0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import streamlit as st
from transformers import pipeline
@st.cache_resource
def load_model():
return pipeline("sentiment-analysis", model="siebert/sentiment-roberta-large-english")
sentiment_analysis = load_model()
st.title("Sentiment Analysis")
rev = st.text_input("Enter a review to analyze its sentiment.")
if st.button("Analyze") and rev:
st.write(sentiment_analysis(rev)[0]['label'])
|