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