File size: 422 Bytes
17087ab
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import streamlit as st
from transformers import pipeline

classifier = pipeline("zero-shot-classification", model="MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli")
sequence_to_classify = "Angela Merkel is a politician in Germany and leader of the CDU"
candidate_labels = ["politics", "economy", "entertainment", "environment"]

output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
st.write(output)