| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- # -*- coding: utf-8 -*-
- # 规则文件:时间实体上下文关键词
- # 源:assembly/time_attrs.py 第 370-574 行 getTimeAttributes() 内 re.search 调用
- # 迁移日期:2026-08-17 Phase 7 §7.6 高优先级
- # 说明:这些正则用于判断时间实体附近的上下文语义,将时间分配到
- # time_bidclose / time_bidopen / time_signContract 等字段。
- # 调用方使用 RuleLoader.get_pattern(id).search(entity_left3) 替换原 re.search。
- version: 1
- category: TIME
- description: |
- 时间实体上下文分类正则。原 getTimeAttributes() 函数中用 re.search(pattern, context)
- 判断时间实体的上下文语义(截标/开标/报名/合同等),本文件将散落在函数体中的
- 正则提取为命名规则,使时间字段分配逻辑可由 dl/rules/ 配置驱动。
- patterns:
- # ── 截标/投标截止(最高频,多处复用) ──
- - id: ctx_bidclose
- description: |
- 截标/投标截止/文件提交截止/报价截止/响应截止/文件提交接收 等上下文。
- 原 time_attrs.py 多处以同一 pattern 出现(370/378/381/386/389 行)。
- pattern: '截标|投标.{,2}截止|([递提]交|接收)(?:文件)?.{,2}截止|报价.{,2}截止|响应.{,2}截止|文件.{,2}([递提]交|接收)'
- method: search
- golden_examples:
- - input: "投标截止时间"
- should_match: true
- - input: "递交文件截止"
- should_match: true
- - input: "报价截止日期"
- should_match: true
- - input: "开标时间"
- should_match: false
- # ── 开标/评审时间 ──
- - id: ctx_bidopen
- description: 开标/评审比选开始时间/选取时间 上下文
- pattern: '开标|(评审|比选).{,2}(?:开始)?(时间|日期)|选取.{,2}(时间|日期)'
- method: search
- golden_examples:
- - input: "开标时间"
- should_match: true
- - input: "评审开始时间"
- should_match: true
- - input: "选取日期"
- should_match: true
- - input: "投标截止"
- should_match: false
- # ── 报名 ──
- - id: ctx_registration
- description: 报名上下文(报名时间判定)
- pattern: '报名'
- method: search
- golden_examples:
- - input: "报名时间"
- should_match: true
- - input: "报名截止"
- should_match: true
- - input: "开标时间"
- should_match: false
- # ── 获取文件 ──
- - id: ctx_getfile
- description: 获取文件上下文(取文件截止时间判定)
- pattern: '获取'
- method: search
- golden_examples:
- - input: "获取文件时间"
- should_match: true
- - input: "获取招标文件"
- should_match: true
- - input: "开标时间"
- should_match: false
- # ── 保证金 ──
- - id: ctx_earnest_money
- description: 保证金接受/收取 上下文
- pattern: '保证金.{,2}(接受|收取)|(接受|收取).{,2}保证金'
- method: search
- golden_examples:
- - input: "保证金接受时间"
- should_match: true
- - input: "收取保证金截止"
- should_match: true
- - input: "投标保证金"
- should_match: false
- # ── 挂牌开始 ──
- - id: ctx_listing_start
- description: 挂牌开始/起始时间日期 上下文
- pattern: '挂牌.?(开始|起始).?(?:时间|日期)'
- method: search
- golden_examples:
- - input: "挂牌开始时间"
- should_match: true
- - input: "挂牌起始日期"
- should_match: true
- - input: "挂牌截止时间"
- should_match: false
- # ── 挂牌截止 ──
- - id: ctx_listing_end
- description: 挂牌截止/结束时间日期 上下文
- pattern: '挂牌.?(截[止至]|结束).?(?:时间|日期)'
- method: search
- golden_examples:
- - input: "挂牌截止时间"
- should_match: true
- - input: "挂牌结束日期"
- should_match: true
- - input: "挂牌开始时间"
- should_match: false
- # ── 挂牌通用(需配合上下文判断 start/end) ──
- - id: ctx_listing_any
- description: 挂牌时间/日期 通用上下文(需配合前后文判断 start/end)
- pattern: '挂牌.{,4}(?:时间|日期)'
- method: search
- golden_examples:
- - input: "挂牌时间"
- should_match: true
- - input: "挂牌日期"
- should_match: true
- - input: "开标时间"
- should_match: false
- # ── 合同签订 ──
- - id: ctx_sign_contract
- description: |
- 合同签订时间/日期 上下文。匹配:
- - 合同xx签订xx(时间|日期)
- - 签订xx合同xx(时间|日期)
- - 合同签订(行尾)
- pattern: '(合同.{,2}签[订定署].{,2}|签[订定署].{,2}合同.{,2})(?:时间|日期)|合同签[订定署].{,1}$'
- method: search
- golden_examples:
- - input: "合同签订时间"
- should_match: true
- - input: "签订合同日期"
- should_match: true
- - input: "合同签订"
- should_match: true
- - input: "服务期限"
- should_match: false
- # ── 合同/服务起始 ──
- - id: ctx_contract_start
- description: 合同/服务/履约 起始/开始时间 上下文
- pattern: '(合同|服务|履约|(合同|服务)履行).{,4}(?:起始|开始)(?:时间|日期)'
- method: search
- golden_examples:
- - input: "合同起始时间"
- should_match: true
- - input: "服务开始日期"
- should_match: true
- - input: "履约履行开始时间"
- should_match: true
- - input: "合同截止时间"
- should_match: false
- # ── 合同/服务截止 ──
- - id: ctx_contract_end
- description: 合同/服务/履约 完成/截止/结束 时间 上下文
- pattern: '(合同|服务|履约).{,2}(?:完成|截止|结束)(?:时间|日期|时限)'
- method: search
- golden_examples:
- - input: "合同截止时间"
- should_match: true
- - input: "服务完成日期"
- should_match: true
- - input: "履约结束时限"
- should_match: true
- - input: "合同起始时间"
- should_match: false
- # ── 合同/服务期限通用 ──
- - id: ctx_contract_period
- description: |
- 合同/服务/履约 期限/有效期/时间/日期/周期 通用上下文。
- 用于判断时间实体是否属于合同服务期。
- pattern: '(?:合同|服务|履约|(合同|服务)履行)(?:期限?|有效期)|(?:服务|履约|(合同|服务)履行)(?:时间|日期|周期)|(?:服务|合同)[时年]限|合同周期'
- method: search
- golden_examples:
- - input: "合同期限"
- should_match: true
- - input: "服务有效期"
- should_match: true
- - input: "履约时间"
- should_match: true
- - input: "合同年限"
- should_match: true
- - input: "开标时间"
- should_match: false
- # ── 截止/止 标记(配合 ctx_contract_period 使用) ──
- - id: ctx_end_marker
- description: 截止/止/前 等结束标记(用于判断 period 是 start 还是 end)
- pattern: '到|至|截[至止]'
- method: search
- golden_examples:
- - input: "至"
- should_match: true
- - input: "截止"
- should_match: true
- - input: "开始"
- should_match: false
- # ── 报价/竞价开始 ──
- - id: ctx_bidprice_start
- description: 报价/竞价 开始/起始 时间日期 上下文
- pattern: '[报竞]价.{,2}(开始|起始).{,2}(时间|日期)'
- method: search
- golden_examples:
- - input: "报价开始时间"
- should_match: true
- - input: "竞价起始日期"
- should_match: true
- - input: "报价截止时间"
- should_match: false
- # ── 报价/竞价起止 ──
- - id: ctx_bidprice_range
- description: 报价/竞价 起止 时间日期 上下文
- pattern: '[报竞]价.{,2}起止.{,2}(时间|日期)'
- method: search
- golden_examples:
- - input: "报价起止时间"
- should_match: true
- - input: "竞价起止日期"
- should_match: true
- - input: "报价开始时间"
- should_match: false
- # ── 报价/竞价截止 ──
- - id: ctx_bidprice_close
- description: 报价/竞价 截止 时间日期 上下文
- pattern: '[报竞]价.{,2}截[止至].{,2}(时间|日期)'
- method: search
- golden_examples:
- - input: "报价截止时间"
- should_match: true
- - input: "竞价截至日期"
- should_match: true
- - input: "报价开始时间"
- should_match: false
- # ── 报价/竞价通用 ──
- - id: ctx_bidprice_any
- description: 报价/竞价 时间日期 通用上下文
- pattern: '(竞价|报价).?(时间|日期)'
- method: search
- golden_examples:
- - input: "报价时间"
- should_match: true
- - input: "竞价日期"
- should_match: true
- - input: "开标时间"
- should_match: false
- # ── 响应文件提交/接收(截止版) ──
- - id: ctx_response_close
- description: 响应文件提交/接收 截止 时间日期 上下文
- pattern: '响应.{,2}文件([递提]交|接收).{,2}(时间|日期)[::]|([递提]交|接收).{,2}响应.{,2}文件.{,2}(时间|日期)[::]'
- method: search
- golden_examples:
- - input: "响应文件递交时间:"
- should_match: true
- - input: "接收响应文件时间:"
- should_match: true
- - input: "响应文件递交时间"
- should_match: false
- # ── 响应文件提交/接收(非截止版) ──
- - id: ctx_response_any
- description: |
- 响应文件提交/接收 时间日期 通用上下文(排除含"截止"的场景)。
- 调用方需额外检查 not RuleLoader.match("ctx_response_close", text)。
- pattern: '响应.{,2}文件([递提]交|接收).{,2}(时间|日期)|([递提]交|接收).{,2}响应.{,2}文件.{,2}(时间|日期)'
- method: search
- golden_examples:
- - input: "响应文件递交时间"
- should_match: true
- - input: "接收响应文件时间"
- should_match: true
- - input: "开标时间"
- should_match: false
- # ── 服务期限关键词(大集合) ──
- - id: ctx_service_period
- description: |
- 服务/工期/履约期限 关键词集合。原 time_attrs.py 第 539-548 行的 re_service 变量,
- 用于 label==0 的时间实体判定为合同起止时间。
- pattern: '合同期限|工期/交货期/服务期|工期\(交货期\)|合格工期|服务期限|工期|工期要求|项目周期|计划工期\(服务期限\)|服务时限|履行期限|服务周期|供货期限|合格工期|计划工期\(服务期\)|服务期|服务,期|交货\(完工\)(时间|日期)|交付\(服务、完工\)(时间|日期)|交货(时间|日期)|工期承诺|(服务|合同|施工|实施|工程|设计)的?(年限|期限|周期|期:)|服务期限为|计划工期|工期要求|服务期限|服务期|投标工期|设计工期|合格服务周期|总工期|服务(时间|日期)(范围)?|流转期限|维护期限|服务时限|交货期|完成(时间|日期)|服务期限|中标工期|项目周期|期限要求|供货期|合同履行日期|计划的?周期|履约期限|合同约定完成时限|合同完成日期|承诺完成日期|合同起始日起|合同履约期|履约截止日期|承包期限|合同完成日期|服务期间|服务履行期|委托(管理)?期限|履约期限、地点等简要信息'
- method: search
- golden_examples:
- - input: "服务期限"
- should_match: true
- - input: "工期要求"
- should_match: true
- - input: "履约期限、地点等简要信息"
- should_match: true
- - input: "交货期"
- should_match: true
- - input: "开标时间"
- should_match: false
|