StoryLens / taxonomy.py
Marek4321's picture
Upload 13 files
6bdfadc verified
FUNCTIONAL_ROLES = {
"OPENING": {
"Hook": "Grabs viewers' attention or interest; appears in first few seconds",
"Establish Context": "Sets up the status quo—who, where, or when—before story progression"
},
"PROBLEM": {
"Problem Setup": "Presents a problem, need, or pain point to resolve for the first time",
"Problem Agitation": "Amplifies the problem to make it relatable or severe"
},
"PRODUCT": {
"Feature Explanation": "Explains product features and why it delivers benefits; goes beyond just showing",
"Product Highlight": "Presents key product attributes or benefits (surface-level showcasing)",
"Demonstration": "Shows the product being used or tested to accomplish a task",
"Comparison": "Contrasts product with competitors or previous states",
"Social Proof": "Shows reviews or testimonials from other people",
"Solution Reveal": "Presents product as solution to a problem"
},
"PERSUASIVE": {
"Emotional Appeal": "Uses emotions to connect with and engage the audience",
"Humor": "Uses comedic elements to entertain and make message relatable",
"Aspirational Vision": "Depicts an ideal lifestyle or future enabled by the product",
"Promotion": "Communicates offer mechanics: discount, bundle, code, pricing terms",
"Urgency Trigger": "Adds time pressure to accelerate action",
"Scarcity Trigger": "Highlights limited availability to create FOMO"
},
"CLOSURE": {
"Call-to-Action": "Cues to act; drives immediate action",
"Outcome": "Shows post-intervention payoff or transformation",
"Branding Moment": "Displays brand identity (logo, tagline, slogans)",
"Insight/Philosophy": "Expresses brand philosophy; leads viewers to discover something new"
},
"OTHER": {
"Visual Filler": "Provides transitional pacing without narrative contribution"
}
}
STORY_ARCS = {
"Problem-Solution-Outcome": {
"sequence": ["Problem Setup", "Solution Reveal", "Outcome"],
"description": "Introduces a problem, offers a solution, and shows the outcome"
},
"Hook-Feature-Benefit-Action": {
"sequence": ["Hook", "Feature Explanation", "Product Highlight", "Call-to-Action"],
"abbreviation": "HFBA",
"description": "Grabs attention, explains features, highlights benefits, drives action"
},
"AIDA": {
"sequence": ["Hook", "Feature Explanation", "Aspirational Vision", "Call-to-Action"],
"description": "Attention-Interest-Desire-Action classic marketing funnel"
},
"Social-Proof-Action": {
"sequence": ["Social Proof", "Call-to-Action"],
"abbreviation": "SPA",
"description": "Shows testimonials/reviews then drives action"
},
"Problem-Agitate-Solution": {
"sequence": ["Problem Setup", "Problem Agitation", "Solution Reveal"],
"abbreviation": "PAS",
"description": "Presents problem, amplifies pain, offers solution"
},
"Before-After-Bridge": {
"sequence": ["Establish Context", "Outcome", "Solution Reveal"],
"abbreviation": "BAB",
"description": "Shows current situation, desired outcome, product as bridge"
},
"Hook-Problem-Solution": {
"sequence": ["Hook", "Problem Setup", "Solution Reveal"],
"abbreviation": "HPS",
"description": "Grabs attention, presents problem, offers solution"
},
"Feature-Benefit-Action": {
"sequence": ["Feature Explanation", "Product Highlight", "Call-to-Action"],
"abbreviation": "FBA",
"description": "Direct product-focused approach"
}
}
STORY_DEFINITION = """
A story is an account of an event or a sequence of connected events
that leads to a transition from an initial state to a later stage or outcome.
Signals of STORY PRESENT:
- Dialogues between characters
- Sharing of personal experiences
- Inclusion of challenges/conflicts/problem solutions
- Character transformation or journey
Signals of STORY ABSENT:
- Announcer/narrator voiceover only
- Promotional language dominance
- Heavy focus on product features without context
- Visual mashups without narrative connection
"""
def get_taxonomy_formatted() -> str:
"""Return taxonomy as formatted string for prompts."""
lines = []
for category, roles in FUNCTIONAL_ROLES.items():
lines.append(f"\n**{category}**")
for role, description in roles.items():
lines.append(f"- {role}: {description}")
return "\n".join(lines)
def get_role_category(role_name: str) -> str:
"""Get category for a role name."""
for category, roles in FUNCTIONAL_ROLES.items():
if role_name in roles:
return category
return "OTHER"