__init__.py 1.5 KB

123456789101112131415161718192021222324252627
  1. # -*- coding: utf-8 -*-
  2. """dl/rules/patterns/ — YAML 正则规则文件目录。
  3. 本目录下的 ``*.yaml`` 文件由 ``RuleLoader`` 自动扫描加载。
  4. 每个文件结构遵循 ``dl/rules/schema/pattern_schema.json`` 定义。
  5. 当前已迁移的规则文件:
  6. | 文件 | 类别 | 规则数 | 来源 |
  7. |---|---|---|---|
  8. | ``failure.yaml`` | FAILURE | 1 | template_extractor.is_fail() |
  9. | ``money_source.yaml`` | MONEY | 13 条关键词规则 | attr_utils.turnMoneySource() |
  10. | ``rank.yaml`` | RANK | 3 | template_extractor.get_rank() |
  11. | ``phone.yaml`` | CONTACT | 1 | template_extractor.get_phone() + role_money.phone |
  12. | ``time.yaml`` | TIME | 6 | time_attrs.py + attr_utils.py extract_serviceTime() |
  13. | ``time_context.yaml`` | TIME | 20 | time_attrs.py getTimeAttributes() |
  14. | ``contact_phone_prefix.yaml`` | CONTACT | 7 | role_money.py re_*_phone |
  15. | ``package.yaml`` | PACKAGE | 6 | package_scope.py getPackagesFromArticle() |
  16. | ``role_context.yaml`` | ROLE | 17 | role.py RoleRulePredictor pattern_left/whole/right |
  17. | ``role_fallback.yaml`` | ROLE | 17 | role.py TendereeRuleRecall + RoleRuleFinalAdd 兜底召回 |
  18. | ``role_context_fix.yaml`` | ROLE | 59 | prem.py PREMPredict.predict_role 模型后修正 |
  19. | ``role_money_fix.yaml`` | MONEY | 12 | prem.py predict_money + correct_money_by_rule 模型后修正 |
  20. 说明:ROLE/MONEY 修正类 YAML 当前为 source of truth(校验+文档),
  21. predictors 消费 YAML 须待 Phase C 规则注入机制就绪
  22. (见 predictors/role_context.py 模块注释)。
  23. """