Download app.py from decodingdatascience/sentimontbot9dec: direct link, hf CLI and curl.
- Browser
- Download file 399 Bytes
-
https://huggingface.co/spaces/decodingdatascience/sentimontbot9dec/resolve/main/app.py
- Command line
-
hf download hf://spaces/decodingdatascience/sentimontbot9dec/app.py
-
curl -L -o app.py https://huggingface.co/spaces/decodingdatascience/sentimontbot9dec/resolve/main/app.py
399 Bytes
| import streamlit as st | |
| from transformers import pipeline | |
| st.title("AI Community 9th Dec Workshop Bot") | |
| sentiment_analysis = pipeline("sentiment-analysis") | |
| #user input | |
| user_input = st.text_area("Enter the comment to analyze") | |
| #analysis button | |
| if st.button("Analyze"): | |
| result = sentiment_analysis(user_input) | |
| st.write("Sentiment", result[0]['label']) | |
| st.write("Score", result[0]['score']) |