MCPcopy Create free account
hub / github.com/hankcs/HanLP / predict_task

Method predict_task

hanlp/components/mtl/multi_task_learning.py:593–599  ·  view source on GitHub ↗
(self, task: Task, output_key, batch, results, output_dict=None, run_transform=True,
                     cls_is_bos=True, sep_is_eos=True)

Source from the content-addressed store, hash-verified

591 return target_tasks
592
593 def predict_task(self, task: Task, output_key, batch, results, output_dict=None, run_transform=True,
594 cls_is_bos=True, sep_is_eos=True):
595 output_dict, batch = self.feed_batch(batch, output_key, output_dict, run_transform, cls_is_bos, sep_is_eos,
596 results)
597 self.decode_output(output_dict, batch, output_key)
598 results[output_key].extend(task.prediction_to_result(output_dict[output_key]['prediction'], batch))
599 return output_dict
600
601 def _resolve_task_name(self, dependencies):
602 resolved_dependencies = set()

Callers 1

predictMethod · 0.95

Calls 4

feed_batchMethod · 0.95
decode_outputMethod · 0.95
extendMethod · 0.80
prediction_to_resultMethod · 0.45

Tested by

no test coverage detected