abdullahzunorain/Text_Classification_App
3
1import streamlit as st2from transformers import pipeline3 4# Create a pipeline for text classification5pipe = pipeline("text-classification", model="distilbert/distilbert-base-uncased-finetuned-sst-2-english")6 7# Streamlit app structure8st.title("Text Classification App")9st.write("Enter some text and the model will predict its sentiment:")10 11# Input text from the user12user_input = st.text_input("Input Text:")13 14# When the button is clicked, classify the input15if st.button("Classify"):16 if user_input:17 result = pipe(user_input)18 st.write(result)19 else:20 st.write("Please enter some text.")21 