taeyeol commited on
Commit
87fd85c
ยท
verified ยท
1 Parent(s): 688bbd9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +71 -150
app.py CHANGED
@@ -2,176 +2,97 @@ import gradio as gr
2
 
3
  # MBTI ์œ ํ˜•๋ณ„ ํ•ด์„
4
  mbti_interpretations = {
5
- "INTJ": "์ „๋žต๊ฐ€, ๋…์ฐฝ์ ์ด๊ณ  ๋…๋ฆฝ์ ์ธ ์‚ฌ๊ณ ๋ฅผ ๊ฐ€์ง„ ์‚ฌ๋žŒ",
6
- "INTP": "๋…ผ๋ฆฌ์ ์ธ ์‚ฌ์ƒ‰๊ฐ€, ์ด๋ก ์ ์ธ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š”๋ฐ ๋Šฅ์ˆ™",
7
- # ๋‚˜๋จธ์ง€ 14๊ฐœ ์œ ํ˜•์— ๋Œ€ํ•œ ํ•ด์„ ์ถ”๊ฐ€...
8
  }
9
 
10
- # ์‚ฌ์šฉ์ž ์‘๋‹ต์„ ๊ธฐ๋ฐ˜์œผ๋กœ MBTI ์œ ํ˜• ๊ฒฐ์ •
11
- def determine_mbti(*answers):
12
- # ์—ฌ๊ธฐ์— ๊ฐ ์งˆ๋ฌธ์— ๋Œ€ํ•œ ์‘๋‹ต์„ ๋ถ„์„ํ•˜๊ณ  MBTI ์œ ํ˜•์„ ๊ฒฐ์ •ํ•˜๋Š” ๋กœ์ง ๊ตฌํ˜„
13
- mbti_type = "INTJ" # ์˜ˆ์‹œ๋กœ INTJ๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋„๋ก ์„ค์ •
14
- interpretation = mbti_interpretations[mbti_type]
15
- return f"๋‹น์‹ ์˜ MBTI ์œ ํ˜•์€ {mbti_type}์ž…๋‹ˆ๋‹ค. {interpretation}"
16
 
17
- # Gradio ์ธํ„ฐํŽ˜์ด์Šค ๊ตฌ์„ฑ
18
  questions = [
19
  "๋‹น์‹ ์€ ์ƒˆ๋กœ์šด ์‚ฌ๋žŒ๋“ค์„ ๋งŒ๋‚  ๋•Œ ์ฃผ๋กœ ์–ด๋–ป๊ฒŒ ํ–‰๋™ํ•˜๋‚˜์š”?",
20
- # ๋‚˜๋จธ์ง€ 9๊ฐœ ์งˆ๋ฌธ ์ถ”๊ฐ€...
21
  ]
22
- options = [["์˜ต์…˜ 1", "์˜ต์…˜ 2", "์˜ต์…˜ 3", "์˜ต์…˜ 4"]] * 10 # ๊ฐ ์งˆ๋ฌธ์— ๋Œ€ํ•œ ์˜ต์…˜
23
-
24
- iface = gr.Interface(
25
- fn=determine_mbti,
26
- inputs=[gr.Radio(options[i], label=question) for i, question in enumerate(questions)],
27
- outputs="text",
28
- title="MBTI ์ง„๋‹จ ํ…Œ์ŠคํŠธ",
29
- description="10๊ฐœ์˜ ์งˆ๋ฌธ์— ๋‹ตํ•˜์—ฌ ๋‹น์‹ ์˜ MBTI ์œ ํ˜•์„ ์•Œ์•„๋ณด์„ธ์š”."
30
- )
31
-
32
- iface.launch()
33
- requirements.txt ํŒŒ์ผ ์˜ˆ์‹œ
34
- gradio
35
- huggingface_hub
36
- ์ด ์ฝ”๋“œ์™€ requirements.txt ํŒŒ์ผ์„ ์‚ฌ์šฉํ•˜์—ฌ Hugging Face Spaces์— ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž๋Š” ์›น ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ํ†ตํ•ด ์งˆ๋ฌธ์— ๋‹ตํ•˜๊ณ , ๊ทธ์— ๋”ฐ๋ฅธ MBTI ์œ ํ˜•๊ณผ ๊ฐ„๋‹จํ•œ ํ•ด์„์„ ๋ฐ›๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
37
-
38
- 10๊ฐœ ๋ชจ๋‘ ์ฑ„์›Œ์„œ ์ „์ฒด์ฝ”๋“œ ์ถœ๋ ฅํ•˜๋ผ
39
-
40
- ์•„๋ž˜๋Š” 10๊ฐœ์˜ MBTI ์ง„๋‹จ ์งˆ๋ฌธ๊ณผ ๊ฐ ์œ ํ˜•์— ๋Œ€ํ•œ ๊ฐ„๋‹จํ•œ ํ•ด์„์„ ํฌํ•จํ•œ ์ „์ฒด ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค. ์ด ์ฝ”๋“œ๋Š” Gradio๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ตฌํ˜„๋˜์—ˆ์œผ๋ฉฐ, ์‚ฌ์šฉ์ž๊ฐ€ 10๊ฐœ์˜ ์งˆ๋ฌธ์— ๋‹ตํ•œ ํ›„ ๊ทธ์— ๋”ฐ๋ฅธ MBTI ์œ ํ˜•๊ณผ ํ•ด์„์„ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.
41
-
42
- import gradio as gr
43
-
44
- # MBTI ์œ ํ˜•๋ณ„ ํ•ด์„
45
- mbti_interpretations = {
46
- "INTJ": "์ „๋žต๊ฐ€, ๋…์ฐฝ์ ์ด๊ณ  ๋…๋ฆฝ์ ์ธ ์‚ฌ๊ณ ๋ฅผ ๊ฐ€์ง„ ์‚ฌ๋žŒ",
47
- "INTP": "๋…ผ๋ฆฌ์ ์ธ ์‚ฌ์ƒ‰๊ฐ€, ์ด๋ก ์ ์ธ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š”๋ฐ ๋Šฅ์ˆ™",
48
- "ENTJ": "๋Œ€๋‹ดํ•œ ํ†ต์†”์ž, ํ™œ๋™์ ์ด๊ณ  ์ง€๋„๋ ฅ์ด ์žˆ๋Š” ์‚ฌ๋žŒ",
49
- "ENTP": "๋œจ๊ฑฐ์šด ๋…ผ์Ÿ์„ ์ฆ๊ธฐ๋Š” ๋ณ€๋ก ๊ฐ€, ์ง€์  ํ˜ธ๊ธฐ์‹ฌ์ด ๋งŽ์€ ์‚ฌ๋žŒ",
50
- "INFJ": "์„ ์˜์˜ ์˜นํ˜ธ์ž, ์กฐ์šฉํ•˜๊ณ  ์‹ ๋น„๋กœ์šด, ์˜๊ฐ์„ ์ฃผ๋Š” ์‚ฌ๋žŒ",
51
- "INFP": "์—ด์ •์ ์ธ ์ค‘์žฌ์ž, ์ฐฝ์˜์ ์ด๊ณ  ์นœ์ ˆํ•œ ์‚ฌ๋žŒ",
52
- "ENFJ": "์‚ฌ๊ต์ ์ธ ์„ ์ƒ๋‹˜, ํƒ€์ธ์„ ๋•๊ณ ์ž ํ•˜๋Š” ์‚ฌ๋žŒ",
53
- "ENFP": "์žฌ๊ธฐ๋ฐœ๋ž„ํ•œ ํ™œ๋™๊ฐ€, ์—ด์ •์ ์ด๊ณ  ์ฐฝ์˜์ ์ธ ์‚ฌ๋žŒ",
54
- "ISTJ": "์ฒญ๋ ด๊ฒฐ๋ฐฑํ•œ ๋…ผ๋ฆฌ์ฃผ์˜์ž, ์‹ค์šฉ์ ์ด๊ณ  ์‚ฌ์‹ค์— ๊ธฐ๋ฐ˜ํ•œ ์‚ฌ๋žŒ",
55
- "ISFJ": "์šฉ๊ฐํ•œ ์ˆ˜ํ˜ธ์ž, ๋ณดํ˜ธํ•˜๊ณ ์ž ํ•˜๋Š” ์‚ฌ๋žŒ",
56
- "ESTJ": "์—„๊ฒฉํ•œ ๊ด€๋ฆฌ์ž, ์งˆ์„œ์™€ ์ „ํ†ต์„ ์ค‘์‹œํ•˜๋Š” ์‚ฌ๋žŒ",
57
- "ESFJ": "์‚ฌ๊ต์ ์ธ ์™ธ๊ต๊ด€, ์นœ์ ˆํ•˜๊ณ  ์–‘์‹ฌ์ ์ธ ์‚ฌ๋žŒ",
58
- "ISTP": "๋งŒ๋Šฅ ์žฌ์ฃผ๊พผ, ํ˜ธ๊ธฐ์‹ฌ ๋งŽ๊ณ  ์‹ค์šฉ์ ์ธ ์‚ฌ๋žŒ",
59
- "ISFP": "ํ˜ธ๊ธฐ์‹ฌ ๋งŽ์€ ์˜ˆ์ˆ ๊ฐ€, ์œ ์—ฐํ•˜๊ณ  ๋งค๋ ฅ์ ์ธ ์‚ฌ๋žŒ",
60
- "ESTP": "๋ชจํ—˜์„ ์ฆ๊ธฐ๋Š” ์‚ฌ์—…๊ฐ€, ์—๋„ˆ์ง€๊ฐ€ ๋„˜์น˜๋Š” ์‚ฌ๋žŒ",
61
- "ESFP": "์ž์œ ๋กœ์šด ์˜ํ˜ผ์˜ ์—ฐ์˜ˆ์ธ, ์ฆ๊ฑฐ์›€์„ ์ถ”๊ตฌํ•˜๋Š” ์‚ฌ๋žŒ"
62
- }
63
 
64
- # ์‚ฌ์šฉ์ž ์‘๋‹ต์„ ๊ธฐ๋ฐ˜์œผ๋กœ MBTI ์œ ํ˜• ๊ฒฐ์ •
65
- def determine_mbti(*answers):
66
- # ์—ฌ๊ธฐ์— ๊ฐ ์งˆ๋ฌธ์— ๋Œ€ํ•œ ์‘๋‹ต์„ ๋ถ„์„ํ•˜๊ณ  MBTI ์œ ํ˜•์„ ๊ฒฐ์ •ํ•˜๋Š” ๋กœ์ง ๊ตฌํ˜„
67
- # ์ด ์˜ˆ์ œ์—์„œ๋Š” ๋‹จ์ˆœํ™”๋ฅผ ์œ„ํ•ด ๋ชจ๋“  ์‘๋‹ต์„ "INTJ"๋กœ ์„ค์ •
68
- mbti_type = "INTJ"
69
- interpretation = mbti_interpretations[mbti_type]
70
- return f"๋‹น์‹ ์˜ MBTI ์œ ํ˜•์€ {mbti_type}์ž…๋‹ˆ๋‹ค. {interpretation}"
 
 
71
 
72
- # Gradio ์ธํ„ฐํŽ˜์ด์Šค ๊ตฌ์„ฑ
73
- questions = [
74
- "์ƒˆ๋กœ์šด ์‚ฌ๋žŒ๋“ค์„ ๋งŒ๋‚  ๋•Œ ์ฃผ๋กœ ์–ด๋–ป๊ฒŒ ํ–‰๋™ํ•˜๋‚˜์š”?",
75
- "๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ๋•Œ ๋‹น์‹ ์˜ ์ ‘๊ทผ ๋ฐฉ์‹์€?",
76
- "์—ฌ๊ฐ€ ์‹œ๊ฐ„์„ ๋ณด๋‚ผ ๋•Œ ์„ ํ˜ธํ•˜๋Š” ํ™œ๋™์€?",
77
- "์˜์‚ฌ ๊ฒฐ๏ฟฝ๏ฟฝ๏ฟฝ์„ ํ•  ๋•Œ ๊ฐ€์žฅ ์ค‘์š”ํ•˜๊ฒŒ ์ƒ๊ฐํ•˜๋Š” ๊ฒƒ์€?",
78
- "์ŠคํŠธ๋ ˆ์Šค๋ฅผ ๋ฐ›์„ ๋•Œ ์ฃผ๋กœ ์–ด๋–ป๊ฒŒ ๋Œ€์ฒ˜ํ•˜๋‚˜์š”?",
79
- "์ƒˆ๋กœ์šด ํ”„๋กœ์ ํŠธ๋ฅผ ์‹œ์ž‘ํ•  ๋•Œ ๋‹น์‹ ์˜ ํƒœ๋„๋Š”?",
80
- "ํŒ€ ํ”„๋กœ์ ํŠธ์—์„œ ๋‹น์‹ ์˜ ์—ญํ• ์€ ์ฃผ๋กœ ๋ฌด์—‡์ธ๊ฐ€์š”?",
81
- "๋ณ€ํ™”๋ฅผ ๋Œ€ํ•  ๋•Œ ๋‹น์‹ ์˜ ํƒœ๋„๋Š”?",
82
- "ํ•™์Šตํ•  ๋•Œ ์„ ํ˜ธํ•˜๋Š” ๋ฐฉ์‹์€?",
83
- "์นœ๊ตฌ๋“ค๊ณผ์˜ ๊ด€๊ณ„์—์„œ ๋‹น์‹ ์€ ์–ด๋–ค ์‚ฌ๋žŒ์ธ๊ฐ€์š”?"
84
- ]
85
- options = [
86
- ["์˜คํ”ˆ ๋งˆ์ธ๋“œ๋กœ ์ ‘๊ทผํ•œ๋‹ค", "์กฐ์‹ฌ์Šค๋Ÿฝ๊ฒŒ ์ ‘๊ทผํ•œ๋‹ค", "์ƒํ™ฉ์„ ๊ด€์ฐฐํ•œ๋‹ค", "์ ๊ทน์ ์œผ๋กœ ์ฐธ์—ฌํ•œ๋‹ค"],
87
- ["๋…ผ๋ฆฌ์ ์œผ๋กœ ๋ถ„์„ํ•œ๋‹ค", "์ง๊ด€์„ ๋”ฐ๋ฅธ๋‹ค", "๊ฒฝํ—˜์— ์˜์กดํ•œ๋‹ค", "๊ฐ์ •์— ๋”ฐ๋ฅธ๋‹ค"],
88
- ["ํ˜ผ์ž๋งŒ์˜ ์‹œ๊ฐ„์„ ์„ ํ˜ธํ•œ๋‹ค", "์นœ๊ตฌ๋“ค๊ณผ ์–ด์šธ๋ฆฐ๋‹ค", "์ƒˆ๋กœ์šด ํ™œ๋™์„ ํƒ์ƒ‰ํ•œ๋‹ค", "์ต์ˆ™ํ•œ ํ™œ๋™์„ ์ฆ๊ธด๋‹ค"],
89
- ["์‚ฌ์‹ค๊ณผ ๋ฐ์ดํ„ฐ", "์ง๊ด€๊ณผ ๊ฐ€๋Šฅ์„ฑ", "ํƒ€์ธ์˜ ์˜๊ฒฌ", "๊ฐœ์ธ์˜ ๊ฐ€์น˜"],
90
- ["ํ™œ๋™์ ์œผ๋กœ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•œ๋‹ค", "ํ˜ผ์ž๋งŒ์˜ ์‹œ๊ฐ„์„ ๊ฐ–๋Š”๋‹ค", "์นœ๊ตฌ๋“ค๊ณผ ์ด์•ผ๊ธฐํ•œ๋‹ค", "๊ฐ์ •์„ ํ‘œํ˜„ํ•œ๋‹ค"],
91
- ["๊ณ„ํš์„ ์„ธ์šด๋‹ค", "์ฆ‰ํฅ์ ์œผ๋กœ ํ–‰๋™ํ•œ๋‹ค", "์•„์ด๋””์–ด๋ฅผ ๋ชจ์€๋‹ค", "๊ฒฝํ—˜์— ์˜์กดํ•œ๋‹ค"],
92
- ["๋ฆฌ๋”", "์กฐ์–ธ์ž", "์‹คํ–‰์ž", "์ง€์›์ž"],
93
- ["๋ณ€ํ™”๋ฅผ ํ™˜์˜ํ•œ๋‹ค", "๋ณ€ํ™”์— ์ €ํ•ญํ•œ๋‹ค", "์ƒํ™ฉ์— ๋”ฐ๋ผ ๋‹ค๋ฅด๋‹ค", "๋ฌด๊ด€์‹ฌํ•˜๋‹ค"],
94
- ["์‹œ๊ฐ์  ์ž๋ฃŒ", "์ฒญ๊ฐ์  ์ž๋ฃŒ", "์‹ค์Šต", "ํ† ๋ก ๊ณผ ๋Œ€ํ™”"],
95
- ["๋ฆฌ๋”", "์กฐ์–ธ์ž", "๋ถ„์œ„๊ธฐ ๋ฉ”์ด์ปค", "๋“ฌ์งํ•œ ์ง€์›์ž"]
96
- ]
97
 
98
- iface = gr.Interface(
99
- fn=determine_mbti,
100
- inputs=[gr.Radio(options[i], label=question) for i, question in enumerate(questions)],
101
- outputs="text",
102
- title="MBTI ์ง„๋‹จ ํ…Œ์ŠคํŠธ",
103
- description="10๊ฐœ์˜ ์งˆ๋ฌธ์— ๋‹ตํ•˜์—ฌ ๋‹น์‹ ์˜ MBTI ์œ ํ˜•์„ ์•Œ์•„๋ณด์„ธ์š”."
104
- )
105
 
106
- iface.launch()
107
- ์ด ์ฝ”๋“œ๋Š” ์‚ฌ์šฉ์ž๊ฐ€ 10๊ฐœ์˜ ์งˆ๋ฌธ์— ๋Œ€ํ•ด ์„ ํƒํ•œ ๋‹ต๋ณ€์„ ๊ธฐ๋ฐ˜์œผ๋กœ MBTI ์œ ํ˜•์„ ๊ฒฐ์ •ํ•˜๊ณ , ํ•ด๋‹น ์œ ํ˜•์— ๋Œ€ํ•œ ๊ฐ„๋‹จํ•œ ํ•ด์„์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์‹ค์ œ MBTI ์œ ํ˜•์„ ๊ฒฐ์ •ํ•˜๋Š” ๋กœ์ง์€ ๋ณต์žกํ•˜๋ฉฐ, ์—ฌ๊ธฐ์„œ๋Š” ์˜ˆ์‹œ๋กœ ๋ชจ๋“  ์‘๋‹ต์„ "INTJ"๋กœ ์„ค์ •ํ–ˆ์Šต๋‹ˆ๋‹ค. ์‹ค์ œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ๋Š” ์‚ฌ์šฉ์ž์˜ ์‘๋‹ต์„ ๋ถ„์„ํ•˜์—ฌ ๋‹ค์–‘ํ•œ MBTI ์œ ํ˜• ์ค‘ ํ•˜๋‚˜๋ฅผ ๊ฒฐ์ •ํ•˜๋Š” ๋กœ์ง์„ ๊ตฌํ˜„ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
108
-
109
- ๊ฐ๊ด€์‹ ์„ ํƒ์—์„œ ์œ ํ˜•์„ ํ‘œ์‹œํ•˜์ง€ ๋ง๊ตฌ ์ถœ๋ ฅํ•ด์ค˜
110
 
111
- ์•„๋ž˜๋Š” ์ˆ˜์ •๋œ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค. ์ด๋ฒˆ์—๋Š” ๊ฐ ์งˆ๋ฌธ์— ๋Œ€ํ•œ ๊ฐ๊ด€์‹ ์„ ํƒ์ง€์—์„œ MBTI ์œ ํ˜•์„ ์ง์ ‘ ํ‘œ์‹œํ•˜์ง€ ์•Š๊ณ , ์‚ฌ์šฉ์ž๊ฐ€ ์„ ํƒํ•œ ๋‹ต๋ณ€์„ ๊ธฐ๋ฐ˜์œผ๋กœ MBTI ์œ ํ˜•์„ ๊ฒฐ์ •ํ•˜๋Š” ๋กœ์ง์„ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค. ์œ ํ˜• ๊ฒฐ์ • ๋กœ์ง์€ ์˜ˆ์‹œ๋กœ ๊ฐ„๋‹จํ•˜๊ฒŒ ์ฒ˜๋ฆฌ๋˜์—ˆ์œผ๋ฉฐ, ์‹ค์ œ๋กœ๋Š” ๋” ๋ณต์žกํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜์ด ํ•„์š”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
112
 
113
  import gradio as gr
114
 
115
  # MBTI ์œ ํ˜•๋ณ„ ํ•ด์„
116
  mbti_interpretations = {
117
- "INTJ": "์ „๋žต๊ฐ€, ๋…์ฐฝ์ ์ด๊ณ  ๋…๋ฆฝ์ ์ธ ์‚ฌ๊ณ ๋ฅผ ๊ฐ€์ง„ ์‚ฌ๋žŒ",
118
- "INTP": "๋…ผ๋ฆฌ์ ์ธ ์‚ฌ์ƒ‰๊ฐ€, ์ด๋ก ์ ์ธ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š”๋ฐ ๋Šฅ์ˆ™",
119
- "ENTJ": "๋Œ€๋‹ดํ•œ ํ†ต์†”์ž, ํ™œ๋™์ ์ด๊ณ  ์ง€๋„๋ ฅ์ด ์žˆ๋Š” ์‚ฌ๋žŒ",
120
- "ENTP": "๋œจ๊ฑฐ์šด ๋…ผ์Ÿ์„ ์ฆ๊ธฐ๋Š” ๋ณ€๋ก ๊ฐ€, ์ง€์  ํ˜ธ๊ธฐ์‹ฌ์ด ๋งŽ์€ ์‚ฌ๋žŒ",
121
- "INFJ": "์„ ์˜์˜ ์˜นํ˜ธ์ž, ์กฐ์šฉํ•˜๊ณ  ์‹ ๋น„๋กœ์šด, ์˜๊ฐ์„ ์ฃผ๋Š” ์‚ฌ๋žŒ",
122
- "INFP": "์—ด์ •์ ์ธ ์ค‘์žฌ์ž, ์ฐฝ์˜์ ์ด๊ณ  ์นœ์ ˆํ•œ ์‚ฌ๋žŒ",
123
- "ENFJ": "์‚ฌ๊ต์ ์ธ ์„ ์ƒ๋‹˜, ํƒ€์ธ์„ ๋•๊ณ ์ž ํ•˜๋Š” ์‚ฌ๋žŒ",
124
- "ENFP": "์žฌ๊ธฐ๋ฐœ๋ž„ํ•œ ํ™œ๋™๊ฐ€, ์—ด์ •์ ์ด๊ณ  ์ฐฝ์˜์ ์ธ ์‚ฌ๋žŒ",
125
- "ISTJ": "์ฒญ๋ ด๊ฒฐ๋ฐฑํ•œ ๋…ผ๋ฆฌ์ฃผ์˜์ž, ์‹ค์šฉ์ ์ด๊ณ  ์‚ฌ์‹ค์— ๊ธฐ๋ฐ˜ํ•œ ์‚ฌ๋žŒ",
126
- "ISFJ": "์šฉ๊ฐํ•œ ์ˆ˜ํ˜ธ์ž, ๋ณดํ˜ธํ•˜๊ณ ์ž ํ•˜๋Š” ์‚ฌ๋žŒ",
127
- "ESTJ": "์—„๊ฒฉํ•œ ๊ด€๋ฆฌ์ž, ์งˆ์„œ์™€ ์ „ํ†ต์„ ์ค‘์‹œํ•˜๋Š” ์‚ฌ๋žŒ",
128
- "ESFJ": "์‚ฌ๊ต์ ์ธ ์™ธ๊ต๊ด€, ์นœ์ ˆํ•˜๊ณ  ์–‘์‹ฌ์ ์ธ ์‚ฌ๋žŒ",
129
- "ISTP": "๋งŒ๋Šฅ ์žฌ์ฃผ๊พผ, ํ˜ธ๊ธฐ์‹ฌ ๋งŽ๊ณ  ์‹ค์šฉ์ ์ธ ์‚ฌ๋žŒ",
130
- "ISFP": "ํ˜ธ๊ธฐ์‹ฌ ๋งŽ์€ ์˜ˆ์ˆ ๊ฐ€, ์œ ์—ฐํ•˜๊ณ  ๋งค๋ ฅ์ ์ธ ์‚ฌ๋žŒ",
131
- "ESTP": "๋ชจํ—˜์„ ์ฆ๊ธฐ๋Š” ์‚ฌ์—…๊ฐ€, ์—๋„ˆ์ง€๊ฐ€ ๋„˜์น˜๋Š” ์‚ฌ๋žŒ",
132
- "ESFP": "์ž์œ ๋กœ์šด ์˜ํ˜ผ์˜ ์—ฐ์˜ˆ์ธ, ์ฆ๊ฑฐ์›€์„ ์ถ”๊ตฌํ•˜๋Š” ์‚ฌ๋žŒ"
133
  }
134
 
135
- # ์‚ฌ์šฉ์ž ์‘๋‹ต์„ ๊ธฐ๋ฐ˜์œผ๋กœ MBTI ์œ ํ˜• ๊ฒฐ์ •
136
- def determine_mbti(*answers):
137
- # ์—ฌ๊ธฐ์— ๊ฐ ์งˆ๋ฌธ์— ๋Œ€ํ•œ ์‘๋‹ต์„ ๋ถ„์„ํ•˜๊ณ  MBTI ์œ ํ˜•์„ ๊ฒฐ์ •ํ•˜๋Š” ๋กœ์ง ๊ตฌํ˜„
138
- # ์ด ์˜ˆ์ œ์—์„œ๋Š” ๋‹จ์ˆœํ™”๋ฅผ ์œ„ํ•ด ๋ชจ๋“  ์‘๋‹ต์„ "INTJ"๋กœ ์„ค์ •
139
- mbti_type = "INTJ"
140
- interpretation = mbti_interpretations[mbti_type]
141
- return f"๋‹น์‹ ์˜ MBTI ์œ ํ˜•์€ {mbti_type}์ž…๋‹ˆ๋‹ค. {interpretation}"
142
 
143
- # Gradio ์ธํ„ฐํŽ˜์ด์Šค ๊ตฌ์„ฑ
144
  questions = [
145
  "์ƒˆ๋กœ์šด ์‚ฌ๋žŒ๋“ค์„ ๋งŒ๋‚  ๋•Œ ์ฃผ๋กœ ์–ด๋–ป๊ฒŒ ํ–‰๋™ํ•˜๋‚˜์š”?",
146
- "๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ๋•Œ ๋‹น์‹ ์˜ ์ ‘๊ทผ ๋ฐฉ์‹์€?",
147
- "์—ฌ๊ฐ€ ์‹œ๊ฐ„์„ ๋ณด๋‚ผ ๋•Œ ์„ ํ˜ธํ•˜๋Š” ํ™œ๋™์€?",
148
- "์˜์‚ฌ ๊ฒฐ์ •์„ ํ•  ๋•Œ ๊ฐ€์žฅ ์ค‘์š”ํ•˜๊ฒŒ ์ƒ๊ฐํ•˜๋Š” ๊ฒƒ์€?",
149
- "์ŠคํŠธ๋ ˆ์Šค๋ฅผ ๋ฐ›์„ ๋•Œ ์ฃผ๋กœ ์–ด๋–ป๊ฒŒ ๋Œ€์ฒ˜ํ•˜๋‚˜์š”?",
150
- "์ƒˆ๋กœ์šด ํ”„๋กœ์ ํŠธ๋ฅผ ์‹œ์ž‘ํ•  ๋•Œ ๋‹น์‹ ์˜ ํƒœ๋„๋Š”?",
151
- "ํŒ€ ํ”„๋กœ์ ํŠธ์—์„œ ๋‹น์‹ ์˜ ์—ญํ• ์€ ์ฃผ๋กœ ๋ฌด์—‡์ธ๊ฐ€์š”?",
152
- "๋ณ€ํ™”๋ฅผ ๋Œ€ํ•  ๋•Œ ๋‹น์‹ ์˜ ํƒœ๋„๋Š”?",
153
- "ํ•™์Šตํ•  ๋•Œ ์„ ํ˜ธํ•˜๋Š” ๋ฐฉ์‹์€?",
154
- "์นœ๊ตฌ๋“ค๊ณผ์˜ ๊ด€๊ณ„์—์„œ ๋‹น์‹ ์€ ์–ด๋–ค ์‚ฌ๋žŒ์ธ๊ฐ€์š”?"
155
  ]
156
- options = [
157
- ["์˜คํ”ˆ ๋งˆ์ธ๋“œ๋กœ ์ ‘๊ทผํ•œ๋‹ค", "์กฐ์‹ฌ์Šค๋Ÿฝ๊ฒŒ ์ ‘๊ทผํ•œ๋‹ค", "์ƒํ™ฉ์„ ๊ด€์ฐฐํ•œ๋‹ค", "์ ๊ทน์ ์œผ๋กœ ์ฐธ์—ฌํ•œ๋‹ค"],
158
- ["๋…ผ๋ฆฌ์ ์œผ๋กœ ๋ถ„์„ํ•œ๋‹ค", "์ง๊ด€์„ ๋”ฐ๋ฅธ๋‹ค", "๊ฒฝํ—˜์— ์˜์กดํ•œ๋‹ค", "๊ฐ์ •์— ๋”ฐ๋ฅธ๋‹ค"],
159
- ["ํ˜ผ์ž๋งŒ์˜ ์‹œ๊ฐ„์„ ์„ ํ˜ธํ•œ๋‹ค", "์นœ๊ตฌ๋“ค๊ณผ ์–ด์šธ๋ฆฐ๋‹ค", "์ƒˆ๋กœ์šด ํ™œ๋™์„ ํƒ์ƒ‰ํ•œ๋‹ค", "์ต์ˆ™ํ•œ ํ™œ๋™์„ ์ฆ๊ธด๋‹ค"],
160
- ["์‚ฌ์‹ค๊ณผ ๋ฐ์ดํ„ฐ", "์ง๊ด€๊ณผ ๊ฐ€๋Šฅ์„ฑ", "ํƒ€์ธ์˜ ์˜๊ฒฌ", "๊ฐœ์ธ์˜ ๊ฐ€์น˜"],
161
- ["ํ™œ๋™์ ์œผ๋กœ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•œ๋‹ค", "ํ˜ผ์ž๋งŒ์˜ ์‹œ๊ฐ„์„ ๊ฐ–๋Š”๋‹ค", "์นœ๊ตฌ๋“ค๊ณผ ์ด์•ผ๊ธฐํ•œ๋‹ค", "๊ฐ์ •์„ ํ‘œํ˜„ํ•œ๋‹ค"],
162
- ["๊ณ„ํš์„ ์„ธ์šด๋‹ค", "์ฆ‰ํฅ์ ์œผ๋กœ ํ–‰๋™ํ•œ๋‹ค", "์•„์ด๋””์–ด๋ฅผ ๋ชจ์€๋‹ค", "๊ฒฝํ—˜์— ์˜์กดํ•œ๋‹ค"],
163
- ["๋ฆฌ๋”", "์กฐ์–ธ์ž", "์‹คํ–‰์ž", "์ง€์›์ž"],
164
- ["๋ณ€ํ™”๋ฅผ ํ™˜์˜ํ•œ๋‹ค", "๋ณ€ํ™”์— ์ €ํ•ญํ•œ๋‹ค", "์ƒํ™ฉ์— ๋”ฐ๋ผ ๋‹ค๋ฅด๋‹ค", "๋ฌด๊ด€์‹ฌํ•˜๋‹ค"],
165
- ["์‹œ๊ฐ์  ์ž๋ฃŒ", "์ฒญ๊ฐ์  ์ž๋ฃŒ", "์‹ค์Šต", "ํ† ๋ก ๊ณผ ๋Œ€ํ™”"],
166
- ["๋ฆฌ๋”", "์กฐ์–ธ์ž", "๋ถ„์œ„๊ธฐ ๋ฉ”์ด์ปค", "๋“ฌ์งํ•œ ์ง€์›์ž"]
167
- ]
168
-
169
- iface = gr.Interface(
170
- fn=determine_mbti,
171
- inputs=[gr.Radio(options[i], label=question) for i, question in enumerate(questions)],
172
- outputs="text",
173
- title="MBTI ์ง„๋‹จ ํ…Œ์ŠคํŠธ",
174
- description="10๊ฐœ์˜ ์งˆ๋ฌธ์— ๋‹ตํ•˜์—ฌ ๋‹น์‹ ์˜ MBTI ์œ ํ˜•์„ ์•Œ์•„๋ณด์„ธ์š”."
175
- )
176
 
177
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  # MBTI ์œ ํ˜•๋ณ„ ํ•ด์„
4
  mbti_interpretations = {
5
+ "INTJ": "์ „๋žต๊ฐ€: ํ˜์‹ ์ ์ด๊ณ  ๋…๋ฆฝ์ ์ธ ์‚ฌ๊ณ ๋ฅผ ๊ฐ€์ง„ ๋น„์ „์˜ ์ฐฝ์กฐ์ž์ž…๋‹ˆ๋‹ค.",
6
+ "INFP": "์ค‘์žฌ์ž: ์ด์ƒ์ ์ด๊ณ  ์ฐฝ์˜์ ์ธ, ํ•ญ์ƒ ์„ ์„ ์ถ”๊ตฌํ•˜๋Š” ์‚ฌ๋žŒ์ž…๋‹ˆ๋‹ค.",
7
+ # ๋‚˜๋จธ์ง€ 14๊ฐœ ์œ ํ˜•์— ๋Œ€ํ•œ ํ•ด์„์„ ์—ฌ๊ธฐ์— ์ถ”๊ฐ€ํ•˜์„ธ์š”.
8
  }
9
 
10
+ def calculate_mbti(*answers):
11
+ # ์—ฌ๊ธฐ์— ์‚ฌ์šฉ์ž์˜ ๋‹ต๋ณ€์„ ๊ธฐ๋ฐ˜์œผ๋กœ MBTI ์œ ํ˜•์„ ๊ณ„์‚ฐํ•˜๋Š” ๋กœ์ง์„ ๊ตฌํ˜„ํ•˜์„ธ์š”.
12
+ # ์ด ์˜ˆ์‹œ์—์„œ๋Š” ๋‹จ์ˆœํ™”๋ฅผ ์œ„ํ•ด "INTJ"๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋„๋ก ์„ค์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
13
+ mbti_type = "INTJ"
14
+ return mbti_type, mbti_interpretations[mbti_type]
 
15
 
16
+ # ์งˆ๋ฌธ ๋ฆฌ์ŠคํŠธ
17
  questions = [
18
  "๋‹น์‹ ์€ ์ƒˆ๋กœ์šด ์‚ฌ๋žŒ๋“ค์„ ๋งŒ๋‚  ๋•Œ ์ฃผ๋กœ ์–ด๋–ป๊ฒŒ ํ–‰๋™ํ•˜๋‚˜์š”?",
19
+ # ๋‚˜๋จธ์ง€ 9๊ฐœ ์งˆ๋ฌธ์„ ์—ฌ๊ธฐ์— ์ถ”๊ฐ€ํ•˜์„ธ์š”.
20
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
+ # Gradio ์•ฑ ์ •์˜
23
+ with gr.Blocks() as app:
24
+ gr.Markdown("# MBTI ์ง„๋‹จ ํ…Œ์ŠคํŠธ")
25
+ # ๊ฐ ์งˆ๋ฌธ์— ๋Œ€ํ•œ ๋‹ต๋ณ€์„ ์ž…๋ ฅ๋ฐ›๋Š” ๋ผ๋””์˜ค ๋ฒ„ํŠผ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
26
+ answers = [gr.Radio(["์˜ต์…˜ 1", "์˜ต์…˜ 2", "์˜ต์…˜ 3"], label=question) for question in questions]
27
+ submit_button = gr.Button("๊ฒฐ๊ณผ ๋ณด๊ธฐ")
28
+ output = gr.Textbox(label="๋‹น์‹ ์˜ MBTI ์œ ํ˜•")
29
+
30
+ submit_button.click(fn=calculate_mbti, inputs=answers, outputs=[output])
31
 
32
+ # ์•ฑ ์‹คํ–‰
33
+ if __name__ == "__main__":
34
+ app.launch()
35
+ ์ด ์ฝ”๋“œ๋Š” MBTI ์œ ํ˜•์„ ๊ฒฐ์ •ํ•˜๋Š” ๋กœ์ง์„ ๋‹จ์ˆœํ™”ํ•˜์—ฌ ๊ตฌํ˜„ํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์‹ค์ œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ๋Š” ์‚ฌ์šฉ์ž์˜ ๋‹ต๋ณ€์„ ๋ถ„์„ํ•˜์—ฌ ์ •ํ™•ํ•œ MBTI ์œ ํ˜•์„ ๊ณ„์‚ฐํ•˜๋Š” ๋” ๋ณต์žกํ•œ ๋กœ์ง์ด ํ•„์š”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ, ๋ชจ๋“  MBTI ์œ ํ˜•์— ๋Œ€ํ•œ ํ•ด์„์„ mbti_interpretations ๋”•์…”๋„ˆ๋ฆฌ์— ์ถ”๊ฐ€ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
+ ์ด ์˜ˆ์‹œ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์ „์—, gradio ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”. ํ•„์š”ํ•œ ๊ฒฝ์šฐ, pip install gradio ๋ช…๋ น์„ ์‚ฌ์šฉํ•˜์—ฌ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
 
 
 
 
 
 
38
 
39
+ 10๊ฐœ ๋ชจ๋‘ ์ฑ„์›Œ์„œ ์ „์ฒด์ฝ”๋“œ ์ถœ๋ ฅํ•˜๋ผ
 
 
 
40
 
41
+ ์•„๋ž˜๋Š” MBTI ์ง„๋‹จ ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•œ Gradio ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์ „์ฒด ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค. ์ด ์ฝ”๋“œ๋Š” ์‚ฌ์šฉ์ž๋กœ๋ถ€ํ„ฐ 10๊ฐœ์˜ ๊ฐ๊ด€์‹ ์งˆ๋ฌธ์— ๋Œ€ํ•œ ๋‹ต๋ณ€์„ ๋ฐ›์•„, ๊ทธ์— ๋”ฐ๋ฅธ MBTI ์œ ํ˜•์„ ๋ถ„์„ํ•˜์—ฌ ๊ฒฐ๊ณผ์™€ ํ•จ๊ป˜ ๊ฐ„๋‹จํ•œ ํ•ด์„์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
42
 
43
  import gradio as gr
44
 
45
  # MBTI ์œ ํ˜•๋ณ„ ํ•ด์„
46
  mbti_interpretations = {
47
+ "INTJ": "์ „๋žต๊ฐ€: ํ˜์‹ ์ ์ด๊ณ  ๋…๋ฆฝ์ ์ธ ์‚ฌ๊ณ ๋ฅผ ๊ฐ€์ง„ ๋น„์ „์˜ ์ฐฝ์กฐ์ž์ž…๋‹ˆ๋‹ค.",
48
+ "INFP": "์ค‘์žฌ์ž: ์ด์ƒ์ ์ด๊ณ  ์ฐฝ์˜์ ์ธ, ํ•ญ์ƒ ์„ ์„ ์ถ”๊ตฌํ•˜๋Š” ์‚ฌ๋žŒ์ž…๋‹ˆ๋‹ค.",
49
+ "INFJ": "์˜นํ˜ธ์ž: ์กฐ์šฉํ•˜๊ณ  ์‹ ๋น„๋กœ์šด, ์˜๊ฐ์„ ์ฃผ๋Š” ์ด์ƒ์ฃผ์˜์ž์ž…๋‹ˆ๋‹ค.",
50
+ "INTP": "๋…ผ๋ฆฌํ•™์ž: ํ˜์‹ ์ ์ธ ๋ฐœ๋ช…๊ฐ€๋กœ, ๋…์ฐฝ์ ์ธ ์ง€์‹์„ ์ถ”๊ตฌํ•ฉ๋‹ˆ๋‹ค.",
51
+ "ENTJ": "ํ†ต์†”์ž: ๋Œ€๋‹ดํ•˜๊ณ  ์ƒ์ƒ๋ ฅ์ด ํ’๋ถ€ํ•˜๋ฉฐ, ํ•ญ์ƒ ๋ชฉํ‘œ๋ฅผ ํ–ฅํ•ด ๋‚˜์•„๊ฐ‘๋‹ˆ๋‹ค.",
52
+ "ENFP": "ํ™œ๋™๊ฐ€: ์—ด์ •์ ์ด๊ณ  ์ฐฝ์˜์ ์œผ๋กœ, ์ž์œ ๋กœ์šด ์˜ํ˜ผ์„ ๊ฐ€์ง„ ์‚ฌ๋žŒ์ž…๋‹ˆ๋‹ค.",
53
+ "ENFJ": "์„ ๋„์ž: ์นด๋ฆฌ์Šค๋งˆ์™€ ์˜๊ฐ์„ ์ฃผ๋Š” ๋ฆฌ๋”, ํƒ€์ธ์˜ ์„ฑ์žฅ์„ ๋•์Šต๋‹ˆ๋‹ค.",
54
+ "ENTP": "๋ณ€๋ก ๊ฐ€: ๋˜‘๋˜‘ํ•˜๊ณ  ํ˜ธ๊ธฐ์‹ฌ์ด ๋งŽ์œผ๋ฉฐ, ์ง€์  ๋„์ „์„ ์ฆ๊น๋‹ˆ๋‹ค.",
55
+ "ISFJ": "์ˆ˜ํ˜ธ์ž: ์„ธ์‹ฌํ•˜๊ณ  ํ—Œ์‹ ์ ์ด๋ฉฐ, ๋”ฐ๋œปํ•œ ๋ณดํ˜ธ์ž์ž…๋‹ˆ๋‹ค.",
56
+ "ISTJ": "๋…ผ๋ฆฌ์ฃผ์˜์ž: ์‹ค์šฉ์ ์ด๊ณ  ์‚ฌ์‹ค์— ๊ธฐ๋ฐ˜ํ•œ ๊ฒฐ์ •์„ ๋‚ด๋ฆฝ๋‹ˆ๋‹ค.",
57
+ "ISFP": "๋ชจํ—˜๊ฐ€: ์œ ์—ฐํ•˜๊ณ  ๋งค๋ ฅ์ ์ด๋ฉฐ, ์ƒˆ๋กœ์šด ๊ฒฝํ—˜์„ ์ฆ๊น๋‹ˆ๋‹ค.",
58
+ "ISTP": "์žฅ์ธ: ์‹คํ—˜์„ ์ฆ๊ธฐ๊ณ  ์†์œผ๋กœ ๋งŒ๋“œ๋Š” ๊ฒƒ์„ ์ข‹์•„ํ•˜๋Š” ์‚ฌ๋žŒ์ž…๋‹ˆ๋‹ค.",
59
+ "ESFJ": "์‚ฌ๊ต์ ์ธ ์™ธ๊ต๊ด€: ํ˜‘๋ ฅ์ ์ด๊ณ  ๋”ฐ๋œปํ•˜๋ฉฐ, ํƒ€์ธ๊ณผ์˜ ์กฐํ™”๋ฅผ ์ค‘์‹œํ•ฉ๋‹ˆ๋‹ค.",
60
+ "ESTJ": "๊ฒฝ์˜์ž: ์งˆ์„œ์ •์—ฐํ•˜๊ณ  ์ฑ…์ž„๊ฐ์ด ๊ฐ•ํ•˜๋ฉฐ, ์‚ฌ๋ฌผ์„ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐ ๋Šฅ์ˆ™ํ•ฉ๋‹ˆ๋‹ค.",
61
+ "ESFP": "์—ฐ์˜ˆ์ธ: ์‚ฌ๊ต์ ์ด๊ณ  ํ™œ๋™์ ์ด๋ฉฐ, ์ฆ๊ฑฐ์›€์„ ์ถ”๊ตฌํ•˜๋Š” ์‚ฌ๋žŒ์ž…๋‹ˆ๋‹ค.",
62
+ "ESTP": "์‚ฌ์—…๊ฐ€: ์—๋„ˆ์ง€๊ฐ€ ๋„˜์น˜๊ณ  ๋Œ€๋‹ดํ•˜๋ฉฐ, ํ–‰๋™์œผ๋กœ ์ƒ๊ฐ์„ ์˜ฎ๊น๋‹ˆ๋‹ค."
63
  }
64
 
65
+ def calculate_mbti(q1, q2, q3, q4, q5, q6, q7, q8, q9, q10):
66
+ # ๋‹จ์ˆœํ™”๋œ MBTI ์œ ํ˜• ๊ณ„์‚ฐ ๋กœ์ง
67
+ # ์‹ค์ œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ๋Š” ์‚ฌ์šฉ์ž์˜ ๋‹ต๋ณ€์„ ๋ถ„์„ํ•˜์—ฌ ์ •ํ™•ํ•œ MBTI ์œ ํ˜•์„ ๊ณ„์‚ฐํ•˜๋Š” ๋กœ์ง์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
68
+ # ์—ฌ๊ธฐ์„œ๋Š” ๋ชจ๋“  ๋‹ต๋ณ€์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ฌด์ž‘์œ„๋กœ MBTI ์œ ํ˜•์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
69
+ mbti_type = "INTJ" # ์˜ˆ์‹œ๋กœ INTJ๋ฅผ ์„ ํƒ
70
+ return mbti_type, mbti_interpretations[mbti_type]
 
71
 
72
+ # ์งˆ๋ฌธ ๋ฆฌ์ŠคํŠธ
73
  questions = [
74
  "์ƒˆ๋กœ์šด ์‚ฌ๋žŒ๋“ค์„ ๋งŒ๋‚  ๋•Œ ์ฃผ๋กœ ์–ด๋–ป๊ฒŒ ํ–‰๋™ํ•˜๋‚˜์š”?",
75
+ "๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ๋•Œ ์–ด๋–ค ์ ‘๊ทผ ๋ฐฉ์‹์„ ์„ ํ˜ธํ•˜๋‚˜์š”?",
76
+ "์—ฌ๊ฐ€ ์‹œ๊ฐ„์„ ์–ด๋–ป๊ฒŒ ๋ณด๋‚ด๋Š” ๊ฒƒ์„ ์„ ํ˜ธํ•˜๋‚˜์š”?",
77
+ "์˜์‚ฌ ๊ฒฐ์ •์„ ํ•  ๋•Œ ๋ฌด์—‡์„ ๋” ์ค‘์š”ํ•˜๊ฒŒ ์—ฌ๊ธฐ๋‚˜์š”?",
78
+ "ํŒ€ ํ”„๋กœ์ ํŠธ๋ฅผ ํ•  ๋•Œ ์–ด๋–ค ์—ญํ• ์„ ์„ ํ˜ธํ•˜๋‚˜์š”?",
79
+ "์ƒˆ๋กœ์šด ์•„์ด๋””์–ด๋‚˜ ํ”„๋กœ์ ํŠธ์— ๋Œ€ํ•ด ์–ด๋–ป๊ฒŒ ๋Š๋ผ๋‚˜์š”?",
80
+ "์ŠคํŠธ๋ ˆ์Šค๋ฅผ ๋ฐ›์„ ๋•Œ ์–ด๋–ป๊ฒŒ ๋Œ€์ฒ˜ํ•˜๋‚˜์š”?",
81
+ "ํ•™์Šตํ•  ๋•Œ ์–ด๋–ค ๋ฐฉ์‹์„ ์„ ํ˜ธํ•˜๋‚˜์š”?",
82
+ "์ผ์ƒ์—์„œ ์–ด๋–ค ๊ฒƒ๋“ค์— ๊ฐ€์žฅ ๊ฐ€์น˜๋ฅผ ๋‘๋‚˜์š”?",
83
+ "๋ณ€ํ™”์— ๋Œ€ํ•ด ์–ด๋–ป๊ฒŒ ๋ฐ˜์‘ํ•˜๋‚˜์š”?"
84
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
 
86
+ # Gradio ์•ฑ ์ •์˜
87
+ with gr.Blocks() as app:
88
+ gr.Markdown("# MBTI ์ง„๋‹จ ํ…Œ์ŠคํŠธ")
89
+ # ๊ฐ ์งˆ๋ฌธ์— ๋Œ€ํ•œ ๋‹ต๋ณ€์„ ์ž…๋ ฅ๋ฐ›๋Š” ๋ผ๋””์˜ค ๋ฒ„ํŠผ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
90
+ answers = [gr.Radio(["์˜ต์…˜ 1", "์˜ต์…˜ 2", "์˜ต์…˜ 3"], label=question) for question in questions]
91
+ submit_button = gr.Button("๊ฒฐ๊ณผ ๋ณด๊ธฐ")
92
+ output_mbti, output_interpretation = gr.Textbox(label="๋‹น์‹ ์˜ MBTI ์œ ํ˜•"), gr.Textbox(label="์œ ํ˜• ํ•ด์„")
93
+
94
+ submit_button.click(fn=calculate_mbti, inputs=answers, outputs=[output_mbti, output_interpretation])
95
+
96
+ # ์•ฑ ์‹คํ–‰
97
+ if __name__ == "__main__":
98
+ app.launch()