简体   繁体   English

Rasa Core-获取最新消息,自定义操作

[英]Rasa Core - Get Latest Message, Custom Action

How do I just collect a user response in Rasa Core without extracting an entity. 如何仅在Rasa Core中收集用户响应而不提取实体。 Right now I have been able to hack it by doing the following, but I am wondering if there is a better way? 现在,我已经可以通过执行以下操作来破解它,但是我想知道是否有更好的方法?

domain.yml domain.yml

slots:
  slot: animal
    type: categorical
    values:
    - cat
    - dog

stories.md storys.md

*greet
   -utter_greet
*inform{"Animal":"Dog"}
   - utter_hello_fido
*inform
   - do_my_action

python code: python代码:

class MyAction(Action):

    def name(self):
       return 'do_my_action'
    def run(self):
        message = tracker.latest.text
        operate on(message)

    return []

You can specify to ignore entity extraction for certain intents by specifying that in your Rasa domain file (see the docs here): 您可以通过在Rasa域文件中指定实体来指定忽略某些意图的实体提取(请参见此处的文档 ):

intents:
  - greet:
      use_entities: None

This would ignore all extracted entities for the intent greet . 这将忽略意图所有提取的实体greet

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM