is it worth checking that `prediction['confidence']` is there? or is it just a precondition from the way the `prediction` dict is constructed?