【问题标题】:will the following JAPE rule override the existing annotation or add an extra annotation?以下 JAPE 规则会覆盖现有注释或添加额外注释吗?
【发布时间】:2016-02-18 12:27:40
【问题描述】:

以下 JAPE 规则将用地址替换电子邮件注释或只是添加一个额外的注释地址?

Rule: EmailFinal
Priority: 50
(
{Email}
)
:address
-->
:address.Address = {kind = "email", rule = "EmailFinal"}

【问题讨论】:

    标签: information-retrieval gate information-extraction


    【解决方案1】:

    :label.Type = {...} 将始终创建一个新注释,但不会触及现有注释。如果要删除输入注释,则需要在规则中添加第二个操作:

    Rule: EmailFinal
    Priority: 50
    (
    {Email}
    )
    :address
    -->
    :address.Address = {kind = "email", rule = "EmailFinal"},
    :address { inputAS.removeAll(addressAnnots); }
    

    【讨论】:

    • Wau inputAS.removeAll(addressAnnots); 是使用 bindings 的旧方式的绝佳捷径。
    • @dedek 是的,标记块:label { ... } 是一种方便的速记 - 它在块内为您提供了一个自动变量labelAnnots,相当于bindings.get("label")块保证仅在该集合不为空的情况下运行。
    猜你喜欢
    • 2012-09-17
    • 1970-01-01
    • 2012-02-03
    • 1970-01-01
    • 2011-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-13
    相关资源
    最近更新 更多