-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_buzzops.py
More file actions
144 lines (110 loc) · 5.12 KB
/
test_buzzops.py
File metadata and controls
144 lines (110 loc) · 5.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
"""
BuzzOps test program — exercises all four tools with sample inputs.
Run with: python test_buzzops.py
"""
import json
from buzzops.server import debuzz, retro_halo, countdown_to_zombie, investor_combustion
RESET = "\033[0m"
BOLD = "\033[1m"
CYAN = "\033[96m"
YELLOW = "\033[93m"
GREEN = "\033[92m"
RED = "\033[91m"
def header(title: str):
print(f"\n{BOLD}{CYAN}{'=' * 60}{RESET}")
print(f"{BOLD}{CYAN} {title}{RESET}")
print(f"{BOLD}{CYAN}{'=' * 60}{RESET}")
def section(label: str, value):
print(f"{YELLOW}{label}:{RESET} {value}")
def show_translations(translations: list):
if not translations:
print(f" {RED}(none matched){RESET}")
return
for t in translations:
print(f" {BOLD}[{t['buzzword']}]{RESET}")
print(f" WHAT THEY SAY: {t['they_say']}")
print(f" {GREEN}WHAT THEY MEAN: {t['they_mean']}{RESET}")
# ---------------------------------------------------------------------------
# Test 1 — AI Debuzzer™ with pasted text
# ---------------------------------------------------------------------------
header("TEST 1 — AI Debuzzer™ (pasted text)")
sample_text = (
"We are an agentic, AI-native, context-engineered semantic intelligence fabric "
"for governed real-time decisioning at enterprise scale. Our composable data product "
"platform empowers modern data teams to democratize actionable insights with "
"frictionless observability and data contracts. With our lakehouse architecture and "
"shift-left quality approach, your AI-ready governance journey starts here."
)
print(f"\nInput:\n {sample_text}\n")
result = json.loads(debuzz(sample_text))
section("Buzzword density", f"{result['buzzword_density_pct']}% ({result['total_buzzwords_found']} buzzwords in {result['total_words']} words)")
section("Top offenders", ", ".join(result["top_offenders"].keys()))
print(f"\n{BOLD}Known translations from the BuzzOps field guide:{RESET}")
show_translations(result["known_translations"])
# ---------------------------------------------------------------------------
# Test 2 — AI Debuzzer™ with a URL
# ---------------------------------------------------------------------------
header("TEST 2 — AI Debuzzer™ (URL fetch)")
url = "https://www.databricks.com/product/data-lakehouse"
print(f"\nFetching: {url}\n")
try:
result = json.loads(debuzz(url))
section("Source", result["source"])
section("Buzzword density", f"{result['buzzword_density_pct']}%")
section("Top offenders", ", ".join(list(result["top_offenders"].keys())[:5]))
print(f"\n{BOLD}Known translations:{RESET}")
show_translations(result["known_translations"])
except Exception as e:
print(f"{RED}Fetch failed (network?): {e}{RESET}")
# ---------------------------------------------------------------------------
# Test 3 — RetroHalo™
# ---------------------------------------------------------------------------
header("TEST 3 — RetroHalo™ (company rebrand archaeology)")
company = "Monte Carlo Data"
print(f"\nCompany: {company}\n")
result = json.loads(retro_halo(company))
print(f"{BOLD}Current messaging snippets:{RESET}")
for item in result["current_messaging"][:2]:
print(f" [{item['title']}]")
print(f" {item['snippet'][:200]}...")
print()
print(f"{BOLD}Old messaging (2022-2023):{RESET}")
for item in result["old_messaging_2022_2023"][:2]:
print(f" [{item['title']}]")
print(f" {item['snippet'][:200]}...")
print()
# ---------------------------------------------------------------------------
# Test 4 — Countdown to Zombie™
# ---------------------------------------------------------------------------
header("TEST 4 — Countdown to Zombie™")
company = "Atlan"
print(f"\nCompany: {company}\n")
result = json.loads(countdown_to_zombie(company))
print(f"{BOLD}Funding signals:{RESET}")
for item in result["funding_signals"][:2]:
print(f" {item['snippet'][:200]}")
print()
print(f"{BOLD}Distress signals:{RESET}")
for item in result["distress_signals"][:2]:
if item["snippet"]:
print(f" {item['snippet'][:200]}")
print()
bw = result["buzzword_density_in_signals"]
if bw:
top = sorted(bw.items(), key=lambda x: x[1], reverse=True)[:5]
print(f"{BOLD}Buzzwords in all signals:{RESET} {dict(top)}")
# ---------------------------------------------------------------------------
# Test 5 — Investor Combustion Model™
# ---------------------------------------------------------------------------
header("TEST 5 — Investor Combustion Model™")
company = "Collibra"
print(f"\nCompany: {company}\n")
result = json.loads(investor_combustion(company))
section("Marketing buzzword density", f"{result['marketing_buzzword_density_pct']}%")
section("Real-user buzzword density", f"{result['user_buzzword_density_pct']}%")
delta = round(result["marketing_buzzword_density_pct"] - result["user_buzzword_density_pct"], 1)
section("Gap (marketing vs users)", f"{delta}pp {'(high BS differential)' if delta > 5 else '(roughly honest)'}")
print(f"\n{BOLD}Top marketing buzzwords:{RESET}")
for bw, count in list(result["top_marketing_buzzwords"].items())[:5]:
print(f" {bw}: {count}")
print(f"\n{BOLD}{GREEN}All tests complete.{RESET}")