Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,15 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
6 |
|
7 |
if text:
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
# Load the text classification pipeline
|
5 |
+
classifier = pipeline("text-classification")
|
6 |
+
|
7 |
+
# Create a text input field
|
8 |
+
text = st.text_input("Enter a sentence:")
|
9 |
|
10 |
if text:
|
11 |
+
# Process the text using the pipeline
|
12 |
+
output = classifier(text)
|
13 |
+
|
14 |
+
# Display the output as JSON
|
15 |
+
st.json(output)
|