import streamlit as st from transformers import pipeline import gc st.header("Sentiment-demo-app") st.subheader("Please be patient and wait up to a minute until the demo app is loaded.") st.caption("This is a very simple demo application for a zero-shot classification pipeline to classify positive, neutral, or negative sentiment for a short text. Enter your text in the box below and press CTRl+ENTER to run the model.") pipe = pipeline("text-classification", model='tabularisai/multilingual-sentiment-analysis') #"zero-shot-classification" model='facebook/bart-large-mnli') text = st.text_area('Enter text here!') #candidate_labels = ['Positive', 'Neutral', 'Negative'] result = pipe(texts) if text: out = pipe(text, result) st.json(out) del out gc.collect()