Naming / app-BACKUP2.py
openfree's picture
Rename app.py to app-BACKUP2.py
a3f5c3b verified
raw
history blame
33.6 kB
"""
Ultimate Brand Theory Generator
===============================
2025-05-28 | 15๊ฐœ ์ด๋ก ์„ ํ†ตํ•ฉํ•œ ์ข…ํ•ฉ ๋ธŒ๋žœ๋“œ ์ƒ์„ฑ๊ธฐ
-----------------------------------------------------
ํ†ตํ•ฉ๋œ ์ด๋ก ๋“ค:
1. Square Theory - ์˜๋ฏธ์  ์‚ฌ๊ฐํ˜• ๊ตฌ์กฐ
2. Conceptual Blending - ๊ฐœ๋… ํ˜ผํ•ฉ
3. Sound Symbolism - ์Œํ–ฅ ์ƒ์ง•์ฃผ์˜
4. Linguistic Relativity - ์–ธ์–ด ์ƒ๋Œ€์„ฑ
5. Archetype Theory - ์›ํ˜• ์ด๋ก 
6. Jobs-to-be-Done - ํ•  ์ผ ์ด๋ก 
7. SCAMPER Method - ์ฐฝ์˜์  ๋ณ€ํ˜•
8. Design Thinking - ๋””์ž์ธ ์‚ฌ๊ณ 
9. Biomimicry - ์ƒ์ฒด๋ชจ๋ฐฉ
10. Cognitive Load - ์ธ์ง€ ๋ถ€ํ•˜
11. Von Restorff Effect - ๊ณ ๋ฆฝ ํšจ๊ณผ
12. Network Effects - ๋„คํŠธ์›Œํฌ ํšจ๊ณผ
13. Memetics - ๋ฐˆ ์ด๋ก 
14. Color Psychology - ์ƒ‰์ƒ ์‹ฌ๋ฆฌํ•™
15. Gestalt Principles - ๊ฒŒ์ŠˆํƒˆํŠธ ์›์น™
"""
import os
import json
import gradio as gr
import openai
from openai import OpenAI
from datetime import datetime
from typing import List, Dict, Tuple, Optional
import random
# OpenAI ํด๋ผ์ด์–ธํŠธ
if not os.getenv("OPENAI_API_KEY"):
raise EnvironmentError("OPENAI_API_KEY ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ•˜์„ธ์š”.")
client = OpenAI()
# ===== 1. SQUARE THEORY =====
SQUARE_THEORY_PROMPT = """
๋‹น์‹ ์€ Square Theory ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. Square Theory๋Š” 4๊ฐœ์˜ ๋‹จ์–ด๊ฐ€ ์˜๋ฏธ์  ๊ด€๊ณ„๋กœ ์—ฐ๊ฒฐ๋˜์–ด ์‚ฌ๊ฐํ˜•์„ ์ด๋ฃจ๋Š” ๊ตฌ์กฐ์ž…๋‹ˆ๋‹ค.
๋ธŒ๋žœ๋“œ๋ช…์ด Square๋ฅผ ์™„์„ฑํ•˜๋ฉฐ "์•„ํ•˜!" ๋ชจ๋จผํŠธ๋ฅผ ๋งŒ๋“ค์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
์‚ฌ์šฉ์ž ์ž…๋ ฅ(์—…์ข…/ํ‚ค์›Œ๋“œ)์„ ๋ฐ›์•„ ๋‹ค์Œ JSON ํ˜•์‹์˜ ๋ฐฐ์—ด์„ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"tl": "์™ผ์ชฝ์ƒ๋‹จ", "tr": "์˜ค๋ฅธ์ชฝ์ƒ๋‹จ", "bl": "์™ผ์ชฝํ•˜๋‹จ", "br": "์˜ค๋ฅธ์ชฝํ•˜๋‹จ",
"top_edge": "์ƒ๋‹จ ๊ด€๊ณ„", "bottom_edge": "ํ•˜๋‹จ ๊ด€๊ณ„",
"left_edge": "์™ผ์ชฝ ๊ด€๊ณ„", "right_edge": "์˜ค๋ฅธ์ชฝ ๊ด€๊ณ„",
"slogan": "์Šฌ๋กœ๊ฑด",
"explanation": "์™œ ํšจ๊ณผ์ ์ธ์ง€"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 2. CONCEPTUAL BLENDING =====
CONCEPTUAL_BLENDING_PROMPT = """
๋‹น์‹ ์€ Conceptual Blending Theory ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ๋‘ ๊ฐœ ์ด์ƒ์˜ ๊ฐœ๋…์„ ํ˜ผํ•ฉํ•˜์—ฌ ์ƒˆ๋กœ์šด ์˜๋ฏธ๋ฅผ ์ฐฝ์ถœํ•ฉ๋‹ˆ๋‹ค.
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"input_space1": "์ฒซ ๋ฒˆ์งธ ๊ฐœ๋…",
"input_space2": "๋‘ ๋ฒˆ์งธ ๊ฐœ๋…",
"generic_space": "๊ณตํ†ต ๊ตฌ์กฐ",
"blended_space": "ํ˜ผํ•ฉ๋œ ์ƒˆ๋กœ์šด ์˜๋ฏธ",
"emergent_properties": "์ฐฝ๋ฐœ์  ์†์„ฑ๋“ค",
"slogan": "์Šฌ๋กœ๊ฑด",
"explanation": "ํ˜ผํ•ฉ์ด ํšจ๊ณผ์ ์ธ ์ด์œ "
}
์˜ˆ์‹œ: Netflix = Net(์ธํ„ฐ๋„ท) + Flix(์˜ํ™”) โ†’ ์˜จ๋ผ์ธ ์ŠคํŠธ๋ฆฌ๋ฐ์˜ ์ƒˆ๋กœ์šด ๊ฐœ๋…
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 3. SOUND SYMBOLISM =====
SOUND_SYMBOLISM_PROMPT = """
๋‹น์‹ ์€ Sound Symbolism ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์Œ์†Œ์™€ ์˜๋ฏธ ๊ฐ„์˜ ์—ฐ๊ด€์„ฑ์„ ํ™œ์šฉํ•ฉ๋‹ˆ๋‹ค.
์Œํ–ฅ ์›์น™:
- ์ „์„ค๋ชจ์Œ(i,e): ์ž‘๊ณ , ๋น ๋ฅด๊ณ , ๊ฐ€๋ฒผ์›€
- ํ›„์„ค๋ชจ์Œ(o,u): ํฌ๊ณ , ๋А๋ฆฌ๊ณ , ๋ฌด๊ฑฐ์›€
- ์œ ์Œ(l,r,m,n): ๋ถ€๋“œ๋Ÿฝ๊ณ  ์œ ์—ฐํ•จ
- ํŒŒ์—ด์Œ(p,t,k,b,d,g): ๊ฐ•ํ•˜๊ณ  ์—ญ๋™์ 
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"phonetic_analysis": "์Œ์„ฑ ๋ถ„์„",
"sound_meaning": "์Œํ–ฅ์ด ์ „๋‹ฌํ•˜๋Š” ์˜๋ฏธ",
"target_emotion": "๋ชฉํ‘œ ๊ฐ์ •",
"industry_fit": "์—…์ข… ์ ํ•ฉ์„ฑ",
"pronunciation_guide": "๋ฐœ์Œ ๊ฐ€์ด๋“œ",
"slogan": "์Šฌ๋กœ๊ฑด"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 4. LINGUISTIC RELATIVITY =====
LINGUISTIC_RELATIVITY_PROMPT = """
๋‹น์‹ ์€ Linguistic Relativity ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์–ธ์–ด๋ณ„ ์‚ฌ๊ณ ๋ฐฉ์‹ ์ฐจ์ด๋ฅผ ๊ณ ๋ คํ•ฉ๋‹ˆ๋‹ค.
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋‹ค์–ธ์–ด ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๊ธ€๋กœ๋ฒŒ ๋ธŒ๋žœ๋“œ๋ช…",
"korean_adaptation": "ํ•œ๊ตญ์–ด ์ ์‘",
"english_meaning": "์˜์–ด ์˜๋ฏธ",
"cultural_considerations": "๋ฌธํ™”์  ๊ณ ๋ ค์‚ฌํ•ญ",
"avoid_meanings": "ํ”ผํ•ด์•ผ ํ•  ์˜๋ฏธ๋“ค",
"localization_strategy": "ํ˜„์ง€ํ™” ์ „๋žต",
"slogan": "์Šฌ๋กœ๊ฑด"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 5. ARCHETYPE THEORY =====
ARCHETYPE_THEORY_PROMPT = """
๋‹น์‹ ์€ Jung์˜ Archetype Theory ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. 12๊ฐ€์ง€ ์›ํ˜• ์ค‘ ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•˜์—ฌ ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
12 ์›ํ˜•: Innocent, Hero, Outlaw, Explorer, Creator, Ruler, Magician, Lover, Caregiver, Jester, Sage, Regular Guy
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"archetype": "์„ ํƒ๋œ ์›ํ˜•",
"archetype_traits": "์›ํ˜•์˜ ํŠน์ง•๋“ค",
"brand_personality": "๋ธŒ๋žœ๋“œ ์„ฑ๊ฒฉ",
"visual_direction": "์‹œ๊ฐ์  ๋ฐฉํ–ฅ",
"voice_tone": "๋ชฉ์†Œ๋ฆฌ ํ†ค",
"slogan": "์Šฌ๋กœ๊ฑด",
"mythology_reference": "์‹ ํ™”์  ์ฐธ์กฐ"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 6. JOBS-TO-BE-DONE =====
JOBS_TO_BE_DONE_PROMPT = """
๋‹น์‹ ์€ Jobs-to-be-Done Theory ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ๊ณ ๊ฐ์ด ํ•ด๊ฒฐํ•˜๋ ค๋Š” '์ผ'์— ์ดˆ์ ์„ ๋งž์ถฅ๋‹ˆ๋‹ค.
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"functional_job": "๊ธฐ๋Šฅ์  ์ผ",
"emotional_job": "๊ฐ์ •์  ์ผ",
"social_job": "์‚ฌํšŒ์  ์ผ",
"job_statement": "ํ•ต์‹ฌ Job ๋ฌธ์žฅ",
"outcome_metrics": "์„ฑ๊ณผ ์ง€ํ‘œ",
"slogan": "์Šฌ๋กœ๊ฑด",
"value_proposition": "๊ฐ€์น˜ ์ œ์•ˆ"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 7. SCAMPER METHOD =====
SCAMPER_PROMPT = """
๋‹น์‹ ์€ SCAMPER Method ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. 7๊ฐ€์ง€ ์ฐฝ์˜์  ๊ธฐ๋ฒ•์„ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.
S - Substitute (๋Œ€์ฒด)
C - Combine (๊ฒฐํ•ฉ)
A - Adapt (์ ์‘)
M - Modify/Magnify (์ˆ˜์ •/ํ™•๋Œ€)
P - Put to another use (๋‹ค๋ฅธ ์šฉ๋„)
E - Eliminate (์ œ๊ฑฐ)
R - Reverse (์—ญ์ „)
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"scamper_technique": "์‚ฌ์šฉ๋œ ๊ธฐ๋ฒ•",
"original_concept": "์›๋ž˜ ๊ฐœ๋…",
"transformation": "๋ณ€ํ˜• ๊ณผ์ •",
"innovative_aspect": "ํ˜์‹ ์  ์ธก๋ฉด",
"slogan": "์Šฌ๋กœ๊ฑด"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 8. DESIGN THINKING =====
DESIGN_THINKING_PROMPT = """
๋‹น์‹ ์€ IDEO์˜ Design Thinking ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์ธ๊ฐ„ ์ค‘์‹ฌ ํ˜์‹ ์„ ์ถ”๊ตฌํ•ฉ๋‹ˆ๋‹ค.
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"user_insight": "์‚ฌ์šฉ์ž ํ†ต์ฐฐ",
"pain_point": "ํ•ด๊ฒฐํ•˜๋Š” ๋ฌธ์ œ์ ",
"desirability": "๋ฐ”๋žŒ์งํ•จ (์ธ๊ฐ„)",
"feasibility": "์‹คํ˜„๊ฐ€๋Šฅ์„ฑ (๊ธฐ์ˆ )",
"viability": "์ƒ์กด๊ฐ€๋Šฅ์„ฑ (๋น„์ฆˆ๋‹ˆ์Šค)",
"prototype_concept": "ํ”„๋กœํ† ํƒ€์ž… ์ปจ์…‰",
"slogan": "์Šฌ๋กœ๊ฑด"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 9. BIOMIMICRY =====
BIOMIMICRY_PROMPT = """
๋‹น์‹ ์€ Biomimicry ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์ž์—ฐ์—์„œ ์˜๊ฐ์„ ๋ฐ›์€ ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"natural_inspiration": "์ž์—ฐ์  ์˜๊ฐ์›",
"biomimetic_principle": "์ƒ์ฒด๋ชจ๋ฐฉ ์›๋ฆฌ",
"form_function": "ํ˜•ํƒœ์™€ ๊ธฐ๋Šฅ",
"sustainability_aspect": "์ง€์†๊ฐ€๋Šฅ์„ฑ ์ธก๋ฉด",
"adaptation_strategy": "์ ์‘ ์ „๋žต",
"slogan": "์Šฌ๋กœ๊ฑด"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 10. COGNITIVE LOAD =====
COGNITIVE_LOAD_PROMPT = """
๋‹น์‹ ์€ Cognitive Load Theory ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์ธ์ง€ ์ฒ˜๋ฆฌ๋ฅผ ์ตœ์†Œํ™”ํ•˜๋Š” ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"syllable_count": "์Œ์ ˆ ์ˆ˜",
"processing_ease": "์ฒ˜๋ฆฌ ์šฉ์ด์„ฑ ์ ์ˆ˜",
"memory_hooks": "๊ธฐ์–ต ๊ณ ๋ฆฌ",
"pronunciation_simplicity": "๋ฐœ์Œ ๋‹จ์ˆœ์„ฑ",
"cognitive_fluency": "์ธ์ง€์  ์œ ์ฐฝ์„ฑ",
"slogan": "์Šฌ๋กœ๊ฑด"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 11. VON RESTORFF EFFECT =====
VON_RESTORFF_PROMPT = """
๋‹น์‹ ์€ Von Restorff Effect ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ๋…ํŠนํ•˜๊ณ  ๊ธฐ์–ต์— ๋‚จ๋Š” ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"category_norm": "์นดํ…Œ๊ณ ๋ฆฌ ํ‘œ์ค€",
"deviation_strategy": "์ผํƒˆ ์ „๋žต",
"uniqueness_factors": "๋…ํŠน์„ฑ ์š”์†Œ๋“ค",
"memorability_score": "๊ธฐ์–ต์„ฑ ์ ์ˆ˜",
"attention_triggers": "์ฃผ์˜ ํŠธ๋ฆฌ๊ฑฐ",
"slogan": "์Šฌ๋กœ๊ฑด"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 12. NETWORK EFFECTS =====
NETWORK_EFFECTS_PROMPT = """
๋‹น์‹ ์€ Network Effects ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ๋„คํŠธ์›Œํฌ ๊ฐ€์น˜๋ฅผ ๊ทน๋Œ€ํ™”ํ•˜๋Š” ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"network_type": "๋„คํŠธ์›Œํฌ ์œ ํ˜•",
"viral_coefficient": "๋ฐ”์ด๋Ÿด ๊ณ„์ˆ˜",
"sharing_ease": "๊ณต์œ  ์šฉ์ด์„ฑ",
"community_aspect": "์ปค๋ฎค๋‹ˆํ‹ฐ ์ธก๋ฉด",
"network_value": "๋„คํŠธ์›Œํฌ ๊ฐ€์น˜",
"slogan": "์Šฌ๋กœ๊ฑด"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 13. MEMETICS =====
MEMETICS_PROMPT = """
๋‹น์‹ ์€ Memetics ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ๋ฌธํ™”์ ์œผ๋กœ ๋ณต์ œ๋˜๊ณ  ์ง„ํ™”ํ•˜๋Š” ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"meme_structure": "๋ฐˆ ๊ตฌ์กฐ",
"replication_ease": "๋ณต์ œ ์šฉ์ด์„ฑ",
"mutation_potential": "๋ณ€์ด ์ž ์žฌ๋ ฅ",
"cultural_fitness": "๋ฌธํ™”์  ์ ํ•ฉ๋„",
"transmission_channels": "์ „๋‹ฌ ์ฑ„๋„",
"slogan": "์Šฌ๋กœ๊ฑด"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 14. COLOR PSYCHOLOGY =====
COLOR_PSYCHOLOGY_PROMPT = """
๋‹น์‹ ์€ Color Psychology ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์ƒ‰์ƒ ์—ฐ์ƒ๊ณผ ๊ฐ์ •์„ ํ™œ์šฉํ•œ ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"primary_color": "์ฃผ ์ƒ‰์ƒ",
"color_meaning": "์ƒ‰์ƒ ์˜๋ฏธ",
"emotional_response": "๊ฐ์ •์  ๋ฐ˜์‘",
"cultural_associations": "๋ฌธํ™”์  ์—ฐ์ƒ",
"industry_alignment": "์—…์ข… ์ •๋ ฌ",
"slogan": "์Šฌ๋กœ๊ฑด"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ===== 15. GESTALT PRINCIPLES =====
GESTALT_PROMPT = """
๋‹น์‹ ์€ Gestalt Theory ์ „๋ฌธ๊ฐ€์ž…๋‹ˆ๋‹ค. ์ง€๊ฐ ์›๋ฆฌ๋ฅผ ํ™œ์šฉํ•œ ๋ธŒ๋žœ๋“œ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
๋‹ค์Œ JSON ํ˜•์‹์œผ๋กœ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”:
{
"brand_name": "๋ธŒ๋žœ๋“œ๋ช…",
"gestalt_principle": "ํ™œ์šฉ ์›์น™",
"visual_structure": "์‹œ๊ฐ์  ๊ตฌ์กฐ",
"perceptual_grouping": "์ง€๊ฐ์  ๊ทธ๋ฃนํ™”",
"figure_ground": "์ „๊ฒฝ-๋ฐฐ๊ฒฝ ๊ด€๊ณ„",
"closure_effect": "ํ์‡„ ํšจ๊ณผ",
"slogan": "์Šฌ๋กœ๊ฑด"
}
๋ฐ˜๋“œ์‹œ ์œ ํšจํ•œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
"""
# ์ด๋ก ๋ณ„ ํ”„๋กฌํ”„ํŠธ ๋งคํ•‘
THEORY_PROMPTS = {
"square": SQUARE_THEORY_PROMPT,
"blending": CONCEPTUAL_BLENDING_PROMPT,
"sound": SOUND_SYMBOLISM_PROMPT,
"linguistic": LINGUISTIC_RELATIVITY_PROMPT,
"archetype": ARCHETYPE_THEORY_PROMPT,
"jobs": JOBS_TO_BE_DONE_PROMPT,
"scamper": SCAMPER_PROMPT,
"design": DESIGN_THINKING_PROMPT,
"biomimicry": BIOMIMICRY_PROMPT,
"cognitive": COGNITIVE_LOAD_PROMPT,
"vonrestorff": VON_RESTORFF_PROMPT,
"network": NETWORK_EFFECTS_PROMPT,
"memetics": MEMETICS_PROMPT,
"color": COLOR_PSYCHOLOGY_PROMPT,
"gestalt": GESTALT_PROMPT
}
def generate_by_theory(industry: str, keywords: str, theory: str, count: int = 3) -> Tuple[str, str]:
"""ํŠน์ • ์ด๋ก ์œผ๋กœ ๋ธŒ๋žœ๋“œ ์ƒ์„ฑ"""
if not industry or not keywords:
return "โš ๏ธ ์—…์ข…๊ณผ ํ‚ค์›Œ๋“œ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.", ""
prompt = THEORY_PROMPTS.get(theory, SQUARE_THEORY_PROMPT)
user_input = f"""์—…์ข…: {industry}
ํ‚ค์›Œ๋“œ: {keywords}
์œ„ ์ •๋ณด๋กœ {count}๊ฐœ์˜ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”.
๋ฐ˜๋“œ์‹œ JSON ํ˜•์‹์œผ๋กœ ์‘๋‹ตํ•˜์„ธ์š”.
๊ฒฐ๊ณผ๋Š” ๋ธŒ๋žœ๋“œ ๊ฐ์ฒด๋“ค์˜ JSON ๋ฐฐ์—ด์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค."""
try:
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "system", "content": prompt},
{"role": "user", "content": user_input}
],
temperature=0.8,
max_tokens=2000,
response_format={"type": "json_object"}
)
content = response.choices[0].message.content
data = json.loads(content)
# ์‘๋‹ต ์ •๊ทœํ™”
if isinstance(data, dict):
if "results" in data:
results = data["results"]
elif "brands" in data:
results = data["brands"]
elif "brand_name" in data:
# ๋‹จ์ผ ๋ธŒ๋žœ๋“œ๋ฅผ ๋ฐฐ์—ด๋กœ ๋ณ€ํ™˜
results = [data]
else:
# ๋ž˜ํ•‘๋œ ์‘๋‹ต ์ฒ˜๋ฆฌ
results = []
for key, value in data.items():
if isinstance(value, list):
results = value
break
elif isinstance(value, dict) and "brand_name" in value:
results = [value]
break
else:
results = data
if not isinstance(results, list):
results = [results]
# ๋งˆํฌ๋‹ค์šด ์ƒ์„ฑ
markdown = generate_theory_markdown(theory, results, industry, keywords)
# HTML ์‹œ๊ฐํ™” ์ƒ์„ฑ
html = generate_theory_visualization(theory, results)
return markdown, html
except Exception as e:
return f"โŒ ์˜ค๋ฅ˜: {str(e)}", ""
def generate_theory_markdown(theory: str, results: List[Dict], industry: str, keywords: str) -> str:
"""์ด๋ก ๋ณ„ ๋งž์ถค ๋งˆํฌ๋‹ค์šด ์ƒ์„ฑ"""
theory_names = {
"square": "Square Theory",
"blending": "Conceptual Blending",
"sound": "Sound Symbolism",
"linguistic": "Linguistic Relativity",
"archetype": "Archetype Theory",
"jobs": "Jobs-to-be-Done",
"scamper": "SCAMPER Method",
"design": "Design Thinking",
"biomimicry": "Biomimicry",
"cognitive": "Cognitive Load Theory",
"vonrestorff": "Von Restorff Effect",
"network": "Network Effects",
"memetics": "Memetics",
"color": "Color Psychology",
"gestalt": "Gestalt Principles"
}
markdown = f"""# ๐ŸŽฏ {theory_names[theory]} ๊ฒฐ๊ณผ
**์—…์ข…**: {industry} | **ํ‚ค์›Œ๋“œ**: {keywords}
*์ƒ์„ฑ ์‹œ๊ฐ: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}*
---
"""
for idx, result in enumerate(results, 1):
brand_name = result.get('brand_name', 'N/A')
slogan = result.get('slogan', 'N/A')
markdown += f"\n## {idx}. {brand_name}\n"
markdown += f"**์Šฌ๋กœ๊ฑด**: *\"{slogan}\"*\n\n"
# ์ด๋ก ๋ณ„ ํŠน์ˆ˜ ํ•„๋“œ ํ‘œ์‹œ
if theory == "square":
markdown += f"""
### Square ๊ตฌ์กฐ
```
[{result.get('tl')}] โ”€({result.get('top_edge')})โ”€ [{result.get('tr')}]
โ”‚ โ”‚
({result.get('left_edge')}) ({result.get('right_edge')})
โ”‚ โ”‚
[{result.get('bl')}] โ”€({result.get('bottom_edge')})โ”€ [{result.get('br')}]
```
"""
elif theory == "blending":
markdown += f"""
### ๊ฐœ๋… ํ˜ผํ•ฉ
- **์ž…๋ ฅ ๊ณต๊ฐ„ 1**: {result.get('input_space1')}
- **์ž…๋ ฅ ๊ณต๊ฐ„ 2**: {result.get('input_space2')}
- **์ผ๋ฐ˜ ๊ณต๊ฐ„**: {result.get('generic_space')}
- **ํ˜ผํ•ฉ ๊ณต๊ฐ„**: {result.get('blended_space')}
- **์ฐฝ๋ฐœ์  ์†์„ฑ**: {result.get('emergent_properties')}
"""
elif theory == "sound":
markdown += f"""
### ์Œํ–ฅ ๋ถ„์„
- **์Œ์„ฑ ๋ถ„์„**: {result.get('phonetic_analysis')}
- **์Œํ–ฅ ์˜๋ฏธ**: {result.get('sound_meaning')}
- **๋ชฉํ‘œ ๊ฐ์ •**: {result.get('target_emotion')}
- **๋ฐœ์Œ ๊ฐ€์ด๋“œ**: {result.get('pronunciation_guide')}
"""
elif theory == "archetype":
markdown += f"""
### ์›ํ˜• ๋ถ„์„
- **์›ํ˜•**: {result.get('archetype')}
- **์›ํ˜• ํŠน์ง•**: {result.get('archetype_traits')}
- **๋ธŒ๋žœ๋“œ ์„ฑ๊ฒฉ**: {result.get('brand_personality')}
- **๋ชฉ์†Œ๋ฆฌ ํ†ค**: {result.get('voice_tone')}
"""
# ์„ค๋ช… ์ถ”๊ฐ€
explanation = result.get('explanation', result.get('value_proposition', ''))
if explanation:
markdown += f"\n๐Ÿ’ก **ํ•ต์‹ฌ ๊ฐ€์น˜**: {explanation}\n"
markdown += "\n---\n"
return markdown
def generate_theory_visualization(theory: str, results: List[Dict]) -> str:
"""์ด๋ก ๋ณ„ ๋งž์ถค ์‹œ๊ฐํ™” ์ƒ์„ฑ"""
html_parts = []
for idx, result in enumerate(results, 1):
if theory == "square":
html_parts.append(visualize_square_brand(result))
elif theory == "blending":
html_parts.append(visualize_conceptual_blend(result))
elif theory == "sound":
html_parts.append(visualize_sound_symbolism(result))
elif theory == "archetype":
html_parts.append(visualize_archetype(result))
elif theory == "color":
html_parts.append(visualize_color_psychology(result))
else:
html_parts.append(visualize_generic_brand(result, theory))
return "\n".join(html_parts)
# ์‹œ๊ฐํ™” ํ•จ์ˆ˜๋“ค (์ผ๋ถ€๋งŒ ์˜ˆ์‹œ)
def visualize_square_brand(brand: Dict) -> str:
"""Square Theory ์‹œ๊ฐํ™”"""
return f"""
<div style="max-width: 700px; margin: 20px auto; font-family: -apple-system, sans-serif;">
<h2 style="text-align: center; color: #2c3e50;">{brand.get('brand_name', 'Brand')}</h2>
<p style="text-align: center; font-style: italic; color: #7f8c8d;">"{brand.get('slogan', '')}"</p>
<div style="position: relative; width: 100%; height: 300px; background: #f5f7fa; border-radius: 12px; padding: 30px;">
<!-- Square ๊ตฌ์กฐ ์‹œ๊ฐํ™” -->
<div style="position: absolute; top: 30px; left: 30px; background: #3498db; color: white; padding: 15px; border-radius: 8px;">
{brand.get('tl', '?')}
</div>
<div style="position: absolute; top: 30px; right: 30px; background: #e74c3c; color: white; padding: 15px; border-radius: 8px;">
{brand.get('tr', '?')}
</div>
<div style="position: absolute; bottom: 30px; left: 30px; background: #f39c12; color: white; padding: 15px; border-radius: 8px;">
{brand.get('bl', '?')}
</div>
<div style="position: absolute; bottom: 30px; right: 30px; background: #27ae60; color: white; padding: 15px; border-radius: 8px;">
{brand.get('br', '?')}
</div>
<!-- ๋ธŒ๋žœ๋“œ๋ช… ์ค‘์•™ -->
<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);">
<div style="font-size: 1.8em; font-weight: bold; color: #2c3e50;">{brand.get('brand_name', 'Brand')}</div>
</div>
</div>
</div>
"""
def visualize_conceptual_blend(brand: Dict) -> str:
"""Conceptual Blending ์‹œ๊ฐํ™”"""
brand_name = brand.get('brand_name', 'Brand')
input1 = brand.get('input_space1', 'Concept 1')
input2 = brand.get('input_space2', 'Concept 2')
blended = brand.get('blended_space', 'Blended Concept')
slogan = brand.get('slogan', '')
return f"""
<div style="max-width: 700px; margin: 20px auto; font-family: -apple-system, sans-serif;">
<h2 style="text-align: center; color: #2c3e50;">{brand_name}</h2>
<div style="display: flex; justify-content: space-around; align-items: center; margin: 30px 0;">
<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;">
<div>
<strong>Input 1</strong><br>
{input1}
</div>
</div>
<div style="font-size: 2em;">+</div>
<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;">
<div>
<strong>Input 2</strong><br>
{input2}
</div>
</div>
<div style="font-size: 2em;">=</div>
<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;">
<div>
<strong>Blend</strong><br>
{blended}
</div>
</div>
</div>
<p style="text-align: center; font-style: italic;">"{slogan}"</p>
</div>
"""
def visualize_sound_symbolism(brand: Dict) -> str:
"""Sound Symbolism ์‹œ๊ฐํ™”"""
return f"""
<div style="max-width: 700px; margin: 20px auto; font-family: -apple-system, sans-serif;">
<h2 style="text-align: center; color: #2c3e50;">{brand.get('brand_name', 'Brand')}</h2>
<div style="background: #f8f9fa; padding: 30px; border-radius: 12px; text-align: center;">
<div style="font-size: 3em; letter-spacing: 0.2em; margin: 20px 0; color: #3498db;">
{brand.get('brand_name', 'BRAND')}
</div>
<div style="margin: 20px 0; padding: 15px; background: white; border-radius: 8px;">
<strong>์Œ์„ฑ ๋ถ„์„</strong><br>
{brand.get('phonetic_analysis', '')}
</div>
<div style="margin: 20px 0; padding: 15px; background: white; border-radius: 8px;">
<strong>์Œํ–ฅ์ด ์ „๋‹ฌํ•˜๋Š” ๊ฐ์ •</strong><br>
{brand.get('sound_meaning', '')}
</div>
<div style="margin: 20px 0; font-style: italic; color: #7f8c8d;">
๋ฐœ์Œ: {brand.get('pronunciation_guide', '')}
</div>
</div>
</div>
"""
def visualize_archetype(brand: Dict) -> str:
"""Archetype Theory ์‹œ๊ฐํ™”"""
archetype_colors = {
"Hero": "#e74c3c",
"Creator": "#9b59b6",
"Sage": "#3498db",
"Explorer": "#1abc9c",
"Innocent": "#f1c40f",
"Jester": "#e67e22",
"Lover": "#e91e63",
"Caregiver": "#00bcd4",
"Ruler": "#795548",
"Magician": "#673ab7",
"Outlaw": "#212121",
"Regular Guy": "#607d8b"
}
archetype = brand.get('archetype', 'Hero')
color = archetype_colors.get(archetype, "#3498db")
return f"""
<div style="max-width: 700px; margin: 20px auto; font-family: -apple-system, sans-serif;">
<h2 style="text-align: center; color: {color};">{brand.get('brand_name', 'Brand')}</h2>
<div style="text-align: center; margin: 30px 0;">
<div style="display: inline-block; padding: 40px; background: {color}; color: white; border-radius: 50%; width: 200px; height: 200px;">
<h3 style="margin: 0;">{archetype}</h3>
<p style="margin: 10px 0; font-size: 0.9em;">{brand.get('archetype_traits', '')}</p>
</div>
</div>
<div style="background: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0;">
<p><strong>๋ธŒ๋žœ๋“œ ์„ฑ๊ฒฉ</strong>: {brand.get('brand_personality', '')}</p>
<p><strong>๋ชฉ์†Œ๋ฆฌ ํ†ค</strong>: {brand.get('voice_tone', '')}</p>
</div>
<p style="text-align: center; font-style: italic; font-size: 1.2em;">"{brand.get('slogan', '')}"</p>
</div>
"""
def visualize_color_psychology(brand: Dict) -> str:
"""Color Psychology ์‹œ๊ฐํ™”"""
color = brand.get('primary_color', '#3498db')
return f"""
<div style="max-width: 700px; margin: 20px auto; font-family: -apple-system, sans-serif;">
<h2 style="text-align: center; color: #2c3e50;">{brand.get('brand_name', 'Brand')}</h2>
<div style="text-align: center; margin: 30px 0;">
<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>
</div>
<div style="background: #f8f9fa; padding: 20px; border-radius: 8px;">
<p><strong>์ฃผ ์ƒ‰์ƒ</strong>: {brand.get('primary_color', '')}</p>
<p><strong>์ƒ‰์ƒ ์˜๋ฏธ</strong>: {brand.get('color_meaning', '')}</p>
<p><strong>๊ฐ์ •์  ๋ฐ˜์‘</strong>: {brand.get('emotional_response', '')}</p>
<p><strong>๋ฌธํ™”์  ์—ฐ์ƒ</strong>: {brand.get('cultural_associations', '')}</p>
</div>
<p style="text-align: center; font-style: italic; margin-top: 20px;">"{brand.get('slogan', '')}"</p>
</div>
"""
def visualize_generic_brand(brand: Dict, theory: str) -> str:
"""์ผ๋ฐ˜์ ์ธ ๋ธŒ๋žœ๋“œ ์‹œ๊ฐํ™”"""
# JSON์„ HTML๋กœ ๋ณ€ํ™˜ (f-string ๋ฐ–์—์„œ ์ฒ˜๋ฆฌ)
json_str = json.dumps(brand, ensure_ascii=False, indent=2)
json_html = json_str.replace("\n", "<br>").replace(" ", "&nbsp;")
html = f"""
<div style="max-width: 700px; margin: 20px auto; padding: 30px; background: #f8f9fa; border-radius: 12px; font-family: -apple-system, sans-serif;">
<h2 style="text-align: center; color: #2c3e50; margin-bottom: 10px;">{brand.get('brand_name', 'Brand')}</h2>
<p style="text-align: center; font-style: italic; color: #7f8c8d; margin-bottom: 30px;">"{brand.get('slogan', '')}"</p>
<div style="background: white; padding: 20px; border-radius: 8px; font-family: monospace; font-size: 0.9em;">
<pre style="margin: 0; white-space: pre-wrap;">{json_str}</pre>
</div>
</div>
"""
return html
# Gradio UI
with gr.Blocks(title="Ultimate Brand Theory Generator", theme=gr.themes.Soft()) as demo:
gr.Markdown("""
# ๐ŸŒŸ Ultimate Brand Theory Generator
### 15๊ฐœ ์ด๋ก ์„ ํ™œ์šฉํ•œ ์ข…ํ•ฉ ๋ธŒ๋žœ๋“œ ์ƒ์„ฑ๊ธฐ
ํ•˜๋‚˜์˜ ์ž…๋ ฅ์œผ๋กœ 15๊ฐ€์ง€ ๋‹ค๋ฅธ ์ด๋ก ์— ๊ธฐ๋ฐ˜ํ•œ ๋ธŒ๋žœ๋“œ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
๊ฐ ํƒญ์—์„œ ๊ฐ ์ด๋ก ์˜ ๊ณ ์œ ํ•œ ๊ด€์ ์œผ๋กœ ๋งŒ๋“ค์–ด์ง„ ๋ธŒ๋žœ๋“œ๋ฅผ ํ™•์ธํ•˜์„ธ์š”!
""")
with gr.Row():
with gr.Column(scale=2):
industry_input = gr.Textbox(
label="๐Ÿญ ์—…์ข…",
placeholder="์˜ˆ: ์นดํŽ˜, ํ”ผํŠธ๋‹ˆ์Šค, ๊ต์œก, ๋ทฐํ‹ฐ...",
value="์นดํŽ˜/์ปคํ”ผ์ˆ"
)
keywords_input = gr.Textbox(
label="๐Ÿ”‘ ํ•ต์‹ฌ ํ‚ค์›Œ๋“œ",
placeholder="ํ”„๋ฆฌ๋ฏธ์—„, ํŽธ์•ˆํ•œ, ๋„์‹œ์ ์ธ, ์นœํ™˜๊ฒฝ...",
info="๋ธŒ๋žœ๋“œ๊ฐ€ ๋‹ด์•„์•ผ ํ•  ํ•ต์‹ฌ ๊ฐ€์น˜๋‚˜ ํŠน์ง•๋“ค"
)
generate_btn = gr.Button("๐Ÿš€ ๋ชจ๋“  ์ด๋ก ์œผ๋กœ ๋ธŒ๋žœ๋“œ ์ƒ์„ฑ", variant="primary", size="lg")
with gr.Column(scale=1):
gr.Markdown("""
### ๐Ÿ’ก 15๊ฐ€์ง€ ์ด๋ก  ๊ฐœ์š”
**๊ตฌ์กฐ์  ์ ‘๊ทผ**
- Square Theory: 4์š”์†Œ ์™„์„ฑ
- Conceptual Blending: ๊ฐœ๋… ํ˜ผํ•ฉ
- Gestalt: ์ง€๊ฐ ์›๋ฆฌ
**์–ธ์–ดํ•™์  ์ ‘๊ทผ**
- Sound Symbolism: ์Œํ–ฅ ์˜๋ฏธ
- Linguistic Relativity: ๋ฌธํ™” ์ ์‘
- Cognitive Load: ์ธ์ง€ ์ตœ์ ํ™”
**์‹ฌ๋ฆฌํ•™์  ์ ‘๊ทผ**
- Archetype: ์›ํ˜• ํ™œ์šฉ
- Color Psychology: ์ƒ‰์ƒ ์‹ฌ๋ฆฌ
- Von Restorff: ๋…ํŠน์„ฑ
**์ „๋žต์  ์ ‘๊ทผ**
- Jobs-to-be-Done: ๊ณ ๊ฐ ๊ณผ์—…
- SCAMPER: ์ฐฝ์˜์  ๋ณ€ํ˜•
- Design Thinking: ์ธ๊ฐ„์ค‘์‹ฌ
**์‹œ์Šคํ…œ์  ์ ‘๊ทผ**
- Network Effects: ๋„คํŠธ์›Œํฌ
- Memetics: ๋ฌธํ™” ์ „ํŒŒ
- Biomimicry: ์ž์—ฐ ๋ชจ๋ฐฉ
""")
# 15๊ฐœ ํƒญ ์ƒ์„ฑ
with gr.Tabs():
# 1. Square Theory
with gr.Tab("๐ŸŸฆ Square Theory"):
square_output = gr.Markdown()
square_visual = gr.HTML()
# 2. Conceptual Blending
with gr.Tab("๐Ÿ”€ Conceptual Blending"):
blending_output = gr.Markdown()
blending_visual = gr.HTML()
# 3. Sound Symbolism
with gr.Tab("๐Ÿ”Š Sound Symbolism"):
sound_output = gr.Markdown()
sound_visual = gr.HTML()
# 4. Linguistic Relativity
with gr.Tab("๐ŸŒ Linguistic Relativity"):
linguistic_output = gr.Markdown()
linguistic_visual = gr.HTML()
# 5. Archetype Theory
with gr.Tab("๐ŸŽญ Archetype Theory"):
archetype_output = gr.Markdown()
archetype_visual = gr.HTML()
# 6. Jobs-to-be-Done
with gr.Tab("โœ… Jobs-to-be-Done"):
jobs_output = gr.Markdown()
jobs_visual = gr.HTML()
# 7. SCAMPER
with gr.Tab("๐Ÿ”ง SCAMPER Method"):
scamper_output = gr.Markdown()
scamper_visual = gr.HTML()
# 8. Design Thinking
with gr.Tab("๐Ÿ’ญ Design Thinking"):
design_output = gr.Markdown()
design_visual = gr.HTML()
# 9. Biomimicry
with gr.Tab("๐ŸŒฟ Biomimicry"):
biomimicry_output = gr.Markdown()
biomimicry_visual = gr.HTML()
# 10. Cognitive Load
with gr.Tab("๐Ÿง  Cognitive Load"):
cognitive_output = gr.Markdown()
cognitive_visual = gr.HTML()
# 11. Von Restorff
with gr.Tab("โšก Von Restorff Effect"):
vonrestorff_output = gr.Markdown()
vonrestorff_visual = gr.HTML()
# 12. Network Effects
with gr.Tab("๐ŸŒ Network Effects"):
network_output = gr.Markdown()
network_visual = gr.HTML()
# 13. Memetics
with gr.Tab("๐Ÿงฌ Memetics"):
memetics_output = gr.Markdown()
memetics_visual = gr.HTML()
# 14. Color Psychology
with gr.Tab("๐ŸŽจ Color Psychology"):
color_output = gr.Markdown()
color_visual = gr.HTML()
# 15. Gestalt Principles
with gr.Tab("๐Ÿ‘๏ธ Gestalt Principles"):
gestalt_output = gr.Markdown()
gestalt_visual = gr.HTML()
# ๋ชจ๋“  ์ด๋ก  ๋™์‹œ ์ƒ์„ฑ ํ•จ์ˆ˜
def generate_all_theories(industry, keywords):
results = {}
theories = [
("square", square_output, square_visual),
("blending", blending_output, blending_visual),
("sound", sound_output, sound_visual),
("linguistic", linguistic_output, linguistic_visual),
("archetype", archetype_output, archetype_visual),
("jobs", jobs_output, jobs_visual),
("scamper", scamper_output, scamper_visual),
("design", design_output, design_visual),
("biomimicry", biomimicry_output, biomimicry_visual),
("cognitive", cognitive_output, cognitive_visual),
("vonrestorff", vonrestorff_output, vonrestorff_visual),
("network", network_output, network_visual),
("memetics", memetics_output, memetics_visual),
("color", color_output, color_visual),
("gestalt", gestalt_output, gestalt_visual)
]
outputs = []
for theory_key, md_output, html_output in theories:
md, html = generate_by_theory(industry, keywords, theory_key)
outputs.extend([md, html])
return outputs
# ์ด๋ฒคํŠธ ์—ฐ๊ฒฐ
generate_btn.click(
fn=generate_all_theories,
inputs=[industry_input, keywords_input],
outputs=[
square_output, square_visual,
blending_output, blending_visual,
sound_output, sound_visual,
linguistic_output, linguistic_visual,
archetype_output, archetype_visual,
jobs_output, jobs_visual,
scamper_output, scamper_visual,
design_output, design_visual,
biomimicry_output, biomimicry_visual,
cognitive_output, cognitive_visual,
vonrestorff_output, vonrestorff_visual,
network_output, network_visual,
memetics_output, memetics_visual,
color_output, color_visual,
gestalt_output, gestalt_visual
]
)
gr.Examples(
examples=[
["์นดํŽ˜/์ปคํ”ผ์ˆ", "ํ”„๋ฆฌ๋ฏธ์—„, ์•„๋Š‘ํ•œ, ๋„์‹œ"],
["ํ”ผํŠธ๋‹ˆ์Šค/ํ—ฌ์Šค์žฅ", "๊ฐ•๋ ฅํ•œ, ์ปค๋ฎค๋‹ˆํ‹ฐ, ๋ณ€ํ™”"],
["๊ต์œก/์—๋“€ํ…Œํฌ", "์Šค๋งˆํŠธ, ์žฌ๋ฏธ์žˆ๋Š”, ์„ฑ์žฅ"],
["์Œ์‹ ๋ฐฐ๋‹ฌ", "๋น ๋ฅธ, ์‹ ์„ ํ•œ, ๋‹ค์–‘ํ•œ"],
["์นœํ™˜๊ฒฝ/์ง€์†๊ฐ€๋Šฅ", "์ž์—ฐ, ๋ฏธ๋ž˜, ์ˆœํ™˜"]
],
inputs=[industry_input, keywords_input]
)
gr.Markdown("""
---
### ๐ŸŽฏ ํ™œ์šฉ ๊ฐ€์ด๋“œ
1. **๋น„๊ต ๋ถ„์„**: ๊ฐ ์ด๋ก ์˜ ๊ฒฐ๊ณผ๋ฅผ ๋น„๊ตํ•˜์—ฌ ๊ฐ€์žฅ ์ ํ•ฉํ•œ ๋ธŒ๋žœ๋“œ ์„ ํƒ
2. **ํ•˜์ด๋ธŒ๋ฆฌ๋“œ ์ ‘๊ทผ**: ์—ฌ๋Ÿฌ ์ด๋ก ์˜ ์žฅ์ ์„ ๊ฒฐํ•ฉํ•œ ์ƒˆ๋กœ์šด ๋ธŒ๋žœ๋“œ ์ฐฝ์กฐ
3. **ํƒ€๊ฒŸ๋ณ„ ์„ ํƒ**: ๋ชฉํ‘œ ๊ณ ๊ฐ์ธต์— ๋”ฐ๋ผ ๊ฐ€์žฅ ํšจ๊ณผ์ ์ธ ์ด๋ก  ์„ ํƒ
4. **A/B ํ…Œ์ŠคํŠธ**: ๋‹ค์–‘ํ•œ ์ด๋ก  ๊ธฐ๋ฐ˜ ๋ธŒ๋žœ๋“œ๋กœ ์‹œ์žฅ ํ…Œ์ŠคํŠธ
### ๐Ÿ“š ๊ฐ ์ด๋ก ์˜ ๊ฐ•์ 
- **์ฆ‰๊ฐ์  ์ดํ•ด**: Cognitive Load, Sound Symbolism
- **๊ฐ์ •์  ์—ฐ๊ฒฐ**: Archetype, Color Psychology
- **์ฐจ๋ณ„ํ™”**: Von Restorff, SCAMPER
- **๋ฐ”์ด๋Ÿด ์ž ์žฌ๋ ฅ**: Memetics, Network Effects
- **๋ฌธ์ œ ํ•ด๊ฒฐ**: Jobs-to-be-Done, Design Thinking
- **ํ˜์‹ ์„ฑ**: Biomimicry, Conceptual Blending
- **๊ตฌ์กฐ์  ์™„์„ฑ๋„**: Square Theory, Gestalt
""")
if __name__ == "__main__":
demo.launch(
server_name="0.0.0.0",
server_port=7860,
share=False
)