Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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)
|