abhidgp1978 commited on
Commit
e51b634
·
verified ·
1 Parent(s): c304890

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +70 -0
app.py ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ zs_details.append((label, float(score)))
3
+
4
+
5
+ # 3) Fallback if everything is zero
6
+ if all(v == 0 for v in votes.values()):
7
+ for ch in ["Instagram", "YouTube", "LinkedIn"]:
8
+ votes[ch] += 1.0
9
+
10
+
11
+ # 4) Rank
12
+ ranked = sorted(votes.items(), key=lambda kv: kv[1], reverse=True)
13
+ top = ranked[: max(1, top_n)]
14
+
15
+
16
+ # 5) Build explanation & suggestions
17
+ def suggestions_for(ch_name: str) -> Dict:
18
+ ch = next(c for c in CHANNELS if c.name == ch_name)
19
+ ideas = {
20
+ "Instagram": [
21
+ "3x Reels/week: product use-cases & UGC",
22
+ "Stories with polls & link stickers",
23
+ "Creators: micro-influencer try-ons/reviews",
24
+ ],
25
+ "TikTok": [
26
+ "Daily short clips riding relevant trends",
27
+ "Unpolished founder POV, behind-the-scenes",
28
+ "Native sounds + captions for accessibility",
29
+ ],
30
+ "YouTube": [
31
+ "Weekly 6–10 min tutorial or demo",
32
+ "YouTube Shorts repurposed from TikTok/Reels",
33
+ "SEO titles targeting problem keywords",
34
+ ],
35
+ "LinkedIn": [
36
+ "3x/week carousel posts with insights",
37
+ "Founder/exec thought-leadership threads",
38
+ "Case-study post with hard metrics + clear CTA",
39
+ ],
40
+ "X (Twitter)": [
41
+ "2–3 threads/week on hot topics",
42
+ "Engage with niche communities daily",
43
+ "Host a Spaces AMA once per month",
44
+ ],
45
+ "Pinterest": [
46
+ "Pin boards by theme (seasonal, how-to)",
47
+ "Infographic step-by-steps & checklists",
48
+ "Link pins to evergreen blog/how-to pages",
49
+ ],
50
+ "Reddit": [
51
+ "Participate in niche subreddits (no spam)",
52
+ "AMA once traction is visible",
53
+ "Share transparent build-in-public learnings",
54
+ ],
55
+ "Discord": [
56
+ "Weekly office hours or support huddles",
57
+ "Early access channel for power users",
58
+ "Automations: welcome, FAQ, release notes",
59
+ ],
60
+ "Twitch": [
61
+ "Monthly live stream with creators",
62
+ "Sponsor segments in aligned channels",
63
+ "Live Q&A around launches or updates",
64
+ ],
65
+ }
66
+ return {
67
+ "channel": ch.name,
68
+ "why": ch.notes,
69
+ "ideal_audience": ", ".join(ch.audience),
70
+ "content_formats": ", ".join(ch.content),