Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,13 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
|
|
|
| 4 |
pipe = pipeline('sentiment-analysis')
|
|
|
|
|
|
|
| 5 |
text = st.text_area('Enter some Text')
|
| 6 |
|
|
|
|
| 7 |
if text:
|
| 8 |
out = pipe(text)
|
| 9 |
-
st.json(out)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# Initialize the sentiment analysis pipeline
|
| 5 |
pipe = pipeline('sentiment-analysis')
|
| 6 |
+
|
| 7 |
+
# Create a text area in the Streamlit app for user input
|
| 8 |
text = st.text_area('Enter some Text')
|
| 9 |
|
| 10 |
+
# If the user has entered text, perform sentiment analysis and display the results
|
| 11 |
if text:
|
| 12 |
out = pipe(text)
|
| 13 |
+
st.json(out)
|