Python API- How do i get the user text as a response instead of the dictionary of all intents and confidence

Hi, when i am pretty new to Rasa. I am currently using the Rasa Python API. Whenever i post a message to the flask endpoint, i get this dict. is it possible to get the actual user response. How do i get the user text as defined in the templates as a response i.e when the userText is “Hello”, I expect to get “Hi, How are you” as the feedback instead of the dictionary of all intents and confidence. – Flask API #!/usr/bin/env python3

coding: utf-8

import warnings from flask import Flask, render_template, request, session, jsonify from rasa.nlu.model import Interpreter from rasa.nlu.model import Trainer from rasa.nlu.training_data import load_data from rasa.nlu import config import json warnings.filterwarnings(“ignore”)

def runModel(userText): interpreter = Interpreter.load("./models/default/nlu_20190719-081249") return interpreter.parse(str(userText))

SECRET_KEY = ‘a secret key’ app = Flask(name) app.config.from_object(name)

@app.route("/") def home(): return render_template(“index.html”)

@app.route("/get") def get_bot_response(): userText = request.args.get(‘text’) result = runModel(userText) resultFormat = json.dumps(result) return resultFormat

if name == “main”: app.run(host=“127.0.0.1”, port=5006, debug=True)

  • Trainer File #!/usr/bin/env python3

coding: utf-8

To train run python trainer.py train-all

from rasa.nlu.training_data import load_data from rasa.nlu.model import Trainer from rasa.nlu.components import ComponentBuilder from rasa.nlu import config from rasa.nlu.model import Metadata, Interpreter

import argparse import warnings

from rasa.core import utils from rasa.core.agent import Agent from rasa.core.policies.keras_policy import KerasPolicy from rasa.core.policies.memoization import MemoizationPolicy

warnings.filterwarnings(“ignore”)

def train_all(): training_data = load_data(‘data/nlu/training_data.json’) trainer = Trainer(config.load(“config.yml”)) trainer.train(training_data) model_directory = trainer.persist(‘models/default’) # Returns the directory the model i

if name == ‘main’: train_all() – Response { “intent”: { “name”: “greet”, “confidence”: 0.9679768085479736 }, “entities”: [], “intent_ranking”: [ { “name”: “greet”, “confidence”: 0.9679768085479736 }, { “name”: “what_is_rh_immunoglobulin”, “confidence”: 0.1803365796804428 }