Spaces:
Runtime error
Runtime error
File size: 632 Bytes
4f77bf2 6c382fe 9b18155 9b135ca 4f77bf2 9b135ca 6c382fe 4f77bf2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
from transformers import pipeline
import gradio as gr
import os
token = os.environ["token"]
classifier = pipeline("zero-shot-classification",
model="joeddav/xlm-roberta-large-xnli",use_auth_token=token)
def classify(text):
return classifier(text, candidate_labels, multi_label=True)
candidate_labels = ["wasser", "strom", "gas", "hausreinigung", "schoenheit", "wellness", "oeffentlichkeit", "oeffentlicher", "verkehr", "vermietung", "medizin", "gesundheit", "pflege", "reisen", "tourismus", "versicherungen", "recht"]
gr.Interface(classify, "textbox", "label", live=True, capture_session=True).launch() |