DLTransformer

class lightautoml.text.dl_transformers.DLTransformer(model, model_params, dataset, dataset_params, loader_params, device='cuda', random_state=42, embedding_model=None, embedding_model_params=None, multigpu=False, verbose=False)[source]

Bases: TransformerMixin

Deep Learning based sentence embeddings.

Parameters:
  • model – Torch model for aggregation word embeddings into sentence embedding.

  • model_params (Dict) – Dict with model parameters.

  • dataset – Torch dataset.

  • dataset_params (Dict) – Dict with dataset params.

  • loader_params (Dict) – Dict with params for torch dataloader.

  • device (str) – String with torch device type or device ids. I.e: ‘0,2’.

  • random_state (int) – Determines random number generation.

  • embedding_model (Optional[Any]) – Torch word embedding model, if dataset do not return embeddings.

  • embedding_model_params (Optional[Dict[str, Dict]]) – Dict with embedding model params.

  • multigpu (bool) – Use data parallel for multiple GPU.

  • verbose (bool) – Show tqdm progress bar.

get_name()[source]

Module name.

Return type:

str

Returns:

String with module name.

get_out_shape()[source]

Output shape.

Return type:

int

Returns:

Int with module output shape.

transform(data)

Embedded sentece.

Return type:

ndarray