pyabsa.tasks.AspectPolarityClassification.instructor.ensembler

Classes

APCEnsembler

Thin wrapper to build datasets/tokenizers and ensemble APC models.

Functions

model_pool_check(models)

Ensure all models in the ensemble belong to the same APC family.

Module Contents

pyabsa.tasks.AspectPolarityClassification.instructor.ensembler.model_pool_check(models)

Ensure all models in the ensemble belong to the same APC family.

Mixing LCF-, BERT-baseline-, and GloVe-based models is not supported because their input conventions and output heads differ.

class pyabsa.tasks.AspectPolarityClassification.instructor.ensembler.APCEnsembler(config, load_dataset=True, **kwargs)

Bases: torch.nn.Module

Thin wrapper to build datasets/tokenizers and ensemble APC models.

  • Merges inputs requirements across models into config.inputs_cols

  • Lazily builds tokenizer/encoder and datasets as needed

  • Supports concatenation or mean-averaging of logits for ensembling

config
inputs_cols
models
tokenizer = None
bert = None
embedding_matrix = None
train_set = None
test_set = None
valid_set = None
test_dataloader = None
valid_dataloader = None
dense
forward(inputs)