8a420e8ef11ebf828e5e5b33e8a830eb74c39d6a,baseline/services.py,ClassifierService,predict,#ClassifierService#Any#Any#Any#,215
Before Change
logger.warning("Warning: Passing `preproc` to `ClassifierService.predict` is deprecated.")
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):
After Change
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 ex p_type is None:
exp_type = "http" if remote.startswith("http") else "grpc"
exp_type = "{}-preproc".format(exp_type) if preproc == "server" else exp_type
exp_type = f"{exp_type}-{task_name}"
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 13
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: undertheseanlp/underthesea
Commit Name: 244940504e919a9f5c4e191f3d121ecebec00950
Time: 2017-07-04
Author: brother.rain.1024@gmail.com
File Name: tests/chunking/test_chunking.py
Class Name:
Method Name: load_input
Project Name: undertheseanlp/underthesea
Commit Name: 5e7a5ee56847be985d62b4f07bdc7c3e587e09b2
Time: 2017-07-04
Author: brother.rain.1024@gmail.com
File Name: tests/pos_tag/test_pos_tag.py
Class Name:
Method Name: load_input