pyabsa.augmentation

Subpackages

Submodules

Package Contents

Functions

auto_aspect_sentiment_classification_augmentation(→ None)

Augment the dataset using BoostTextAugmentation tool (https://github.com/yangheng95/BoostTextAugmentation) for aspect

auto_classification_augmentation(→ None)

Augment the dataset using BoostTextAugmentation tool (https://github.com/yangheng95/BoostTextAugmentation) for text

pyabsa.augmentation.auto_aspect_sentiment_classification_augmentation(config, dataset, device: str, boosting_fold: int = 4, classifier_training_num: int = 1, augment_num_per_case: int = 10, winner_num_per_case: int = 5, augment_backend: str = 'eda', train_after_aug: bool = True, rewrite_cache: bool = True) None[source]

Augment the dataset using BoostTextAugmentation tool (https://github.com/yangheng95/BoostTextAugmentation) for aspect sentiment classification.

Parameters:
  • config (ABSAConfig) – The configuration object for ABSA.

  • dataset (ABSADataset) – The dataset to be augmented.

  • device (str) – The device to run the augment on.

  • boosting_fold (int, optional) – The number of boosting fold. Defaults to 4.

  • classifier_training_num (int, optional) – The number of classifier training. Defaults to 1.

  • augment_num_per_case (int, optional) – The number of augmented samples to generate per case. Defaults to 10.

  • winner_num_per_case (int, optional) – The number of winners per case. Defaults to 5.

  • augment_backend (str, optional) – The data augment backend to use. Defaults to “eda”.

  • train_after_aug (bool, optional) – Whether to train the model after the data augmentation. Defaults to True.

  • rewrite_cache (bool, optional) – Whether to rewrite the cache files. Defaults to True.

Returns:

None

pyabsa.augmentation.auto_classification_augmentation(config, dataset, device: str, boosting_fold: int = 4, classifier_training_num: int = 1, augment_num_per_case: int = 10, winner_num_per_case: int = 5, augment_backend: str = 'eda', train_after_aug: bool = True, rewrite_cache: bool = True) None[source]

Augment the dataset using BoostTextAugmentation tool (https://github.com/yangheng95/BoostTextAugmentation) for text classification.

Parameters:
  • config (ABSAConfig) – The configuration object for ABSA.

  • dataset (ABSADataset) – The dataset to be augmented.

  • device (str) – The device to run the augment on.

  • boosting_fold (int, optional) – The number of boosting fold. Defaults to 4.

  • classifier_training_num (int, optional) – The number of classifier training. Defaults to 1.

  • augment_num_per_case (int, optional) – The number of augmented samples to generate per case. Defaults to 10.

  • winner_num_per_case (int, optional) – The number of winners per case. Defaults to 5.

  • augment_backend (str, optional) – The data augment backend to use. Defaults to “eda”.

  • train_after_aug (bool, optional) – Whether to train the model after the data augmentation. Defaults to True.

  • rewrite_cache (bool, optional) – Whether to rewrite the cache files. Defaults to True.

Returns:

None