I want to store the output of my Predicted_intent and entities in a JSON file. Can anyone please guide me on how to do that?
When exactly do you want to store the intents and entities? After every turn or at the end of the dialogue?
If you want to write down the intents and entities somewhen during a conversation, you can add a custom action that gets the current status of the tracker with all its events via tracker.current_status()
(see Tracker). You can filter out the information of interest and store those in a JSON file.
If you just want to parse individual messages and store the predicted intent and entities, you may want to use the our HTTP API. The endpoint /model/parse
can be used for that.
I want to store the predicted intent and the extracted entities after each user input, along with the next predicted action in a JSON format after each user input
One approach is to use our event broker to create your own queue of the tracker store events and process that queue. This gives you a live feed of the dialog with intent and entity predictions. Look halfway down this blog post and you’ll find a description of how to do this using our RabbitMQ event broker.