I
indexion-segment
by @trkbt10v
4.4(120)
此技能能将文本智能地分割成具有上下文意义的片段,支持窗口、TF-IDF、标点或混合策略。它主要用于为 RAG(检索增强生成)和嵌入管道准备数据,确保文本内容被有效组织,从而提升 AI 模型理解和处理长文档的能力。
安装方式
npx skills add https://github.com/trkbt10/indexion-skills --skill indexion-segmentcompare_arrows
Before / After 效果对比
1 组使用前
在没有此技能之前,用户需要手动或通过简单的脚本来分割长文本,以适应 RAG 或嵌入模型的输入要求。这个过程不仅耗时,而且难以保证分割的上下文质量,经常导致 AI 模型在理解复杂文档时出现偏差,影响最终的生成效果。
使用后
此技能能够自动且智能地将文本分割成具有上下文意义的片段,显著减少了数据预处理所需的时间和精力。通过优化文本块的质量,该 Skill 提升了 RAG 系统的检索准确性和 AI 模型对长文档的理解能力,从而提高了整体应用性能。
SKILL.md
indexion segment
Split text into contextual segments using divergence-based, TF-IDF, or punctuation strategies.
When to Use
- User needs to chunk text for RAG or embedding pipelines
- User wants to split a document into meaningful sections
- User asks to segment text for processing
- Preparing text for similarity analysis at sub-document level
Usage
# Default window divergence strategy
indexion segment <input-file> <output-dir>
# TF-IDF based segmentation
indexion segment --strategy=tfidf <input-file> <output-dir>
# Punctuation-based segmentation
indexion segment --strategy=punctuation <input-file> <output-dir>
# Custom segment sizes
indexion segment --min-size=200 --max-size=3000 --target-size=800 document.txt output/
# Custom divergence threshold
indexion segment --threshold=0.5 document.txt output/
# Adaptive threshold mode (default)
indexion segment --adaptive document.txt output/
# Hybrid NCD+TF-IDF mode
indexion segment --hybrid --ncd-weight=0.6 --tfidf-weight=0.4 document.txt output/
# Custom window size
indexion segment --window-size=5 document.txt output/
# Custom output prefix
indexion segment --prefix=chunk document.txt output/
Options
| Option | Default | Description |
|---|---|---|
--strategy=NAME | window | Strategy: window, tfidf, punctuation |
--min-size=INT | 100 | Minimum segment characters |
--max-size=INT | 2000 | Maximum segment characters |
--target-size=INT | 500 | Target segment characters |
--threshold=FLOAT | 0.42 | Divergence threshold |
--window-size=INT | 3 | Window size |
--adaptive | true | Adaptive threshold mode |
--hybrid | false | NCD+TF-IDF hybrid mode |
--ncd-weight=FLOAT | 0.5 | NCD weight in hybrid mode |
--tfidf-weight=FLOAT | 0.5 | TF-IDF weight in hybrid mode |
--prefix=NAME | segment | Output file prefix |
Strategies
| Strategy | Description |
|---|---|
window (default) | Sliding window divergence detection |
tfidf | TF-IDF based topic change detection |
punctuation | Punctuation/sentence boundary based |
Workflow
- Run
indexion segment <input-file> <output-dir>to split text with defaults - Adjust
--thresholdand--target-sizeto tune segmentation granularity - Use
--hybridmode for better accuracy on mixed-content documents
用户评价 (0)
发表评价
效果
易用性
文档
兼容性
暂无评价
统计数据
安装量4.9K
评分4.4 / 5.0
版本
更新日期2026年6月30日
对比案例1 组
用户评分
4.4(120)
5
37%
4
43%
3
13%
2
5%
1
2%
为此 Skill 评分
0.0
兼容平台
🤖claude-code
时间线
创建2026年6月9日
最后更新2026年6月30日