Abstract Trimmer
Precision editing tool that reduces abstract word count through intelligent compression techniques, maintaining scientific rigor while meeting strict journal and conference requirements.
Features
- - Smart Compression: Multiple strategies (aggressive, conservative, balanced)
- Key Information Preservation: Retains critical findings and statistics
- Structural Integrity: Maintains Background-Methods-Results-Conclusion flow
- Quantitative Safety: Protects numbers, P-values, and confidence intervals
- Batch Processing: Trim multiple abstracts efficiently
- Quality Validation: Post-trim readability and accuracy checks
Usage
Basic Usage
CODEBLOCK0
Parameters
| Parameter | Type | Default | Required | Description |
|---|
| INLINECODE0 , INLINECODE1 | str | None | No | Input file containing abstract |
| INLINECODE2 , INLINECODE3 |
str | None | No | Abstract text (alternative to --input) |
|
--target,
-T | int | 250 | No | Target word count |
|
--strategy,
-s | str | balanced | No | Trimming strategy (conservative/balanced/aggressive) |
|
--output,
-o | str | None | No | Output file path |
|
--check-only,
-c | flag | False | No | Only check word count without trimming |
|
--format | str | json | No | Output format (json/text) |
Advanced Usage
CODEBLOCK1
Trimming Strategies
| Strategy | Approach | Best For |
|---|
| Conservative | Remove filler words, simplify sentences | Minor trims (10-20 words) |
| Balanced |
Condense phrases, merge sentences | Moderate trims (20-50 words) |
|
Aggressive | Remove secondary details, abbreviate | Major trims (50+ words) |
Output Format
JSON Output
CODEBLOCK2
Text Output
CODEBLOCK3
Technical Difficulty: LOW
⚠️ AI自主验收状态: 需人工检查
This skill requires:
- - Python 3.7+ environment
- No external dependencies
Dependencies
Required Python Packages
CODEBLOCK4
Requirements File
No external dependencies required (uses only Python standard library).
Risk Assessment
| Risk Indicator | Assessment | Level |
|---|
| Code Execution | Python scripts executed locally | Low |
| Network Access |
No network access | Low |
| File System Access | Read/write text files only | Low |
| Instruction Tampering | Standard prompt guidelines | Low |
| Data Exposure | No sensitive data exposure | Low |
Security Checklist
- - [x] No hardcoded credentials or API keys
- [x] No unauthorized file system access (../)
- [x] Output does not expose sensitive information
- [x] Prompt injection protections in place
- [x] Input file paths validated
- [x] Output directory restricted to workspace
- [x] Script execution in sandboxed environment
- [x] Error messages sanitized
- [x] Dependencies audited
Prerequisites
CODEBLOCK5
Evaluation Criteria
Success Metrics
- - [ ] Successfully trims abstracts to target word count
- [ ] Preserves key scientific information
- [ ] Maintains grammatical correctness
- [ ] Handles edge cases gracefully
Test Cases
- 1. Basic Trimming: Input abstract → Trimed to target word count
- Check Mode: --check-only flag → Reports word count statistics
- File I/O: Read from file, write to file → Correct file handling
- Different Strategies: All three strategies work → Different compression levels
Lifecycle Status
- - Current Stage: Draft
- Next Review Date: 2026-03-15
- Known Issues: None
- Planned Improvements:
- Enhanced protection for quantitative data
- Support for structured abstracts
- Batch processing mode
References
See references/ for:
- - Compression strategies documentation
- Protected elements guidelines
- Journal word limits by publisher
Limitations
- - Language: Optimized for English academic abstracts
- Content Type: Designed for structured abstracts (BMRC format)
- No Rewriting: Only removes/compresses; doesn't rephrase
- Final Review: Automated trimming requires human validation
✂️ Remember: This tool helps meet word limits, but never sacrifice scientific accuracy. Always validate that trimmed abstracts maintain the integrity of your findings.
摘要精简器
通过智能压缩技术减少摘要字数的精准编辑工具,在保持科学严谨性的同时满足严格的期刊和会议要求。
功能特性
- - 智能压缩:多种策略(激进、保守、平衡)
- 关键信息保留:保留重要发现和统计数据
- 结构完整性:维持背景-方法-结果-结论的流程
- 数据安全:保护数字、P值和置信区间
- 批量处理:高效精简多个摘要
- 质量验证:精简后可读性与准确性检查
使用方法
基本用法
bash
从文件精简摘要
python scripts/main.py --input abstract.txt --target 250
从命令行精简摘要
python scripts/main.py --text 在此输入您的摘要... --target 200
仅检查字数
python scripts/main.py --input abstract.txt --target 250 --check-only
参数说明
| 参数 | 类型 | 默认值 | 必填 | 描述 |
|---|
| --input, -i | str | None | 否 | 包含摘要的输入文件 |
| --text, -t |
str | None | 否 | 摘要文本(替代--input) |
| --target, -T | int | 250 | 否 | 目标字数 |
| --strategy, -s | str | balanced | 否 | 精简策略(conservative/balanced/aggressive) |
| --output, -o | str | None | 否 | 输出文件路径 |
| --check-only, -c | 标志 | False | 否 | 仅检查字数,不进行精简 |
| --format | str | json | 否 | 输出格式(json/text) |
高级用法
bash
激进精简并输出文本格式
python scripts/main.py \
--input abstract.txt \
--target 200 \
--strategy aggressive \
--format text \
--output trimmed.txt
批量检查多个摘要
for file in *.txt; do
python scripts/main.py --input $file --target 250 --check-only
done
精简策略
| 策略 | 方法 | 适用场景 |
|---|
| 保守 | 删除填充词,简化句子 | 小幅精简(10-20词) |
| 平衡 |
压缩短语,合并句子 | 中等精简(20-50词) |
|
激进 | 删除次要细节,使用缩写 | 大幅精简(50词以上) |
输出格式
JSON输出
json
{
trimmed_abstract: 压缩后的摘要文本...,
original_words: 320,
final_words: 248,
reduction_percent: 22.5
}
文本输出
压缩后的摘要文本...
技术难度:低
⚠️ AI自主验收状态:需人工检查
此技能需要:
依赖项
所需Python包
bash
pip install -r requirements.txt
依赖文件
无需外部依赖(仅使用Python标准库)。
风险评估
| 风险指标 | 评估 | 等级 |
|---|
| 代码执行 | Python脚本本地执行 | 低 |
| 网络访问 |
无网络访问 | 低 |
| 文件系统访问 | 仅读写文本文件 | 低 |
| 指令篡改 | 标准提示词指南 | 低 |
| 数据泄露 | 无敏感数据泄露 | 低 |
安全检查清单
- - [x] 无硬编码凭据或API密钥
- [x] 无未经授权的文件系统访问(../)
- [x] 输出不暴露敏感信息
- [x] 已实施提示注入防护
- [x] 输入文件路径已验证
- [x] 输出目录限制在工作空间内
- [x] 脚本在沙盒环境中执行
- [x] 错误信息已清理
- [x] 依赖项已审计
前置条件
bash
无需依赖
python scripts/main.py --help
评估标准
成功指标
- - [ ] 成功将摘要精简至目标字数
- [ ] 保留关键科学信息
- [ ] 保持语法正确性
- [ ] 优雅处理边缘情况
测试用例
- 1. 基本精简:输入摘要 → 精简至目标字数
- 检查模式:--check-only标志 → 报告字数统计
- 文件输入输出:从文件读取,写入文件 → 正确的文件处理
- 不同策略:三种策略均有效 → 不同压缩程度
生命周期状态
- - 当前阶段:草案
- 下次审核日期:2026-03-15
- 已知问题:无
- 计划改进:
- 增强对定量数据的保护
- 支持结构化摘要
- 批量处理模式
参考资料
参见 references/ 目录:
- - 压缩策略文档
- 受保护元素指南
- 按出版商分类的期刊字数限制
局限性
- - 语言:针对英文学术摘要优化
- 内容类型:专为结构化摘要(BMRC格式)设计
- 不进行重写:仅删除/压缩;不重新措辞
- 最终审核:自动精简需要人工验证
✂️ 请记住:此工具有助于满足字数限制,但切勿牺牲科学准确性。务必验证精简后的摘要是否保持研究结果的完整性。