71432d1890209628e189edf04d7d623160943718,autokeras/hypermodel/preprocessor.py,TextToNgramVector,transform,#TextToNgramVector#Any#Any#,182

Before Change



    def transform(self, x, fit=False):
        sentence = nest.flatten(x)[0].numpy().decode("utf-8")
        data = self.vectorizer.transform([sentence]).toarray()
        if self.selector:
            data = self.selector.transform(data).astype("float32")
        return data[0]

    def output_types(self):
        return (tf.float32,)

After Change



        for feature in tokens:
            if feature in self.vocabulary:
                feature_idx = self.vocabulary[feature]
                tf[feature_idx] += 1
        result = tf * self.k_best_idf_values
        result = normalize([result], norm=self.norm, copy=False)[0]
        return result
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: keras-team/autokeras
Commit Name: 71432d1890209628e189edf04d7d623160943718
Time: 2019-12-18
Author: 33369174+Davidsirui@users.noreply.github.com
File Name: autokeras/hypermodel/preprocessor.py
Class Name: TextToNgramVector
Method Name: transform


Project Name: neurosynth/neurosynth
Commit Name: 73675264dd48387319f62780b52d81389016cc1f
Time: 2014-03-24
Author: tyarkoni@gmail.com
File Name: neurosynth/base/dataset.py
Class Name: FeatureTable
Method Name: get_ids


Project Name: neurosynth/neurosynth
Commit Name: 73675264dd48387319f62780b52d81389016cc1f
Time: 2014-03-24
Author: tyarkoni@gmail.com
File Name: neurosynth/base/dataset.py
Class Name: FeatureTable
Method Name: get_features_by_ids