Spaces:
Paused
Paused
File size: 8,535 Bytes
8075297 | 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 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <random>
#include <chrono>
#include <sstream>
std::vector<std::string> headlines = {
"Deep Tissue & {thing} — Manhattan",
"{adjective} Bodywork in Manhattan",
"{name} Does {thing} — Manhattan",
"The Wolf's {thing} — Manhattan",
"{thing} for {person} — Manhattan",
"Manhattan's {adjective} {thing}",
"Not Your Average {thing} — Manhattan",
"Real {thing} for {person}",
"{thing}: No Fluff, Just Pressure",
"Bring the {body_part}, Bring the Wolf — Manhattan",
"{adjective} {thing} in Manhattan, NYC",
"The {person}'s {thing} — Manhattan",
"Wolf-Level {thing} — Manhattan",
"{body_part} Rescue in Manhattan",
"From {city} Stress to {thing}",
};
std::vector<std::string> hooks = {
"Your shoulders called. They want out of this meeting.",
"I don't do feathers. I do fixes.",
"You bring the stress, I bring the Wolf.",
"If your body were a group chat, your hips would be the one screaming.",
"Some people meditate. I prefer pressure.",
"Desk life: 1. Your posture: 0. I can fix that.",
"Your back is not a storage unit for stress.",
"I work on humans, not mannequins.",
"The gym builds muscle. I build recovery.",
"Tight neck? Tight shoulders? Tight everything? Same.",
"Wolf knows where the knots hide.",
"You can't out-train bad recovery, but you can out-massage it.",
"Manhattan is stressful. Your body doesn't have to be.",
"My hands are GPS for tension.",
"If your muscles wrote a Yelp review, it would not be five stars.",
"I find the thing that hurts and make it stop hurting.",
"Your body is a resume. Let's edit it.",
"Squats gave you glutes. I give them back their range of motion.",
"The only thing I ghost is tension.",
"I've got strong hands and zero patience for bad posture.",
};
std::vector<std::string> specialties = {
"I specialize in deep tissue, sports recovery, and targeted relief for shoulders, neck, back, and hips.",
"My focus is pressure-forward work: slow, deliberate, and built around the muscle groups that actually need it.",
"I do deep tissue, recovery bodywork, and the kind of pressure that actually changes how you move.",
"Sports recovery, deep tissue, and hip/glute work are my main zones.",
"I work on the tension that builds from training, travel, and ten-hour desk days.",
};
std::vector<std::string> clients = {
"Best for lifters, runners, desk workers, and anyone who treats their body like a rental.",
"Great if you sit all day, train hard, or fly too much.",
"If your neck feels like a phone cord from 1997, you're my people.",
"For clients who want real pressure, clear communication, and a clean space.",
"You don't need to be an athlete. You need to be tight.",
};
std::vector<std::string> styles = {
"My style is direct. I find the tension, apply pressure, and stay there until it releases.",
"No spa music required. No fluffy rituals. Just focused work.",
"I adjust pressure to your body, not a script.",
"Strong hands, calm presence, zero attitude.",
"I work with intention. Every minute has a target.",
};
std::vector<std::string> proofs = {
"Clients usually leave looser, taller, and less hostile toward their desk.",
"The feedback I get most: 'I should have done this months ago.'",
"One session won't fix ten years of bad posture, but it's a solid opening argument.",
"I don't promise magic. I promise real pressure in the right places.",
};
std::vector<std::string> ctas = {
"Message me with your focus areas and we'll get you sorted.",
"Manhattan incall. Text or email to book.",
"Clean private space in Manhattan. DM me to set something up.",
"If your body is ready, so am I. Message for availability.",
"Book a session and let's make your muscles less dramatic.",
};
std::vector<std::string> things = {
"Sports Recovery", "Deep Tissue", "Bodywork", "Knot Removal", "Recovery",
"Shoulder Rescue", "Hip Relief", "Back Therapy", "Desk Detox", "Stress Reset",
};
std::vector<std::string> adjectives = {
"Serious", "Pressure-Forward", "Wolf-Approved", "No-Nonsense", "Focused",
"Real", "Direct", "Professional", "High-Octane", "Tension-Finding",
};
std::vector<std::string> persons = {
"Desk Workers", "Athletes", "Gym Rats", "Frequent Flyers", "Tired Humans",
"Shoulders", "Hips", "Runners", "Lifters", "Stressed New Yorkers",
};
std::vector<std::string> body_parts = {
"Shoulders", "Back", "Hips", "Neck", "Glutes",
};
std::vector<std::string> cities = {
"Manhattan", "Midtown", "Chelsea", "Hell's Kitchen", "NYC",
};
std::vector<std::string> names = {
"The Wolf", "Karpathian Wolf", "Wolf", "This Guy",
};
std::string replace_all(std::string str, const std::string& from, const std::string& to) {
size_t start_pos = 0;
while((start_pos = str.find(from, start_pos)) != std::string::npos) {
str.replace(start_pos, from.length(), to);
start_pos += to.length();
}
return str;
}
std::string generate_headline(std::mt19937& rng) {
std::uniform_int_distribution<int> dist(0, headlines.size() - 1);
std::string h = headlines[dist(rng)];
h = replace_all(h, "{thing}", things[std::uniform_int_distribution<int>(0, things.size()-1)(rng)]);
h = replace_all(h, "{adjective}", adjectives[std::uniform_int_distribution<int>(0, adjectives.size()-1)(rng)]);
h = replace_all(h, "{name}", names[std::uniform_int_distribution<int>(0, names.size()-1)(rng)]);
h = replace_all(h, "{person}", persons[std::uniform_int_distribution<int>(0, persons.size()-1)(rng)]);
h = replace_all(h, "{body_part}", body_parts[std::uniform_int_distribution<int>(0, body_parts.size()-1)(rng)]);
h = replace_all(h, "{city}", cities[std::uniform_int_distribution<int>(0, cities.size()-1)(rng)]);
return h;
}
std::string generate_description(std::mt19937& rng) {
std::string hook = hooks[std::uniform_int_distribution<int>(0, hooks.size()-1)(rng)];
std::string specialty = specialties[std::uniform_int_distribution<int>(0, specialties.size()-1)(rng)];
std::string client = clients[std::uniform_int_distribution<int>(0, clients.size()-1)(rng)];
std::string style = styles[std::uniform_int_distribution<int>(0, styles.size()-1)(rng)];
std::string proof = proofs[std::uniform_int_distribution<int>(0, proofs.size()-1)(rng)];
std::string cta = ctas[std::uniform_int_distribution<int>(0, ctas.size()-1)(rng)];
std::uniform_int_distribution<int> template_dist(0, 1);
if (template_dist(rng) == 0) {
return hook + "\n\n" + specialty + "\n\n" + client + "\n\n" + style + "\n\n" + cta;
}
return hook + "\n\n" + style + "\n\n" + specialty + "\n\n" + proof + "\n\n" + cta;
}
std::string json_escape(const std::string& s) {
std::string out;
for (char c : s) {
switch (c) {
case '"': out += "\\\""; break;
case '\\': out += "\\\\"; break;
case '\b': out += "\\b"; break;
case '\f': out += "\\f"; break;
case '\n': out += "\\n"; break;
case '\r': out += "\\r"; break;
case '\t': out += "\\t"; break;
default: out += c;
}
}
return out;
}
int main(int argc, char* argv[]) {
int count = 1000;
if (argc > 1) count = std::stoi(argv[1]);
std::string output_path = "rm_traffic/data/bios_generated.jsonl";
if (argc > 2) output_path = argv[2];
std::random_device rd;
std::mt19937 rng(rd());
std::ofstream out(output_path);
if (!out) {
std::cerr << "Cannot open " << output_path << std::endl;
return 1;
}
auto start = std::chrono::high_resolution_clock::now();
for (int i = 0; i < count; i++) {
std::string h = generate_headline(rng);
std::string d = generate_description(rng);
out << "{\"id\":\"cpp_" << i << "\",\"headline\":\"" << json_escape(h)
<< "\",\"description\":\"" << json_escape(d) << "\"}\n";
}
out.close();
auto end = std::chrono::high_resolution_clock::now();
auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
std::cout << "Generated " << count << " bios in " << ms << " ms" << std::endl;
std::cout << "Rate: " << (count * 60000.0 / ms) << " bios/minute" << std::endl;
std::cout << "Saved to: " << output_path << std::endl;
return 0;
}
|