matchzoo.auto.preparer.prepare
¶
Module Contents¶
-
matchzoo.auto.preparer.prepare.
prepare
(task: BaseTask, model_class: typing.Type[BaseModel], data_pack: mz.DataPack, callback: typing.Optional[BaseCallback] = None, preprocessor: typing.Optional[BasePreprocessor] = None, embedding: typing.Optional['mz.Embedding'] = None, config: typing.Optional[dict] = None)¶ A simple shorthand for using
matchzoo.Preparer
.config is used to control specific behaviors. The default config will be updated accordingly if a config dictionary is passed. e.g. to override the default bin_size, pass config={‘bin_size’: 15}.
Parameters: - task – Task.
- model_class – Model class.
- data_pack – DataPack used to fit the preprocessor.
- callback – Callback used to padding a batch. (default: the default callback of model_class)
- preprocessor – Preprocessor used to fit the data_pack. (default: the default preprocessor of model_class)
- embedding – Embedding to build a embedding matrix. If not set, then a correctly shaped randomized matrix will be built.
- config – Configuration of specific behaviors. (default: return value of mz.Preparer.get_default_config())
Returns: A tuple of (model, preprocessor, data_generator_builder, embedding_matrix).