cab8566e1e7ac059bde5355b4057c94f42a7fd6d,baseline/services.py,ONNXTaggerService,predict,#ONNXTaggerService#Any#,418

Before Change


    def predict(self, tokens, **kwargs):
        tokens_batch = self.batch_input(tokens)
        self.prepare_vectorizers(tokens_batch)
        examples = self.vectorize(tokens_batch)
        outcomes_list = self.model.run(None, examples)
        outcomes_list = outcomes_list[0]
        return self.format_output(tokens, outcomes_list)

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

After Change


        self.prepare_vectorizers(tokens_batch)
        // Process each example in the batch by itself to hide the one at a time nature
        examples = [self.vectorize([tokens]) for tokens in tokens_batch]
        outcomes_list = np.concatenate([self.model.run(None, example)[0] for example in examples], axis=0)
        return self.format_output(outcomes_list, tokens_batch, label_field=kwargs.get("label", "label"))

    def vectorize(self, tokens_batch):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


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: 8a420e8ef11ebf828e5e5b33e8a830eb74c39d6a
Time: 2020-03-09
Author: blester125@gmail.com
File Name: baseline/services.py
Class Name: ClassifierService
Method Name: predict


Project Name: stellargraph/stellargraph
Commit Name: 492c4e30d962a9e4ce73d37924ef6e4b1bb597ea
Time: 2020-04-27
Author: Huon.Wilson@data61.csiro.au
File Name: stellargraph/mapper/full_batch_generators.py
Class Name: FullBatchGenerator
Method Name: __init__