import streamlit as st from transformers import pipeline import gc st.header("Sentiment Analysis") st.subheader("Input text. Submit. The machine will classify the text as positive, negative and neutral and display probabilities.") st.caption("Input text and press control + enter.") classifier = pipeline("zero-shot-classification", model='facebook/bart-large-mnli') text = st.text_area("Input text and press control + enter.") candidate_labels = ['positive', 'negative', 'neutral'] if text: out = classifier(text, candidate_labels) st.json(out) del out gc.collect()