Spaces:
Sleeping
Sleeping
import streamlit as st | |
from BART_utils import get_prob, judge_mbti, compute_score, mbti_translator, plot_mbti, device | |
st.title("MBTI ๋ฒ์ญ๊ธฐ") | |
if device == "cpu": | |
processor = "๐ฅ๏ธ" | |
else: | |
processor = "๐ฝ" | |
st.subheader("Running on {}".format(device + processor)) | |
st.header("๐ป๋๋ ์ค๋ ์ด๋ค MBTI์ฒ๋ผ ๋งํ๊ณ , ์ด์์๊น?") | |
st.write("๐ค๋ฌธ์ฅ์ ์ ๋ ฅํ๋ฉด, ์ด๋ฅผ ๋ถ์ํด์ MBTI๋ฅผ ์ถ๋ ฅํด์ค๋๋ค. ์์ง์ ์์ด๋ง ์ง์๋ฉ๋๋ค!") | |
st.header("๐ค์๋ ์๋ฆฌ๋?:") | |
st.write("Faceook ์ Zero-Shot NLI ๋ชจ๋ธ์ ํตํด ๋ฌธ์ฅ๊ณผ ๋จ์ด์ ์ฐ๊ด์ฑ์ ์ถ๋ก ํฉ๋๋ค.") | |
st.write("๋ชจ๋ธ ๋ฐ ํ๋ก์ ํธ์ ๋ํด์ ์์ธํ ์๊ณ ์ถ๋ค๋ฉด: https://github.com/ethHong/mbti_translator_demo") | |
user_input = st.text_input("๐๐๋ฌธ์ฅ์ ์ ๋ ฅํ๋ฉด MBTI๊ฐ ๋์ต๋๋ค!", "I stayed home all day") | |
submit = st.button("๋ฌธ์ฅ ์์ฑ") | |
if submit: | |
with st.spinner("AI๊ฐ ๊ฒฐ๊ณผ๋ฅผ ๋ถ์ํ๋ ์ค์ด์์..."): | |
output_mbti, output_ratio = mbti_translator( | |
user_input) | |
st.success("Success") | |
st.subheader("๐ค์ฐธ ์ด MBTI๊ฐ์ ๋ฌธ์ฅ์ด๊ตฐ์๐ : " + output_mbti) | |
for result in output_ratio: | |
plot_mbti(result) | |