Beispiel #1
0
class RandomDelete:
    def __init__(self, vectors, aug_p=0.3, stopwords=[]):
        self.swap_aug = WordEmbsAug(model=vectors,
                                    action='delete',
                                    stopwords=stopwords,
                                    aug_p=aug_p)

    def __call__(self, text):
        text_transformed = self.swap_aug.augment(text)
        return text_transformed
Beispiel #2
0
class RandomDelete:
    def __init__(self, vectors, aug_p=0.3):
        self.swap_aug = WordEmbsAug(
            model=vectors,
            action='substitute',
            stopwords=['<cls>', '<eos>', '<sep>', '<pad>'],
            aug_p=aug_p)

    def __call__(self, text):
        text_transformed = self.swap_aug.augment(text)
        return text_transformed
Beispiel #3
0
 def __init__(self, vectors, aug_p=0.3):
     self.swap_aug = WordEmbsAug(
         model=vectors,
         action='substitute',
         stopwords=['<cls>', '<eos>', '<sep>', '<pad>'],
         aug_p=aug_p)
Beispiel #4
0
 def __init__(self, vectors, aug_p=0.3, stopwords=[]):
     self.swap_aug = WordEmbsAug(model=vectors,
                                 action='delete',
                                 stopwords=stopwords,
                                 aug_p=aug_p)