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

Before Change


        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


        // Calculate tf at doc level
        tf = np.zeros(len(self.vocabulary), dtype=int)
        x = nest.flatten(x)[0].numpy().decode("utf-8")
        token_pattern = re.compile(r"(?u)\b\w\w+\b")
        tokens = self._word_ngram(token_pattern.findall(x.lower()))

        for feature in tokens:
            if feature in self.vocabulary:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: streamlit/streamlit
Commit Name: 0f65b0232077bf3f00fa4405d7412094dfd2a33a
Time: 2019-07-02
Author: thiago@streamlit.io
File Name: lib/streamlit/util.py
Class Name:
Method Name: is_altair_chart


Project Name: streamlit/streamlit
Commit Name: 96d076279cf62ce4157421c7b05b8b3721be56f5
Time: 2019-06-27
Author: domoritz@gmail.com
File Name: lib/streamlit/util.py
Class Name:
Method Name: is_altair_chart