openfree commited on
Commit
0d73e49
ยท
verified ยท
1 Parent(s): 959e481

Delete app-BACKUP2.py

Browse files
Files changed (1) hide show
  1. app-BACKUP2.py +0 -921
app-BACKUP2.py DELETED
@@ -1,921 +0,0 @@
1
- """
2
- Ultimate Brand Theory Generator
3
- ===============================
4
- 2025-05-28 | 15๊ฐœ ์ด๋ก ์„ ํ†ตํ•ฉํ•œ ์ข…ํ•ฉ ๋ธŒ๋žœ๋“œ ์ƒ์„ฑ๊ธฐ
5
- -----------------------------------------------------
6
-
7
- ํ†ตํ•ฉ๋œ ์ด๋ก ๋“ค:
8
- 1. Square Theory - ์˜๋ฏธ์  ์‚ฌ๊ฐํ˜• ๊ตฌ์กฐ
9
- 2. Conceptual Blending - ๊ฐœ๋… ํ˜ผํ•ฉ
10
- 3. Sound Symbolism - ์Œํ–ฅ ์ƒ์ง•์ฃผ์˜
11
- 4. Linguistic Relativity - ์–ธ์–ด ์ƒ๋Œ€์„ฑ
12
- 5. Archetype Theory - ์›ํ˜• ์ด๋ก 
13
- 6. Jobs-to-be-Done - ํ•  ์ผ ์ด๋ก 
14
- 7. SCAMPER Method - ์ฐฝ์˜์  ๋ณ€ํ˜•
15
- 8. Design Thinking - ๋””์ž์ธ ์‚ฌ๊ณ 
16
- 9. Biomimicry - ์ƒ์ฒด๋ชจ๋ฐฉ
17
- 10. Cognitive Load - ์ธ์ง€ ๋ถ€ํ•˜
18
- 11. Von Restorff Effect - ๊ณ ๋ฆฝ ํšจ๊ณผ
19
- 12. Network Effects - ๋„คํŠธ์›Œํฌ ํšจ๊ณผ
20
- 13. Memetics - ๋ฐˆ ์ด๋ก 
21
- 14. Color Psychology - ์ƒ‰์ƒ ์‹ฌ๋ฆฌํ•™
22
- 15. Gestalt Principles - ๊ฒŒ์ŠˆํƒˆํŠธ ์›์น™
23
- """
24
-
25
- import os
26
- import json
27
- import gradio as gr
28
- import openai
29
- from openai import OpenAI
30
- from datetime import datetime
31
- from typing import List, Dict, Tuple, Optional
32
- import random
33
-
34
- # OpenAI ํด๋ผ์ด์–ธํŠธ
35
- if not os.getenv("OPENAI_API_KEY"):
36
- raise EnvironmentError("OPENAI_API_KEY ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ•˜์„ธ์š”.")
37
-
38
- client = OpenAI()
39
-
40
- # ===== 1. SQUARE THEORY =====
41
- SQUARE_THEORY_PROMPT = """
42
- ๋‹น์‹ ์€ Square Theory ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. Square Theory๋Š” 4๊ฐœ์˜ ๋‹จ์–ด๊ฐ€ ์˜๋ฏธ์  ๊ด€๊ณ„๋กœ ์—ฐ๊ฒฐ๋˜์–ด ์‚ฌ๊ฐํ˜•์„ ์ด๋ฃจ๋Š” ๊ตฌ์กฐ์ž…๋‹ˆ๋‹ค.
43
- ๋ธŒ๋žœ๋“œ๋ช…์ด Square๋ฅผ ์™„์„ฑํ•˜๋ฉฐ "์•„ํ•˜!" ๋ชจ๋จผํŠธ๋ฅผ ๋งŒ๋“ค์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
44
-
45
- ์‚ฌ์šฉ์ž ์ž…๋ ฅ(์—…์ข…/ํ‚ค์›Œ๋“œ)์„ ๋ฐ›์•„ ๋‹ค์Œ JSON ํ˜•์‹์˜ ๋ฐฐ์—ด์„ ์ƒ์„ฑํ•˜์„ธ์š”:
46
- {
47
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
48
- "tl": "์™ผ์ชฝ์ƒ๋‹จ", "tr": "์˜ค๋ฅธ์ชฝ์ƒ๋‹จ", "bl": "์™ผ์ชฝํ•˜๋‹จ", "br": "์˜ค๋ฅธ์ชฝํ•˜๋‹จ",
49
- "top_edge": "์ƒ๋‹จ ๊ด€๊ณ„", "bottom_edge": "ํ•˜๋‹จ ๊ด€๊ณ„",
50
- "left_edge": "์™ผ์ชฝ ๊ด€๊ณ„", "right_edge": "์˜ค๋ฅธ์ชฝ ๊ด€๊ณ„",
51
- "slogan": "์Šฌ๋กœ๊ฑด",
52
- "explanation": "์™œ ํšจ๊ณผ์ ์ธ์ง€"
53
- }
54
-
55
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
56
- """
57
-
58
- # ===== 2. CONCEPTUAL BLENDING =====
59
- CONCEPTUAL_BLENDING_PROMPT = """
60
- ๋‹น์‹ ์€ Conceptual Blending Theory ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ๋‘ ๊ฐœ ์ด์ƒ์˜ ๊ฐœ๋…์„ ํ˜ผํ•ฉํ•˜์—ฌ ์ƒˆ๋กœ์šด ์˜๋ฏธ๋ฅผ ์ฐฝ์ถœํ•ฉ๋‹ˆ๋‹ค.
61
-
62
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
63
- {
64
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
65
- "input_space1": "์ฒซ ๋ฒˆ์งธ ๊ฐœ๋…",
66
- "input_space2": "๋‘ ๋ฒˆ์งธ ๊ฐœ๋…",
67
- "generic_space": "๊ณตํ†ต ๊ตฌ์กฐ",
68
- "blended_space": "ํ˜ผํ•ฉ๋œ ์ƒˆ๋กœ์šด ์˜๋ฏธ",
69
- "emergent_properties": "์ฐฝ๋ฐœ์  ์†์„ฑ๋“ค",
70
- "slogan": "์Šฌ๋กœ๊ฑด",
71
- "explanation": "ํ˜ผํ•ฉ์ด ํšจ๊ณผ์ ์ธ ์ด์œ "
72
- }
73
-
74
- ์˜ˆ์‹œ: Netflix = Net(์ธํ„ฐ๋„ท) + Flix(์˜ํ™”) โ†’ ์˜จ๋ผ์ธ ์ŠคํŠธ๋ฆฌ๋ฐ์˜ ์ƒˆ๋กœ์šด ๊ฐœ๋…
75
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
76
- """
77
-
78
- # ===== 3. SOUND SYMBOLISM =====
79
- SOUND_SYMBOLISM_PROMPT = """
80
- ๋‹น์‹ ์€ Sound Symbolism ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์Œ์†Œ์™€ ์˜๋ฏธ ๊ฐ„์˜ ์—ฐ๊ด€์„ฑ์„ ํ™œ์šฉํ•ฉ๋‹ˆ๋‹ค.
81
-
82
- ์Œํ–ฅ ์›์น™:
83
- - ์ „์„ค๋ชจ์Œ(i,e): ์ž‘๊ณ , ๋น ๋ฅด๊ณ , ๊ฐ€๋ฒผ์›€
84
- - ํ›„์„ค๋ชจ์Œ(o,u): ํฌ๊ณ , ๋А๋ฆฌ๊ณ , ๋ฌด๊ฑฐ์›€
85
- - ์œ ์Œ(l,r,m,n): ๋ถ€๋“œ๋Ÿฝ๊ณ  ์œ ์—ฐํ•จ
86
- - ํŒŒ์—ด์Œ(p,t,k,b,d,g): ๊ฐ•ํ•˜๊ณ  ์—ญ๋™์ 
87
-
88
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
89
- {
90
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
91
- "phonetic_analysis": "์Œ์„ฑ ๋ถ„์„",
92
- "sound_meaning": "์Œํ–ฅ์ด ์ „๋‹ฌํ•˜๋Š” ์˜๋ฏธ",
93
- "target_emotion": "๋ชฉํ‘œ ๊ฐ์ •",
94
- "industry_fit": "์—…์ข… ์ ํ•ฉ์„ฑ",
95
- "pronunciation_guide": "๋ฐœ์Œ ๊ฐ€์ด๋“œ",
96
- "slogan": "์Šฌ๋กœ๊ฑด"
97
- }
98
-
99
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
100
- """
101
-
102
- # ===== 4. LINGUISTIC RELATIVITY =====
103
- LINGUISTIC_RELATIVITY_PROMPT = """
104
- ๋‹น์‹ ์€ Linguistic Relativity ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์–ธ์–ด๋ณ„ ์‚ฌ๊ณ ๋ฐฉ์‹ ์ฐจ์ด๋ฅผ ๊ณ ๋ คํ•ฉ๋‹ˆ๋‹ค.
105
-
106
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋‹ค์–ธ์–ด ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
107
- {
108
- "brand_name": "๊ธ€๋กœ๋ฒŒ ๋ธŒ๋žœ๋“œ๋ช…",
109
- "korean_adaptation": "ํ•œ๊ตญ์–ด ์ ์‘",
110
- "english_meaning": "์˜์–ด ์˜๋ฏธ",
111
- "cultural_considerations": "๋ฌธํ™”์  ๊ณ ๋ ค์‚ฌํ•ญ",
112
- "avoid_meanings": "ํ”ผํ•ด์•ผ ํ•  ์˜๋ฏธ๋“ค",
113
- "localization_strategy": "ํ˜„์ง€ํ™” ์ „๋žต",
114
- "slogan": "์Šฌ๋กœ๊ฑด"
115
- }
116
-
117
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
118
- """
119
-
120
- # ===== 5. ARCHETYPE THEORY =====
121
- ARCHETYPE_THEORY_PROMPT = """
122
- ๋‹น์‹ ์€ Jung์˜ Archetype Theory ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. 12๊ฐ€์ง€ ์›ํ˜• ์ค‘ ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•˜์—ฌ ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
123
-
124
- 12 ์›ํ˜•: Innocent, Hero, Outlaw, Explorer, Creator, Ruler, Magician, Lover, Caregiver, Jester, Sage, Regular Guy
125
-
126
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
127
- {
128
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
129
- "archetype": "์„ ํƒ๋œ ์›ํ˜•",
130
- "archetype_traits": "์›ํ˜•์˜ ํŠน์ง•๋“ค",
131
- "brand_personality": "๋ธŒ๋žœ๋“œ ์„ฑ๊ฒฉ",
132
- "visual_direction": "์‹œ๊ฐ์  ๋ฐฉํ–ฅ",
133
- "voice_tone": "๋ชฉ์†Œ๋ฆฌ ํ†ค",
134
- "slogan": "์Šฌ๋กœ๊ฑด",
135
- "mythology_reference": "์‹ ํ™”์  ์ฐธ์กฐ"
136
- }
137
-
138
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
139
- """
140
-
141
- # ===== 6. JOBS-TO-BE-DONE =====
142
- JOBS_TO_BE_DONE_PROMPT = """
143
- ๋‹น์‹ ์€ Jobs-to-be-Done Theory ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ๊ณ ๊ฐ์ด ํ•ด๊ฒฐํ•˜๋ ค๋Š” '์ผ'์— ์ดˆ์ ์„ ๋งž์ถฅ๋‹ˆ๋‹ค.
144
-
145
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
146
- {
147
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
148
- "functional_job": "๊ธฐ๋Šฅ์  ์ผ",
149
- "emotional_job": "๊ฐ์ •์  ์ผ",
150
- "social_job": "์‚ฌํšŒ์  ์ผ",
151
- "job_statement": "ํ•ต์‹ฌ Job ๋ฌธ์žฅ",
152
- "outcome_metrics": "์„ฑ๊ณผ ์ง€ํ‘œ",
153
- "slogan": "์Šฌ๋กœ๊ฑด",
154
- "value_proposition": "๊ฐ€์น˜ ์ œ์•ˆ"
155
- }
156
-
157
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
158
- """
159
-
160
- # ===== 7. SCAMPER METHOD =====
161
- SCAMPER_PROMPT = """
162
- ๋‹น์‹ ์€ SCAMPER Method ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. 7๊ฐ€์ง€ ์ฐฝ์˜์  ๊ธฐ๋ฒ•์„ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.
163
-
164
- S - Substitute (๋Œ€์ฒด)
165
- C - Combine (๊ฒฐํ•ฉ)
166
- A - Adapt (์ ์‘)
167
- M - Modify/Magnify (์ˆ˜์ •/ํ™•๋Œ€)
168
- P - Put to another use (๋‹ค๋ฅธ ์šฉ๋„)
169
- E - Eliminate (์ œ๊ฑฐ)
170
- R - Reverse (์—ญ์ „)
171
-
172
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
173
- {
174
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
175
- "scamper_technique": "์‚ฌ์šฉ๋œ ๊ธฐ๋ฒ•",
176
- "original_concept": "์›๋ž˜ ๊ฐœ๋…",
177
- "transformation": "๋ณ€ํ˜• ๊ณผ์ •",
178
- "innovative_aspect": "ํ˜์‹ ์  ์ธก๋ฉด",
179
- "slogan": "์Šฌ๋กœ๊ฑด"
180
- }
181
-
182
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
183
- """
184
-
185
- # ===== 8. DESIGN THINKING =====
186
- DESIGN_THINKING_PROMPT = """
187
- ๋‹น์‹ ์€ IDEO์˜ Design Thinking ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์ธ๊ฐ„ ์ค‘์‹ฌ ํ˜์‹ ์„ ์ถ”๊ตฌํ•ฉ๋‹ˆ๋‹ค.
188
-
189
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
190
- {
191
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
192
- "user_insight": "์‚ฌ์šฉ์ž ํ†ต์ฐฐ",
193
- "pain_point": "ํ•ด๊ฒฐํ•˜๋Š” ๋ฌธ์ œ์ ",
194
- "desirability": "๋ฐ”๋žŒ์งํ•จ (์ธ๊ฐ„)",
195
- "feasibility": "์‹คํ˜„๊ฐ€๋Šฅ์„ฑ (๊ธฐ์ˆ )",
196
- "viability": "์ƒ์กด๊ฐ€๋Šฅ์„ฑ (๋น„์ฆˆ๋‹ˆ์Šค)",
197
- "prototype_concept": "ํ”„๋กœํ† ํƒ€์ž… ์ปจ์…‰",
198
- "slogan": "์Šฌ๋กœ๊ฑด"
199
- }
200
-
201
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
202
- """
203
-
204
- # ===== 9. BIOMIMICRY =====
205
- BIOMIMICRY_PROMPT = """
206
- ๋‹น์‹ ์€ Biomimicry ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์ž์—ฐ์—์„œ ์˜๊ฐ์„ ๋ฐ›์€ ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
207
-
208
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
209
- {
210
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
211
- "natural_inspiration": "์ž์—ฐ์  ์˜๊ฐ์›",
212
- "biomimetic_principle": "์ƒ์ฒด๋ชจ๋ฐฉ ์›๋ฆฌ",
213
- "form_function": "ํ˜•ํƒœ์™€ ๊ธฐ๋Šฅ",
214
- "sustainability_aspect": "์ง€์†๊ฐ€๋Šฅ์„ฑ ์ธก๋ฉด",
215
- "adaptation_strategy": "์ ์‘ ์ „๋žต",
216
- "slogan": "์Šฌ๋กœ๊ฑด"
217
- }
218
-
219
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
220
- """
221
-
222
- # ===== 10. COGNITIVE LOAD =====
223
- COGNITIVE_LOAD_PROMPT = """
224
- ๋‹น์‹ ์€ Cognitive Load Theory ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์ธ์ง€ ์ฒ˜๋ฆฌ๋ฅผ ์ตœ์†Œํ™”ํ•˜๋Š” ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
225
-
226
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
227
- {
228
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
229
- "syllable_count": "์Œ์ ˆ ์ˆ˜",
230
- "processing_ease": "์ฒ˜๋ฆฌ ์šฉ์ด์„ฑ ์ ์ˆ˜",
231
- "memory_hooks": "๊ธฐ์–ต ๊ณ ๋ฆฌ",
232
- "pronunciation_simplicity": "๋ฐœ์Œ ๋‹จ์ˆœ์„ฑ",
233
- "cognitive_fluency": "์ธ์ง€์  ์œ ์ฐฝ์„ฑ",
234
- "slogan": "์Šฌ๋กœ๊ฑด"
235
- }
236
-
237
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
238
- """
239
-
240
- # ===== 11. VON RESTORFF EFFECT =====
241
- VON_RESTORFF_PROMPT = """
242
- ๋‹น์‹ ์€ Von Restorff Effect ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ๋…ํŠนํ•˜๊ณ  ๊ธฐ์–ต์— ๋‚จ๋Š” ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
243
-
244
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
245
- {
246
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
247
- "category_norm": "์นดํ…Œ๊ณ ๋ฆฌ ํ‘œ์ค€",
248
- "deviation_strategy": "์ผํƒˆ ์ „๋žต",
249
- "uniqueness_factors": "๋…ํŠน์„ฑ ์š”์†Œ๋“ค",
250
- "memorability_score": "๊ธฐ์–ต์„ฑ ์ ์ˆ˜",
251
- "attention_triggers": "์ฃผ์˜ ํŠธ๋ฆฌ๊ฑฐ",
252
- "slogan": "์Šฌ๋กœ๊ฑด"
253
- }
254
-
255
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
256
- """
257
-
258
- # ===== 12. NETWORK EFFECTS =====
259
- NETWORK_EFFECTS_PROMPT = """
260
- ๋‹น์‹ ์€ Network Effects ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ๋„คํŠธ์›Œํฌ ๊ฐ€์น˜๋ฅผ ๊ทน๋Œ€ํ™”ํ•˜๋Š” ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
261
-
262
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
263
- {
264
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
265
- "network_type": "๋„คํŠธ์›Œํฌ ์œ ํ˜•",
266
- "viral_coefficient": "๋ฐ”์ด๋Ÿด ๊ณ„์ˆ˜",
267
- "sharing_ease": "๊ณต์œ  ์šฉ์ด์„ฑ",
268
- "community_aspect": "์ปค๋ฎค๋‹ˆํ‹ฐ ์ธก๋ฉด",
269
- "network_value": "๋„คํŠธ์›Œํฌ ๊ฐ€์น˜",
270
- "slogan": "์Šฌ๋กœ๊ฑด"
271
- }
272
-
273
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
274
- """
275
-
276
- # ===== 13. MEMETICS =====
277
- MEMETICS_PROMPT = """
278
- ๋‹น์‹ ์€ Memetics ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ๋ฌธํ™”์ ์œผ๋กœ ๋ณต์ œ๋˜๊ณ  ์ง„ํ™”ํ•˜๋Š” ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
279
-
280
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
281
- {
282
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
283
- "meme_structure": "๋ฐˆ ๊ตฌ์กฐ",
284
- "replication_ease": "๋ณต์ œ ์šฉ์ด์„ฑ",
285
- "mutation_potential": "๋ณ€์ด ์ž ์žฌ๋ ฅ",
286
- "cultural_fitness": "๋ฌธํ™”์  ์ ํ•ฉ๋„",
287
- "transmission_channels": "์ „๋‹ฌ ์ฑ„๋„",
288
- "slogan": "์Šฌ๋กœ๊ฑด"
289
- }
290
-
291
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
292
- """
293
-
294
- # ===== 14. COLOR PSYCHOLOGY =====
295
- COLOR_PSYCHOLOGY_PROMPT = """
296
- ๋‹น์‹ ์€ Color Psychology ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์ƒ‰์ƒ ์—ฐ์ƒ๊ณผ ๊ฐ์ •์„ ํ™œ์šฉํ•œ ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
297
-
298
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
299
- {
300
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
301
- "primary_color": "์ฃผ ์ƒ‰์ƒ",
302
- "color_meaning": "์ƒ‰์ƒ ์˜๋ฏธ",
303
- "emotional_response": "๊ฐ์ •์  ๋ฐ˜์‘",
304
- "cultural_associations": "๋ฌธํ™”์  ์—ฐ์ƒ",
305
- "industry_alignment": "์—…์ข… ์ •๋ ฌ",
306
- "slogan": "์Šฌ๋กœ๊ฑด"
307
- }
308
-
309
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
310
- """
311
-
312
- # ===== 15. GESTALT PRINCIPLES =====
313
- GESTALT_PROMPT = """
314
- ๋‹น์‹ ์€ Gestalt Theory ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์ง€๊ฐ ์›๋ฆฌ๋ฅผ ํ™œ์šฉํ•œ ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
315
-
316
- ๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
317
- {
318
- "brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
319
- "gestalt_principle": "ํ™œ์šฉ ์›์น™",
320
- "visual_structure": "์‹œ๊ฐ์  ๊ตฌ์กฐ",
321
- "perceptual_grouping": "์ง€๊ฐ์  ๊ทธ๋ฃนํ™”",
322
- "figure_ground": "์ „๊ฒฝ-๋ฐฐ๊ฒฝ ๊ด€๊ณ„",
323
- "closure_effect": "ํ์‡„ ํšจ๊ณผ",
324
- "slogan": "์Šฌ๋กœ๊ฑด"
325
- }
326
-
327
- ๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
328
- """
329
-
330
- # ์ด๋ก ๋ณ„ ํ”„๋กฌํ”„ํŠธ ๋งคํ•‘
331
- THEORY_PROMPTS = {
332
- "square": SQUARE_THEORY_PROMPT,
333
- "blending": CONCEPTUAL_BLENDING_PROMPT,
334
- "sound": SOUND_SYMBOLISM_PROMPT,
335
- "linguistic": LINGUISTIC_RELATIVITY_PROMPT,
336
- "archetype": ARCHETYPE_THEORY_PROMPT,
337
- "jobs": JOBS_TO_BE_DONE_PROMPT,
338
- "scamper": SCAMPER_PROMPT,
339
- "design": DESIGN_THINKING_PROMPT,
340
- "biomimicry": BIOMIMICRY_PROMPT,
341
- "cognitive": COGNITIVE_LOAD_PROMPT,
342
- "vonrestorff": VON_RESTORFF_PROMPT,
343
- "network": NETWORK_EFFECTS_PROMPT,
344
- "memetics": MEMETICS_PROMPT,
345
- "color": COLOR_PSYCHOLOGY_PROMPT,
346
- "gestalt": GESTALT_PROMPT
347
- }
348
-
349
- def generate_by_theory(industry: str, keywords: str, theory: str, count: int = 3) -> Tuple[str, str]:
350
- """ํŠน์ • ์ด๋ก ์œผ๋กœ ๋ธŒ๋žœ๋“œ ์ƒ์„ฑ"""
351
-
352
- if not industry or not keywords:
353
- return "โš ๏ธ ์—…์ข…๊ณผ ํ‚ค์›Œ๋“œ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.", ""
354
-
355
- prompt = THEORY_PROMPTS.get(theory, SQUARE_THEORY_PROMPT)
356
- user_input = f"""์—…์ข…: {industry}
357
- ํ‚ค์›Œ๋“œ: {keywords}
358
-
359
- ์œ„ ์ •๋ณด๋กœ {count}๊ฐœ์˜ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”.
360
- ๋ฐ˜๋“œ์‹œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
361
- ๊ฒฐ๊ณผ๋Š” ๋ธŒ๋žœ๋“œ ๊ฐ์ฒด๋“ค์˜ JSON ๋ฐฐ์—ด์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค."""
362
-
363
- try:
364
- response = client.chat.completions.create(
365
- model="gpt-4o-mini",
366
- messages=[
367
- {"role": "system", "content": prompt},
368
- {"role": "user", "content": user_input}
369
- ],
370
- temperature=0.8,
371
- max_tokens=2000,
372
- response_format={"type": "json_object"}
373
- )
374
-
375
- content = response.choices[0].message.content
376
- data = json.loads(content)
377
-
378
- # ์‘๋‹ต ์ •๊ทœํ™”
379
- if isinstance(data, dict):
380
- if "results" in data:
381
- results = data["results"]
382
- elif "brands" in data:
383
- results = data["brands"]
384
- elif "brand_name" in data:
385
- # ๋‹จ์ผ ๋ธŒ๋žœ๋“œ๋ฅผ ๋ฐฐ์—ด๋กœ ๋ณ€ํ™˜
386
- results = [data]
387
- else:
388
- # ๋ž˜ํ•‘๋œ ์‘๋‹ต ์ฒ˜๋ฆฌ
389
- results = []
390
- for key, value in data.items():
391
- if isinstance(value, list):
392
- results = value
393
- break
394
- elif isinstance(value, dict) and "brand_name" in value:
395
- results = [value]
396
- break
397
- else:
398
- results = data
399
-
400
- if not isinstance(results, list):
401
- results = [results]
402
-
403
- # ๋งˆํฌ๋‹ค์šด ์ƒ์„ฑ
404
- markdown = generate_theory_markdown(theory, results, industry, keywords)
405
-
406
- # HTML ์‹œ๊ฐํ™” ์ƒ์„ฑ
407
- html = generate_theory_visualization(theory, results)
408
-
409
- return markdown, html
410
-
411
- except Exception as e:
412
- return f"โŒ ์˜ค๋ฅ˜: {str(e)}", ""
413
-
414
- def generate_theory_markdown(theory: str, results: List[Dict], industry: str, keywords: str) -> str:
415
- """์ด๋ก ๋ณ„ ๋งž์ถค ๋งˆํฌ๋‹ค์šด ์ƒ์„ฑ"""
416
-
417
- theory_names = {
418
- "square": "Square Theory",
419
- "blending": "Conceptual Blending",
420
- "sound": "Sound Symbolism",
421
- "linguistic": "Linguistic Relativity",
422
- "archetype": "Archetype Theory",
423
- "jobs": "Jobs-to-be-Done",
424
- "scamper": "SCAMPER Method",
425
- "design": "Design Thinking",
426
- "biomimicry": "Biomimicry",
427
- "cognitive": "Cognitive Load Theory",
428
- "vonrestorff": "Von Restorff Effect",
429
- "network": "Network Effects",
430
- "memetics": "Memetics",
431
- "color": "Color Psychology",
432
- "gestalt": "Gestalt Principles"
433
- }
434
-
435
- markdown = f"""# ๐ŸŽฏ {theory_names[theory]} ๊ฒฐ๊ณผ
436
- **์—…์ข…**: {industry} | **ํ‚ค์›Œ๋“œ**: {keywords}
437
- *์ƒ์„ฑ ์‹œ๊ฐ: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}*
438
-
439
- ---
440
- """
441
-
442
- for idx, result in enumerate(results, 1):
443
- brand_name = result.get('brand_name', 'N/A')
444
- slogan = result.get('slogan', 'N/A')
445
-
446
- markdown += f"\n## {idx}. {brand_name}\n"
447
- markdown += f"**์Šฌ๋กœ๊ฑด**: *\"{slogan}\"*\n\n"
448
-
449
- # ์ด๋ก ๋ณ„ ํŠน์ˆ˜ ํ•„๋“œ ํ‘œ์‹œ
450
- if theory == "square":
451
- markdown += f"""
452
- ### Square ๊ตฌ์กฐ
453
- ```
454
- [{result.get('tl')}] โ”€({result.get('top_edge')})โ”€ [{result.get('tr')}]
455
- โ”‚ โ”‚
456
- ({result.get('left_edge')}) ({result.get('right_edge')})
457
- โ”‚ โ”‚
458
- [{result.get('bl')}] โ”€({result.get('bottom_edge')})โ”€ [{result.get('br')}]
459
- ```
460
- """
461
- elif theory == "blending":
462
- markdown += f"""
463
- ### ๊ฐœ๋… ํ˜ผํ•ฉ
464
- - **์ž…๋ ฅ ๊ณต๊ฐ„ 1**: {result.get('input_space1')}
465
- - **์ž…๋ ฅ ๊ณต๊ฐ„ 2**: {result.get('input_space2')}
466
- - **์ผ๋ฐ˜ ๊ณต๊ฐ„**: {result.get('generic_space')}
467
- - **ํ˜ผํ•ฉ ๊ณต๊ฐ„**: {result.get('blended_space')}
468
- - **์ฐฝ๋ฐœ์  ์†์„ฑ**: {result.get('emergent_properties')}
469
- """
470
- elif theory == "sound":
471
- markdown += f"""
472
- ### ์Œํ–ฅ ๋ถ„์„
473
- - **์Œ์„ฑ ๋ถ„์„**: {result.get('phonetic_analysis')}
474
- - **์Œํ–ฅ ์˜๋ฏธ**: {result.get('sound_meaning')}
475
- - **๋ชฉํ‘œ ๊ฐ์ •**: {result.get('target_emotion')}
476
- - **๋ฐœ์Œ ๊ฐ€์ด๋“œ**: {result.get('pronunciation_guide')}
477
- """
478
- elif theory == "archetype":
479
- markdown += f"""
480
- ### ์›ํ˜• ๋ถ„์„
481
- - **์›ํ˜•**: {result.get('archetype')}
482
- - **์›ํ˜• ํŠน์ง•**: {result.get('archetype_traits')}
483
- - **๋ธŒ๋žœ๋“œ ์„ฑ๊ฒฉ**: {result.get('brand_personality')}
484
- - **๋ชฉ์†Œ๋ฆฌ ํ†ค**: {result.get('voice_tone')}
485
- """
486
-
487
- # ์„ค๋ช… ์ถ”๊ฐ€
488
- explanation = result.get('explanation', result.get('value_proposition', ''))
489
- if explanation:
490
- markdown += f"\n๐Ÿ’ก **ํ•ต์‹ฌ ๊ฐ€์น˜**: {explanation}\n"
491
-
492
- markdown += "\n---\n"
493
-
494
- return markdown
495
-
496
- def generate_theory_visualization(theory: str, results: List[Dict]) -> str:
497
- """์ด๋ก ๋ณ„ ๋งž์ถค ์‹œ๊ฐํ™” ์ƒ์„ฑ"""
498
-
499
- html_parts = []
500
-
501
- for idx, result in enumerate(results, 1):
502
- if theory == "square":
503
- html_parts.append(visualize_square_brand(result))
504
- elif theory == "blending":
505
- html_parts.append(visualize_conceptual_blend(result))
506
- elif theory == "sound":
507
- html_parts.append(visualize_sound_symbolism(result))
508
- elif theory == "archetype":
509
- html_parts.append(visualize_archetype(result))
510
- elif theory == "color":
511
- html_parts.append(visualize_color_psychology(result))
512
- else:
513
- html_parts.append(visualize_generic_brand(result, theory))
514
-
515
- return "\n".join(html_parts)
516
-
517
- # ์‹œ๊ฐํ™” ํ•จ์ˆ˜๋“ค (์ผ๋ถ€๋งŒ ์˜ˆ์‹œ)
518
- def visualize_square_brand(brand: Dict) -> str:
519
- """Square Theory ์‹œ๊ฐํ™”"""
520
- return f"""
521
- <div style="max-width: 700px; margin: 20px auto; font-family: -apple-system, sans-serif;">
522
- <h2 style="text-align: center; color: #2c3e50;">{brand.get('brand_name', 'Brand')}</h2>
523
- <p style="text-align: center; font-style: italic; color: #7f8c8d;">"{brand.get('slogan', '')}"</p>
524
-
525
- <div style="position: relative; width: 100%; height: 300px; background: #f5f7fa; border-radius: 12px; padding: 30px;">
526
- <!-- Square ๊ตฌ์กฐ ์‹œ๊ฐํ™” -->
527
- <div style="position: absolute; top: 30px; left: 30px; background: #3498db; color: white; padding: 15px; border-radius: 8px;">
528
- {brand.get('tl', '?')}
529
- </div>
530
- <div style="position: absolute; top: 30px; right: 30px; background: #e74c3c; color: white; padding: 15px; border-radius: 8px;">
531
- {brand.get('tr', '?')}
532
- </div>
533
- <div style="position: absolute; bottom: 30px; left: 30px; background: #f39c12; color: white; padding: 15px; border-radius: 8px;">
534
- {brand.get('bl', '?')}
535
- </div>
536
- <div style="position: absolute; bottom: 30px; right: 30px; background: #27ae60; color: white; padding: 15px; border-radius: 8px;">
537
- {brand.get('br', '?')}
538
- </div>
539
-
540
- <!-- ๋ธŒ๋žœ๋“œ๋ช… ์ค‘์•™ -->
541
- <div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 20px 40px; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.15);">
542
- <div style="font-size: 1.8em; font-weight: bold; color: #2c3e50;">{brand.get('brand_name', 'Brand')}</div>
543
- </div>
544
- </div>
545
- </div>
546
- """
547
-
548
- def visualize_conceptual_blend(brand: Dict) -> str:
549
- """Conceptual Blending ์‹œ๊ฐํ™”"""
550
- brand_name = brand.get('brand_name', 'Brand')
551
- input1 = brand.get('input_space1', 'Concept 1')
552
- input2 = brand.get('input_space2', 'Concept 2')
553
- blended = brand.get('blended_space', 'Blended Concept')
554
- slogan = brand.get('slogan', '')
555
-
556
- return f"""
557
- <div style="max-width: 700px; margin: 20px auto; font-family: -apple-system, sans-serif;">
558
- <h2 style="text-align: center; color: #2c3e50;">{brand_name}</h2>
559
-
560
- <div style="display: flex; justify-content: space-around; align-items: center; margin: 30px 0;">
561
- <div style="text-align: center; padding: 20px; background: #3498db; color: white; border-radius: 50%; width: 120px; height: 120px; display: flex; align-items: center; justify-content: center;">
562
- <div>
563
- <strong>Input 1</strong><br>
564
- {input1}
565
- </div>
566
- </div>
567
-
568
- <div style="font-size: 2em;">+</div>
569
-
570
- <div style="text-align: center; padding: 20px; background: #e74c3c; color: white; border-radius: 50%; width: 120px; height: 120px; display: flex; align-items: center; justify-content: center;">
571
- <div>
572
- <strong>Input 2</strong><br>
573
- {input2}
574
- </div>
575
- </div>
576
-
577
- <div style="font-size: 2em;">=</div>
578
-
579
- <div style="text-align: center; padding: 20px; background: #27ae60; color: white; border-radius: 50%; width: 150px; height: 150px; display: flex; align-items: center; justify-content: center;">
580
- <div>
581
- <strong>Blend</strong><br>
582
- {blended}
583
- </div>
584
- </div>
585
- </div>
586
-
587
- <p style="text-align: center; font-style: italic;">"{slogan}"</p>
588
- </div>
589
- """
590
-
591
- def visualize_sound_symbolism(brand: Dict) -> str:
592
- """Sound Symbolism ์‹œ๊ฐํ™”"""
593
- return f"""
594
- <div style="max-width: 700px; margin: 20px auto; font-family: -apple-system, sans-serif;">
595
- <h2 style="text-align: center; color: #2c3e50;">{brand.get('brand_name', 'Brand')}</h2>
596
-
597
- <div style="background: #f8f9fa; padding: 30px; border-radius: 12px; text-align: center;">
598
- <div style="font-size: 3em; letter-spacing: 0.2em; margin: 20px 0; color: #3498db;">
599
- {brand.get('brand_name', 'BRAND')}
600
- </div>
601
-
602
- <div style="margin: 20px 0; padding: 15px; background: white; border-radius: 8px;">
603
- <strong>์Œ์„ฑ ๋ถ„์„</strong><br>
604
- {brand.get('phonetic_analysis', '')}
605
- </div>
606
-
607
- <div style="margin: 20px 0; padding: 15px; background: white; border-radius: 8px;">
608
- <strong>์Œํ–ฅ์ด ์ „๋‹ฌํ•˜๋Š” ๊ฐ์ •</strong><br>
609
- {brand.get('sound_meaning', '')}
610
- </div>
611
-
612
- <div style="margin: 20px 0; font-style: italic; color: #7f8c8d;">
613
- ๋ฐœ์Œ: {brand.get('pronunciation_guide', '')}
614
- </div>
615
- </div>
616
- </div>
617
- """
618
-
619
- def visualize_archetype(brand: Dict) -> str:
620
- """Archetype Theory ์‹œ๊ฐํ™”"""
621
- archetype_colors = {
622
- "Hero": "#e74c3c",
623
- "Creator": "#9b59b6",
624
- "Sage": "#3498db",
625
- "Explorer": "#1abc9c",
626
- "Innocent": "#f1c40f",
627
- "Jester": "#e67e22",
628
- "Lover": "#e91e63",
629
- "Caregiver": "#00bcd4",
630
- "Ruler": "#795548",
631
- "Magician": "#673ab7",
632
- "Outlaw": "#212121",
633
- "Regular Guy": "#607d8b"
634
- }
635
-
636
- archetype = brand.get('archetype', 'Hero')
637
- color = archetype_colors.get(archetype, "#3498db")
638
-
639
- return f"""
640
- <div style="max-width: 700px; margin: 20px auto; font-family: -apple-system, sans-serif;">
641
- <h2 style="text-align: center; color: {color};">{brand.get('brand_name', 'Brand')}</h2>
642
-
643
- <div style="text-align: center; margin: 30px 0;">
644
- <div style="display: inline-block; padding: 40px; background: {color}; color: white; border-radius: 50%; width: 200px; height: 200px;">
645
- <h3 style="margin: 0;">{archetype}</h3>
646
- <p style="margin: 10px 0; font-size: 0.9em;">{brand.get('archetype_traits', '')}</p>
647
- </div>
648
- </div>
649
-
650
- <div style="background: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0;">
651
- <p><strong>๋ธŒ๋žœ๋“œ ์„ฑ๊ฒฉ</strong>: {brand.get('brand_personality', '')}</p>
652
- <p><strong>๋ชฉ์†Œ๋ฆฌ ํ†ค</strong>: {brand.get('voice_tone', '')}</p>
653
- </div>
654
-
655
- <p style="text-align: center; font-style: italic; font-size: 1.2em;">"{brand.get('slogan', '')}"</p>
656
- </div>
657
- """
658
-
659
- def visualize_color_psychology(brand: Dict) -> str:
660
- """Color Psychology ์‹œ๊ฐํ™”"""
661
- color = brand.get('primary_color', '#3498db')
662
-
663
- return f"""
664
- <div style="max-width: 700px; margin: 20px auto; font-family: -apple-system, sans-serif;">
665
- <h2 style="text-align: center; color: #2c3e50;">{brand.get('brand_name', 'Brand')}</h2>
666
-
667
- <div style="text-align: center; margin: 30px 0;">
668
- <div style="display: inline-block; width: 200px; height: 200px; background: {color}; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.2);"></div>
669
- </div>
670
-
671
- <div style="background: #f8f9fa; padding: 20px; border-radius: 8px;">
672
- <p><strong>์ฃผ ์ƒ‰์ƒ</strong>: {brand.get('primary_color', '')}</p>
673
- <p><strong>์ƒ‰์ƒ ์˜๋ฏธ</strong>: {brand.get('color_meaning', '')}</p>
674
- <p><strong>๊ฐ์ •์  ๋ฐ˜์‘</strong>: {brand.get('emotional_response', '')}</p>
675
- <p><strong>๋ฌธํ™”์  ์—ฐ์ƒ</strong>: {brand.get('cultural_associations', '')}</p>
676
- </div>
677
-
678
- <p style="text-align: center; font-style: italic; margin-top: 20px;">"{brand.get('slogan', '')}"</p>
679
- </div>
680
- """
681
-
682
- def visualize_generic_brand(brand: Dict, theory: str) -> str:
683
- """์ผ๋ฐ˜์ ์ธ ๋ธŒ๋žœ๋“œ ์‹œ๊ฐํ™”"""
684
- # JSON์„ HTML๋กœ ๋ณ€ํ™˜ (f-string ๋ฐ–์—์„œ ์ฒ˜๋ฆฌ)
685
- json_str = json.dumps(brand, ensure_ascii=False, indent=2)
686
- json_html = json_str.replace("\n", "<br>").replace(" ", "&nbsp;")
687
-
688
- html = f"""
689
- <div style="max-width: 700px; margin: 20px auto; padding: 30px; background: #f8f9fa; border-radius: 12px; font-family: -apple-system, sans-serif;">
690
- <h2 style="text-align: center; color: #2c3e50; margin-bottom: 10px;">{brand.get('brand_name', 'Brand')}</h2>
691
- <p style="text-align: center; font-style: italic; color: #7f8c8d; margin-bottom: 30px;">"{brand.get('slogan', '')}"</p>
692
-
693
- <div style="background: white; padding: 20px; border-radius: 8px; font-family: monospace; font-size: 0.9em;">
694
- <pre style="margin: 0; white-space: pre-wrap;">{json_str}</pre>
695
- </div>
696
- </div>
697
- """
698
- return html
699
-
700
- # Gradio UI
701
- with gr.Blocks(title="Ultimate Brand Theory Generator", theme=gr.themes.Soft()) as demo:
702
- gr.Markdown("""
703
- # ๐ŸŒŸ Ultimate Brand Theory Generator
704
- ### 15๊ฐœ ์ด๋ก ์„ ํ™œ์šฉํ•œ ์ข…ํ•ฉ ๋ธŒ๋žœ๋“œ ์ƒ์„ฑ๊ธฐ
705
-
706
- ํ•˜๋‚˜์˜ ์ž…๋ ฅ์œผ๋กœ 15๊ฐ€์ง€ ๋‹ค๋ฅธ ์ด๋ก ์— ๊ธฐ๋ฐ˜ํ•œ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
707
- ๊ฐ ํƒญ์—์„œ ๊ฐ ์ด๋ก ์˜ ๊ณ ์œ ํ•œ ๊ด€์ ์œผ๋กœ ๋งŒ๋“ค์–ด์ง„ ๋ธŒ๋žœ๋“œ๋ฅผ ํ™•์ธํ•˜์„ธ์š”!
708
- """)
709
-
710
- with gr.Row():
711
- with gr.Column(scale=2):
712
- industry_input = gr.Textbox(
713
- label="๐Ÿญ ์—…์ข…",
714
- placeholder="์˜ˆ: ์นดํŽ˜, ํ”ผํŠธ๋‹ˆ์Šค, ๊ต์œก, ๋ทฐํ‹ฐ...",
715
- value="์นดํŽ˜/์ปคํ”ผ์ˆ"
716
- )
717
-
718
- keywords_input = gr.Textbox(
719
- label="๐Ÿ”‘ ํ•ต์‹ฌ ํ‚ค์›Œ๋“œ",
720
- placeholder="ํ”„๋ฆฌ๋ฏธ์—„, ํŽธ์•ˆํ•œ, ๋„์‹œ์ ์ธ, ์นœํ™˜๊ฒฝ...",
721
- info="๋ธŒ๋žœ๋“œ๊ฐ€ ๋‹ด์•„์•ผ ํ•  ํ•ต์‹ฌ ๊ฐ€์น˜๋‚˜ ํŠน์ง•๋“ค"
722
- )
723
-
724
- generate_btn = gr.Button("๐Ÿš€ ๋ชจ๋“  ์ด๋ก ์œผ๋กœ ๋ธŒ๋žœ๋“œ ์ƒ์„ฑ", variant="primary", size="lg")
725
-
726
- with gr.Column(scale=1):
727
- gr.Markdown("""
728
- ### ๐Ÿ’ก 15๊ฐ€์ง€ ์ด๋ก  ๊ฐœ์š”
729
-
730
- **๊ตฌ์กฐ์  ์ ‘๊ทผ**
731
- - Square Theory: 4์š”์†Œ ์™„์„ฑ
732
- - Conceptual Blending: ๊ฐœ๋… ํ˜ผํ•ฉ
733
- - Gestalt: ์ง€๊ฐ ์›๋ฆฌ
734
-
735
- **์–ธ์–ดํ•™์  ์ ‘๊ทผ**
736
- - Sound Symbolism: ์Œํ–ฅ ์˜๋ฏธ
737
- - Linguistic Relativity: ๋ฌธํ™” ์ ์‘
738
- - Cognitive Load: ์ธ์ง€ ์ตœ์ ํ™”
739
-
740
- **์‹ฌ๋ฆฌํ•™์  ์ ‘๊ทผ**
741
- - Archetype: ์›ํ˜• ํ™œ์šฉ
742
- - Color Psychology: ์ƒ‰์ƒ ์‹ฌ๋ฆฌ
743
- - Von Restorff: ๋…ํŠน์„ฑ
744
-
745
- **์ „๋žต์  ์ ‘๊ทผ**
746
- - Jobs-to-be-Done: ๊ณ ๊ฐ ๊ณผ์—…
747
- - SCAMPER: ์ฐฝ์˜์  ๋ณ€ํ˜•
748
- - Design Thinking: ์ธ๊ฐ„์ค‘์‹ฌ
749
-
750
- **์‹œ์Šคํ…œ์  ์ ‘๊ทผ**
751
- - Network Effects: ๋„คํŠธ์›Œํฌ
752
- - Memetics: ๋ฌธํ™” ์ „ํŒŒ
753
- - Biomimicry: ์ž์—ฐ ๋ชจ๋ฐฉ
754
- """)
755
-
756
- # 15๊ฐœ ํƒญ ์ƒ์„ฑ
757
- with gr.Tabs():
758
- # 1. Square Theory
759
- with gr.Tab("๐ŸŸฆ Square Theory"):
760
- square_output = gr.Markdown()
761
- square_visual = gr.HTML()
762
-
763
- # 2. Conceptual Blending
764
- with gr.Tab("๐Ÿ”€ Conceptual Blending"):
765
- blending_output = gr.Markdown()
766
- blending_visual = gr.HTML()
767
-
768
- # 3. Sound Symbolism
769
- with gr.Tab("๐Ÿ”Š Sound Symbolism"):
770
- sound_output = gr.Markdown()
771
- sound_visual = gr.HTML()
772
-
773
- # 4. Linguistic Relativity
774
- with gr.Tab("๐ŸŒ Linguistic Relativity"):
775
- linguistic_output = gr.Markdown()
776
- linguistic_visual = gr.HTML()
777
-
778
- # 5. Archetype Theory
779
- with gr.Tab("๐ŸŽญ Archetype Theory"):
780
- archetype_output = gr.Markdown()
781
- archetype_visual = gr.HTML()
782
-
783
- # 6. Jobs-to-be-Done
784
- with gr.Tab("โœ… Jobs-to-be-Done"):
785
- jobs_output = gr.Markdown()
786
- jobs_visual = gr.HTML()
787
-
788
- # 7. SCAMPER
789
- with gr.Tab("๐Ÿ”ง SCAMPER Method"):
790
- scamper_output = gr.Markdown()
791
- scamper_visual = gr.HTML()
792
-
793
- # 8. Design Thinking
794
- with gr.Tab("๐Ÿ’ญ Design Thinking"):
795
- design_output = gr.Markdown()
796
- design_visual = gr.HTML()
797
-
798
- # 9. Biomimicry
799
- with gr.Tab("๐ŸŒฟ Biomimicry"):
800
- biomimicry_output = gr.Markdown()
801
- biomimicry_visual = gr.HTML()
802
-
803
- # 10. Cognitive Load
804
- with gr.Tab("๐Ÿง  Cognitive Load"):
805
- cognitive_output = gr.Markdown()
806
- cognitive_visual = gr.HTML()
807
-
808
- # 11. Von Restorff
809
- with gr.Tab("โšก Von Restorff Effect"):
810
- vonrestorff_output = gr.Markdown()
811
- vonrestorff_visual = gr.HTML()
812
-
813
- # 12. Network Effects
814
- with gr.Tab("๐ŸŒ Network Effects"):
815
- network_output = gr.Markdown()
816
- network_visual = gr.HTML()
817
-
818
- # 13. Memetics
819
- with gr.Tab("๐Ÿงฌ Memetics"):
820
- memetics_output = gr.Markdown()
821
- memetics_visual = gr.HTML()
822
-
823
- # 14. Color Psychology
824
- with gr.Tab("๐ŸŽจ Color Psychology"):
825
- color_output = gr.Markdown()
826
- color_visual = gr.HTML()
827
-
828
- # 15. Gestalt Principles
829
- with gr.Tab("๐Ÿ‘๏ธ Gestalt Principles"):
830
- gestalt_output = gr.Markdown()
831
- gestalt_visual = gr.HTML()
832
-
833
- # ๋ชจ๋“  ์ด๋ก  ๋™์‹œ ์ƒ์„ฑ ํ•จ์ˆ˜
834
- def generate_all_theories(industry, keywords):
835
- results = {}
836
-
837
- theories = [
838
- ("square", square_output, square_visual),
839
- ("blending", blending_output, blending_visual),
840
- ("sound", sound_output, sound_visual),
841
- ("linguistic", linguistic_output, linguistic_visual),
842
- ("archetype", archetype_output, archetype_visual),
843
- ("jobs", jobs_output, jobs_visual),
844
- ("scamper", scamper_output, scamper_visual),
845
- ("design", design_output, design_visual),
846
- ("biomimicry", biomimicry_output, biomimicry_visual),
847
- ("cognitive", cognitive_output, cognitive_visual),
848
- ("vonrestorff", vonrestorff_output, vonrestorff_visual),
849
- ("network", network_output, network_visual),
850
- ("memetics", memetics_output, memetics_visual),
851
- ("color", color_output, color_visual),
852
- ("gestalt", gestalt_output, gestalt_visual)
853
- ]
854
-
855
- outputs = []
856
- for theory_key, md_output, html_output in theories:
857
- md, html = generate_by_theory(industry, keywords, theory_key)
858
- outputs.extend([md, html])
859
-
860
- return outputs
861
-
862
- # ์ด๋ฒคํŠธ ์—ฐ๊ฒฐ
863
- generate_btn.click(
864
- fn=generate_all_theories,
865
- inputs=[industry_input, keywords_input],
866
- outputs=[
867
- square_output, square_visual,
868
- blending_output, blending_visual,
869
- sound_output, sound_visual,
870
- linguistic_output, linguistic_visual,
871
- archetype_output, archetype_visual,
872
- jobs_output, jobs_visual,
873
- scamper_output, scamper_visual,
874
- design_output, design_visual,
875
- biomimicry_output, biomimicry_visual,
876
- cognitive_output, cognitive_visual,
877
- vonrestorff_output, vonrestorff_visual,
878
- network_output, network_visual,
879
- memetics_output, memetics_visual,
880
- color_output, color_visual,
881
- gestalt_output, gestalt_visual
882
- ]
883
- )
884
-
885
- gr.Examples(
886
- examples=[
887
- ["์นดํŽ˜/์ปคํ”ผ์ˆ", "ํ”„๋ฆฌ๋ฏธ์—„, ์•„๋Š‘ํ•œ, ๋„์‹œ"],
888
- ["ํ”ผํŠธ๋‹ˆ์Šค/ํ—ฌ์Šค์žฅ", "๊ฐ•๋ ฅํ•œ, ์ปค๋ฎค๋‹ˆํ‹ฐ, ๋ณ€ํ™”"],
889
- ["๊ต์œก/์—๋“€ํ…Œํฌ", "์Šค๋งˆํŠธ, ์žฌ๋ฏธ์žˆ๋Š”, ์„ฑ์žฅ"],
890
- ["์Œ์‹ ๋ฐฐ๋‹ฌ", "๋น ๋ฅธ, ์‹ ์„ ํ•œ, ๋‹ค์–‘ํ•œ"],
891
- ["์นœํ™˜๊ฒฝ/์ง€์†๊ฐ€๋Šฅ", "์ž์—ฐ, ๋ฏธ๋ž˜, ์ˆœํ™˜"]
892
- ],
893
- inputs=[industry_input, keywords_input]
894
- )
895
-
896
- gr.Markdown("""
897
- ---
898
- ### ๐ŸŽฏ ํ™œ์šฉ ๊ฐ€์ด๋“œ
899
-
900
- 1. **๋น„๊ต ๋ถ„์„**: ๊ฐ ์ด๋ก ์˜ ๊ฒฐ๊ณผ๋ฅผ ๋น„๊ตํ•˜์—ฌ ๊ฐ€์žฅ ์ ํ•ฉํ•œ ๋ธŒ๋žœ๋“œ ์„ ํƒ
901
- 2. **ํ•˜์ด๋ธŒ๋ฆฌ๋“œ ์ ‘๊ทผ**: ์—ฌ๋Ÿฌ ์ด๋ก ์˜ ์žฅ์ ์„ ๊ฒฐํ•ฉํ•œ ์ƒˆ๋กœ์šด ๋ธŒ๋žœ๋“œ ์ฐฝ์กฐ
902
- 3. **ํƒ€๊ฒŸ๋ณ„ ์„ ํƒ**: ๋ชฉํ‘œ ๊ณ ๊ฐ์ธต์— ๋”ฐ๋ผ ๊ฐ€์žฅ ํšจ๊ณผ์ ์ธ ์ด๋ก  ์„ ํƒ
903
- 4. **A/B ํ…Œ์ŠคํŠธ**: ๋‹ค์–‘ํ•œ ์ด๋ก  ๊ธฐ๋ฐ˜ ๋ธŒ๋žœ๋“œ๋กœ ์‹œ์žฅ ํ…Œ์ŠคํŠธ
904
-
905
- ### ๐Ÿ“š ๊ฐ ์ด๋ก ์˜ ๊ฐ•์ 
906
-
907
- - **์ฆ‰๊ฐ์  ์ดํ•ด**: Cognitive Load, Sound Symbolism
908
- - **๊ฐ์ •์  ์—ฐ๊ฒฐ**: Archetype, Color Psychology
909
- - **์ฐจ๋ณ„ํ™”**: Von Restorff, SCAMPER
910
- - **๋ฐ”์ด๋Ÿด ์ž ์žฌ๋ ฅ**: Memetics, Network Effects
911
- - **๋ฌธ์ œ ํ•ด๊ฒฐ**: Jobs-to-be-Done, Design Thinking
912
- - **ํ˜์‹ ์„ฑ**: Biomimicry, Conceptual Blending
913
- - **๊ตฌ์กฐ์  ์™„์„ฑ๋„**: Square Theory, Gestalt
914
- """)
915
-
916
- if __name__ == "__main__":
917
- demo.launch(
918
- server_name="0.0.0.0",
919
- server_port=7860,
920
- share=False
921
- )