hierarchical-taxonomy-clustering

Cluster hierarchical category paths into unified multi-level taxonomies.

4|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill hierarchical-taxonomy-clustering
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hierarchical-taxonomy-clustering
Source: https://github.com/GeneralReasoning/env-skillsbench/tree/main/taxonomy-tree-merge/environment/skills/hierarchical-taxonomy-clustering
Command: npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill hierarchical-taxonomy-clustering

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, numpy, scipy, nltk, sentence-transformers, tqdm, and includes scripts (resource) components.

What problem does it solve?

Given disparate category paths from multiple sources (for example Electronics > Computers > Laptops), this approach builds a single, unified taxonomy that groups similar paths, assigns meaningful names, and outputs a clean, fixed-depth hierarchy (typically five levels) for analysis and cross-platform comparisons.

Core Features & Use Cases

  • Hierarchical weighting and embedding-based representation of category paths to capture semantic similarity across sources.
  • Recursive clustering with cosine distance to form a coherent, multi-level taxonomy (levels 1–5 by default).
  • Intelligent naming by combining weighted terms and lemmatization to generate human-readable category labels.
  • Quality control to remove duplicates and prevent ancestor path collisions, enabling stable taxonomy across datasets.

Use cases include harmonizing vendor catalogs, enabling cross-platform analytics, and powering downstream search or recommendation tasks.

Quick Start

Run the full 4-step pipeline to process multiple sources and export unified taxonomy CSVs.

Frequently Asked Questions about hierarchical-taxonomy-clustering

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I unify product taxonomy from multiple e-commerce sources?

To unify product taxonomy from multiple e-commerce sources, this approach applies embedding-weighted clustering to group disparate hierarchical category paths into a single, consistent N-level taxonomy with meaningful names and a clean hierarchy.

What is the best way to cluster hierarchical category paths using embeddings?

The best way to cluster hierarchical category paths using embeddings involves a four-step pipeline: preprocessing paths, generating weighted embeddings, applying recursive clustering with cosine distance, and exporting the unified taxonomy.

How does recursive clustering generate human-readable category names?

Recursive clustering generates human-readable category names by combining weighted terms from the hierarchical paths and applying lemmatization through nltk, ensuring the final taxonomy labels are coherent and meaningful.

Does this taxonomy clustering approach work with pandas and sentence-transformers?

Yes, this taxonomy clustering approach works with pandas and sentence-transformers, alongside dependencies including numpy, scipy, nltk, and tqdm, to process category paths and generate embedding-weighted representations.

How do I handle duplicate categories and ancestor path collisions in a unified taxonomy?

To handle duplicate categories and ancestor path collisions in a unified taxonomy, the pipeline applies quality control measures that remove duplicates and prevent collisions, ensuring stable taxonomy across datasets.

When do I need to build a fixed-depth hierarchy for cross-platform analytics?

You need to build a fixed-depth hierarchy for cross-platform analytics when harmonizing vendor catalogs or enabling downstream search tasks, requiring a consistent N-level taxonomy (typically five levels) for accurate comparisons.