Charlotte Junod
Charlotte Junod

Reputation: 53

Logs for Rasa in command-line mode

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 ?

Upvotes: 4

Views: 3583

Answers (2)

gsid
gsid

Reputation: 470

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"
}

Upvotes: 2

Caleb Keller
Caleb Keller

Reputation: 2161

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

Upvotes: 2

Related Questions