Spaces:
Runtime error
Runtime error
| import streamlit as st | |
| from transformers import pipeline | |
| classifier = pipeline('zero-shot-classification') | |
| text = st.text_area('Enter the text') | |
| labels = ["education", "politics", "business", "art", "sport", "science"] | |
| selected_labels = st.multiselect("Select Labels", labels) | |
| if text: | |
| prediction = classifier( | |
| text, | |
| candidate_labels=selected_labels | |
| ) | |
| st.json(prediction) |