[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72WQ8R4DZKK1CT397C0ARQD":3,"skill-same:01M72WQ8R4DZKK1CT397C0ARQD":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M72WQ8R4DZKK1CT397C0ARQD","hierarchical-taxonomy-clustering",null,"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.","agentscope-ai\u002FPawBench","agentscope-ai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F211762292?v=4","01M6CRT6543BZGGVK3P85GC08Q","AgentScope-AI","01M72WJAXCYDAXK74090327ER7",127,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT139_skillsbench_taxonomy-tree-merge\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: hierarchical-taxonomy-clustering\ndescription: 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.\n---\n\n# Hierarchical Taxonomy Clustering\n\nCreate a unified multi-level taxonomy from hierarchical category paths by clustering similar paths and automatically generating meaningful category names.\n\n## Problem\n\nGiven 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.\n\n## Methodology\n\n1. **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\n2. **Recursive Clustering**: Hierarchically cluster at each level (10-20 clusters at L1, 3-20 at L2-L5) using cosine distance\n3. **Intelligent Naming**: Generate category names via weighted word frequency + lemmatization + bundle word logic\n4. **Quality Control**: Exclude all ancestor words (parent, grandparent, etc.), avoid ancestor path duplicates, clean special characters\n\n## Output\n\nDataFrame with added columns:\n- `unified_level_1`: Top-level category (e.g., \"electronic | device\")\n- `unified_level_2`: Second-level category (e.g., \"computer | laptop\")\n- `unified_level_3` through `unified_level_N`: Deeper levels\n\nCategory names use ` | ` separator, max 5 words, covering 70%+ of records in each cluster.\n\n## Installation\n\n```bash\npip install pandas numpy scipy sentence-transformers nltk tqdm\npython -c \"import nltk; nltk.download('wordnet'); nltk.download('omw-1.4')\"\n```\n\n## 4-Step Pipeline\n\n### Step 1: Load, Standardize, Filter and Merge (`step1_preprocessing_and_merge.py`)\n- **Input**: List of (DataFrame, source_name) tuples, each of the  with `category_path` column\n- **Process**: Per-source deduplication, text cleaning (remove &\u002F,\u002F'\u002F-\u002Fquotes,'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\n- **Output**: Merged DataFrame with `category_path`, `source`, `depth`, `source_level_1` through `source_level_N`\n\n### Step 2: Weighted Embeddings (`step2_weighted_embedding_generation.py`)\n- **Input**: DataFrame from Step 1\n- **Output**: Numpy embedding matrix (n_records × 384)\n- Weights: L1=1.0, L2=0.6, L3=0.36, L4=0.216, L5=0.1296 (exponential decay 0.6^(n-1))\n- **Performance**: For ~10,000 records, expect 2-5 minutes. Progress bar will show encoding status.\n\n### Step 3: Recursive Clustering (`step3_recursive_clustering_naming.py`)\n- **Input**: DataFrame + embeddings from Step 2\n- **Output**: Assignments dict {index → {level_1: ..., level_5: ...}}\n- Average linkage + cosine distance, 10-20 clusters at L1, 3-20 at L2-L5\n- Word-based naming: weighted frequency + lemmatization + coverage ≥70%\n- **Performance**: For ~10,000 records, expect 1-3 minutes for hierarchical clustering and naming. Be patient - the system is working through recursive levels.\n\n### Step 4: Export Results (`step4_result_assignments.py`)\n- **Input**: DataFrame + assignments from Step 3\n- **Output**:\n  - `unified_taxonomy_full.csv` - all records with unified categories\n  - `unified_taxonomy_hierarchy.csv` - unique taxonomy structure\n\n## Usage\n\n**Use `scripts\u002Fpipeline.py` to run the complete 4-step workflow.**\n\nSee `scripts\u002Fpipeline.py` for:\n- Complete implementation of all 4 steps\n- Example code for processing multiple sources\n- Command-line interface\n- Individual step usage (for advanced control)\n","# Hierarchical Taxonomy Clustering\n\nCreate a unified multi-level taxonomy from hierarchical category paths by clustering similar paths and automatically generating meaningful category names.\n\n## Problem\n\nGiven 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.\n\n## Methodology\n\n1. **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\n2. **Recursive Clustering**: Hierarchically cluster at each level (10-20 clusters at L1, 3-20 at L2-L5) using cosine distance\n3. **Intelligent Naming**: Generate category names via weighted word frequency + lemmatization + bundle word logic\n4. **Quality Control**: Exclude all ancestor words (parent, grandparent, etc.), avoid ancestor path duplicates, clean special characters\n\n## Output\n\nDataFrame with added columns:\n- `unified_level_1`: Top-level category (e.g., \"electronic | device\")\n- `unified_level_2`: Second-level category (e.g., \"computer | laptop\")\n- `unified_level_3` through `unified_level_N`: Deeper levels\n\nCategory names use ` | ` separator, max 5 words, covering 70%+ of records in each cluster.\n\n## Installation\n\n```bash\npip install pandas numpy scipy sentence-transformers nltk tqdm\npython -c \"import nltk; nltk.download('wordnet'); nltk.download('omw-1.4')\"\n```\n\n## 4-Step Pipeline\n\n### Step 1: Load, Standardize, Filter and Merge (`step1_preprocessing_and_merge.py`)\n- **Input**: List of (DataFrame, source_name) tuples, each of the  with `category_path` column\n- **Process**: Per-source deduplication, text cleaning (remove &\u002F,\u002F'\u002F-\u002Fquotes,'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\n- **Output**: Merged DataFrame with `category_path`, `source`, `depth`, `source_level_1` through `source_level_N`\n\n### Step 2: Weighted Embeddings (`step2_weighted_embedding_generation.py`)\n- **Input**: DataFrame from Step 1\n- **Output**: Numpy embedding matrix (n_records × 384)\n- Weights: L1=1.0, L2=0.6, L3=0.36, L4=0.216, L5=0.1296 (exponential decay 0.6^(n-1))\n- **Performance**: For ~10,000 records, expect 2-5 minutes. Progress bar will show encoding status.\n\n### Step 3: Recursive Clustering (`step3_recursive_clustering_naming.py`)\n- **Input**: DataFrame + embeddings from Step 2\n- **Output**: Assignments dict {index → {level_1: ..., level_5: ...}}\n- Average linkage + cosine distance, 10-20 clusters at L1, 3-20 at L2-L5\n- Word-based naming: weighted frequency + lemmatization + coverage ≥70%\n- **Performance**: For ~10,000 records, expect 1-3 minutes for hierarchical clustering and naming. Be patient - the system is working through recursive levels.\n\n### Step 4: Export Results (`step4_result_assignments.py`)\n- **Input**: DataFrame + assignments from Step 3\n- **Output**:\n  - `unified_taxonomy_full.csv` - all records with unified categories\n  - `unified_taxonomy_hierarchy.csv` - unique taxonomy structure\n\n## Usage\n\n**Use `scripts\u002Fpipeline.py` to run the complete 4-step workflow.**\n\nSee `scripts\u002Fpipeline.py` for:\n- Complete implementation of all 4 steps\n- Example code for processing multiple sources\n- Command-line interface\n- Individual step usage (for advanced control)\n",{"name":5,"description":7},"main","0f794a8bb6c27aa9ee4091b2691fa30e4ed9cc8f","data\u002Fpawbench-v1.0\u002Fassets\u002FT139_skillsbench_taxonomy-tree-merge\u002Fskills\u002Fhierarchical-taxonomy-clustering",24,"https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench","https:\u002F\u002Fagentscope-ai.github.io\u002FPawBench\u002F","https:\u002F\u002Fgithub.com\u002Fagentscope-ai","2026-08-03 20:09:53",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add agentscope-ai\u002FPawBench --skill hierarchical-taxonomy-clustering",{"tool":38,"command":39},"bunx","bunx skills add agentscope-ai\u002FPawBench --skill hierarchical-taxonomy-clustering",{"tool":41,"command":42},"pnpm","pnpm dlx skills add agentscope-ai\u002FPawBench --skill hierarchical-taxonomy-clustering","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT139_skillsbench_taxonomy-tree-merge\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002FSKILL.md",true,[46,52,56,60,64],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"scripts\u002Fpipeline.py","SCRIPT","脚本",5069,"https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT139_skillsbench_taxonomy-tree-merge\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002Fscripts\u002Fpipeline.py",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"scripts\u002Fstep1_preprocessing_and_merge.py",6672,"https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT139_skillsbench_taxonomy-tree-merge\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002Fscripts\u002Fstep1_preprocessing_and_merge.py",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"scripts\u002Fstep2_weighted_embedding_generation.py",4257,"https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT139_skillsbench_taxonomy-tree-merge\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002Fscripts\u002Fstep2_weighted_embedding_generation.py",{"path":61,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":62,"sourceHtmlUrl":63},"scripts\u002Fstep3_recursive_clustering_naming.py",13788,"https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT139_skillsbench_taxonomy-tree-merge\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002Fscripts\u002Fstep3_recursive_clustering_naming.py",{"path":65,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":66,"sourceHtmlUrl":67},"scripts\u002Fstep4_result_assignments.py",6860,"https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT139_skillsbench_taxonomy-tree-merge\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002Fscripts\u002Fstep4_result_assignments.py",[69,75,82,89,96,103],{"skillNo":70,"name":71,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M72WQCJKBJZB6SC8MMYK3C8R","data-reconciliation","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT140_skillsbench_xlsx-recover-data\u002Fskills\u002Fdata-reconciliation\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M72WQ1989ZX613G3PY8Z492J","nlp-research-repo-package-installment","Align Python version and repo-declared dependencies (requirements.txt \u002F environment.yml) before installing packages for NLP research code reproduction.","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT138_skillsbench_simpo-code-reproduction\u002Fskills\u002Fnlp-research-repo-package-installment\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M72WPZ828E746PAB3WCCQARW","state-space-linearization","Linearizing nonlinear dynamics around operating points for control design.","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT137_skillsbench_r2r-mpc-control\u002Fskills\u002Fstate-space-linearization\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M72WPXFXKWDFVTGAYX0B1TSA","mpc-horizon-tuning","Selecting MPC prediction horizon and cost matrices for web handling.","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT137_skillsbench_r2r-mpc-control\u002Fskills\u002Fmpc-horizon-tuning\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M72WPW3863555HM0CACRCCFK","integral-action-design","Adding integral action to MPC for offset-free tension tracking.","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT137_skillsbench_r2r-mpc-control\u002Fskills\u002Fintegral-action-design\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M72WPTB069R65ZYFG2B2NY4Q","finite-horizon-lqr","Solving finite-horizon LQR via dynamic programming for MPC.","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT137_skillsbench_r2r-mpc-control\u002Fskills\u002Ffinite-horizon-lqr\u002FSKILL.md",[],[]]