Sukhyun commited on
Commit
21fc10a
ยท
1 Parent(s): f60bfe8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -2,29 +2,29 @@ import streamlit as st
2
  from BART_utils import get_prob, judge_mbti, compute_score, mbti_translator, plot_mbti, device
3
 
4
 
5
- st.title("MBTI ๋ฒˆ์—ญ๊ธฐ")
6
  if device == "cpu":
7
  processor = "๐Ÿ–ฅ๏ธ"
8
  else:
9
  processor = "๐Ÿ’ฝ"
10
  st.subheader("Running on {}".format(device + processor))
11
 
12
- st.header("๐Ÿ’ป๋‚˜๋Š” ์˜ค๋Š˜ ์–ด๋–ค MBTI์ฒ˜๋Ÿผ ๋งํ•˜๊ณ , ์‚ด์•˜์„๊นŒ?")
13
- st.write("๐Ÿค—๋ฌธ์žฅ์„ ์ž…๋ ฅํ•˜๋ฉด, ์ด๋ฅผ ๋ถ„์„ํ•ด์„œ MBTI๋ฅผ ์ถœ๋ ฅํ•ด์ค๋‹ˆ๋‹ค. ์•„์ง์€ ์˜์–ด๋งŒ ์ง€์›๋ฉ๋‹ˆ๋‹ค!")
14
- st.write("๐Ÿค”์ž‘๋™ ์›๋ฆฌ๋Š”?:")
15
- st.write("Faceook ์˜ Zero-Shot NLI ๋ชจ๋ธ์„ ํ†ตํ•ด ๋ฌธ์žฅ๊ณผ ๋‹จ์–ด์˜ ์—ฐ๊ด€์„ฑ์„ ์ถ”๋ก ํ•ฉ๋‹ˆ๋‹ค.")
16
- st.write("๋ชจ๋ธ ๋ฐ ํ”„๋กœ์ ํŠธ์— ๋Œ€ํ•ด์„œ ์ž์„ธํžˆ ์•Œ๊ณ ์‹ถ๋‹ค๋ฉด: https://github.com/ethHong/mbti_translator_demo")
17
 
18
- user_input = st.text_input("๐Ÿ‘‡๐Ÿ‘‡๋ฌธ์žฅ์„ ์ž…๋ ฅํ•˜๋ฉด MBTI๊ฐ€ ๋‚˜์˜ต๋‹ˆ๋‹ค!", "I stayed home all day")
19
- submit = st.button("๋ฌธ์žฅ ์ƒ์„ฑ")
20
 
21
  if submit:
22
- with st.spinner("AI๊ฐ€ ๊ฒฐ๊ณผ๋ฅผ ๋ถ„์„ํ•˜๋Š” ์ค‘์ด์—์š”..."):
23
  output_mbti, output_ratio = mbti_translator(
24
  user_input)
25
 
26
  st.success("Success")
27
- st.subheader("๐Ÿค”์ฐธ ์ด MBTI๊ฐ™์€ ๋ฌธ์žฅ์ด๊ตฐ์š”๐ŸŽ‰ : " + output_mbti)
28
 
29
  for result in output_ratio:
30
- plot_mbti(result)
 
2
  from BART_utils import get_prob, judge_mbti, compute_score, mbti_translator, plot_mbti, device
3
 
4
 
5
+ st.title("MBTI translator")
6
  if device == "cpu":
7
  processor = "๐Ÿ–ฅ๏ธ"
8
  else:
9
  processor = "๐Ÿ’ฝ"
10
  st.subheader("Running on {}".format(device + processor))
11
 
12
+ st.header("๐Ÿ’ปInfer my MBTI from my langauge (What I speak)")
13
+ st.write("๐Ÿค—Give any sentences: I'll try to guess your MBTI")
14
+ st.header("๐Ÿค”How it works??:")
15
+ st.write("Using Zero-Shot NLI model, it computes probability of sentence and MBTI keywords")
16
+ st.write("More about the model: https://github.com/ethHong/mbti_translator_demo")
17
 
18
+ user_input = st.text_input("๐Ÿ‘‡๐Ÿ‘‡Put your sentence here", "I stayed home all day")
19
+ submit = st.button("Generate:)
20
 
21
  if submit:
22
+ with st.spinner("AI is analysing result..."):
23
  output_mbti, output_ratio = mbti_translator(
24
  user_input)
25
 
26
  st.success("Success")
27
+ st.subheader("๐Ÿค”Probable MBTI is...๐ŸŽ‰ : " + output_mbti)
28
 
29
  for result in output_ratio:
30
+ plot_mbti(result)