educational-app / app.py
emre-kocyigit's picture
Update app.py
052e951
raw
history blame contribute delete
402 Bytes
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)