跳到主要内容
版本:2.0.0

NLU Pipeline

本章节将讲解:NLU Pipeline中的各个流程,以及如何自定义策略

  1. NLU Pipeline与机器人的语言模型强相关,针对不同的语言模型,NLU的处理流程也有区别

  2. 下表为NLU Pipeline中不同语言模型的的处理流程,其中有些参数可以自定义修改。

language: zh
pipeline:
- name: wulai_nlu.preprocess.Preprocess
case_conversion: '' # 英文大小写转换 'lower','upper'或''
to_simplified: false # 繁体转换为简体 false或true
- name: JiebaTokenizer
- name: wulai_nlu.custom_entity_extractor.CustomEntityExtractor
catelog: # 系统实体列表
- sys.date
- sys.time
- sys.province
- sys.city
- sys.any
policy: 1 # 实体消歧策略
# 0: 返回全部实体
# 1: 去掉同实体中被包含的实体值,返回最长的
# 2: 去掉全部被包含的实体值,返回最长的
case_sensitive: false # 大小写敏感 false或true
max_entities: 200 # 返回的实体值数量的上限
- name: wulai_nlu.keyword_classifier.KeywordClassifier
- name: wulai_nlu.intent_searcher.IntentSearcher
- name: wulai_nlu.example_classifier.ExampleClassifier
threshold_entity: 0.6
threshold_intent: 0.5
threshold_ngram: 0.8
template_only: true # 只对句式进行匹配,提高效率 true或false
- name: wulai_nlu.rerank_classifier.RerankClassifier
- name: FallbackClassifier
ambiguity_threshold: -1 # top1&2的分差最小值
threshold: 0.7 # 兜底分数
  1. 如需自定义NLU Pipeline,请将修改后的内容粘贴进:机器人管理页面-机器人设置-“annotation”字段中。