Delete app-BACKUP2.py
Browse files- 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(" ", " ")
|
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 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|