Exemple #1
0
    def attach_feature_list(self, feature_list):
        """Attach feature to text objects in real Data set.

        Using feature interface for computing attributes and
        set feature values to text objects in real Data set.

        Use feature_list for attaching more than one feature.

        Parameters
        ----------
        feature_list : array, shape = [string feature1 name, string feature2
        name, ...]
            Contains the names of the corresponding features, that
            should be attached.
        """
        if self.real_data_size == 0:
            raise NoAnnotationException(self.raw_data.name)

        else:
            feature = Feature(name_list=feature_list, bow_model=self.bow_model)
            feature.add_attribute_list(self.r_D_text_set)
            self.bow_model = feature.bow_model

            for feature_name in feature_list:
                self.features_fit.append(feature_name)
Exemple #2
0
    def attach_feature(self, feature_name):
        """Attach feature to text objects in real Data set.

        Using feature interface for computing attributes and
        set feature values to text objects in real Data set.

        Parameters
        ----------
        feature_name : string
            Contains the name of the corresponding feature, that
            should be attached.
        """

        if self.real_data_size == 0:
            raise NoAnnotationException(self.raw_data.name)

        else:
            feature = Feature(name=feature_name, bow_model=self.bow_model)
            feature.add_attribute(self.r_D_text_set)
            self.bow_model = feature.bow_model
            self.features_fit.append(feature_name)