Spaces:
Sleeping
Sleeping
import streamlit as st | |
from transformers import pipeline | |
# Initialize the model | |
model_name = "distilbert-base-uncased-finetuned-sst-2-english" # Example model | |
classifier = pipeline("text-classification", model=model_name) | |
# Streamlit app layout | |
st.title("Intent Classification App") | |
# Text input | |
user_input = st.text_input("Enter your text here:") | |
if user_input: | |
# Model prediction | |
result = classifier(user_input) | |
# Display results | |
st.write("Intent:", result[0]['label']) | |
st.write("Confidence:", result[0]['score']) |