File size: 543 Bytes
3de2036
a3a8b1d
3de2036
0ae7b40
a3a8b1d
 
0ae7b40
 
 
a3a8b1d
0ae7b40
a3a8b1d
0ae7b40
 
a3a8b1d
0ae7b40
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)