File size: 719 Bytes
2e3e167
7414700
 
2e3e167
 
7414700
c317697
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import streamlit as st
from transformers import pipeline

# Load Zero-Shot Classification Model
zero_shot_classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")

# Entry point for the app
if __name__ == "__main__":
    st.write("Hello, Hugging Face Space!")
    
    # Title for the app
    st.title("Zero-Shot Classification")
    
    # Input from the user
    text_input = st.text_area("Enter text to classify:", "")
    
    # Define possible candidate labels
    candidate_labels = ["reasoning", "logic", "problem-solving", "explanation"]
    
    # Run the zero-shot model
    if text_input:
        result = zero_shot_classifier(text_input, candidate_labels)
        st.write(result)