File size: 303 Bytes
0144081
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import streamlit as st
from transformers import pipeline

# Load trained model
classifier = pipeline("text-classification", model="./models")

st.title("Sentiment Analysis with DistilBERT")
text = st.text_area("Enter a text")

if st.button("Predict"):
    result = classifier(text)
    st.write(result)