def predict_label_for_doc(self, d):
        """Returns the predicted label from a doc's prediction report.
        """
        if (self._num_docs < self._DEFAULT_MIN_DOCS_TO_PREDICT or
                self._num_labels < self._DEFAULT_MIN_LABELS_TO_PREDICT):
            return self.DEFAULT_LABEL
        return self._get_prediction_report_for_doc(d)['prediction_label_name']
dataset/ETHPy150Open oppia/oppia/core/domain/classifier_services.py/StringClassifier.predict_label_for_doc/original