matchzoo.preprocessors.build_unit_from_data_pack
¶
Build unit from data pack.
Module Contents¶
-
matchzoo.preprocessors.build_unit_from_data_pack.
build_unit_from_data_pack
(unit:StatefulUnit, data_pack:mz.DataPack, mode:str='both', flatten:bool=True, verbose:int=1) → StatefulUnit¶ Build a
StatefulUnit
from aDataPack
object.Parameters: - unit –
StatefulUnit
object to be built. - data_pack – The input
DataPack
object. - mode – One of ‘left’, ‘right’, and ‘both’, to determine the source
data for building the
VocabularyUnit
. - flatten – Flatten the datapack or not. True to organize the
DataPack
text as a list, and False to organizeDataPack
text as a list of list. - verbose – Verbosity.
Returns: A built
StatefulUnit
object.- unit –