{"slug": "i-almost-used-ai-to-classify-user-input-simple-rules-worked-better", "title": "I Almost Used AI to Classify User Input. Simple Rules Worked Better", "summary": "A developer rebuilding a name tattoo tool found that deterministic rules outperformed an AI classifier for categorizing user inputs. By using simple regex-based checks to identify initials, dates, name pairs, and other patterns, the developer achieved predictable recommendations without the cost and complexity of an LLM call. The approach was implemented in the Name Tattoo Generator, where AI is reserved for later, more open-ended custom composition requests.", "body_md": "I’ve been rebuilding a small name tattoo tool recently, and I ran into a problem that looked like a good use case for AI.\n\nThe user enters some text.\n\nAt first, I treated every input basically the same:\n\n**text → show a set of lettering styles**\n\nThat works for simple names.\n\nBut these are all very different inputs:\n\n`Emma`\n\n`A.M.`\n\n`Jack + Mia`\n\n`Amelia · 1998-11-14`\n\n`Anna-Marie`\n\n`Forever Dad`\n\nShowing the exact same recommendations for all of them started to feel wrong.\n\nMy first thought was: classify the input with an LLM.\n\nI already use AI elsewhere in the product, so sending the text through another model call would have been easy enough.\n\nBut after listing the cases I actually cared about, I realized the classification problem was tiny.\n\nI didn’t need to understand arbitrary human language.\n\nI mostly needed to distinguish things like:\n\nSo instead of adding another model call, I used deterministic rules.\n\nA simplified version looks roughly like this:\n\n``` js\nfunction getNameStructure(text: string) {\n  const value = text.trim()\n\n  if (looksLikeInitialsAndDate(value)) {\n    return \"initials-date\"\n  }\n\n  if (looksLikeNameAndDate(value)) {\n    return \"name-date\"\n  }\n\n  if (looksLikeInitials(value)) {\n    return \"initials\"\n  }\n\n  if (looksLikeNamePair(value)) {\n    return \"name-pair\"\n  }\n\n  if (value.includes(\"-\")) {\n    return \"hyphenated\"\n  }\n\n  if (value.split(/\\s+/).length > 1) {\n    return \"multi-word\"\n  }\n\n  if (value.length <= 5) {\n    return \"short\"\n  }\n\n  if (value.length <= 9) {\n    return \"medium\"\n  }\n\n  return \"long\"\n}\n```\n\nThe real implementation has a few more checks, especially around dates and separators, but the idea is the same.\n\nNothing clever.\n\nAnd that turned out to be a good thing.\n\nI didn’t want classification for its own sake.\n\nI wanted the first few lettering options to make more sense for the input.\n\nFor example, compact initials can tolerate directions that might feel too heavy for a long name.\n\nA name pair needs enough spacing to keep both names readable.\n\nA name + date has a second piece of information competing for attention.\n\nA long name usually needs a little more restraint than a short one.\n\nSo the structure changes the recommendation order.\n\nSomething like:\n\n``` js\nconst recommendations = {\n  initials: [\n    \"bold\",\n    \"minimal\",\n    \"gothic\",\n  ],\n\n  \"name-pair\": [\n    \"minimal\",\n    \"script\",\n    \"serif\",\n  ],\n\n  \"name-date\": [\n    \"serif\",\n    \"minimal\",\n    \"script\",\n  ],\n\n  short: [\n    \"script\",\n    \"signature\",\n    \"bold\",\n  ],\n}\n```\n\nThe exact presets aren’t important here.\n\nWhat mattered was that recommendations became predictable.\n\nAnd I still keep the other styles visible.\n\nThe classifier doesn’t decide:\n\nThis is the correct style for your tattoo.\n\nIt only decides:\n\nThese are probably useful directions to show first.\n\nThat distinction helped keep the rules small.\n\nThe more I worked on it, the less attractive an AI classifier became.\n\nWith deterministic rules:\n\nMost importantly, the problem itself wasn’t fuzzy enough to justify a model.\n\nThe product still uses AI when the user wants an actual custom lettering composition with flowers, symbols, flourishes, or other supporting details.\n\nBut deciding whether `A.M.`\n\nlooks like initials?\n\nThat doesn’t need intelligence.\n\nIt needs a regex.\n\nI ended up using this approach in the [Name Tattoo Generator](https://aimaketattoo.com/name-tattoo-generator), where the lightweight preview stays deterministic and the AI step only comes later when the user actually wants custom composition.\n\nFor a while my default question was:\n\nCould AI handle this?\n\nNow I’m trying to ask:\n\nIs there enough uncertainty here that AI is actually useful?\n\nIf the input space is small, the rules are understandable, and predictability matters, a boring classifier can be a better product decision.\n\nAI is much more valuable later in this workflow, where the user asks for something genuinely open-ended.\n\nThe funny part is that making the AI product better in this case meant using less AI.\n\nI’m curious how other people draw this line.\n\nWhat’s something you originally planned to solve with an LLM, then replaced with normal code?", "url": "https://wpnews.pro/news/i-almost-used-ai-to-classify-user-input-simple-rules-worked-better", "canonical_source": "https://dev.to/warrenshi/i-almost-used-ai-to-classify-user-input-simple-rules-worked-better-40c1", "published_at": "2026-08-15 01:56:06+00:00", "updated_at": "2026-08-15 02:11:42.980426+00:00", "lang": "en", "topics": ["artificial-intelligence", "developer-tools"], "entities": ["Name Tattoo Generator", "aimaketattoo.com"], "alternates": {"html": "https://wpnews.pro/news/i-almost-used-ai-to-classify-user-input-simple-rules-worked-better", "markdown": "https://wpnews.pro/news/i-almost-used-ai-to-classify-user-input-simple-rules-worked-better.md", "text": "https://wpnews.pro/news/i-almost-used-ai-to-classify-user-input-simple-rules-worked-better.txt", "jsonld": "https://wpnews.pro/news/i-almost-used-ai-to-classify-user-input-simple-rules-worked-better.jsonld"}}