role_context_fix.yaml 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080
  1. # PREMPredict.predict_role 模型后修正规则(角色分类流程优化 Phase B 外置 / Phase C 机器可读化)。
  2. #
  3. # 来源:dl/predictors/prem.py PREMPredict.predict_role(约 166-357 行)
  4. # 按 label 分支组织的 if/elif 修正链。
  5. #
  6. # 机器可读语义(Phase C RoleRuleEngine 消费):
  7. # - stage:引擎执行阶段。角色链路固定阶段序(对应原代码 if/elif 短路语义):
  8. # global_pre(全局前置,非终止)→ 阈值过滤(label∈[0,4] 且 values[label]<
  9. # p_model_threshold → label=5,终止)→ seq_check(label∈[2,3,4] 命中 →
  10. # label=5,终止)→ 按 label 进入分支阶段:
  11. # label=0 → l0;label=2 → l2;label=1 → l1;label∈[3,4] → l34;
  12. # label=5 → l5_win_yes → notify → l5(逐阶段首条命中即止)。
  13. # - model_labels:规则仅对当前 label 命中列表内值时生效。
  14. # 标签映射:0=tenderee, 1=agency, 2=winTenderer, 3=secondTenderer,
  15. # 4=thirdTenderer, 5=other。
  16. # - applies_to:pattern 匹配的切片。front=实体前文(23 字),behind=实体后文
  17. # (25 字),whole=前文末10字+实体+后文首10字(与原代码一致)。
  18. # - window:applies_to 切片的截断(front 取末 size 字 / behind 取前 size 字),
  19. # 对应原代码 front[-N:]/behind[:N]。
  20. # - guard / guard_not / or_trigger:结构化条件(AND / OR-排除 / OR-替代触发),
  21. # 类型见 schema/pattern_schema.json definitions.condition。
  22. # - set_label / set_prob:命中后改写的标签与概率。set_prob.index 显式指定
  23. # values 写入槽位;缺省 = set_label(若有)否则当前 label。原代码中
  24. # `label=N; values[label]=x` 写新标签槽位,`values[旧label]=x; label=N`
  25. # 写旧标签槽位——两者语义不同,index 字段区分。
  26. # - 阈值过滤为程序逻辑(非 YAML 规则),引擎用 probability_ladder 的
  27. # p_model_threshold 常量执行。
  28. version: 1
  29. category: ROLE
  30. description: >-
  31. 角色模型预测后的上下文修正规则:按模型预测 label 分支,
  32. 用实体前文(front)/后文(behind)/整句(whole)模式纠正明显错分的
  33. tenderee/agency/winTenderer/secondTenderer/thirdTenderer/other。
  34. probability_ladder:
  35. p_model_threshold: 0.5
  36. p_rule_override: 0.501
  37. p_fallback: 0.51
  38. p_title: 0.55
  39. patterns:
  40. # ---- global_pre:全局前置(label≠2 时生效,非终止,改写后继续走阈值/分支)----
  41. - id: fix_global_win_by_amount
  42. description: '后文(label≠2):以 N 万元中标 → 中标人。doc 244261884 大连长之琳科技发展有限公司以7.63277万元中标'
  43. stage: global_pre
  44. model_labels: [0, 1, 3, 4, 5]
  45. applies_to: behind
  46. pattern: '^以\d+[\d,.]+万?元中标'
  47. set_label: 2
  48. set_prob: {value: 0.8}
  49. golden_examples:
  50. - input: '以7.63277万元中标'
  51. should_match: true
  52. - input: '以万元中标'
  53. should_match: false
  54. # ---- seq_check:序号候选(label∈[2,3,4],命中终止)----
  55. - id: fix_global_candidate_seq
  56. description: '前文[-15:](label∈[2,3,4]):序号:N,X候选(表格行)→ 其他'
  57. stage: seq_check
  58. model_labels: [2, 3, 4]
  59. applies_to: front
  60. window: {size: 15}
  61. pattern: '序号:\d+,\w{,2}候选'
  62. set_label: 5
  63. golden_examples:
  64. - input: '序号:1,单位候选'
  65. should_match: true
  66. - input: '序号:1,供应商'
  67. should_match: false
  68. # ---- l0:label=0(招标人)分支 ----
  69. - id: fix_l0_single_source_supplier
  70. description: '前文:拟邀请/单一来源采购单位:/拟委托单位等 → 中标人。doc 626700009 632486555 642115802 654427839 659519320'
  71. stage: l0
  72. model_labels: [0]
  73. applies_to: front
  74. pattern: '拟邀请$|受邀谈判方|流入方名称:$|拟?(选用|采用|选取)(单位|公司|企业)(名称)?:$|选择(建设|\w{,2})?服务单位:$|单一来源采购单位:$|中标通知书,致:$|拟委托(单位|公司|企业)(名称)?[:,]$'
  75. set_label: 2
  76. set_prob: {value: 0.501}
  77. golden_examples:
  78. - input: '二、拟选用单位:'
  79. should_match: true
  80. - input: '单一来源采购单位:'
  81. should_match: true
  82. - input: '采购人:'
  83. should_match: false
  84. - id: fix_l0_publisher_agency
  85. description: '前文:发布人/组织单位/(采购|招标|发布)机构 等+是为: 结尾,且实体名命中代理机构词典(is_agency)→ 代理机构'
  86. stage: l0
  87. model_labels: [0]
  88. applies_to: front
  89. pattern: '(发布(人|方|单位|机构|组织|用户|业主|主体|部门|公司|企业)|组织(单位|人|方|机构)?|(采购|招标|发布)机构)(名称)?[是为:]+$'
  90. guard:
  91. - {type: is_agency}
  92. set_label: 1
  93. set_prob: {value: 0.501}
  94. golden_examples:
  95. - input: '发布单位名称:'
  96. should_match: true
  97. - input: '组织单位:'
  98. should_match: true
  99. - input: '供应商名称:'
  100. should_match: false
  101. - id: fix_l0_consignee
  102. description: '前文:受托人(盖章): → 代理机构'
  103. stage: l0
  104. model_labels: [0]
  105. applies_to: front
  106. pattern: '受托人((盖章))?:$'
  107. set_label: 1
  108. set_prob: {value: 0.501}
  109. golden_examples:
  110. - input: '受托人:'
  111. should_match: true
  112. - input: '受托人(盖章):'
  113. should_match: true
  114. - input: '委托人:'
  115. should_match: false
  116. - id: fix_l0_weak_context_other
  117. description: '前文[-12:]:采用$/异议受理部门/本次招标有:/直购企业:/主报名人:/采购候选人:/申报企业:/生产企业:/公示如下:/技术单位: → 其他。doc 368177736 438880541 654390120 659598669'
  118. stage: l0
  119. model_labels: [0]
  120. applies_to: front
  121. window: {size: 12}
  122. pattern: '采用$|异议受理部门|本次招标有:$|直购企业:$|主报名人:$|采购候选人:$|申报企业:$|生产企业:$|公示如下:$|技术单位:$'
  123. set_label: 5
  124. golden_examples:
  125. - input: '本次招标有:'
  126. should_match: true
  127. - input: '直购企业:'
  128. should_match: true
  129. - input: '采购人:'
  130. should_match: false
  131. - id: fix_l0_unit_name_price
  132. description: '前文 ,单位名称:$ 且后文 ^,(中标|中选)价格 → 中标人'
  133. stage: l0
  134. model_labels: [0]
  135. applies_to: front
  136. pattern: ',单位名称:$'
  137. guard:
  138. - {type: regex, on: behind, pattern: '^,(中标|中选)价格'}
  139. set_label: 2
  140. set_prob: {value: 0.501}
  141. golden_examples:
  142. - input: ',单位名称:'
  143. should_match: true
  144. - input: '单位名称:'
  145. should_match: false
  146. - id: fix_l0_choose_evaluate_other
  147. description: '前文:选择$/挂牌业务:/评价单位:/代建单位:/报价(人|单位):/,实施主体: → 其他。doc 92729222 75044917 73326818 119136658 90007873 626694010'
  148. stage: l0
  149. model_labels: [0]
  150. applies_to: front
  151. pattern: '选择$|挂牌业务:$|评价单位:$|代建单位:$|报价(人|单位):$|,实施主体:$'
  152. set_label: 5
  153. golden_examples:
  154. - input: '只能选择'
  155. should_match: true
  156. - input: '代建单位:'
  157. should_match: true
  158. - input: '招标单位:'
  159. should_match: false
  160. - id: fix_l0_complaint_other
  161. description: '前文 向X$ 且后文 ^反映(异议投诉对象)→ 其他。doc 113239863'
  162. stage: l0
  163. model_labels: [0]
  164. applies_to: front
  165. pattern: '向\w{,4}$'
  166. guard:
  167. - {type: regex, on: behind, pattern: '^反映'}
  168. set_label: 5
  169. golden_examples:
  170. - input: '前向采购人'
  171. should_match: true
  172. - input: '采购人'
  173. should_match: false
  174. - id: fix_l0_hereinafter_other
  175. description: '后文 ^(以下简称 且后文[:10]不含 招标|采购|询价|建设单位|甲方 → 其他。doc 90145222'
  176. stage: l0
  177. model_labels: [0]
  178. applies_to: behind
  179. pattern: '^(以下简称'
  180. guard_not:
  181. - {type: regex, on: behind, size: 10, pattern: '招标|采购|询价|建设单位|甲方'}
  182. set_label: 5
  183. golden_examples:
  184. - input: '(以下简称'
  185. should_match: true
  186. - input: '以下简称'
  187. should_match: false
  188. - id: fix_l0_trade_unit_boost
  189. description: '前文[-10:]:交易单位/组织单位/发起组织/项目名称:/(受理|监督)部门 → 保持 label=0,仅将 values[0] 提为 0.5'
  190. stage: l0
  191. model_labels: [0]
  192. applies_to: front
  193. window: {size: 10}
  194. pattern: '交易单位|组织单位|发起组织|项目名称:$|(受理|监督)部门'
  195. set_prob: {index: 0, value: 0.5}
  196. golden_examples:
  197. - input: '交易单位'
  198. should_match: true
  199. - input: '监督部门'
  200. should_match: true
  201. - input: '中标单位'
  202. should_match: false
  203. - id: fix_l0_entrust_with_price
  204. description: '前文 拟委托单位:$ 且后文[:6] 匹配 报价|价格 → 中标人。doc 653102137'
  205. stage: l0
  206. model_labels: [0]
  207. applies_to: front
  208. pattern: '拟委托单位:$'
  209. guard:
  210. - {type: regex, on: behind, size: 6, pattern: '报价|价格'}
  211. set_label: 2
  212. set_prob: {value: 0.501}
  213. golden_examples:
  214. - input: '拟委托单位:'
  215. should_match: true
  216. - input: '委托单位:'
  217. should_match: false
  218. - id: fix_l0_will_as_winner
  219. description: '前文 拟将$ 且后文 ^作为 → 中标人(作为招标代理机构)。doc 659891919'
  220. stage: l0
  221. model_labels: [0]
  222. applies_to: front
  223. pattern: '拟将$'
  224. guard:
  225. - {type: regex, on: behind, pattern: '^作为'}
  226. set_label: 2
  227. set_prob: {value: 0.501}
  228. golden_examples:
  229. - input: '拟将'
  230. should_match: true
  231. - input: '拟采购'
  232. should_match: false
  233. - id: fix_l0_purchaser_agent_paren
  234. description: '前文 ((采购|招标)人),$ 且后文 ^((采购|招标)代理(机构)?) → 代理机构。doc 697390036'
  235. stage: l0
  236. model_labels: [0]
  237. applies_to: front
  238. pattern: '((采购|招标)人),$'
  239. guard:
  240. - {type: regex, on: behind, pattern: '^((采购|招标)代理(机构)?)'}
  241. set_label: 1
  242. set_prob: {value: 0.501}
  243. golden_examples:
  244. - input: '(采购人),'
  245. should_match: true
  246. - input: '(代理机构),'
  247. should_match: false
  248. - id: fix_l0_entrusted_agency
  249. description: '前文 (招标|采购|转让)[人方]现对$ 且后文头部匹配(re.match)进行委托 → 代理机构'
  250. stage: l0
  251. model_labels: [0]
  252. applies_to: front
  253. pattern: '(招标|采购|转让)[人方]现对$'
  254. guard:
  255. - {type: match, on: behind, pattern: '进行委托'}
  256. set_label: 1
  257. set_prob: {value: 0.501}
  258. golden_examples:
  259. - input: '招标人现对'
  260. should_match: true
  261. - input: '现对'
  262. should_match: false
  263. # ---- l2:label=2(中标人)分支 ----
  264. - id: fix_l2_sign_contract_tenderee
  265. description: '整句:中标单位和…签订合同 → 招标人'
  266. stage: l2
  267. model_labels: [2]
  268. applies_to: whole
  269. pattern: '中标单位和.{,25}签订合同'
  270. set_label: 0
  271. set_prob: {value: 0.501}
  272. golden_examples:
  273. - input: '中标单位和某公司签订合同'
  274. should_match: true
  275. - input: '签订合同'
  276. should_match: false
  277. - id: fix_l2_dear_supplier_tenderee
  278. description: '整句:尊敬的供应商:…我公司 → 招标人(公告口吻)'
  279. stage: l2
  280. model_labels: [2]
  281. applies_to: whole
  282. pattern: '尊敬的供应商:.{,25}我公司'
  283. set_label: 0
  284. set_prob: {value: 0.801}
  285. golden_examples:
  286. - input: '尊敬的供应商:我公司'
  287. should_match: true
  288. - input: '尊敬的供应商:贵公司'
  289. should_match: false
  290. - id: fix_l2_rank3_third
  291. description: '后文:^,评审排名:3; → 第三候选人。doc 730252497'
  292. stage: l2
  293. model_labels: [2]
  294. applies_to: behind
  295. pattern: '^,评审排名:3;'
  296. set_label: 4
  297. set_prob: {value: 0.5}
  298. golden_examples:
  299. - input: ',评审排名:3;'
  300. should_match: true
  301. - input: ',评审排名:2;'
  302. should_match: false
  303. - id: fix_l2_dear_supplier_front_tenderee
  304. description: '前文:尊敬的供应商:/本项目确定1名中标人为:/各位供应商:/供方单位名称: → 招标人。doc 669341698 751281385'
  305. stage: l2
  306. model_labels: [2]
  307. applies_to: front
  308. pattern: '尊敬的供应商:$|本项目确定1名中[标选]人为$|各位供应商:$|供方单位名称:$'
  309. set_label: 0
  310. set_prob: {value: 0.501}
  311. golden_examples:
  312. - input: '各位供应商:'
  313. should_match: true
  314. - input: '供应商:'
  315. should_match: false
  316. - id: fix_l2_rank_ge4_other
  317. description: '前文[-12:]:第4名及以上中标候选人/提交单位:/竞投单位: → 其他(values[2] 降为 0.5)'
  318. stage: l2
  319. model_labels: [2]
  320. applies_to: front
  321. window: {size: 12}
  322. pattern: '第[4-9四五六]中标候选人|(提交单位|竞投单位):$|第[4-9四五六七八九十]名'
  323. set_label: 5
  324. set_prob: {index: 2, value: 0.5}
  325. golden_examples:
  326. - input: '第四中标候选人'
  327. should_match: true
  328. - input: '第5名'
  329. should_match: true
  330. - input: '第一名'
  331. should_match: false
  332. - id: fix_l2_rank_num_ge4_other
  333. description: '前文[-10:]:(排名|排序|名次):(4-9 或两位数), → 其他(values[2] 降为 0.5)。doc 293225236'
  334. stage: l2
  335. model_labels: [2]
  336. applies_to: front
  337. window: {size: 10}
  338. pattern: '(排名|排序|名次):([4-9]|\d{2,}),'
  339. set_label: 5
  340. set_prob: {index: 2, value: 0.5}
  341. golden_examples:
  342. - input: '排名:4,'
  343. should_match: true
  344. - input: '排名:1,'
  345. should_match: false
  346. - id: fix_l2_tax_bear_other
  347. description: '前文含 税费 且后文 ^承担 → 其他'
  348. stage: l2
  349. model_labels: [2]
  350. applies_to: front
  351. pattern: '税费'
  352. guard:
  353. - {type: regex, on: behind, pattern: '^承担'}
  354. set_label: 5
  355. golden_examples:
  356. - input: '本项目税费'
  357. should_match: true
  358. - input: '税'
  359. should_match: false
  360. - id: fix_l2_first_backup_second
  361. description: '前文:(第一候补|第一后备|备选)X: → 第二候选人'
  362. stage: l2
  363. model_labels: [2]
  364. applies_to: front
  365. pattern: '(第一候补|第一后备|备选)\w{1,5}:$'
  366. set_label: 3
  367. set_prob: {value: 0.6}
  368. golden_examples:
  369. - input: '第一候补供应商:'
  370. should_match: true
  371. - input: '第一候补:'
  372. should_match: false
  373. - id: fix_l2_giveup_other
  374. description: '后文[:10]:^放弃中标资格/是否中标:否/^(中标|成交)(公示|公告) → 其他(values[2] 降为 0.5)'
  375. stage: l2
  376. model_labels: [2]
  377. applies_to: behind
  378. window: {size: 10}
  379. pattern: '^放弃中标资格|是否中标:否|^(中标|成交)(公示|公告)'
  380. set_label: 5
  381. set_prob: {index: 2, value: 0.5}
  382. golden_examples:
  383. - input: '放弃中标资格'
  384. should_match: true
  385. - input: '中标公示'
  386. should_match: true
  387. - input: '中标资格'
  388. should_match: false
  389. - id: fix_l2_bid_fail_other
  390. description: '后文[:10]:^,?投标报价/资格审查不通过 且前文不含 中标|成交|中选|排名|排序|名次|第[一1] 且 values[2]<0.7 → 其他(values[2] 降为 0.5)。doc 560768263'
  391. stage: l2
  392. model_labels: [2]
  393. applies_to: behind
  394. window: {size: 10}
  395. pattern: '^,?(投标报价|(资格性审查:|符合性审查:)?(不通过|不符合))'
  396. guard:
  397. - {type: value_lt, index: 2, threshold: 0.7}
  398. guard_not:
  399. - {type: regex, on: front, pattern: '中标|成交|中选|排名|排序|名次|第[一1]'}
  400. set_label: 5
  401. set_prob: {index: 2, value: 0.5}
  402. golden_examples:
  403. - input: '投标报价'
  404. should_match: true
  405. - input: '不通过'
  406. should_match: true
  407. - input: '通过'
  408. should_match: false
  409. - id: fix_l2_misc_other
  410. description: '前文:承包权人:/帐户名称:/债务人:/推荐预审合格投标人名单:/确定为标的的受让方,/出入口/承刻单位:/乙方接受为/丙方:/来源名称: 等 → 其他。doc 234501112 262414286 241929628 600825761'
  411. stage: l2
  412. model_labels: [2]
  413. applies_to: front
  414. pattern: '(承包权人|帐户名称|债务人|推荐预审合格投标人名单):$|确定为标的的受让方,$|[主次出]入口?,?$|确定(项目|\w{,2})成交供应商,$|,承刻单位:$|乙方接受为$|丙方:$|来源名称:$'
  415. set_label: 5
  416. golden_examples:
  417. - input: '债务人:'
  418. should_match: true
  419. - input: '丙方:'
  420. should_match: true
  421. - input: '甲方:'
  422. should_match: false
  423. - id: fix_l2_source_tenderee
  424. description: '前文:来源(单位)?: → 招标人。doc 472062585'
  425. stage: l2
  426. model_labels: [2]
  427. applies_to: front
  428. pattern: '来源(单位)?:$'
  429. set_label: 0
  430. set_prob: {value: 0.5}
  431. golden_examples:
  432. - input: '来源单位:'
  433. should_match: true
  434. - input: '来源名称:'
  435. should_match: false
  436. - id: fix_l2_contract_party_tenderee
  437. description: '前文:合同供方/签约(单位|方|主体):/中标单位合同签订主体: → 招标人。doc 632476647 642339031 740312111 750150491'
  438. stage: l2
  439. model_labels: [2]
  440. applies_to: front
  441. pattern: '合同供方:?$|签约(单位|方|主体):$|中标单位合同签订主体:$'
  442. set_label: 0
  443. set_prob: {value: 0.5}
  444. golden_examples:
  445. - input: '签约单位:'
  446. should_match: true
  447. - input: '招标单位:'
  448. should_match: false
  449. - id: fix_l2_leader_other
  450. description: '前文 现由$ 且后文 ^作为\d个单位的牵头(单位|公司)? → 其他。doc 469369884'
  451. stage: l2
  452. model_labels: [2]
  453. applies_to: front
  454. pattern: '现由$'
  455. guard:
  456. - {type: regex, on: behind, pattern: '^作为\d个单位的牵头(单位|公司)?'}
  457. set_label: 5
  458. golden_examples:
  459. - input: '现由'
  460. should_match: true
  461. - input: '由'
  462. should_match: false
  463. - id: fix_l2_auction_other
  464. description: '前文:X(中标|成交|结果)(公告|公示),/中标人信息:/买受人:/管理方:/丙方: → 其他(拍卖类)。doc 642237534 703036720。注:pattern 原样迁移自 prem.py(含原文的括号笔误)'
  465. stage: l2
  466. model_labels: [2]
  467. applies_to: front
  468. pattern: '\w(中标|成交)?|结果)?)(公告|公示),$|中标人信息:$|买受人:$|管理方:$|丙方:$'
  469. set_label: 5
  470. golden_examples:
  471. - input: '买受人:'
  472. should_match: true
  473. - input: '中标人信息:'
  474. should_match: true
  475. - input: '甲方:'
  476. should_match: false
  477. - id: fix_l2_conduct_tender_tenderee
  478. description: '前文 由$ 且后文 ^进行招标 → 招标人'
  479. stage: l2
  480. model_labels: [2]
  481. applies_to: front
  482. pattern: '由$'
  483. guard:
  484. - {type: regex, on: behind, pattern: '^进行招标'}
  485. set_label: 0
  486. set_prob: {value: 0.5}
  487. golden_examples:
  488. - input: '项目由'
  489. should_match: true
  490. - input: '进行'
  491. should_match: false
  492. - id: fix_l2_second_unit_second
  493. description: '后文:^为X第二(成交|中标)单位 → 第二候选人。doc 601143888'
  494. stage: l2
  495. model_labels: [2]
  496. applies_to: behind
  497. pattern: '^为\w{,10}第二(成交|中标)单位'
  498. set_label: 3
  499. set_prob: {value: 0.5}
  500. golden_examples:
  501. - input: '为某公司第二成交单位'
  502. should_match: true
  503. - input: ',第二成交单位'
  504. should_match: false
  505. - id: fix_l2_notify_other
  506. description: '前文:被确定为/如我方成功中选/联系人:X,单位: → 其他。doc 632523961 632380222 678869616'
  507. stage: l2
  508. model_labels: [2]
  509. applies_to: front
  510. pattern: '被确定为$|如果?我方成功中选$|联系人:\w{2,5},单位:$'
  511. set_label: 5
  512. golden_examples:
  513. - input: '被确定为'
  514. should_match: true
  515. - input: '确定为'
  516. should_match: false
  517. - id: fix_l2_winner_comma_other
  518. description: '前文:X{4,}(成交|中标|中选)(人|单位),/受益人: → 其他。doc 588005167 750067840'
  519. stage: l2
  520. model_labels: [2]
  521. applies_to: front
  522. pattern: '\w{4,}(成交|中标|中选)(人|单位),$|受益人:$'
  523. set_label: 5
  524. golden_examples:
  525. - input: '确定为该项目的中标人,'
  526. should_match: true
  527. - input: '受益人:'
  528. should_match: true
  529. - input: '中标人,'
  530. should_match: false
  531. - id: fix_l2_reserve_second
  532. description: '后文:^为预备中标单位 或 ^,评审排名:2; → 第二候选人。doc 730252497'
  533. stage: l2
  534. model_labels: [2]
  535. applies_to: behind
  536. pattern: '^为预备中标单位|^,评审排名:2;'
  537. set_label: 3
  538. set_prob: {value: 0.5}
  539. golden_examples:
  540. - input: '为预备中标单位'
  541. should_match: true
  542. - input: ',评审排名:2;'
  543. should_match: true
  544. - input: ',评审排名:3;'
  545. should_match: false
  546. - id: fix_l2_winner_paren_other
  547. description: '前文 ,中标人,$ 且后文 ^\w{5,} → 其他。doc 629482521'
  548. stage: l2
  549. model_labels: [2]
  550. applies_to: front
  551. pattern: ',中标人,$'
  552. guard:
  553. - {type: regex, on: behind, pattern: '^\w{5,}'}
  554. set_label: 5
  555. golden_examples:
  556. - input: ',中标人,'
  557. should_match: true
  558. - input: '中标人,'
  559. should_match: false
  560. - id: fix_l2_review_table_other
  561. description: '前文 [:,,]供应商(名称)?:$ 且后文 ^,(是否通过资格审查|资格审查情况|专家\d) → 其他。doc 654107563'
  562. stage: l2
  563. model_labels: [2]
  564. applies_to: front
  565. pattern: '[:,,]供应商(名称)?:$'
  566. guard:
  567. - {type: regex, on: behind, pattern: '^,(是否通过资格审查|资格审查情况|专家\d)'}
  568. set_label: 5
  569. golden_examples:
  570. - input: ',供应商名称:'
  571. should_match: true
  572. - input: '供应商名称:'
  573. should_match: false
  574. - id: fix_l2_supplier_provide_other
  575. description: '前文 (中标|中选|成交)供应商为$ 且后文 ^提供 → 其他。doc 337031215'
  576. stage: l2
  577. model_labels: [2]
  578. applies_to: front
  579. pattern: '(中标|中选|成交)供应商为$'
  580. guard:
  581. - {type: regex, on: behind, pattern: '^提供'}
  582. set_label: 5
  583. golden_examples:
  584. - input: '成交供应商为'
  585. should_match: true
  586. - input: '成交供应商:'
  587. should_match: false
  588. - id: fix_l2_rank1_second
  589. description: '前文 排名第一;$ 且后文 ^报价:\d+万?元,排名第二; → 第二候选人。doc 751288823'
  590. stage: l2
  591. model_labels: [2]
  592. applies_to: front
  593. pattern: '排名第一;$'
  594. guard:
  595. - {type: regex, on: behind, pattern: '^报价:\d+万?元,排名第二;'}
  596. set_label: 3
  597. set_prob: {value: 0.8}
  598. golden_examples:
  599. - input: '排名第一;'
  600. should_match: true
  601. - input: '排名第二;'
  602. should_match: false
  603. # ---- l5_win_yes:label=5 是否中标(第一阶段,命中终止)----
  604. - id: fix_l5_win_yes_supplier
  605. description: '前文[-12:](label=5):是否中标:是,供应商 → 中标人'
  606. stage: l5_win_yes
  607. model_labels: [5]
  608. applies_to: front
  609. window: {size: 12}
  610. pattern: '是否中标:是,供应商'
  611. set_label: 2
  612. set_prob: {value: 0.9}
  613. golden_examples:
  614. - input: '是否中标:是,供应商'
  615. should_match: true
  616. - input: '是否中标:否'
  617. should_match: false
  618. # ---- l1:label=1(代理机构)分支 ----
  619. - id: fix_l1_entrust_tenderee
  620. description: '前文:委托(单位|人|方)[是为:]+ 且前文不含 受委托(单位|人|方) → 招标人'
  621. stage: l1
  622. model_labels: [1]
  623. applies_to: front
  624. pattern: '委托(单位|人|方)[是为:]+$'
  625. guard_not:
  626. - {type: regex, on: front, pattern: '受委托(单位|人|方)[是为:]+'}
  627. set_label: 0
  628. set_prob: {value: 0.501}
  629. golden_examples:
  630. - input: '委托单位:'
  631. should_match: true
  632. - input: '委托代理机构'
  633. should_match: false
  634. - id: fix_l1_agency_name_winner
  635. description: '前文[-12:]:(第一)?(服务|中选|中标|成交)(中介|采购|招标)?(服务|代理)?(公司|机构)(名称)? 或 排名:1 → 中标人。doc 626552262'
  636. stage: l1
  637. model_labels: [1]
  638. applies_to: front
  639. window: {size: 12}
  640. pattern: '([,。:]|^)(第一)?(服务|中选|中标|成交)(中介|采购|招标)?(服务|代理)?(公司|机构)(名称)?|排名:1'
  641. set_label: 2
  642. set_prob: {value: 0.501}
  643. golden_examples:
  644. - input: ',成交采购代理机构名称'
  645. should_match: true
  646. - input: '排名:1'
  647. should_match: true
  648. - input: '招标人:'
  649. should_match: false
  650. - id: fix_l1_intermarket_winner
  651. description: '前文 在中介超市委托$ 且后文 ^负责 → 中标人'
  652. stage: l1
  653. model_labels: [1]
  654. applies_to: front
  655. pattern: '在中介超市委托$'
  656. guard:
  657. - {type: regex, on: behind, pattern: '^负责'}
  658. set_label: 2
  659. set_prob: {value: 0.501}
  660. golden_examples:
  661. - input: '在中介超市委托'
  662. should_match: true
  663. - input: '中介超市'
  664. should_match: false
  665. - id: fix_l1_colon_shou_other
  666. description: '后文:^:受(附件格式:X公司:受…委托)→ 其他。doc 354009560'
  667. stage: l1
  668. model_labels: [1]
  669. applies_to: behind
  670. pattern: '^:受'
  671. set_label: 5
  672. golden_examples:
  673. - input: ':受'
  674. should_match: true
  675. - input: '受'
  676. should_match: false
  677. - id: fix_l1_publisher_not_agency_tenderee
  678. description: '前文[-10:]:发布机构 且实体名不命中代理机构词典(not is_agency)→ 招标人'
  679. stage: l1
  680. model_labels: [1]
  681. applies_to: front
  682. window: {size: 10}
  683. pattern: '发布机构'
  684. guard_not:
  685. - {type: is_agency}
  686. set_label: 0
  687. set_prob: {value: 0.501}
  688. golden_examples:
  689. - input: '发布机构'
  690. should_match: true
  691. - input: '代理机构'
  692. should_match: false
  693. - id: fix_l1_bank_eia_other
  694. description: '前文[-10:]:开户银行:/环境影响评价机构/环评机构/评价机构 → 其他。doc 368214232'
  695. stage: l1
  696. model_labels: [1]
  697. applies_to: front
  698. window: {size: 10}
  699. pattern: '开户银行:$|环境影响评价机构|环评机构|评价机构'
  700. set_label: 5
  701. golden_examples:
  702. - input: '开户银行:'
  703. should_match: true
  704. - input: '环评机构'
  705. should_match: true
  706. - input: '代理机构'
  707. should_match: false
  708. - id: fix_l1_sampling_other
  709. description: '前文 委托$ 且后文 ^(抽样|送检|看样) → 其他'
  710. stage: l1
  711. model_labels: [1]
  712. applies_to: front
  713. pattern: '委托$'
  714. guard:
  715. - {type: regex, on: behind, pattern: '^(抽样|送检|看样)'}
  716. set_label: 5
  717. golden_examples:
  718. - input: '委托'
  719. should_match: true
  720. - input: '受托'
  721. should_match: false
  722. - id: fix_l1_agent_name_winner
  723. description: '前文:推荐入围的招标代理单位:/(拟确定|被选取)的?(招标)?代理(服务)?(机构|单位|公司)(名称)?[为:] → 中标人。doc 302505502'
  724. stage: l1
  725. model_labels: [1]
  726. applies_to: front
  727. pattern: '推荐入围的招标代理单位:$|(拟确定|被选取)的?(招标)?代理(服务)?(机构|单位|公司)(名称)?[为:]$'
  728. set_label: 2
  729. set_prob: {value: 0.501}
  730. golden_examples:
  731. - input: '推荐入围的招标代理单位:'
  732. should_match: true
  733. - input: '拟确定的代理机构为'
  734. should_match: true
  735. - input: '代理机构:'
  736. should_match: false
  737. - id: fix_l1_agent_sales_other
  738. description: '前文 代理公司$ 且后文 ^销售 → 其他。doc 103462671'
  739. stage: l1
  740. model_labels: [1]
  741. applies_to: front
  742. pattern: '代理公司$'
  743. guard:
  744. - {type: regex, on: behind, pattern: '^销售'}
  745. set_label: 5
  746. golden_examples:
  747. - input: '代理公司'
  748. should_match: true
  749. - input: '代理机构'
  750. should_match: false
  751. # ---- l34:label∈[3,4](第二/第三候选人)分支 ----
  752. - id: fix_l34_branch_winner
  753. description: '前文:第[二三]分(公司|店),中标(人|供应商|单位|公司):/拟中标人:/第1名,单位名称: → 中标人。doc 642061144 559849015'
  754. stage: l34
  755. model_labels: [3, 4]
  756. applies_to: front
  757. pattern: '第[二三]分(公司|店),中标(人|供应商|单位|公司):$|拟中标人:$|第1名,单位名称:$'
  758. set_label: 2
  759. set_prob: {value: 0.7}
  760. golden_examples:
  761. - input: '拟中标人:'
  762. should_match: true
  763. - input: '第1名,单位名称:'
  764. should_match: true
  765. - input: '第二中标候选人:'
  766. should_match: false
  767. - id: fix_l34_promote_winner
  768. description: '前文 (决定选择|确定原?)?第[二三23](名|(中标|成交|中选)候选人) 且后文 ^[作”]?为(包X|第X包标段)?(中标|成交)(人|供应商|单位|公司) → 中标人。doc 689871229'
  769. stage: l34
  770. model_labels: [3, 4]
  771. applies_to: front
  772. pattern: '(决定选择|确定原?)?第[二三23](名|(中标|成交|中选)候选人)'
  773. guard:
  774. - {type: regex, on: behind, pattern: '^[作”]?为(包[\w\d]|第[\w\d](包|标[段包]))?(中标|成交)(人|供应商|单位|公司)'}
  775. set_label: 2
  776. set_prob: {value: 0.8}
  777. golden_examples:
  778. - input: '确定第二中标候选人'
  779. should_match: true
  780. - input: '第一中标候选人'
  781. should_match: false
  782. - id: fix_l34_fallback_winner
  783. description: '前文[-12:]:\d+\.\d+,供应商名称:/顺延至第[二三23]…/第[二三23]名为(中标|成交)… → 中标人。doc 341385226 699460059'
  784. stage: l34
  785. model_labels: [3, 4]
  786. applies_to: front
  787. window: {size: 12}
  788. pattern: '\d+\.\d+,供应商名称:|顺延至第[二三23](名|中标|成交|中选)|第[二三23]名为(中标|成交)(人|供应商|单位|公司)'
  789. set_label: 2
  790. set_prob: {value: 0.501}
  791. golden_examples:
  792. - input: '顺延至第二名'
  793. should_match: true
  794. - input: '顺延至第一名'
  795. should_match: false
  796. - id: fix_l34_second_list_other
  797. description: '前文:\d+\.\d+[,、]?(中标|成交)候选人:/[;,][23]、(中标|中选|成交)候选人:/排名第三; → 其他(values[5]=0.501)'
  798. stage: l34
  799. model_labels: [3, 4]
  800. applies_to: front
  801. pattern: '\d+\.\d+[,、]?(中标|成交)候选人:$|[;,][23]、(中标|中选|成交)候选人:$|排名第三;$'
  802. set_label: 5
  803. set_prob: {value: 0.501}
  804. golden_examples:
  805. - input: '排名第三;'
  806. should_match: true
  807. - input: '30.2,中标候选人:'
  808. should_match: true
  809. - input: '排名第二;'
  810. should_match: false
  811. - id: fix_l34_first_name_winner
  812. description: '前文:第一名:/[二三23][,、](中标|成交|中选)(单位|人|供应商):/成交供应商为 → 中标人。doc 108505049'
  813. stage: l34
  814. model_labels: [3, 4]
  815. applies_to: front
  816. pattern: '第一名:$|[二三23][,、](中标|成交|中选)(单位|人|供应商):$|成交供应商为$'
  817. set_label: 2
  818. set_prob: {value: 0.7}
  819. golden_examples:
  820. - input: '第一名:'
  821. should_match: true
  822. - input: '二、成交单位:'
  823. should_match: true
  824. - input: '第二:'
  825. should_match: false
  826. - id: fix_l34_confirm_second_winner
  827. description: '前文 确定原?第二(中标|成交|中选)?候选 且后文 ^”?为\w{,15}(中标|成交|中选)(人|供应商|单位|公司) → 中标人'
  828. stage: l34
  829. model_labels: [3, 4]
  830. applies_to: front
  831. pattern: '确定原?第二(中标|成交|中选)?候选'
  832. guard:
  833. - {type: regex, on: behind, pattern: '^”?为\w{,15}(中标|成交|中选)(人|供应商|单位|公司)'}
  834. set_label: 2
  835. set_prob: {value: 0.501}
  836. golden_examples:
  837. - input: '确定第二候选'
  838. should_match: true
  839. - input: '确定第一候选'
  840. should_match: false
  841. - id: fix_l34_comma_winner
  842. description: '前文:,(中标|成交|中选)(人|供应商|单位|公司)(名称)?[:为] → 中标人'
  843. stage: l34
  844. model_labels: [3, 4]
  845. applies_to: front
  846. pattern: ',(中标|成交|中选)(人|供应商|单位|公司)(名称)?[:为]$'
  847. set_label: 2
  848. set_prob: {value: 0.601}
  849. golden_examples:
  850. - input: ',中标供应商:'
  851. should_match: true
  852. - input: '中标供应商:'
  853. should_match: false
  854. - id: fix_l34_review_rank3_third
  855. description: '后文:^,评审排名:3 → 第三候选人'
  856. stage: l34
  857. model_labels: [3, 4]
  858. applies_to: behind
  859. pattern: '^,评审排名:3'
  860. set_label: 4
  861. set_prob: {value: 0.601}
  862. golden_examples:
  863. - input: ',评审排名:3'
  864. should_match: true
  865. - input: ',评审排名:2'
  866. should_match: false
  867. - id: fix_l34_review_rank4_third
  868. description: '后文:^,评审排名:4 → 第三候选人'
  869. stage: l34
  870. model_labels: [3, 4]
  871. applies_to: behind
  872. pattern: '^,评审排名:4'
  873. set_label: 4
  874. set_prob: {value: 0.5}
  875. golden_examples:
  876. - input: ',评审排名:4'
  877. should_match: true
  878. - input: ',评审排名:3'
  879. should_match: false
  880. - id: fix_l34_tenderee_bracket
  881. description: '前文:(招标|采购)(人|单位):【? → 招标人。doc 748607691'
  882. stage: l34
  883. model_labels: [3, 4]
  884. applies_to: front
  885. pattern: '(招标|采购)(人|单位):【?$'
  886. set_label: 0
  887. set_prob: {value: 0.6}
  888. golden_examples:
  889. - input: '招标人:'
  890. should_match: true
  891. - input: '采购单位:【'
  892. should_match: true
  893. - input: '招标代理:'
  894. should_match: false
  895. - id: fix_l34_rank2_third
  896. description: '前文 排名第二;$ 且后文 ^报价:\d+万?元,排名第三; → 第三候选人。doc 751288823'
  897. stage: l34
  898. model_labels: [3, 4]
  899. applies_to: front
  900. pattern: '排名第二;$'
  901. guard:
  902. - {type: regex, on: behind, pattern: '^报价:\d+万?元,排名第三;'}
  903. set_label: 4
  904. set_prob: {value: 0.8}
  905. golden_examples:
  906. - input: '排名第二;'
  907. should_match: true
  908. - input: '排名第一;'
  909. should_match: false
  910. # ---- notify:label=5 通知书(l5_win_yes 未命中时第二阶段)----
  911. - id: fix_notify_winner
  912. description: '前文 (中标|成交)通知书[,:]$ 且后文 ^: 且 label≠2(引擎阶段序保证仅 label=5 到达)→ 中标人'
  913. stage: notify
  914. model_labels: [5]
  915. applies_to: front
  916. pattern: '(中标|成交)通知书[,:]$'
  917. guard:
  918. - {type: regex, on: behind, pattern: '^:'}
  919. set_label: 2
  920. set_prob: {value: 0.8}
  921. golden_examples:
  922. - input: '中标通知书,'
  923. should_match: true
  924. - input: '中标通知书'
  925. should_match: false
  926. # ---- l5:label=5(其他)兜底分支 ----
  927. - id: fix_l5_plan_tenderee
  928. description: '后文:^拟(招标|采购)一批 或 ^须购置一批 → 招标人'
  929. stage: l5
  930. model_labels: [5]
  931. applies_to: behind
  932. pattern: '^拟(招标|采购)一批|^须购置一批'
  933. set_label: 0
  934. set_prob: {value: 0.7}
  935. golden_examples:
  936. - input: '拟采购一批'
  937. should_match: true
  938. - input: '须购置一批'
  939. should_match: true
  940. - input: '采购一批'
  941. should_match: false
  942. - id: fix_l5_rank1_winner
  943. description: '前文 (投标人|供应商)(名称)?:$ 且后文 ^,排[序名]1; 或 ^,评审排名:1; → 中标人。doc 642045526'
  944. stage: l5
  945. model_labels: [5]
  946. applies_to: front
  947. pattern: '(投标人|供应商)(名称)?:$'
  948. guard:
  949. - {type: regex, on: behind, pattern: '^,排[序名]1;|^,评审排名:1;'}
  950. set_label: 2
  951. set_prob: {value: 0.6}
  952. golden_examples:
  953. - input: '供应商名称:'
  954. should_match: true
  955. - input: '招标人:'
  956. should_match: false
  957. - id: fix_l5_rank2_second
  958. description: '前文 (投标人|供应商)(名称)?:$ 且后文 ^,排[序名]2; 或 ^,评审排名:2; → 第二候选人'
  959. stage: l5
  960. model_labels: [5]
  961. applies_to: front
  962. pattern: '(投标人|供应商)(名称)?:$'
  963. guard:
  964. - {type: regex, on: behind, pattern: '^,排[序名]2;|^,评审排名:2;'}
  965. set_label: 3
  966. set_prob: {value: 0.6}
  967. golden_examples:
  968. - input: '供应商名称:'
  969. should_match: true
  970. - input: '招标人:'
  971. should_match: false
  972. - id: fix_l5_rank3_third
  973. description: '前文 (投标人|供应商)(名称)?:$ 且后文 ^,排[序名]3; 或 ^,评审排名:3; → 第三候选人'
  974. stage: l5
  975. model_labels: [5]
  976. applies_to: front
  977. pattern: '(投标人|供应商)(名称)?:$'
  978. guard:
  979. - {type: regex, on: behind, pattern: '^,排[序名]3;|^,评审排名:3;'}
  980. set_label: 4
  981. set_prob: {value: 0.6}
  982. golden_examples:
  983. - input: '供应商名称:'
  984. should_match: true
  985. - input: '招标人:'
  986. should_match: false
  987. - id: fix_l5_select_winner
  988. description: '前文 ,$ 且后文 ^,?中[选标], → 中标人。doc 642105225'
  989. stage: l5
  990. model_labels: [5]
  991. applies_to: front
  992. pattern: ',$'
  993. guard:
  994. - {type: regex, on: behind, pattern: '^,?中[选标],'}
  995. set_label: 2
  996. set_prob: {value: 0.6}
  997. golden_examples:
  998. - input: ','
  999. should_match: true
  1000. - input: '。'
  1001. should_match: false
  1002. - id: fix_l5_price_rank1_winner
  1003. description: '后文:^报价:\d+万?元,排名第一; → 中标人。doc 751288823'
  1004. stage: l5
  1005. model_labels: [5]
  1006. applies_to: behind
  1007. pattern: '^报价:\d+万?元,排名第一;'
  1008. set_label: 2
  1009. set_prob: {value: 0.6}
  1010. golden_examples:
  1011. - input: '报价:709640元,排名第一;'
  1012. should_match: true
  1013. - input: '报价:709640元,排名第二;'
  1014. should_match: false