【问题标题】:uima ruta create two annotations in one ruta ruleuima ruta 在一个 ruta 规则中创建两个注释
【发布时间】:2018-06-14 08:08:38
【问题描述】:

我正在编写 ruta 脚本以从文本中捕获 sbp&dbp 注释,例如“bp: 120/80mmHg”。我想要获得的是: 符号:name="sbp", value=120, unit=mmHg 符号:name="dbp", value=80, unit=mmHg

谁能告诉我该怎么做?谢谢

【问题讨论】:

    标签: uima ruta


    【解决方案1】:

    以正确的方式正确执行此操作需要大量额外资源和分析引擎,例如,mabye 对 loinc 的概念映射、检测任意复数值、检测单位和测量值,也在斜线枚举中、针对 si 基本单位的规范化等等。

    这是一个简单的 Ruta 脚本作为初始原型(用 2.6.1 测试):

    DECLARE BloodPressure (DOUBLE systolic, DOUBLE diastolic, STRING unit);
    
    DECLARE Unit, BloodPressureIndicator;
    
    // mock annotations, replace with dictionary or unit parser
    "mmHg" -> Unit;
    "bp" -> BloodPressureIndicator;
    
    DOUBLE d1, d2;
    (BloodPressureIndicator COLON? NUM{PARSE(d1)} SPECIAL.ct=="/" NUM{PARSE(d2)} u:Unit)
        {-> CREATE(BloodPressure, "systolic" = d1, "diastolic" = d2, "unit" = u.ct)};
    

    这里是一个创建两个不同类型注释的示例:

    DECLARE BloodPressure (DOUBLE value, STRING unit);
    DECLARE BloodPressure SBP, DBP;
    
    DECLARE Unit, BloodPressureIndicator;
    
    // mock annotations, replace with dictionary or unit parser
    "mmHg" -> Unit;
    "bp" -> BloodPressureIndicator;
    
    DOUBLE d1, d2;
    (BloodPressureIndicator COLON? 
        NUM{PARSE(d1) -> CREATE(SBP, "value" = d1, "unit" = u.ct)} 
        SPECIAL.ct=="/" 
        NUM{PARSE(d2) -> CREATE(DBP, "value" = d2, "unit" = u.ct)}
        u:Unit);
    

    免责声明:我是 UIMA Ruta 的开发人员

    【讨论】:

    • 啊,好吧,我完全错过了问题的标题。我会修改我的答案。
    猜你喜欢
    • 2018-08-27
    • 2017-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多