Update app.py
Browse files
app.py
CHANGED
|
@@ -30,7 +30,7 @@ questions = [
|
|
| 30 |
mbti_types = {
|
| 31 |
"INTJ": {"description": "전략적인 사고가 뛰어난 사람입니다.", "jobs": ["분석가", "과학자"], "good_match": ["ENTP", "ENTJ"], "bad_match": ["ESFP", "ESTP"]},
|
| 32 |
"ENTP": {"description": "창의적이고 빠르게 적응하는 성격입니다.", "jobs": ["마케터", "창업가"], "good_match": ["INTJ", "INFJ"], "bad_match": ["ISFJ", "ISTJ"]},
|
| 33 |
-
#
|
| 34 |
}
|
| 35 |
|
| 36 |
def calculate_mbti_responses(responses):
|
|
@@ -72,10 +72,12 @@ def calculate_mbti_responses(responses):
|
|
| 72 |
|
| 73 |
def mbti_analysis(responses):
|
| 74 |
mbti_code, percentages = calculate_mbti_responses(responses)
|
| 75 |
-
analysis = mbti_types.get(mbti_code, {
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
|
|
|
|
|
|
| 79 |
|
| 80 |
result = {
|
| 81 |
"MBTI 유형": mbti_code,
|
|
@@ -93,7 +95,7 @@ def interface(*responses):
|
|
| 93 |
return json.dumps(result, ensure_ascii=False, indent=4), json.dumps(percentages, ensure_ascii=False, indent=4)
|
| 94 |
|
| 95 |
inputs = [
|
| 96 |
-
gr.Slider(minimum=1, maximum=5, step=1, label=f"질문 {i+1}") for i in range(len(questions))
|
| 97 |
]
|
| 98 |
|
| 99 |
demo = gr.Interface(
|
|
@@ -108,4 +110,4 @@ demo = gr.Interface(
|
|
| 108 |
)
|
| 109 |
|
| 110 |
if __name__ == "__main__":
|
| 111 |
-
demo.launch()
|
|
|
|
| 30 |
mbti_types = {
|
| 31 |
"INTJ": {"description": "전략적인 사고가 뛰어난 사람입니다.", "jobs": ["분석가", "과학자"], "good_match": ["ENTP", "ENTJ"], "bad_match": ["ESFP", "ESTP"]},
|
| 32 |
"ENTP": {"description": "창의적이고 빠르게 적응하는 성격입니다.", "jobs": ["마케터", "창업가"], "good_match": ["INTJ", "INFJ"], "bad_match": ["ISFJ", "ISTJ"]},
|
| 33 |
+
# 모든 16개 유형 정의 필요
|
| 34 |
}
|
| 35 |
|
| 36 |
def calculate_mbti_responses(responses):
|
|
|
|
| 72 |
|
| 73 |
def mbti_analysis(responses):
|
| 74 |
mbti_code, percentages = calculate_mbti_responses(responses)
|
| 75 |
+
analysis = mbti_types.get(mbti_code, {
|
| 76 |
+
"description": "유형에 대한 설명이 없습니다.",
|
| 77 |
+
"jobs": [],
|
| 78 |
+
"good_match": [],
|
| 79 |
+
"bad_match": []
|
| 80 |
+
})
|
| 81 |
|
| 82 |
result = {
|
| 83 |
"MBTI 유형": mbti_code,
|
|
|
|
| 95 |
return json.dumps(result, ensure_ascii=False, indent=4), json.dumps(percentages, ensure_ascii=False, indent=4)
|
| 96 |
|
| 97 |
inputs = [
|
| 98 |
+
gr.Slider(minimum=1, maximum=5, step=1, label=f"질문 {i+1}", value=3) for i in range(len(questions))
|
| 99 |
]
|
| 100 |
|
| 101 |
demo = gr.Interface(
|
|
|
|
| 110 |
)
|
| 111 |
|
| 112 |
if __name__ == "__main__":
|
| 113 |
+
demo.launch()
|