ChatbotTF / app.py
M1NJ1's picture
Upload 3 files
eadeab6 verified
raw
history blame contribute delete
590 Bytes
import streamlit as st
from chatbot import predict_multi, generate_response
st.set_page_config(page_title="๊ฐ์ • ๊ณต๊ฐ ์ฑ—๋ด‡")
st.title("T / F ๊ฐ์ • ๊ณต๊ฐ ์ฑ—๋ด‡ ๐Ÿ’ฌ")
text = st.text_area("๋งˆ์Œ์† ์ด์•ผ๊ธฐ๋ฅผ ๋“ค๋ ค์ฃผ์„ธ์š”")
mode = st.radio("์ฑ—๋ด‡ ์‘๋‹ต ์Šคํƒ€์ผ", ["T - ์ด์„ฑ์  ์กฐ์–ธ", "F - ๊ฐ์„ฑ์  ์œ„๋กœ"])
if st.button("์ฑ—๋ด‡์—๊ฒŒ ๋ง ๊ฑธ๊ธฐ"):
flag = 'T' if mode.startswith('T') else 'F'
emotions = predict_multi(text)
st.write("### ์˜ˆ์ธก๋œ ๊ฐ์ •:", ", ".join(emotions))
response = generate_response(emotions, flag)
st.success(response)