Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
text = st.text_area('Enter Any Text That comes in Your Mind!!')
|
| 7 |
|
|
|
|
| 8 |
if text:
|
| 9 |
-
out = pipe(text)
|
| 10 |
-
st.json(out)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# Define the pipeline and assign it to `pipe`
|
| 5 |
+
pipe = pipeline('sentiment-analysis')
|
| 6 |
|
| 7 |
+
# Create a text area for input
|
| 8 |
text = st.text_area('Enter Any Text That comes in Your Mind!!')
|
| 9 |
|
| 10 |
+
# Process the text when the user inputs it
|
| 11 |
if text:
|
| 12 |
+
out = pipe(text) # Use the `pipe` variable here
|
| 13 |
+
st.json(out) # Display the result as JSON
|