Tag Consolidator
Use cases
Groups a CSV by primary tag and sends each group's unique secondary tags to the OpenAI chat completions API (JSON mode) in a single call per group.
GPT returns a mapping of broader category names to original tags, which is written back as a Generic Tag column.
Supports GPT-4o-mini, GPT-4o and GPT-4.1.
Platform
Python script (requires Python 3.x)
Input
OpenAI API key
CSV with a primary tag column and a secondary tag column
Output
CSV with all original columns plus a Generic Tag column mapping each secondary tag to a broader category.
Features
- One API call per primary tag group (cost scales with group count, not row count)
- OpenAI JSON mode response format
- GPT-4o-mini, GPT-4o, or GPT-4.1 model selection
- Column mapping for primary and secondary tag columns
- Unmapped row detection and warning
- Progress bar with per-group status
How to use
- 1 Enter your OpenAI API key in the sidebar
- 2 Select a model (GPT-4o-mini recommended for cost)
- 3 Upload your tag CSV
- 4 Map the primary and secondary tag columns
- 5 Click Consolidate Tags
- 6 Download the CSV with the new Generic Tag column
Frequently asked questions
- How many API calls does this make?
- One call per unique primary tag group, not one per row. If your CSV has 5,000 rows across 12 primary tags, it makes 12 API calls. Each call sends the unique secondary tags for that group and receives a JSON mapping back.
- Can the same secondary tag end up in different generic categories across primary groups?
- Yes. Each primary tag group is processed independently in its own API call, so the phrase 'poor quality' under a Delivery primary tag might map to 'Handling Issues' while the same phrase under Build Quality might map to 'Material Problems'. The context of the group influences the consolidation.
- What happens if the API does not return a mapping for some tags?
- Tags that the API omits from its JSON response are left with a blank Generic Tag value. The tool reports the count of unmapped rows after processing and you can re-run the same file to retry them.
- Which models are available?
- The sidebar offers GPT-4o-mini, GPT-4o and GPT-4.1. GPT-4o-mini is the default because it is the cheapest per call while still producing reliable JSON-mode responses for this task.
- What format does the input CSV need?
- Any CSV with at least two columns: one for primary tags and one for secondary tags. Column names are selectable in the UI, with defaults of 'Primary Tag' and 'Secondary Tag'. Encoding is auto-detected (utf-8 first, then latin-1 fallback).
Want me to run this for you?
I run this tool as a managed service, or build something custom around your data. You get the insights without touching the code.
Related Tools
Translate H1 headings to English in bulk via any OpenAI-compatible API.
Automatically identify the best CSS selector for a page's main content using an LLM, then extract as Markdown.
Tag customer reviews with a one or two-word topic label using OpenAI GPT models in batches.
Discover which descriptive words competitors use in titles that you are missing.
Extract content blocks and XPath patterns using Claude Haiku for template analysis.
Calculate CPC, total spend, or clicks from any two values.
Need something built for your business?
This tool started as bespoke client work. I build custom scripts, data pipelines, and full apps for SEO and product data problems that off-the-shelf tools don't solve.
Tell Me What You Need