Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,12 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
if text:
|
| 8 |
-
|
| 9 |
-
st.
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# Load sentiment analysis model
|
| 5 |
+
analyzer = pipeline('sentiment_analysis')
|
| 6 |
+
|
| 7 |
+
# Streamlit UI
|
| 8 |
+
text = st.text_area('Enter some text for sentiment analysis:')
|
| 9 |
|
| 10 |
if text:
|
| 11 |
+
result = analyzer(text)[0]
|
| 12 |
+
st.write(f"**Label:** {result['label']} \n**Confidence:** {result['score']:.2f}")
|