8a420e8ef11ebf828e5e5b33e8a830eb74c39d6a,baseline/services.py,ClassifierService,predict,#ClassifierService#Any#Any#Any#,215

Before Change


        tokens_batch = self.batch_input(tokens)
        self.prepare_vectorizers(tokens_batch)
        if self.preproc == "client":
            examples = self.vectorize(tokens_batch)
        elif self.preproc == "server":
            // TODO: here we allow vectorizers even for preproc=server to get `word_lengths`.
            // vectorizers should not be available when preproc=server.
            featurized_examples = self.vectorize(tokens_batch)
            examples = {
                        "tokens": np.array([" ".join(x) for x in tokens_batch]),
                        self.model.lengths_key: featurized_examples[self.model.lengths_key]
            }

        outcomes_list = self.model.predict(examples)
        return self.format_output(outcomes_list)

    def format_output(self, predicted):
        results = []

After Change


        version = kwargs.get("version")

        if backend not in {"tf"}:
            raise ValueError("only Tensorflow is currently supported for remote Services")
        import_user_module("baseline.{}.remote".format(backend))
        exp_type = kwargs.get("remote_type")
        if exp_type is None:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: dpressel/mead-baseline
Commit Name: 8a420e8ef11ebf828e5e5b33e8a830eb74c39d6a
Time: 2020-03-09
Author: blester125@gmail.com
File Name: baseline/services.py
Class Name: ClassifierService
Method Name: predict


Project Name: dpressel/mead-baseline
Commit Name: cab8566e1e7ac059bde5355b4057c94f42a7fd6d
Time: 2020-05-18
Author: blester125@users.noreply.github.com
File Name: baseline/services.py
Class Name: ONNXTaggerService
Method Name: predict


Project Name: dpressel/mead-baseline
Commit Name: cab8566e1e7ac059bde5355b4057c94f42a7fd6d
Time: 2020-05-18
Author: blester125@users.noreply.github.com
File Name: baseline/services.py
Class Name: ONNXClassifierService
Method Name: predict