'Transform data to luis.ai format.'

def normalise_response_json(self, data):

    top_intent = self._top_intent(data)
    ranking = self._ranking(data)
    return {u'query': data[u'text'], u'topScoringIntent': top_intent, u'intents': ranking, u'entities': ([{u'entity': e[u'value'], u'type': e[u'entity'], u'startIndex': None, u'endIndex': None, u'score': None} for e in data[u'entities']] if (u'entities' in data) else [])}
