Update app.py
Browse files
app.py
CHANGED
@@ -28,6 +28,33 @@ def model_inference(
|
|
28 |
if text == "" and images:
|
29 |
gr.Error("Please input a text query along the image(s).")
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
if isinstance(images, Image.Image):
|
32 |
images = [images]
|
33 |
|
|
|
28 |
if text == "" and images:
|
29 |
gr.Error("Please input a text query along the image(s).")
|
30 |
|
31 |
+
# Check if the input is related to marketing
|
32 |
+
marketing_keywords = [
|
33 |
+
"product", "brand", "advertisement", "marketing", "strategy", "comparison",
|
34 |
+
"analysis", "trend", "audience", "segmentation", "targeting", "demographics",
|
35 |
+
"psychographics", "behavioral", "content", "SEO", "SEM", "PPC", "email",
|
36 |
+
"marketing", "automation", "CRM", "lead", "nurturing", "conversion",
|
37 |
+
"optimization", "funnel", "landing", "page", "CTA", "banner", "ads",
|
38 |
+
"display", "retargeting", "remarketing", "social", "media", "platform",
|
39 |
+
"influencer", "marketing", "KOL", "brand", "ambassador", "hashtag",
|
40 |
+
"campaign", "ROI", "KPI", "metrics", "analytics", "Google", "Analytics",
|
41 |
+
"Facebook", "Ads", "Instagram", "Twitter", "LinkedIn", "YouTube", "TikTok",
|
42 |
+
"Snapchat", "Pinterest", "Quora", "Reddit", "Forums", "blog", "podcast",
|
43 |
+
"webinar", "event", "offline", "activation", "loyalty", "program", "referral",
|
44 |
+
"program", "affiliate", "marketing", "partnership", "collaboration", "influencer",
|
45 |
+
"relationship", "management", "brand", "voice", "tone", "messaging", "storytelling",
|
46 |
+
"visual", "design", "UX", "UI", "wireframe", "prototype", "user", "testing",
|
47 |
+
"A/B", "testing", "heatmaps", "surveys", "feedback", "customer", "journey",
|
48 |
+
"customer", "experience", "CX", "voice", "of", "customer", "VOC", "net",
|
49 |
+
"promoter", "score", "NPS", "CSAT", "customer", "support", "customer", "service",
|
50 |
+
"customer", "success", "customer", "acquisition", "customer", "retention",
|
51 |
+
"churn", "rate", "lifetime", "value", "CLV", "cohort", "analysis", "funnel",
|
52 |
+
"analysis", "conversion", "rate", "bounce", "rate", "engagement", "rate",
|
53 |
+
"time", "on", "site", "page", "views", "unique", "visitors", "session", "duration"
|
54 |
+
]
|
55 |
+
if not any(keyword in text.lower() for keyword in marketing_keywords):
|
56 |
+
return "Your question is not in the marketing area. Please upload another image or try again."
|
57 |
+
|
58 |
if isinstance(images, Image.Image):
|
59 |
images = [images]
|
60 |
|