def _add_label_features(self, model_data: RasaModelData, training_data: List[Message], label_attribute: Text, label_id_dict: Dict[(Text, int)], training: bool=True) -> None:
    label_ids = []
    if (training and self.component_config[INTENT_CLASSIFICATION]):
        for example in training_data:
            if example.get(label_attribute):
                label_ids.append(label_id_dict[example.get(label_attribute)])
        model_data.add_features(LABEL_KEY, LABEL_SUB_KEY, [FeatureArray(np.expand_dims(label_ids, (- 1)), number_of_dimensions=2)])
    if (label_attribute and model_data.does_feature_not_exist(label_attribute, SENTENCE) and model_data.does_feature_not_exist(label_attribute, SEQUENCE)):
        model_data.add_features(LABEL, SENTENCE, self._use_default_label_features(np.array(label_ids)))
    model_data.update_key(label_attribute, SENTENCE, LABEL, SENTENCE)
    model_data.update_key(label_attribute, SEQUENCE, LABEL, SEQUENCE)
    model_data.update_key(label_attribute, MASK, LABEL, MASK)
    model_data.add_lengths(LABEL, SEQUENCE_LENGTH, LABEL, SEQUENCE)
def _add_label_features(self, model_data: RasaModelData, training_data: List[Message], label_attribute: Text, label_id_dict: Dict[(Text, int)], training: bool=True) -> None:
    label_ids = []
    if (training and self.component_config[INTENT_CLASSIFICATION]):
        for example in training_data:
            if example.get(label_attribute):
                label_ids.append(label_id_dict[example.get(label_attribute)])
        model_data.add_features(LABEL_KEY, LABEL_SUB_KEY, [FeatureArray(np.expand_dims(label_ids, (- 1)), number_of_dimensions=2)])
    if (label_attribute and model_data.does_feature_not_exist(label_attribute, SENTENCE) and model_data.does_feature_not_exist(label_attribute, SEQUENCE)):
        model_data.add_features(LABEL, SENTENCE, self._use_default_label_features(np.array(label_ids)))
    model_data.update_key(label_attribute, SENTENCE, LABEL, SENTENCE)
    model_data.update_key(label_attribute, SEQUENCE, LABEL, SEQUENCE)
    model_data.update_key(label_attribute, MASK, LABEL, MASK)
    model_data.add_lengths(LABEL, SEQUENCE_LENGTH, LABEL, SEQUENCE)