Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
| 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 = st.text_input("enter your piece please")
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
st.write(output)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# Create a zero-shot classification pipeline
|
| 5 |
classifier = pipeline("zero-shot-classification", model="MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli")
|
|
|
|
| 6 |
|
| 7 |
+
# Candidate labels
|
| 8 |
+
candidate_labels = ["science", "technology", "history"]
|
| 9 |
+
|
| 10 |
+
# Sequence to classify
|
| 11 |
+
sequence_to_classify = st.input_text()
|
| 12 |
+
|
| 13 |
+
# Classify the sequence
|
| 14 |
+
output = classifier(sequence_to_classify, candidate_labels)
|
| 15 |
+
|
| 16 |
+
|
| 17 |
st.write(output)
|