Spaces:
Runtime error
Runtime error
Update appZSC.py
Browse files
appZSC.py
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import transformers
|
| 3 |
+
from transformers import pipeline
|
| 4 |
+
|
| 5 |
+
classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
|
| 6 |
+
sequence_to_classify = st.text_area("Enter the text here")
|
| 7 |
+
candidate_labels = ['travel', 'cooking', 'dancing']
|
| 8 |
+
classifier(sequence_to_classify, candidate_labels, multi_label=True)
|
| 9 |
+
|
| 10 |
+
if sequence_to_classify :
|
| 11 |
+
out = classifier(sequence_to_classify)
|
| 12 |
+
st.json(out)
|