← 返回
未分类 中文

Ehr Semantic Compressor

AI-powered EHR summarization using Transformer architecture to extract key clinical information from lengthy medical records
基于Transformer架构的AI驱动病历摘要,自动从冗长医疗记录中提取关键临床信息
aipoch-ai aipoch-ai 来源
未分类 clawhub v0.1.0 1 版本 99815.2 Key: 无需
★ 0
Stars
📥 540
下载
💾 0
安装
1
版本
#latest

概述

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

ParameterTypeDefaultRequiredDescription
-------------------------------------------------
--input, -istring-YesInput EHR document text file path
--output, -ostring-NoOutput JSON file path
--max-lengthint300NoMaximum summary length in words
--extract-sectionsstringallNoComma-separated sections to extract
--formatstringjsonNoOutput 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 IndicatorAssessmentLevel
-----------------------------------
Code ExecutionPython/R scripts executed locallyMedium
Network AccessNo external API callsLow
File System AccessRead input files, write output filesMedium
Instruction TamperingStandard prompt guidelinesLow
Data ExposureOutput files saved to workspaceLow

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

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-05-02 02:48 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

professional

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 277 📥 57,541
data-analysis

Survival Analysis (KM)

aipoch-ai
生成Kaplan‑Meier生存曲线,计算生存统计量(log‑rank检验、中位生存时间),并估算临床及生物...的 hazard ratios。
★ 2 📥 977
professional

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 187 📥 62,241