Spaces:
Runtime error
Runtime error
import streamlit as st | |
from transformers import pipeline | |
import gc | |
st.header("Sentiment Analyzer - BART-Large-MNLI") | |
st.write("Input text and press control + enter. The machine will present the likelihood that the text can be categorized as positive, negative and neutral.") | |
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() |