nebiyu29 commited on
Commit
17087ab
1 Parent(s): 124b0fe

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ classifier = pipeline("zero-shot-classification", model="MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli")
5
+ sequence_to_classify = "Angela Merkel is a politician in Germany and leader of the CDU"
6
+ candidate_labels = ["politics", "economy", "entertainment", "environment"]
7
+
8
+ output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
9
+ st.write(output)