4

I would like to log conversation (especially intents) from a Rasa bot. There is a perfect feature for that when Rasa NLU is run as an http server, but I can't seem to find anything similar when running in command-line mode. Is there a way to do that ? If, not, would there be a way to implement that ?

2 Answers2

2

What do you mean exactly by command line mode? If you start the server with:

python -m rasa_nlu.server --path projects --response_log logs

logging should be enabled. This assumes version 0.12.3

Caleb Keller
  • 2,151
  • 17
  • 26
  • I mean by not starting nlu as a server at all, but using cmd-line input/output to ineract with it This is the code for launching the bot: `def run(serve_forever=True): interpreter = RasaNLUInterpreter("models/nlu/default/current") agent = Agent.load("models/dialogue", interpreter=interpreter) if serve_forever: agent.handle_channel(ConsoleInputChannel()) return agent` – Charlotte Junod May 04 '18 at 07:39
2

In the Rasa Core architecture a class called Tracker contains the history of the current conversation. I imagine you may implement your log by calling its as_dialogue method.

Looking at the docs, the output of this serialization seems to be exactly like the items in the logs produced by the server:

{  
  "py/object":"rasa_core.conversation.Dialogue",
  "events":[
    {
      "py/object": "rasa_core.events.UserUttered",
      "entities": [],
      "intent": {
        "name": "greet",
        "confidence": 1.0
      },
      "text": "/greet"
    },
    {
      "py/object": "rasa_core.events.ActionExecuted",
      "action_name": "utter_greet",
      "unpredictable": false
    }
  ],
  "name":"hello_world"
}
gsid
  • 470
  • 4
  • 6