hierarchical-taxonomy-clustering
Build unified multi-level category taxonomy from hierarchical product category paths from any e-commerce companies using embedding-based recursive clustering…
Skill by benchflow-ai
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/benchflow-ai-hierarchical-taxonomy-clustering
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, ml
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/hierarchical-taxonomy-clustering
What's inside
- Skill name
hierarchical-taxonomy-clustering- Description
- Build unified multi-level category taxonomy from hierarchical product category paths from any e-commerce companies using embedding-based recursive clustering with intelligent category naming via weighted word frequency analysis.
- License
- Apache-2.0
- Instructions
- 68 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (6)
- SKILL.md
- pipeline.py · scripts/
- step1_preprocessing_and_merge.py · scripts/
- step2_weighted_embedding_generation.py · scripts/
- step3_recursive_clustering_naming.py · scripts/
- step4_result_assignments.py · scripts/
SKILL.md (first lines)
# Hierarchical Taxonomy Clustering
Create a unified multi-level taxonomy from hierarchical category paths by clustering similar paths and automatically generating meaningful category names.
## Problem
Given category paths from multiple sources (e.g., "electronics -> computers -> laptops"), create a unified taxonomy that groups similar paths across sources, generates meaningful category names, and produces a clean N-level hierarchy (typically 5 levels). The unified category taxonomy could be used to do analysis or metric tracking on products from different platform.
## Methodology
1. **Hierarchical Weighting**: Convert paths to embeddings with exponentially decaying weights (Level i gets weight 0.6^(i-1)) to signify the importance of category granularity
2. **Recursive Clustering**: Hierarchically cluster at each level (10-20 clusters at L1, 3-20 at L2-L5) using cosine distance
3. **Intelligent Naming**: Generate category names via weighted word frequency + lemmatization + bundle word logic
4. **Quality Control**: Exclude all ancestor words (parent, grandparent, etc.), avoid ancestor path duplicates, clean special characters
## Output
DataFrame with added columns:
- `unified_level_1`: Top-level category (e.g., "electronic | device")
- `unified_level_2`: Second-level category (e.g., "computer | laptop")
- `unified_level_3` through `unified_level_N`: Deeper levels
Category names use ` | ` separator, max 5 words, covering 70%+ of records in each cluster.
## Installation
```bash
pip install pandas numpy scipy sentence-transformers nltk tqdm
python -c "import nltk; nltk.download('wordnet'); nltk.download('omw-1.4')"
```
## 4-Step Pipeline
### Step 1: Load, Standardize, Filter and Merge (`step1_preprocessing_and_merge.py`)
- **Input**: List of (DataFrame, source_name) tuples, each of the with `category_path` column
- **Process**: Per-source deduplication, text cleaning (remove &/,/'/-/quotes,'and' or "&", "," and so on, lemmatize words as nouns), normalize delimiter to ` > `, depth filtering, prefix removal, then merge all sources. source_level should reflect the processed version of the source level name
- **Output**: Merged DataFrame with `category_path`, `source`, `depth`, `source_level_1` through `source_level_N`
### Step 2: Weighted Embeddings (`step2_weighted_embedding_generation.py`)
- **Input**: DataFrame from Step 1
- **Output**: Numpy embedding matrix (n_records × 384)
- Weights: L1=1.0, L2=0.6, L3=0.36, L4=0.216, L5=0.1296 (exponential decay 0.6^(n-1))
- **Performance**: For ~10,000 records, expect 2-5 minutes. Progress bar will show encoding status.
### Step 3: Recursive Clustering (`step3_recursive_clustering_naming.py`)
- **Input**: DataFrame + embeddings from Step 2
- **Output**: Assignments dict {index → {level_1: ..., level_5: ...}}
- Average linkage + cosine distance, 10-20 clusters at L1, 3-20 at L2-L5
- Word-based naming: weighted frequency + lemmatization + coverage ≥70%
- **Performance**: For ~10,000 records, expect 1-3 minutes for hierarchical clustering and naming. Be patient - the system is working through recursive levels.
### Step 4: Export Results (`step4_result_assignments.py`)
- **Input**: DataFrame + assignments from Step 3
- **Output**:
- `unified_taxonomy_full.csv` - all records with unified categories
- `unified_taxonomy_hierarchy.csv` - unique taxonomy structure
## Usage
**Use `scripts/pipeline.py` to run the complete 4-step workflow.**
See `scripts/pipeline.py` for:
- Complete implementation of all 4 steps
- Example code for processing multiple sources
- Command-line interface
- Individual step usage (for advanced control)From benchflow-ai/skillsbench, Apache-2.0.
More from benchflow-ai/skillsbench
- 0.552score
d3-visualization
benchflow-ai
Build deterministic, verifiable data visualizations with D3.js (v6).
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
grpo
benchflow-ai
Reference for the GRPO (Group Relative Policy Optimization) algorithm.
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
civ6lib
benchflow-ai
Civilization 6 district mechanics library.
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
task-review
benchflow-ai
SkillsBench task PR review — classifies the task track (standard / research / multimodal), runs static policy checks against the track-specific rubric…
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
hex-grid-spatial
benchflow-ai
Hex grid spatial utilities for offset coordinate systems.
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
mesh-analysis
benchflow-ai
Analyzes 3D mesh files (STL) to calculate geometric properties (volume, components) and extract attribute data.
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
modal-gpu
benchflow-ai
Run Python code on cloud GPUs using Modal serverless platform.
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
mhc-algorithm
benchflow-ai
Implement mHC (Manifold-Constrained Hyper-Connections) for stabilizing deep network training.
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
transaction-concurrency-control-foundations
benchflow-ai
Provides database transaction concurrency-control background.
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
search-accommodations
benchflow-ai
Lookup accommodations by city from the bundled dataset.
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
search-attractions
benchflow-ai
Retrieve attractions by city from the bundled dataset.
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
rl-post-training
benchflow-ai
Diagnostic guide for RL-based post-training of language models (GRPO, PPO, REINFORCE, DPO).
SkillCFreshness: C★ 1.9KClaude Code +9
Signals
- Stars
- 1,870
- Forks
- 372
- Open issues
- 50
- Last commit (this folder)
- Jun 8, 2026 (4 months ago)
- Last release
- Jun 14, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/benchflow-ai/skillsbench
- Website
- www.skillsbench.ai
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from benchflow-ai
- 0.552score
modal-gpu
benchflow-ai
Run Python code on cloud GPUs using Modal serverless platform.
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
task-review
benchflow-ai
SkillsBench task PR review — classifies the task track (standard / research / multimodal), runs static policy checks against the track-specific rubric…
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
transaction-concurrency-control-foundations
benchflow-ai
Provides database transaction concurrency-control background.
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
search-attractions
benchflow-ai
Retrieve attractions by city from the bundled dataset.
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
search-accommodations
benchflow-ai
Lookup accommodations by city from the bundled dataset.
SkillCFreshness: C★ 1.9KClaude Code +9 - 0.552score
mhc-algorithm
benchflow-ai
Implement mHC (Manifold-Constrained Hyper-Connections) for stabilizing deep network training.
SkillCFreshness: C★ 1.9KClaude Code +9
Cite this page
hierarchical-taxonomy-clustering skill. Agent Mart. https://agentmart.dev/skills/benchflow-ai-hierarchical-taxonomy-clustering (last updated 2026-10-24)