def modify_pred_classes(y_pred_proba, y_pred_classes, thresh=.9):
    """
    Modifies predicted classes to account for words not in command words set. Based on prediction confidence.
    y_pred_proba: array of prediction probability output from Keras model
    y_pred_classes: array of prediction classes from Keras model
    thresh: threshold to predict anything less confident than as "unknown"
    """
    probs = y_pred_proba.max(axis=1)
    is_unknown = probs < thresh
    y_pred_modified = y_pred_classes.copy()
    y_pred_modified[is_unknown] = 11
    return y_pred_modified