Is there a way to use trained model in from python? (not rasa shell)

Hi,

I was snooping around the rasa documentation and I realized that it is possible to use a Rasa NLU model from Python.

Is it possible to use the model trained using $ rasa train nlu?

I’ve managed to do something close using Agents, but all I got is a plain answer, I’m interested in the JSON as in:


hi how are you?

{
  "text": "hi how are you?",
  "intent": {
    "id": 9143215906925421507,
    "name": "bot_challenge",
    "confidence": 0.7018750905990601
  },
  "entities": [],
  "intent_ranking": [
    {
      "id": 9143215906925421507,
      "name": "bot_challenge",
      "confidence": 0.7018750905990601
    },
    {
      "id": 1323864409858369479,
      "name": "greet",
      "confidence": 0.28036993741989136
    },
    {
      "id": -1048609481864390385,
      "name": "start_feedback",
      "confidence": 0.0058972956612706184
    },   
  ],
  "response_selector": {
    "all_retrieval_intents": [],
    "default": {
      "response": {
        "id": null,
        "responses": null,
        "response_templates": null,
        "confidence": 0.0,
        "intent_response_key": null,
        "utter_action": "utter_None",
        "template_name": "utter_None"
      },
      "ranking": []
    }
  }
}

Is it possible?

The /model/parse endpoint may be what you’re looking for. Defined here

2 Likes

Wow, thank you!!! :grinning: