| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080 |
- # PREMPredict.predict_role 模型后修正规则(角色分类流程优化 Phase B 外置 / Phase C 机器可读化)。
- #
- # 来源:dl/predictors/prem.py PREMPredict.predict_role(约 166-357 行)
- # 按 label 分支组织的 if/elif 修正链。
- #
- # 机器可读语义(Phase C RoleRuleEngine 消费):
- # - stage:引擎执行阶段。角色链路固定阶段序(对应原代码 if/elif 短路语义):
- # global_pre(全局前置,非终止)→ 阈值过滤(label∈[0,4] 且 values[label]<
- # p_model_threshold → label=5,终止)→ seq_check(label∈[2,3,4] 命中 →
- # label=5,终止)→ 按 label 进入分支阶段:
- # label=0 → l0;label=2 → l2;label=1 → l1;label∈[3,4] → l34;
- # label=5 → l5_win_yes → notify → l5(逐阶段首条命中即止)。
- # - model_labels:规则仅对当前 label 命中列表内值时生效。
- # 标签映射:0=tenderee, 1=agency, 2=winTenderer, 3=secondTenderer,
- # 4=thirdTenderer, 5=other。
- # - applies_to:pattern 匹配的切片。front=实体前文(23 字),behind=实体后文
- # (25 字),whole=前文末10字+实体+后文首10字(与原代码一致)。
- # - window:applies_to 切片的截断(front 取末 size 字 / behind 取前 size 字),
- # 对应原代码 front[-N:]/behind[:N]。
- # - guard / guard_not / or_trigger:结构化条件(AND / OR-排除 / OR-替代触发),
- # 类型见 schema/pattern_schema.json definitions.condition。
- # - set_label / set_prob:命中后改写的标签与概率。set_prob.index 显式指定
- # values 写入槽位;缺省 = set_label(若有)否则当前 label。原代码中
- # `label=N; values[label]=x` 写新标签槽位,`values[旧label]=x; label=N`
- # 写旧标签槽位——两者语义不同,index 字段区分。
- # - 阈值过滤为程序逻辑(非 YAML 规则),引擎用 probability_ladder 的
- # p_model_threshold 常量执行。
- version: 1
- category: ROLE
- description: >-
- 角色模型预测后的上下文修正规则:按模型预测 label 分支,
- 用实体前文(front)/后文(behind)/整句(whole)模式纠正明显错分的
- tenderee/agency/winTenderer/secondTenderer/thirdTenderer/other。
- probability_ladder:
- p_model_threshold: 0.5
- p_rule_override: 0.501
- p_fallback: 0.51
- p_title: 0.55
- patterns:
- # ---- global_pre:全局前置(label≠2 时生效,非终止,改写后继续走阈值/分支)----
- - id: fix_global_win_by_amount
- description: '后文(label≠2):以 N 万元中标 → 中标人。doc 244261884 大连长之琳科技发展有限公司以7.63277万元中标'
- stage: global_pre
- model_labels: [0, 1, 3, 4, 5]
- applies_to: behind
- pattern: '^以\d+[\d,.]+万?元中标'
- set_label: 2
- set_prob: {value: 0.8}
- golden_examples:
- - input: '以7.63277万元中标'
- should_match: true
- - input: '以万元中标'
- should_match: false
- # ---- seq_check:序号候选(label∈[2,3,4],命中终止)----
- - id: fix_global_candidate_seq
- description: '前文[-15:](label∈[2,3,4]):序号:N,X候选(表格行)→ 其他'
- stage: seq_check
- model_labels: [2, 3, 4]
- applies_to: front
- window: {size: 15}
- pattern: '序号:\d+,\w{,2}候选'
- set_label: 5
- golden_examples:
- - input: '序号:1,单位候选'
- should_match: true
- - input: '序号:1,供应商'
- should_match: false
- # ---- l0:label=0(招标人)分支 ----
- - id: fix_l0_single_source_supplier
- description: '前文:拟邀请/单一来源采购单位:/拟委托单位等 → 中标人。doc 626700009 632486555 642115802 654427839 659519320'
- stage: l0
- model_labels: [0]
- applies_to: front
- pattern: '拟邀请$|受邀谈判方|流入方名称:$|拟?(选用|采用|选取)(单位|公司|企业)(名称)?:$|选择(建设|\w{,2})?服务单位:$|单一来源采购单位:$|中标通知书,致:$|拟委托(单位|公司|企业)(名称)?[:,]$'
- set_label: 2
- set_prob: {value: 0.501}
- golden_examples:
- - input: '二、拟选用单位:'
- should_match: true
- - input: '单一来源采购单位:'
- should_match: true
- - input: '采购人:'
- should_match: false
- - id: fix_l0_publisher_agency
- description: '前文:发布人/组织单位/(采购|招标|发布)机构 等+是为: 结尾,且实体名命中代理机构词典(is_agency)→ 代理机构'
- stage: l0
- model_labels: [0]
- applies_to: front
- pattern: '(发布(人|方|单位|机构|组织|用户|业主|主体|部门|公司|企业)|组织(单位|人|方|机构)?|(采购|招标|发布)机构)(名称)?[是为:]+$'
- guard:
- - {type: is_agency}
- set_label: 1
- set_prob: {value: 0.501}
- golden_examples:
- - input: '发布单位名称:'
- should_match: true
- - input: '组织单位:'
- should_match: true
- - input: '供应商名称:'
- should_match: false
- - id: fix_l0_consignee
- description: '前文:受托人(盖章): → 代理机构'
- stage: l0
- model_labels: [0]
- applies_to: front
- pattern: '受托人((盖章))?:$'
- set_label: 1
- set_prob: {value: 0.501}
- golden_examples:
- - input: '受托人:'
- should_match: true
- - input: '受托人(盖章):'
- should_match: true
- - input: '委托人:'
- should_match: false
- - id: fix_l0_weak_context_other
- description: '前文[-12:]:采用$/异议受理部门/本次招标有:/直购企业:/主报名人:/采购候选人:/申报企业:/生产企业:/公示如下:/技术单位: → 其他。doc 368177736 438880541 654390120 659598669'
- stage: l0
- model_labels: [0]
- applies_to: front
- window: {size: 12}
- pattern: '采用$|异议受理部门|本次招标有:$|直购企业:$|主报名人:$|采购候选人:$|申报企业:$|生产企业:$|公示如下:$|技术单位:$'
- set_label: 5
- golden_examples:
- - input: '本次招标有:'
- should_match: true
- - input: '直购企业:'
- should_match: true
- - input: '采购人:'
- should_match: false
- - id: fix_l0_unit_name_price
- description: '前文 ,单位名称:$ 且后文 ^,(中标|中选)价格 → 中标人'
- stage: l0
- model_labels: [0]
- applies_to: front
- pattern: ',单位名称:$'
- guard:
- - {type: regex, on: behind, pattern: '^,(中标|中选)价格'}
- set_label: 2
- set_prob: {value: 0.501}
- golden_examples:
- - input: ',单位名称:'
- should_match: true
- - input: '单位名称:'
- should_match: false
- - id: fix_l0_choose_evaluate_other
- description: '前文:选择$/挂牌业务:/评价单位:/代建单位:/报价(人|单位):/,实施主体: → 其他。doc 92729222 75044917 73326818 119136658 90007873 626694010'
- stage: l0
- model_labels: [0]
- applies_to: front
- pattern: '选择$|挂牌业务:$|评价单位:$|代建单位:$|报价(人|单位):$|,实施主体:$'
- set_label: 5
- golden_examples:
- - input: '只能选择'
- should_match: true
- - input: '代建单位:'
- should_match: true
- - input: '招标单位:'
- should_match: false
- - id: fix_l0_complaint_other
- description: '前文 向X$ 且后文 ^反映(异议投诉对象)→ 其他。doc 113239863'
- stage: l0
- model_labels: [0]
- applies_to: front
- pattern: '向\w{,4}$'
- guard:
- - {type: regex, on: behind, pattern: '^反映'}
- set_label: 5
- golden_examples:
- - input: '前向采购人'
- should_match: true
- - input: '采购人'
- should_match: false
- - id: fix_l0_hereinafter_other
- description: '后文 ^(以下简称 且后文[:10]不含 招标|采购|询价|建设单位|甲方 → 其他。doc 90145222'
- stage: l0
- model_labels: [0]
- applies_to: behind
- pattern: '^(以下简称'
- guard_not:
- - {type: regex, on: behind, size: 10, pattern: '招标|采购|询价|建设单位|甲方'}
- set_label: 5
- golden_examples:
- - input: '(以下简称'
- should_match: true
- - input: '以下简称'
- should_match: false
- - id: fix_l0_trade_unit_boost
- description: '前文[-10:]:交易单位/组织单位/发起组织/项目名称:/(受理|监督)部门 → 保持 label=0,仅将 values[0] 提为 0.5'
- stage: l0
- model_labels: [0]
- applies_to: front
- window: {size: 10}
- pattern: '交易单位|组织单位|发起组织|项目名称:$|(受理|监督)部门'
- set_prob: {index: 0, value: 0.5}
- golden_examples:
- - input: '交易单位'
- should_match: true
- - input: '监督部门'
- should_match: true
- - input: '中标单位'
- should_match: false
- - id: fix_l0_entrust_with_price
- description: '前文 拟委托单位:$ 且后文[:6] 匹配 报价|价格 → 中标人。doc 653102137'
- stage: l0
- model_labels: [0]
- applies_to: front
- pattern: '拟委托单位:$'
- guard:
- - {type: regex, on: behind, size: 6, pattern: '报价|价格'}
- set_label: 2
- set_prob: {value: 0.501}
- golden_examples:
- - input: '拟委托单位:'
- should_match: true
- - input: '委托单位:'
- should_match: false
- - id: fix_l0_will_as_winner
- description: '前文 拟将$ 且后文 ^作为 → 中标人(作为招标代理机构)。doc 659891919'
- stage: l0
- model_labels: [0]
- applies_to: front
- pattern: '拟将$'
- guard:
- - {type: regex, on: behind, pattern: '^作为'}
- set_label: 2
- set_prob: {value: 0.501}
- golden_examples:
- - input: '拟将'
- should_match: true
- - input: '拟采购'
- should_match: false
- - id: fix_l0_purchaser_agent_paren
- description: '前文 ((采购|招标)人),$ 且后文 ^((采购|招标)代理(机构)?) → 代理机构。doc 697390036'
- stage: l0
- model_labels: [0]
- applies_to: front
- pattern: '((采购|招标)人),$'
- guard:
- - {type: regex, on: behind, pattern: '^((采购|招标)代理(机构)?)'}
- set_label: 1
- set_prob: {value: 0.501}
- golden_examples:
- - input: '(采购人),'
- should_match: true
- - input: '(代理机构),'
- should_match: false
- - id: fix_l0_entrusted_agency
- description: '前文 (招标|采购|转让)[人方]现对$ 且后文头部匹配(re.match)进行委托 → 代理机构'
- stage: l0
- model_labels: [0]
- applies_to: front
- pattern: '(招标|采购|转让)[人方]现对$'
- guard:
- - {type: match, on: behind, pattern: '进行委托'}
- set_label: 1
- set_prob: {value: 0.501}
- golden_examples:
- - input: '招标人现对'
- should_match: true
- - input: '现对'
- should_match: false
- # ---- l2:label=2(中标人)分支 ----
- - id: fix_l2_sign_contract_tenderee
- description: '整句:中标单位和…签订合同 → 招标人'
- stage: l2
- model_labels: [2]
- applies_to: whole
- pattern: '中标单位和.{,25}签订合同'
- set_label: 0
- set_prob: {value: 0.501}
- golden_examples:
- - input: '中标单位和某公司签订合同'
- should_match: true
- - input: '签订合同'
- should_match: false
- - id: fix_l2_dear_supplier_tenderee
- description: '整句:尊敬的供应商:…我公司 → 招标人(公告口吻)'
- stage: l2
- model_labels: [2]
- applies_to: whole
- pattern: '尊敬的供应商:.{,25}我公司'
- set_label: 0
- set_prob: {value: 0.801}
- golden_examples:
- - input: '尊敬的供应商:我公司'
- should_match: true
- - input: '尊敬的供应商:贵公司'
- should_match: false
- - id: fix_l2_rank3_third
- description: '后文:^,评审排名:3; → 第三候选人。doc 730252497'
- stage: l2
- model_labels: [2]
- applies_to: behind
- pattern: '^,评审排名:3;'
- set_label: 4
- set_prob: {value: 0.5}
- golden_examples:
- - input: ',评审排名:3;'
- should_match: true
- - input: ',评审排名:2;'
- should_match: false
- - id: fix_l2_dear_supplier_front_tenderee
- description: '前文:尊敬的供应商:/本项目确定1名中标人为:/各位供应商:/供方单位名称: → 招标人。doc 669341698 751281385'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '尊敬的供应商:$|本项目确定1名中[标选]人为$|各位供应商:$|供方单位名称:$'
- set_label: 0
- set_prob: {value: 0.501}
- golden_examples:
- - input: '各位供应商:'
- should_match: true
- - input: '供应商:'
- should_match: false
- - id: fix_l2_rank_ge4_other
- description: '前文[-12:]:第4名及以上中标候选人/提交单位:/竞投单位: → 其他(values[2] 降为 0.5)'
- stage: l2
- model_labels: [2]
- applies_to: front
- window: {size: 12}
- pattern: '第[4-9四五六]中标候选人|(提交单位|竞投单位):$|第[4-9四五六七八九十]名'
- set_label: 5
- set_prob: {index: 2, value: 0.5}
- golden_examples:
- - input: '第四中标候选人'
- should_match: true
- - input: '第5名'
- should_match: true
- - input: '第一名'
- should_match: false
- - id: fix_l2_rank_num_ge4_other
- description: '前文[-10:]:(排名|排序|名次):(4-9 或两位数), → 其他(values[2] 降为 0.5)。doc 293225236'
- stage: l2
- model_labels: [2]
- applies_to: front
- window: {size: 10}
- pattern: '(排名|排序|名次):([4-9]|\d{2,}),'
- set_label: 5
- set_prob: {index: 2, value: 0.5}
- golden_examples:
- - input: '排名:4,'
- should_match: true
- - input: '排名:1,'
- should_match: false
- - id: fix_l2_tax_bear_other
- description: '前文含 税费 且后文 ^承担 → 其他'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '税费'
- guard:
- - {type: regex, on: behind, pattern: '^承担'}
- set_label: 5
- golden_examples:
- - input: '本项目税费'
- should_match: true
- - input: '税'
- should_match: false
- - id: fix_l2_first_backup_second
- description: '前文:(第一候补|第一后备|备选)X: → 第二候选人'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '(第一候补|第一后备|备选)\w{1,5}:$'
- set_label: 3
- set_prob: {value: 0.6}
- golden_examples:
- - input: '第一候补供应商:'
- should_match: true
- - input: '第一候补:'
- should_match: false
- - id: fix_l2_giveup_other
- description: '后文[:10]:^放弃中标资格/是否中标:否/^(中标|成交)(公示|公告) → 其他(values[2] 降为 0.5)'
- stage: l2
- model_labels: [2]
- applies_to: behind
- window: {size: 10}
- pattern: '^放弃中标资格|是否中标:否|^(中标|成交)(公示|公告)'
- set_label: 5
- set_prob: {index: 2, value: 0.5}
- golden_examples:
- - input: '放弃中标资格'
- should_match: true
- - input: '中标公示'
- should_match: true
- - input: '中标资格'
- should_match: false
- - id: fix_l2_bid_fail_other
- description: '后文[:10]:^,?投标报价/资格审查不通过 且前文不含 中标|成交|中选|排名|排序|名次|第[一1] 且 values[2]<0.7 → 其他(values[2] 降为 0.5)。doc 560768263'
- stage: l2
- model_labels: [2]
- applies_to: behind
- window: {size: 10}
- pattern: '^,?(投标报价|(资格性审查:|符合性审查:)?(不通过|不符合))'
- guard:
- - {type: value_lt, index: 2, threshold: 0.7}
- guard_not:
- - {type: regex, on: front, pattern: '中标|成交|中选|排名|排序|名次|第[一1]'}
- set_label: 5
- set_prob: {index: 2, value: 0.5}
- golden_examples:
- - input: '投标报价'
- should_match: true
- - input: '不通过'
- should_match: true
- - input: '通过'
- should_match: false
- - id: fix_l2_misc_other
- description: '前文:承包权人:/帐户名称:/债务人:/推荐预审合格投标人名单:/确定为标的的受让方,/出入口/承刻单位:/乙方接受为/丙方:/来源名称: 等 → 其他。doc 234501112 262414286 241929628 600825761'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '(承包权人|帐户名称|债务人|推荐预审合格投标人名单):$|确定为标的的受让方,$|[主次出]入口?,?$|确定(项目|\w{,2})成交供应商,$|,承刻单位:$|乙方接受为$|丙方:$|来源名称:$'
- set_label: 5
- golden_examples:
- - input: '债务人:'
- should_match: true
- - input: '丙方:'
- should_match: true
- - input: '甲方:'
- should_match: false
- - id: fix_l2_source_tenderee
- description: '前文:来源(单位)?: → 招标人。doc 472062585'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '来源(单位)?:$'
- set_label: 0
- set_prob: {value: 0.5}
- golden_examples:
- - input: '来源单位:'
- should_match: true
- - input: '来源名称:'
- should_match: false
- - id: fix_l2_contract_party_tenderee
- description: '前文:合同供方/签约(单位|方|主体):/中标单位合同签订主体: → 招标人。doc 632476647 642339031 740312111 750150491'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '合同供方:?$|签约(单位|方|主体):$|中标单位合同签订主体:$'
- set_label: 0
- set_prob: {value: 0.5}
- golden_examples:
- - input: '签约单位:'
- should_match: true
- - input: '招标单位:'
- should_match: false
- - id: fix_l2_leader_other
- description: '前文 现由$ 且后文 ^作为\d个单位的牵头(单位|公司)? → 其他。doc 469369884'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '现由$'
- guard:
- - {type: regex, on: behind, pattern: '^作为\d个单位的牵头(单位|公司)?'}
- set_label: 5
- golden_examples:
- - input: '现由'
- should_match: true
- - input: '由'
- should_match: false
- - id: fix_l2_auction_other
- description: '前文:X(中标|成交|结果)(公告|公示),/中标人信息:/买受人:/管理方:/丙方: → 其他(拍卖类)。doc 642237534 703036720。注:pattern 原样迁移自 prem.py(含原文的括号笔误)'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '\w(中标|成交)?|结果)?)(公告|公示),$|中标人信息:$|买受人:$|管理方:$|丙方:$'
- set_label: 5
- golden_examples:
- - input: '买受人:'
- should_match: true
- - input: '中标人信息:'
- should_match: true
- - input: '甲方:'
- should_match: false
- - id: fix_l2_conduct_tender_tenderee
- description: '前文 由$ 且后文 ^进行招标 → 招标人'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '由$'
- guard:
- - {type: regex, on: behind, pattern: '^进行招标'}
- set_label: 0
- set_prob: {value: 0.5}
- golden_examples:
- - input: '项目由'
- should_match: true
- - input: '进行'
- should_match: false
- - id: fix_l2_second_unit_second
- description: '后文:^为X第二(成交|中标)单位 → 第二候选人。doc 601143888'
- stage: l2
- model_labels: [2]
- applies_to: behind
- pattern: '^为\w{,10}第二(成交|中标)单位'
- set_label: 3
- set_prob: {value: 0.5}
- golden_examples:
- - input: '为某公司第二成交单位'
- should_match: true
- - input: ',第二成交单位'
- should_match: false
- - id: fix_l2_notify_other
- description: '前文:被确定为/如我方成功中选/联系人:X,单位: → 其他。doc 632523961 632380222 678869616'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '被确定为$|如果?我方成功中选$|联系人:\w{2,5},单位:$'
- set_label: 5
- golden_examples:
- - input: '被确定为'
- should_match: true
- - input: '确定为'
- should_match: false
- - id: fix_l2_winner_comma_other
- description: '前文:X{4,}(成交|中标|中选)(人|单位),/受益人: → 其他。doc 588005167 750067840'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '\w{4,}(成交|中标|中选)(人|单位),$|受益人:$'
- set_label: 5
- golden_examples:
- - input: '确定为该项目的中标人,'
- should_match: true
- - input: '受益人:'
- should_match: true
- - input: '中标人,'
- should_match: false
- - id: fix_l2_reserve_second
- description: '后文:^为预备中标单位 或 ^,评审排名:2; → 第二候选人。doc 730252497'
- stage: l2
- model_labels: [2]
- applies_to: behind
- pattern: '^为预备中标单位|^,评审排名:2;'
- set_label: 3
- set_prob: {value: 0.5}
- golden_examples:
- - input: '为预备中标单位'
- should_match: true
- - input: ',评审排名:2;'
- should_match: true
- - input: ',评审排名:3;'
- should_match: false
- - id: fix_l2_winner_paren_other
- description: '前文 ,中标人,$ 且后文 ^\w{5,} → 其他。doc 629482521'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: ',中标人,$'
- guard:
- - {type: regex, on: behind, pattern: '^\w{5,}'}
- set_label: 5
- golden_examples:
- - input: ',中标人,'
- should_match: true
- - input: '中标人,'
- should_match: false
- - id: fix_l2_review_table_other
- description: '前文 [:,,]供应商(名称)?:$ 且后文 ^,(是否通过资格审查|资格审查情况|专家\d) → 其他。doc 654107563'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '[:,,]供应商(名称)?:$'
- guard:
- - {type: regex, on: behind, pattern: '^,(是否通过资格审查|资格审查情况|专家\d)'}
- set_label: 5
- golden_examples:
- - input: ',供应商名称:'
- should_match: true
- - input: '供应商名称:'
- should_match: false
- - id: fix_l2_supplier_provide_other
- description: '前文 (中标|中选|成交)供应商为$ 且后文 ^提供 → 其他。doc 337031215'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '(中标|中选|成交)供应商为$'
- guard:
- - {type: regex, on: behind, pattern: '^提供'}
- set_label: 5
- golden_examples:
- - input: '成交供应商为'
- should_match: true
- - input: '成交供应商:'
- should_match: false
- - id: fix_l2_rank1_second
- description: '前文 排名第一;$ 且后文 ^报价:\d+万?元,排名第二; → 第二候选人。doc 751288823'
- stage: l2
- model_labels: [2]
- applies_to: front
- pattern: '排名第一;$'
- guard:
- - {type: regex, on: behind, pattern: '^报价:\d+万?元,排名第二;'}
- set_label: 3
- set_prob: {value: 0.8}
- golden_examples:
- - input: '排名第一;'
- should_match: true
- - input: '排名第二;'
- should_match: false
- # ---- l5_win_yes:label=5 是否中标(第一阶段,命中终止)----
- - id: fix_l5_win_yes_supplier
- description: '前文[-12:](label=5):是否中标:是,供应商 → 中标人'
- stage: l5_win_yes
- model_labels: [5]
- applies_to: front
- window: {size: 12}
- pattern: '是否中标:是,供应商'
- set_label: 2
- set_prob: {value: 0.9}
- golden_examples:
- - input: '是否中标:是,供应商'
- should_match: true
- - input: '是否中标:否'
- should_match: false
- # ---- l1:label=1(代理机构)分支 ----
- - id: fix_l1_entrust_tenderee
- description: '前文:委托(单位|人|方)[是为:]+ 且前文不含 受委托(单位|人|方) → 招标人'
- stage: l1
- model_labels: [1]
- applies_to: front
- pattern: '委托(单位|人|方)[是为:]+$'
- guard_not:
- - {type: regex, on: front, pattern: '受委托(单位|人|方)[是为:]+'}
- set_label: 0
- set_prob: {value: 0.501}
- golden_examples:
- - input: '委托单位:'
- should_match: true
- - input: '委托代理机构'
- should_match: false
- - id: fix_l1_agency_name_winner
- description: '前文[-12:]:(第一)?(服务|中选|中标|成交)(中介|采购|招标)?(服务|代理)?(公司|机构)(名称)? 或 排名:1 → 中标人。doc 626552262'
- stage: l1
- model_labels: [1]
- applies_to: front
- window: {size: 12}
- pattern: '([,。:]|^)(第一)?(服务|中选|中标|成交)(中介|采购|招标)?(服务|代理)?(公司|机构)(名称)?|排名:1'
- set_label: 2
- set_prob: {value: 0.501}
- golden_examples:
- - input: ',成交采购代理机构名称'
- should_match: true
- - input: '排名:1'
- should_match: true
- - input: '招标人:'
- should_match: false
- - id: fix_l1_intermarket_winner
- description: '前文 在中介超市委托$ 且后文 ^负责 → 中标人'
- stage: l1
- model_labels: [1]
- applies_to: front
- pattern: '在中介超市委托$'
- guard:
- - {type: regex, on: behind, pattern: '^负责'}
- set_label: 2
- set_prob: {value: 0.501}
- golden_examples:
- - input: '在中介超市委托'
- should_match: true
- - input: '中介超市'
- should_match: false
- - id: fix_l1_colon_shou_other
- description: '后文:^:受(附件格式:X公司:受…委托)→ 其他。doc 354009560'
- stage: l1
- model_labels: [1]
- applies_to: behind
- pattern: '^:受'
- set_label: 5
- golden_examples:
- - input: ':受'
- should_match: true
- - input: '受'
- should_match: false
- - id: fix_l1_publisher_not_agency_tenderee
- description: '前文[-10:]:发布机构 且实体名不命中代理机构词典(not is_agency)→ 招标人'
- stage: l1
- model_labels: [1]
- applies_to: front
- window: {size: 10}
- pattern: '发布机构'
- guard_not:
- - {type: is_agency}
- set_label: 0
- set_prob: {value: 0.501}
- golden_examples:
- - input: '发布机构'
- should_match: true
- - input: '代理机构'
- should_match: false
- - id: fix_l1_bank_eia_other
- description: '前文[-10:]:开户银行:/环境影响评价机构/环评机构/评价机构 → 其他。doc 368214232'
- stage: l1
- model_labels: [1]
- applies_to: front
- window: {size: 10}
- pattern: '开户银行:$|环境影响评价机构|环评机构|评价机构'
- set_label: 5
- golden_examples:
- - input: '开户银行:'
- should_match: true
- - input: '环评机构'
- should_match: true
- - input: '代理机构'
- should_match: false
- - id: fix_l1_sampling_other
- description: '前文 委托$ 且后文 ^(抽样|送检|看样) → 其他'
- stage: l1
- model_labels: [1]
- applies_to: front
- pattern: '委托$'
- guard:
- - {type: regex, on: behind, pattern: '^(抽样|送检|看样)'}
- set_label: 5
- golden_examples:
- - input: '委托'
- should_match: true
- - input: '受托'
- should_match: false
- - id: fix_l1_agent_name_winner
- description: '前文:推荐入围的招标代理单位:/(拟确定|被选取)的?(招标)?代理(服务)?(机构|单位|公司)(名称)?[为:] → 中标人。doc 302505502'
- stage: l1
- model_labels: [1]
- applies_to: front
- pattern: '推荐入围的招标代理单位:$|(拟确定|被选取)的?(招标)?代理(服务)?(机构|单位|公司)(名称)?[为:]$'
- set_label: 2
- set_prob: {value: 0.501}
- golden_examples:
- - input: '推荐入围的招标代理单位:'
- should_match: true
- - input: '拟确定的代理机构为'
- should_match: true
- - input: '代理机构:'
- should_match: false
- - id: fix_l1_agent_sales_other
- description: '前文 代理公司$ 且后文 ^销售 → 其他。doc 103462671'
- stage: l1
- model_labels: [1]
- applies_to: front
- pattern: '代理公司$'
- guard:
- - {type: regex, on: behind, pattern: '^销售'}
- set_label: 5
- golden_examples:
- - input: '代理公司'
- should_match: true
- - input: '代理机构'
- should_match: false
- # ---- l34:label∈[3,4](第二/第三候选人)分支 ----
- - id: fix_l34_branch_winner
- description: '前文:第[二三]分(公司|店),中标(人|供应商|单位|公司):/拟中标人:/第1名,单位名称: → 中标人。doc 642061144 559849015'
- stage: l34
- model_labels: [3, 4]
- applies_to: front
- pattern: '第[二三]分(公司|店),中标(人|供应商|单位|公司):$|拟中标人:$|第1名,单位名称:$'
- set_label: 2
- set_prob: {value: 0.7}
- golden_examples:
- - input: '拟中标人:'
- should_match: true
- - input: '第1名,单位名称:'
- should_match: true
- - input: '第二中标候选人:'
- should_match: false
- - id: fix_l34_promote_winner
- description: '前文 (决定选择|确定原?)?第[二三23](名|(中标|成交|中选)候选人) 且后文 ^[作”]?为(包X|第X包标段)?(中标|成交)(人|供应商|单位|公司) → 中标人。doc 689871229'
- stage: l34
- model_labels: [3, 4]
- applies_to: front
- pattern: '(决定选择|确定原?)?第[二三23](名|(中标|成交|中选)候选人)'
- guard:
- - {type: regex, on: behind, pattern: '^[作”]?为(包[\w\d]|第[\w\d](包|标[段包]))?(中标|成交)(人|供应商|单位|公司)'}
- set_label: 2
- set_prob: {value: 0.8}
- golden_examples:
- - input: '确定第二中标候选人'
- should_match: true
- - input: '第一中标候选人'
- should_match: false
- - id: fix_l34_fallback_winner
- description: '前文[-12:]:\d+\.\d+,供应商名称:/顺延至第[二三23]…/第[二三23]名为(中标|成交)… → 中标人。doc 341385226 699460059'
- stage: l34
- model_labels: [3, 4]
- applies_to: front
- window: {size: 12}
- pattern: '\d+\.\d+,供应商名称:|顺延至第[二三23](名|中标|成交|中选)|第[二三23]名为(中标|成交)(人|供应商|单位|公司)'
- set_label: 2
- set_prob: {value: 0.501}
- golden_examples:
- - input: '顺延至第二名'
- should_match: true
- - input: '顺延至第一名'
- should_match: false
- - id: fix_l34_second_list_other
- description: '前文:\d+\.\d+[,、]?(中标|成交)候选人:/[;,][23]、(中标|中选|成交)候选人:/排名第三; → 其他(values[5]=0.501)'
- stage: l34
- model_labels: [3, 4]
- applies_to: front
- pattern: '\d+\.\d+[,、]?(中标|成交)候选人:$|[;,][23]、(中标|中选|成交)候选人:$|排名第三;$'
- set_label: 5
- set_prob: {value: 0.501}
- golden_examples:
- - input: '排名第三;'
- should_match: true
- - input: '30.2,中标候选人:'
- should_match: true
- - input: '排名第二;'
- should_match: false
- - id: fix_l34_first_name_winner
- description: '前文:第一名:/[二三23][,、](中标|成交|中选)(单位|人|供应商):/成交供应商为 → 中标人。doc 108505049'
- stage: l34
- model_labels: [3, 4]
- applies_to: front
- pattern: '第一名:$|[二三23][,、](中标|成交|中选)(单位|人|供应商):$|成交供应商为$'
- set_label: 2
- set_prob: {value: 0.7}
- golden_examples:
- - input: '第一名:'
- should_match: true
- - input: '二、成交单位:'
- should_match: true
- - input: '第二:'
- should_match: false
- - id: fix_l34_confirm_second_winner
- description: '前文 确定原?第二(中标|成交|中选)?候选 且后文 ^”?为\w{,15}(中标|成交|中选)(人|供应商|单位|公司) → 中标人'
- stage: l34
- model_labels: [3, 4]
- applies_to: front
- pattern: '确定原?第二(中标|成交|中选)?候选'
- guard:
- - {type: regex, on: behind, pattern: '^”?为\w{,15}(中标|成交|中选)(人|供应商|单位|公司)'}
- set_label: 2
- set_prob: {value: 0.501}
- golden_examples:
- - input: '确定第二候选'
- should_match: true
- - input: '确定第一候选'
- should_match: false
- - id: fix_l34_comma_winner
- description: '前文:,(中标|成交|中选)(人|供应商|单位|公司)(名称)?[:为] → 中标人'
- stage: l34
- model_labels: [3, 4]
- applies_to: front
- pattern: ',(中标|成交|中选)(人|供应商|单位|公司)(名称)?[:为]$'
- set_label: 2
- set_prob: {value: 0.601}
- golden_examples:
- - input: ',中标供应商:'
- should_match: true
- - input: '中标供应商:'
- should_match: false
- - id: fix_l34_review_rank3_third
- description: '后文:^,评审排名:3 → 第三候选人'
- stage: l34
- model_labels: [3, 4]
- applies_to: behind
- pattern: '^,评审排名:3'
- set_label: 4
- set_prob: {value: 0.601}
- golden_examples:
- - input: ',评审排名:3'
- should_match: true
- - input: ',评审排名:2'
- should_match: false
- - id: fix_l34_review_rank4_third
- description: '后文:^,评审排名:4 → 第三候选人'
- stage: l34
- model_labels: [3, 4]
- applies_to: behind
- pattern: '^,评审排名:4'
- set_label: 4
- set_prob: {value: 0.5}
- golden_examples:
- - input: ',评审排名:4'
- should_match: true
- - input: ',评审排名:3'
- should_match: false
- - id: fix_l34_tenderee_bracket
- description: '前文:(招标|采购)(人|单位):【? → 招标人。doc 748607691'
- stage: l34
- model_labels: [3, 4]
- applies_to: front
- pattern: '(招标|采购)(人|单位):【?$'
- set_label: 0
- set_prob: {value: 0.6}
- golden_examples:
- - input: '招标人:'
- should_match: true
- - input: '采购单位:【'
- should_match: true
- - input: '招标代理:'
- should_match: false
- - id: fix_l34_rank2_third
- description: '前文 排名第二;$ 且后文 ^报价:\d+万?元,排名第三; → 第三候选人。doc 751288823'
- stage: l34
- model_labels: [3, 4]
- applies_to: front
- pattern: '排名第二;$'
- guard:
- - {type: regex, on: behind, pattern: '^报价:\d+万?元,排名第三;'}
- set_label: 4
- set_prob: {value: 0.8}
- golden_examples:
- - input: '排名第二;'
- should_match: true
- - input: '排名第一;'
- should_match: false
- # ---- notify:label=5 通知书(l5_win_yes 未命中时第二阶段)----
- - id: fix_notify_winner
- description: '前文 (中标|成交)通知书[,:]$ 且后文 ^: 且 label≠2(引擎阶段序保证仅 label=5 到达)→ 中标人'
- stage: notify
- model_labels: [5]
- applies_to: front
- pattern: '(中标|成交)通知书[,:]$'
- guard:
- - {type: regex, on: behind, pattern: '^:'}
- set_label: 2
- set_prob: {value: 0.8}
- golden_examples:
- - input: '中标通知书,'
- should_match: true
- - input: '中标通知书'
- should_match: false
- # ---- l5:label=5(其他)兜底分支 ----
- - id: fix_l5_plan_tenderee
- description: '后文:^拟(招标|采购)一批 或 ^须购置一批 → 招标人'
- stage: l5
- model_labels: [5]
- applies_to: behind
- pattern: '^拟(招标|采购)一批|^须购置一批'
- set_label: 0
- set_prob: {value: 0.7}
- golden_examples:
- - input: '拟采购一批'
- should_match: true
- - input: '须购置一批'
- should_match: true
- - input: '采购一批'
- should_match: false
- - id: fix_l5_rank1_winner
- description: '前文 (投标人|供应商)(名称)?:$ 且后文 ^,排[序名]1; 或 ^,评审排名:1; → 中标人。doc 642045526'
- stage: l5
- model_labels: [5]
- applies_to: front
- pattern: '(投标人|供应商)(名称)?:$'
- guard:
- - {type: regex, on: behind, pattern: '^,排[序名]1;|^,评审排名:1;'}
- set_label: 2
- set_prob: {value: 0.6}
- golden_examples:
- - input: '供应商名称:'
- should_match: true
- - input: '招标人:'
- should_match: false
- - id: fix_l5_rank2_second
- description: '前文 (投标人|供应商)(名称)?:$ 且后文 ^,排[序名]2; 或 ^,评审排名:2; → 第二候选人'
- stage: l5
- model_labels: [5]
- applies_to: front
- pattern: '(投标人|供应商)(名称)?:$'
- guard:
- - {type: regex, on: behind, pattern: '^,排[序名]2;|^,评审排名:2;'}
- set_label: 3
- set_prob: {value: 0.6}
- golden_examples:
- - input: '供应商名称:'
- should_match: true
- - input: '招标人:'
- should_match: false
- - id: fix_l5_rank3_third
- description: '前文 (投标人|供应商)(名称)?:$ 且后文 ^,排[序名]3; 或 ^,评审排名:3; → 第三候选人'
- stage: l5
- model_labels: [5]
- applies_to: front
- pattern: '(投标人|供应商)(名称)?:$'
- guard:
- - {type: regex, on: behind, pattern: '^,排[序名]3;|^,评审排名:3;'}
- set_label: 4
- set_prob: {value: 0.6}
- golden_examples:
- - input: '供应商名称:'
- should_match: true
- - input: '招标人:'
- should_match: false
- - id: fix_l5_select_winner
- description: '前文 ,$ 且后文 ^,?中[选标], → 中标人。doc 642105225'
- stage: l5
- model_labels: [5]
- applies_to: front
- pattern: ',$'
- guard:
- - {type: regex, on: behind, pattern: '^,?中[选标],'}
- set_label: 2
- set_prob: {value: 0.6}
- golden_examples:
- - input: ','
- should_match: true
- - input: '。'
- should_match: false
- - id: fix_l5_price_rank1_winner
- description: '后文:^报价:\d+万?元,排名第一; → 中标人。doc 751288823'
- stage: l5
- model_labels: [5]
- applies_to: behind
- pattern: '^报价:\d+万?元,排名第一;'
- set_label: 2
- set_prob: {value: 0.6}
- golden_examples:
- - input: '报价:709640元,排名第一;'
- should_match: true
- - input: '报价:709640元,排名第二;'
- should_match: false
|