← 返回 Skills 市场
aipoch-ai

Ehr Semantic Compressor

作者 AIpoch · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
232
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install ehr-semantic-compressor
功能描述
AI-powered EHR summarization using Transformer architecture to extract key clinical information from lengthy medical records
使用说明 (SKILL.md)

EHR Semantic Compressor

Overview

AI-powered EHR summarization using Transformer architecture to extract key clinical information from lengthy medical records. This skill processes lengthy Electronic Health Record (EHR) documents and generates structured, clinically accurate summaries.

Technical Difficulty: High

When to Use

  • Input contains lengthy EHR documents (1600+ words) requiring summarization
  • Clinical records need structured extraction of key information
  • Quick review of patient history, medications, allergies, or diagnoses is needed
  • Medical documentation requires compression while maintaining accuracy

Core Features

  1. Fast Processing: Process lengthy EHR documents (1600+ words) in 10-20 seconds
  2. Structured Summaries: Generate bullet-point summaries (200-300 words)
  3. Critical Information Extraction:
    • Patient allergies and adverse reactions
    • Family medical history
    • Current and past medications
    • Diagnoses and conditions
    • Vital signs and lab results
    • Procedures and surgeries
  4. Clinical Accuracy: Maintains completeness of medical information

Usage

Basic Usage

python scripts/main.py --input ehr_document.txt --output summary.json

Input Format

{
  "ehr_text": "Full EHR document text...",
  "max_length": 300,
  "extract_sections": ["allergies", "medications", "diagnoses", "family_history"]
}

Output Format

{
  "status": "success",
  "data": {
    "summary": "Structured bullet-point summary...",
    "extracted_sections": {
      "allergies": [...],
      "medications": [...],
      "diagnoses": [...],
      "family_history": [...]
    },
    "metadata": {
      "original_length": 2500,
      "summary_length": 280,
      "compression_ratio": 0.89
    }
  }
}

Parameters

Parameter Type Default Required Description
--input, -i string - Yes Input EHR document text file path
--output, -o string - No Output JSON file path
--max-length int 300 No Maximum summary length in words
--extract-sections string all No Comma-separated sections to extract
--format string json No Output format (json, markdown, text)

Technical Details

Architecture

  • Base Model: Transformer-based encoder-decoder architecture
  • Medical Domain Adaptation: Fine-tuned on clinical text corpora
  • Section Extraction: Rule-based + ML hybrid approach for structured data
  • Processing Pipeline: Text segmentation -> Summarization -> Section extraction -> Output formatting

Dependencies

See references/requirements.txt for complete list.

Key dependencies:

  • transformers >= 4.30.0
  • torch >= 2.0.0
  • spacy >= 3.6.0
  • scispacy >= 0.5.3

Performance

  • Processing Time: 10-20 seconds for 1600+ word documents
  • Memory: Requires ~2GB RAM
  • Output Length: 200-300 words (configurable)
  • Compression Ratio: ~85-90%

References

  • references/requirements.txt - Python dependencies
  • references/guidelines.md - Clinical summarization guidelines
  • references/sample_input.json - Example input format
  • references/sample_output.json - Example output format

Safety & Compliance

  • No external API calls or service dependencies
  • All processing performed locally
  • No patient data transmitted outside the system
  • Error messages are semantic and do not expose technical details

Testing

Run unit tests:

cd scripts
python test_main.py

Error Handling

All errors return semantic messages:

{
  "status": "error",
  "error": {
    "type": "input_validation_error",
    "message": "EHR text is empty or too short",
    "suggestion": "Provide EHR text with at least 100 words"
  }
}

Risk Assessment

Risk Indicator Assessment Level
Code Execution Python/R scripts executed locally Medium
Network Access No external API calls Low
File System Access Read input files, write output files Medium
Instruction Tampering Standard prompt guidelines Low
Data Exposure Output files saved to workspace Low

Security Checklist

  • No hardcoded credentials or API keys
  • No unauthorized file system access (../)
  • Output does not expose sensitive information
  • Prompt injection protections in place
  • Input file paths validated (no ../ traversal)
  • Output directory restricted to workspace
  • Script execution in sandboxed environment
  • Error messages sanitized (no stack traces exposed)
  • Dependencies audited

Prerequisites

# Python dependencies
pip install -r requirements.txt

Evaluation Criteria

Success Metrics

  • Successfully executes main functionality
  • Output meets quality standards
  • Handles edge cases gracefully
  • Performance is acceptable

Test Cases

  1. Basic Functionality: Standard input → Expected output
  2. Edge Case: Invalid input → Graceful error handling
  3. Performance: Large dataset → Acceptable processing time

Lifecycle Status

  • Current Stage: Draft
  • Next Review Date: 2026-03-06
  • Known Issues: None
  • Planned Improvements:
    • Performance optimization
    • Additional feature support
安全使用建议
This package contains contradictions and incomplete packaging rather than obvious malicious code, but treat it cautiously: - Don't assume the 'Transformer / fine-tuned model' claims are true — the included script is extractive and does not use heavy ML libraries. Ask the author which implementation is intended and request the actual model code if you expect a Transformer-based summarizer. - Verify dependencies before installing: the top-level requirements.txt ('main') is invalid while references/requirements.txt lists large ML packages. Installing unnecessary ML libs could be costly and expose you to additional attack surface. - Confirm missing tests and files: SKILL.md references test_main.py (not present). Ask for a complete test suite and a reproducible install/run guide. - Check input-file handling and path validation: the README/checklist mentions protection against ../ traversal, but the code does not show explicit path-sanitization. If you will run this on real PHI, run it in an isolated/sandboxed environment and audit file-path handling to prevent reading unintended files. - Validate that no network activity occurs at runtime: although SKILL.md states processing is local and visible code appears local, confirm there are no hidden calls or optional code paths that contact external endpoints (search dynamically for subprocess, urllib/requests, socket usage in the remainder of scripts/main.py or other files). - If you plan to process Protected Health Information (PHI), perform a security and compliance review (logging, data retention, access controls) and consider running the skill in an isolated environment with non-production data first. If you need a higher-confidence assessment, provide the full (untruncated) scripts/main.py and any additional files or a clarification from the author about intended model usage and expected dependencies.
功能分析
Type: OpenClaw Skill Name: ehr-semantic-compressor Version: 0.1.0 The EHR Semantic Compressor is a clinical text summarization tool that processes medical records locally. While the documentation in SKILL.md claims to use a Transformer-based architecture, the actual implementation in scripts/main.py is a simple rule-based extractive summarizer using keyword scoring and regex. The script handles local file I/O for input and output as described, lacks any network connectivity or shell execution capabilities, and shows no signs of data exfiltration or malicious intent. The discrepancy between the claimed and actual technology appears to be a functional limitation rather than a security threat.
能力评估
Purpose & Capability
The SKILL.md and references claim a Transformer encoder‑decoder, fine‑tuning on clinical corpora, and heavy ML deps (transformers, torch, scispacy), but the provided scripts/main.py implements a purely extractive, keyword-and-frequency based summarizer with no imports or code using transformers/torch/scispacy. This is a substantive mismatch between claimed capability and actual implementation and could indicate inaccurate documentation or incomplete/placeholder packaging.
Instruction Scope
SKILL.md instructs local processing and explicitly states no external API calls — the visible code appears to operate locally on supplied text. However SKILL.md's testing section refers to running python test_main.py but no test_main.py is present in the package. Also SKILL.md lists many security checklist items (path traversal protection, prompt injection protections) but there's no clear evidence the CLI enforces all of those protections; the script validates input text length and JSON shape, but file-path validation and sandboxing are not shown in the visible code.
Install Mechanism
There is no install spec (instruction-only) — lowest install risk — but the packaging is inconsistent: references/requirements.txt lists heavy ML libs (transformers, torch, numpy) while the top-level requirements.txt contains the single line 'main' (nonsensical). If users install the referenced heavy dependencies they may pull large ML toolchains unnecessarily. The project either ships inaccurate dependency metadata or is incomplete.
Credentials
The skill declares no required environment variables, no credentials, and the code does not attempt to read secrets or network credentials. There is no evidence of unrelated credential requests.
Persistence & Privilege
The skill is not always-enabled and has no reported privilege to persist beyond its own files. It reads input files and writes output files (expected for a CLI summarizer). There is no indication it modifies other skills or global agent configs.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ehr-semantic-compressor
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ehr-semantic-compressor 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release of ehr-semantic-compressor—an AI-powered tool for generating structured summaries from lengthy EHRs. - Summarizes 1600+ word EHR documents in 10–20 seconds with Transformer-based models - Extracts key clinical information: allergies, medications, diagnoses, family history, lab results, and more - Outputs 200–300 word bullet summaries with detailed section extraction - Supports JSON, Markdown, and text output formats; configurable via command-line arguments - Emphasizes clinical accuracy, local processing (no external API calls), and strict security controls - Provides comprehensive error handling and test coverage for robust usage
元数据
Slug ehr-semantic-compressor
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Ehr Semantic Compressor 是什么?

AI-powered EHR summarization using Transformer architecture to extract key clinical information from lengthy medical records. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 232 次。

如何安装 Ehr Semantic Compressor?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install ehr-semantic-compressor」即可一键安装,无需额外配置。

Ehr Semantic Compressor 是免费的吗?

是的,Ehr Semantic Compressor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Ehr Semantic Compressor 支持哪些平台?

Ehr Semantic Compressor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Ehr Semantic Compressor?

由 AIpoch(@aipoch-ai)开发并维护,当前版本 v0.1.0。

💬 留言讨论