san2deep/TextClassification
0
1import streamlit as st2from transformers import pipeline3 4# Set the title for the web app5st.title('Text Classification Bot')6 7# Initialize the pipeline for text classification8classifier_pipeline = pipeline('text-classification')9 10# Input text box for the user to enter text11user_input = st.text_area('Enter text for classification')12 13# Button to trigger classification14if st.button('Classify'):15 # Perform text classification on user input16 result = classifier_pipeline(user_input)17 18 # Display the classification label and confidence score19 st.write('Classification:', result[0]['label'])20 st.write('Confidence Score:', result[0]['score'])