role_fallback.yaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. # 招标人兜底召回规则(角色分类流程优化 Phase B)。
  2. #
  3. # 来源(触发条件均为 tenderee_notfound,即全文无 label=0 且 prob>0.55 的实体):
  4. # 1. dl/predictors/role.py TendereeRuleRecall(约 699-921 行):
  5. # - entity_context_rule:7 级优先级链(left_1..left_5 → right → right2 → right3),
  6. # 命中后 label=0,prob=0.5+values[0]/10(略高于 0.5 基线)
  7. # - subject_rule:公告主语 [我本][院校局]
  8. # 2. dl/predictors/role.py RoleRuleFinalAdd(约 598-695 行):
  9. # 文末格式(公司名+日期)、招标联系人、户名、买家信息、发布单位、站源格式,
  10. # 命中后 label=0/1,prob=0.51(比标题概率略高)
  11. #
  12. # 优先级(priority 越大越先执行,与代码中的串行顺序一致):
  13. # final_*(RoleRuleFinalAdd,extract.py 中先执行)→
  14. # left_1 > left_2 > left_3 > left_4 > left_5 > right > right2 > right3 → subject
  15. version: 1
  16. category: ROLE
  17. description: >-
  18. 招标人兜底召回规则:模型与上下文规则均未召回招标人时,
  19. 按 7 级上下文 → 文末格式 → 主语的优先级链补充召回。
  20. probability_ladder:
  21. p_model_threshold: 0.5
  22. p_rule_override: 0.501
  23. p_fallback: 0.51
  24. p_title: 0.55
  25. patterns:
  26. # ---- RoleRuleFinalAdd:文末/全文格式召回(先执行)----
  27. - id: final_publisher
  28. description: '全文前 5000 字:发布人/单位/机构/企业、项目业主、所属公司、寻源单位、主办单位、卖家:实体名。doc DX020065-3 卖家:成都积微物联电子商务有限公司'
  29. role: tenderee
  30. prob: 0.51
  31. priority: 90
  32. pattern: '(发布(?:人|单位|机构|企业)|项目业主|所属公司|寻源单位|主办单位|卖家)[,::][A-Za-z0-9_]*(?P<entity>[\u4e00-\u9fa5()()]{4,20})[,。]'
  33. golden_examples:
  34. - input: '发布单位:济南城市建设有限公司,'
  35. should_match: true
  36. - input: '卖家:成都积微物联电子商务有限公司。'
  37. should_match: true
  38. - input: '中标单位:青岛市政工程集团有限公司,'
  39. should_match: false
  40. - id: final_buyer_info
  41. description: '全文前 5000 字:买家信息/所有权人/土地权属单位/报名咨询/收送货地点:实体名'
  42. role: tenderee
  43. prob: 0.51
  44. priority: 89
  45. pattern: '(买家信息|所有权人|土地权属单位|报名咨询|[收送交]货地点)[,:](?P<entity>[\u4e00-\u9fa5()()]{5,20})[0-9\-]*[,。]'
  46. golden_examples:
  47. - input: '买家信息:广州市水务局,'
  48. should_match: true
  49. - input: '收货地点:济南市历城区仓库。'
  50. should_match: true
  51. - input: '发布单位:某公司,'
  52. should_match: false
  53. - id: final_account_name
  54. description: '全文前 5000 字:户名/开户名称/发票抬头:实体名'
  55. role: tenderee
  56. prob: 0.51
  57. priority: 88
  58. pattern: '[,:](户名|开户名称|发票抬头)[::](?P<entity>[\u4e00-\u9fa5()()]{5,20})[,。]'
  59. golden_examples:
  60. - input: ',户名:苏州市广播电视总台,'
  61. should_match: true
  62. - input: '户名:某某公司'
  63. should_match: false
  64. - id: final_contact_unit
  65. description: '全文前 5000 字:招标/采购联系人:姓名+实体名'
  66. role: tenderee
  67. prob: 0.51
  68. priority: 87
  69. pattern: '((招标|采购)联系人)[,::][A-Za-z0-9_]*(?P<entity>[\u4e00-\u9fa5()()]{4,20})'
  70. golden_examples:
  71. - input: '采购联系人:张先生济南城建集团'
  72. should_match: true
  73. - input: '联系人:李先生'
  74. should_match: false
  75. - id: final_end_date
  76. description: >-
  77. 文末(最后 5 句由后往前,去网址/招标办/附件名后 200 字):
  78. 实体名 + 日期格式(公告日期/电子签章/年月日)。doc 402073799 285264698。
  79. guard_not: 实体名前后出现 报价记录|竞价成交 则不召回。
  80. role: tenderee
  81. prob: 0.51
  82. priority: 86
  83. pattern: '([,。;:]|^)(?P<entity>[\u4e00-\u9fa5()()]{5,20}(,?[\u4e00-\u9fa5]{,8})?),?\s*((公告|发布)(日期|时间):|(电子签章),)?[0-9零一二三四五六七八九十〇○]{2,4}[年\-/][0-9零一二三四五六七八九十]{1,2}[月\-/]([0-9零一二三四五六七八九十]{1,2}日?)?'
  84. guard_not: '报价记录|竞价成交'
  85. golden_examples:
  86. - input: '。苏州卫生职业技术学院,2022年11月24日'
  87. should_match: true
  88. - input: '传真:0512-62690315,2022年11月24日'
  89. should_match: false
  90. - id: final_end_date_fallback
  91. description: >-
  92. final_end_date 主模式未命中时,取正文末尾 100 字重试:与主模式的差异为
  93. 引导符不含 :、(公告|发布) 可选、日期"日"可缺省。
  94. 注:原 role.py L632 此模式括号不平衡(缺 ")")导致该分支一旦执行必抛
  95. re.error,属隐性 bug;迁移时已修复(补齐 ")?"),badcase 回归集未覆盖
  96. 该路径,行为差异仅为"原来必崩 → 现在正常匹配"。
  97. role: tenderee
  98. prob: 0.51
  99. priority: 85
  100. pattern: '([,。;]|^)(?P<entity>[\u4e00-\u9fa5()()]{5,20}(,?[\u4e00-\u9fa5]{,8})?),?\s*((公告|发布)?(日期|时间):|(电子签章),)?[0-9零一二三四五六七八九十〇○]{2,4}[年\-/][0-9零一二三四五六七八九十]{1,2}[月\-/]([0-9零一二三四五六七八九十]{1,2}日?)?'
  101. guard_not: '报价记录|竞价成交'
  102. golden_examples:
  103. - input: '。某某某某单位2022年11月'
  104. should_match: true
  105. - input: '传真:0512-62690315'
  106. should_match: false
  107. - id: final_station_format
  108. description: '站源格式:,单位名称:实体名,联系人及联系电话:。doc 665632891'
  109. role: tenderee
  110. prob: 0.51
  111. priority: 85
  112. pattern: ',单位名称:(?P<entity>[\u4e00-\u9fa5()()]{4,20}),联系人及联系电话:'
  113. golden_examples:
  114. - input: ',单位名称:驻马店市公共资源交易中心,联系人及联系电话:'
  115. should_match: true
  116. - input: ',单位名称:某公司'
  117. should_match: false
  118. # ---- TendereeRuleRecall:7 级上下文链(front=前 40 词,behind=后 40 词)----
  119. - id: recall_left_1
  120. description: '前文(40 词):采购商/项目法人/询价单位/预算单位/买方单位/购买主体 等+冒号结尾'
  121. role: tenderee
  122. prob: 0.55
  123. applies_to: front
  124. priority: 70
  125. pattern: '((?:采购商|项目法人|项目业主)(名称)?|(?:采购商|询价|项目法人|项目业主|申购|预算|买方|需求|寻源|需用|征集)(单位|公司)((?:单位|公司)?名称)?|询价企业|业主单位咨询电话|购买主体|采购工厂|需求方(信息[,:])?(单位|公司)?名称|采购单位[\((].{1,6}[\))])[::是为][^。;,]{,2}$'
  126. golden_examples:
  127. - input: '项目业主:'
  128. should_match: true
  129. - input: '预算单位名称:'
  130. should_match: true
  131. - input: '供应商名称:'
  132. should_match: false
  133. - id: recall_left_2
  134. description: '前文(40 词):招标承办单位/交易人/招标人代表/交易单位/发起单位/收货单位/使用方/买家信息 等+冒号结尾'
  135. role: tenderee
  136. prob: 0.55
  137. applies_to: front
  138. priority: 69
  139. pattern: '(招标承办单位|交易人(?:名称)?|招标人代表|(采购|招标)联系人|交易单位|发起(单位|组织)|收货单位|使用方|买家信息)[::是为][^。;,]{,2}$'
  140. golden_examples:
  141. - input: '招标承办单位:'
  142. should_match: true
  143. - input: '收货单位:'
  144. should_match: true
  145. - input: '代理机构:'
  146. should_match: false
  147. - id: recall_left_3
  148. description: '前文(40 词):本公司/本单位(我/本引导)结尾'
  149. role: tenderee
  150. prob: 0.55
  151. applies_to: front
  152. priority: 68
  153. pattern: '[本我](?:公司|单位)[\(\[(【]?$'
  154. golden_examples:
  155. - input: '本公司'
  156. should_match: true
  157. - input: '本单位('
  158. should_match: true
  159. - input: '贵公司'
  160. should_match: false
  161. - id: recall_left_4
  162. description: '前文(40 词):采购机构/组织单位/执行单位/联系单位 等+冒号结尾(需实体名非代理类或机构类后缀)'
  163. role: tenderee
  164. prob: 0.55
  165. applies_to: front
  166. priority: 67
  167. pattern: '(采购机构|(?:采购|招标|询价)?(组织|执行)(机构|方|单位|部门|组织)|联系(单位|部门)|联系(人|方式),?(单位|公司)(名称)?|联系(人|方式),名称)[::是为][^。;,]{,2}$'
  168. golden_examples:
  169. - input: '采购机构:'
  170. should_match: true
  171. - input: '组织单位:'
  172. should_match: true
  173. - input: '招标人:'
  174. should_match: false
  175. - id: recall_left_5
  176. description: '前文(40 词):撰写单位/发布人/发布单位/发布机构/发布公司/发布部门/发布企业 结尾'
  177. role: tenderee
  178. prob: 0.55
  179. applies_to: front
  180. priority: 66
  181. pattern: '(撰写单位|发布(?:人|单位|机构|公司|部门|企业))[^。;,]{,2}$'
  182. golden_examples:
  183. - input: '发布单位:'
  184. should_match: true
  185. - input: '撰写单位:'
  186. should_match: true
  187. - input: '中标单位:'
  188. should_match: false
  189. - id: recall_behind
  190. description: '后文(40 词):(以下简称"我X")/(称招标人)/对…进行采购/关于…的公告/的…正在…进行/已批准/选定供应商 等'
  191. role: tenderee
  192. prob: 0.55
  193. applies_to: behind
  194. priority: 60
  195. pattern: '^[^。;::]{,5}[((](以?下简?称)?,?[,"“]*[我本][一-龥]{1,2}[,"”]*[))]|^[\((][^。;::\))]{,5}称(?:招标|采购)(?:人|单位)|^[^。;::]{,10}[对就][^。;,]+,?[^。;,]{,20}进行[^。;,]*(采购|询比?价|遴选|招投?标|征集)|^[^。;::]{,10}关于[^。;,]+,?[^。;,]{,20}的[^。;,]{,20}公告|^[^。;,::]{,10}的[^。;,]+,?[^。;]{,20}正在[^。;,]{,5}进行|^[^。;,::]{,10}的[^。;,]+,?[^。;]{,20}已?[^。;,]{,20}批准|^[^。;,::]{,15}(选定|选取|征集|遴选)[^。;,]{,20}(供应商|(代理|咨询|设计)[^。;,]{,5}机构|代理人)'
  196. golden_examples:
  197. - input: '(以下简称“我院”)'
  198. should_match: true
  199. - input: '关于2025年度物业服务项目的公告'
  200. should_match: true
  201. - input: ',中标人,'
  202. should_match: false
  203. - id: recall_behind_2
  204. description: '后文(40 词):前 10 字内出现 招标办/采购部/办事处/采购小组'
  205. role: tenderee
  206. prob: 0.55
  207. applies_to: behind
  208. priority: 59
  209. pattern: '^[^。;,::]{,10}(招标办|采购部|办事处|采购小?组)'
  210. golden_examples:
  211. - input: '招标办'
  212. should_match: true
  213. - input: '采购小组'
  214. should_match: true
  215. - input: '中标办'
  216. should_match: false
  217. - id: recall_behind_3
  218. description: '后文(40 词):对/就/关于/的 + 项目名(4-40 字),项目名命中 name 实体时召回'
  219. role: tenderee
  220. prob: 0.5
  221. applies_to: behind
  222. priority: 58
  223. pattern: '^[^。;,::]{,10}(对|就|关于|的)(?P<project>[^。;,?!::]{4,40})'
  224. golden_examples:
  225. - input: '关于某某市人民医院物业服务项目'
  226. should_match: true
  227. - input: ',中'
  228. should_match: false
  229. - id: recall_subject
  230. description: '公告主语:全文出现 我院/本校/我局(实体名含院/校/局 时召回,prob=0.5+values/10)'
  231. role: tenderee
  232. prob: 0.55
  233. priority: 50
  234. pattern: '[我本][院校局]'
  235. golden_examples:
  236. - input: '我院'
  237. should_match: true
  238. - input: '本校'
  239. should_match: true
  240. - input: '贵校'
  241. should_match: false