Spaces:
Runtime error
Runtime error
Download src/streamlit_app.py from Reza110/Sentiment-Analysis: direct link, hf CLI and curl.
- Browser
- Download file 401 Bytes
-
https://huggingface.co/spaces/Reza110/Sentiment-Analysis/resolve/main/src/streamlit_app.py
- Command line
-
hf download hf://spaces/Reza110/Sentiment-Analysis/src/streamlit_app.py
-
curl -L -o streamlit_app.py https://huggingface.co/spaces/Reza110/Sentiment-Analysis/resolve/main/src/streamlit_app.py
401 Bytes
| import streamlit as st | |
| from transformers import pipeline | |
| 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']) | |