[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XES7A0SGCPJC78KMVWK0HN":3,"skill-same:01M6XES7A0SGCPJC78KMVWK0HN":82},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":13,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":6,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M6XES7A0SGCPJC78KMVWK0HN","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.","Waaaalnut\u002Fskillsbench","Waaaalnut","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F103995656?v=4","01M6XCS9K1V51EY3JMB7DGMX24","01M6XCS9Q4WPW88W62C55G1H44",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Ftaxonomy-tree-merge\u002Fenvironment\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"clustering","taxonomy","hierarchical taxonomy clustering","product","analysis","Word","build","via","paths","multi","embedding","e-commerce","with","commerce","naming","recursive","2026-11-10 10:12:30",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","7eeb258ada72b7f58119b0e7a2c00ea89d9beedd","tasks\u002Ftaxonomy-tree-merge\u002Fenvironment\u002Fskills\u002Fhierarchical-taxonomy-clustering","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench","https:\u002F\u002Fgithub.com\u002FWaaaalnut","student of Zhejiang University","2026-04-21 23:16:23",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add Waaaalnut\u002Fskillsbench --skill hierarchical-taxonomy-clustering",{"tool":52,"command":53},"bunx","bunx skills add Waaaalnut\u002Fskillsbench --skill hierarchical-taxonomy-clustering",{"tool":55,"command":56},"pnpm","pnpm dlx skills add Waaaalnut\u002Fskillsbench --skill hierarchical-taxonomy-clustering","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Ftaxonomy-tree-merge\u002Fenvironment\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002FSKILL.md",true,[60,66,70,74,78],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"scripts\u002Fpipeline.py","SCRIPT","脚本",5069,"https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Ftaxonomy-tree-merge\u002Fenvironment\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002Fscripts\u002Fpipeline.py",{"path":67,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":68,"sourceHtmlUrl":69},"scripts\u002Fstep1_preprocessing_and_merge.py",6672,"https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Ftaxonomy-tree-merge\u002Fenvironment\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002Fscripts\u002Fstep1_preprocessing_and_merge.py",{"path":71,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":72,"sourceHtmlUrl":73},"scripts\u002Fstep2_weighted_embedding_generation.py",4257,"https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Ftaxonomy-tree-merge\u002Fenvironment\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002Fscripts\u002Fstep2_weighted_embedding_generation.py",{"path":75,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":76,"sourceHtmlUrl":77},"scripts\u002Fstep3_recursive_clustering_naming.py",13788,"https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Ftaxonomy-tree-merge\u002Fenvironment\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002Fscripts\u002Fstep3_recursive_clustering_naming.py",{"path":79,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":80,"sourceHtmlUrl":81},"scripts\u002Fstep4_result_assignments.py",6860,"https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Ftaxonomy-tree-merge\u002Fenvironment\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002Fscripts\u002Fstep4_result_assignments.py",[83,92,107,130,150,169],{"skillNo":84,"name":85,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":34},"01M6XEWMJ6VY3ZC53MPDCPG3GH","data-reconciliation","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fxlsx-recover-data\u002Fenvironment\u002Fskills\u002Fdata-reconciliation\u002FSKILL.md",[],[89,90,91],"data reconciliation","reconciliation","data",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":34},"01M6XEW8MNPMF1KRXV6ATGFRQF","speech-to-text","Transcribe video to timestamped text using Whisper tiny model (pre-installed).","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-tutorial-indexer\u002Fenvironment\u002Fskills\u002Fspeech-to-text\u002FSKILL.md",[],[99,100,101,102,103,104,105,106],"speech","text","speech to text","transcribe video","whisper","model","Video","transcribe",{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":34},"01M6XEW3FQZP0T1RKQQJFXVY9T","video-processor","Process videos by removing segments and concatenating remaining parts. Use when you need to remove detected pauses\u002Fopenings from videos, create highlight reels, or batch process segment removals using ffmpeg filter_complex.","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Fvideo-processor\u002FSKILL.md",[],[105,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129],"processor","video processor","batch","create","reels","when","parts","segments","process","videos","you","segment","filter","ffmpeg","use","remove",{"skillNo":131,"name":132,"nameZh":6,"description":133,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":136,"publishedAt":34},"01M6XEVXJ5KZ0NTY3XZKRY4AS1","silence-detector","Detect initial silence segments in audio\u002Fvideo using energy-based analysis. Use when you need to find low-energy periods at the start of recordings (title slides, setup time, pre-roll silence).","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Fsilence-detector\u002FSKILL.md",[],[137,138,139,140,119,124,141,142,143,144,145,121,146,147,105,22,148,149,128],"detector","silence detector","title","slides","time","energy","at","recordings","detect","find","Audio","start","setup",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":34},"01M6XEVT3NGRN1FT7JPMAPXS6M","segment-combiner","Combine multiple segment detection results into a unified list. Use when you need to merge segments from different detectors, prepare removal lists for video processing, or consolidate detection outputs.","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Fsegment-combiner\u002FSKILL.md",[],[125,157,105,158,159,160,161,162,119,163,164,121,124,165,166,128,167,168],"segment combiner","detection","prepare","merge","video processing","for","outputs","combine","processing","consolidate","results","list",{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":34},"01M6XEVMPVASGS2KX86QK4FMT7","report-generator","Generate compression reports for video processing. Use when you need to create structured JSON reports with duration statistics, compression ratios, and segment details after video processing.","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Freport-generator\u002FSKILL.md",[],[176,177,178,125,119,162,124,30,165,179,180,181,128,161,182,105,183,184,117],"generator","report generator","report","statistics","structured","reports","json","compression","generate"]