def fancy_prediction(classifier, input_str: str) -> str:
    """
    Helper function to print out prediction results of a single input string.
    The input string will be given a list of labels and their corresponding
    chance that the label matches with the input string.

    Parameters
    ----------
    classifier:
        The trained fasttext classifier used to predict the input string
    input_str: str :
        The input string to predict

    Returns
    -------
    str
        The well-formmated results of the prediction on the given input string.

    """
    predictions = classifier.predict_proba(
        [input_str], k=len(classifier.labels)
    )
    longest_label_len = max(map(len, classifier.labels))
    predict_str = ""
    for curr_string_prediction in predictions:
        for label, prob in curr_string_prediction:
            predict_str += f"{str(label).ljust(longest_label_len)}: {prob}"
            predict_str += '\n'
    predict_str += "Text:\n"
    # tokens = input_str.split()
    # if len(tokens) > 21:
    #     predict_str += ' '.join(tokens[:10]) + " ... " + ' '.join(tokens[-10:])
    # else:
    predict_str += input_str
    return predict_str