Spaces:
Runtime error
Runtime error
| import streamlit as st | |
| from transformers import pipeline | |
| pipe = pipeline('sentiment-analysis') | |
| text = st.text_area('enter some text!') | |
| if text: | |
| out = pipe(text) | |
| st.json(out) | |
| # text = st.text_area('enter some text!') | |
| # classifier = pipeline("text-classification", model="hun3359/klue-bert-base-sentiment") | |
| # preds = classifier(text, top_k=None) | |
| # sorted_preds = sorted(preds, key=lambda x: x['score'], reverse=True) | |
| # for item in sorted_preds: | |
| # item['score'] = round(item['score'], 5) | |
| # if text: | |
| # st.json(sorted_preds) | |