我试图从输入中提取用户名。这是相关的训练数据(我没有提供完整的数据,因为这会使问题变得臃肿):
nlu:
- intent: greet
examples: |
- hey
- hello
- hi
- hello there
- intent: en_name
examples: |
- my name is [adarsh](name)
- name is [suma](name)
- I am [sourav](name)
- regex: name
examples: |
- \w{2,40}
stories:
- story: Start conversation
- intent: greet
- action: utter_greet
- action: utter_help
- intent: seek_scheme
- action: user_info_form
- active_loop: user_info_form
rules:
- rule: activate form
steps:
- intent: seek_scheme
- action : user_info_form
- active_loop: user_info_form
- rule : submit form
condition:
- active_loop: user_info_form
steps:
- action : user_info_form
- active_loop: null
- slot_was_set:
- requested_slot : null
- action: utter_submit
- action: utter_slot_values
- rule : Deviated form path
condition:
- active_loop: user_info_form
steps:
- intent: bot_challenge
- action: utter_iamabot
- action : user_info_form
- active_loop: user_info_form
在这里,由于我使用的是正则表达式,我必须RegexEntityExtractor
为我的管道添加。但是在添加它之后,即使是“hi”作为输入也被视为实体名称。这是 rasa 交互式会话的示例:
? Your input -> hi
? Is the intent 'greet' correct for '[hi](name)' and are all entities labeled correctly? No
? What intent is it? 1.00 greet
? Please mark the entities using [value](type) notation hi
像这样,对于我提供的任何单词,它都将其标记为 entity name。我想这是因为,RegexEntityExtractor
在提取实体时没有考虑意图。如何解决这个问题?