rasa/core/training/interactive.py
def _selection_choices_from_intent_prediction(
    predictions: List[Dict[Text, Any]]
) -> List[Dict[Text, Text]]:
    """"Given a list of ML predictions create a UI choice list."""

    sorted_intents = sorted(predictions,
                            key=lambda k: (-k['confidence'], k['name']))

    choices = []
    for p in sorted_intents:
        name_with_confidence = "{:03.2f} {:40}".format(p.get("confidence"),
                                                       p.get("name"))
        choice = {
            "name": name_with_confidence,
            "value": p.get("name")
        }
        choices.append(choice)

    return choices
Given a list of ML predictions create a UI choice list.
Given a list of ML predictions create a UI choice list.
Given a list of ML predictions create a UI choice list .
def _selection_choices_from_intent_prediction(
    predictions: List[Dict[Text, Any]]
) -> List[Dict[Text, Text]]:
    sorted_intents = sorted(predictions,
                            key=lambda k: (-k['confidence'], k['name']))
    choices = []
    for p in sorted_intents:
        name_with_confidence = "{:03.2f} {:40}".format(p.get("confidence"),
                                                       p.get("name"))
        choice = {
            "name": name_with_confidence,
            "value": p.get("name")
        }
        choices.append(choice)
    return choices
def _selection_choices_from_intent_prediction ( predictions : List [ Dict [ Text , Any ] ] ) -> List [ Dict [ Text , Text ] ] : sorted_intents = sorted ( predictions , key = lambda k : ( - k [ 'confidence' ] , k [ 'name' ] ) ) choices = [ ] for p in sorted_intents : name_with_confidence = "{:03.2f} {:40}" . format ( p . get ( "confidence" ) , p . get ( "name" ) ) choice = { "name" : name_with_confidence , "value" : p . get ( "name" ) } choices . append ( choice ) return choices
Given a list of ML predictions create a UI choice list.
Given a list of ML predictions create a UI choice list .
""""Given a list of ML predictions create a UI choice list."""
predictions
List[Dict[Text, Any]]