Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,17 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
st.title("Text Classifier
|
5 |
-
st.write("Input text and labels. Submit. The machine will classify the text according to the labels.")
|
6 |
|
7 |
classifier = pipeline(task="zero-shot-classification")
|
8 |
|
9 |
-
|
10 |
-
|
|
|
|
|
11 |
|
12 |
-
if
|
13 |
labs = labels.title().split(',')
|
14 |
text = input_text.title()
|
15 |
res = classifier(text, labs)
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
st.title("Text Classifier 1")
|
5 |
+
st.write("Input text and labels -- comma separate labels. Submit. The machine will classify the text according to the labels.")
|
6 |
|
7 |
classifier = pipeline(task="zero-shot-classification")
|
8 |
|
9 |
+
form = st.form(key='zeroclassifier_form')
|
10 |
+
input_text = form.text_input(label='Input Text')
|
11 |
+
labels = form.text_input(label='Labels -- comma separate labels')
|
12 |
+
submit_button = form.form_submit_button(label='Submit')
|
13 |
|
14 |
+
if submit_button:
|
15 |
labs = labels.title().split(',')
|
16 |
text = input_text.title()
|
17 |
res = classifier(text, labs)
|