@@ -29,23 +29,23 @@ class RandomCharAug(CharAugmenter):
29
29
:param int aug_word_max: Maximum number of word will be augmented. If None is passed, number of augmentation is
30
30
calculated via aup_word_p. If calculated result from aug_word_p is smaller than aug_word_max, will use calculated result
31
31
from aug_word_p. Otherwise, using aug_max.
32
- :param bool include_upper_case: If True, upper case character may be included in augmented data. If `candidiates '
32
+ :param bool include_upper_case: If True, upper case character may be included in augmented data. If `candidates '
33
33
value is provided, this param will be ignored.
34
- :param bool include_lower_case: If True, lower case character may be included in augmented data. If `candidiates '
34
+ :param bool include_lower_case: If True, lower case character may be included in augmented data. If `candidates '
35
35
value is provided, this param will be ignored.
36
- :param bool include_numeric: If True, numeric character may be included in augmented data. If `candidiates '
36
+ :param bool include_numeric: If True, numeric character may be included in augmented data. If `candidates '
37
37
value is provided, this param will be ignored.
38
38
:param int min_char: If word less than this value, do not draw word for augmentation
39
39
:param swap_mode: When action is 'swap', you may pass 'adjacent', 'middle' or 'random'. 'adjacent' means swap action
40
40
only consider adjacent character (within same word). 'middle' means swap action consider adjacent character but
41
41
not the first and last character of word. 'random' means swap action will be executed without constraint.
42
- :param str spec_char: Special character may be included in augmented data. If `candidiates '
42
+ :param str spec_char: Special character may be included in augmented data. If `candidates '
43
43
value is provided, this param will be ignored.
44
44
:param list stopwords: List of words which will be skipped from augment operation.
45
45
:param str stopwords_regex: Regular expression for matching words which will be skipped from augment operation.
46
46
:param func tokenizer: Customize tokenization process
47
47
:param func reverse_tokenizer: Customize reverse of tokenization process
48
- :param List candidiates : List of string for augmentation. E.g. ['AAA', '11', '===']. If values is provided,
48
+ :param List candidates : List of string for augmentation. E.g. ['AAA', '11', '===']. If values is provided,
49
49
`include_upper_case`, `include_lower_case`, `include_numeric` and `spec_char` will be ignored.
50
50
:param str name: Name of this augmenter.
51
51
@@ -56,7 +56,7 @@ class RandomCharAug(CharAugmenter):
56
56
def __init__ (self , action = Action .SUBSTITUTE , name = 'RandomChar_Aug' , aug_char_min = 1 , aug_char_max = 10 , aug_char_p = 0.3 ,
57
57
aug_word_p = 0.3 , aug_word_min = 1 , aug_word_max = 10 , include_upper_case = True , include_lower_case = True ,
58
58
include_numeric = True , min_char = 4 , swap_mode = 'adjacent' , spec_char = '!@#$%^&*()_+' , stopwords = None ,
59
- tokenizer = None , reverse_tokenizer = None , verbose = 0 , stopwords_regex = None , candidiates = None ):
59
+ tokenizer = None , reverse_tokenizer = None , verbose = 0 , stopwords_regex = None , candidates = None ):
60
60
super ().__init__ (
61
61
action = action , name = name , min_char = min_char , aug_char_min = aug_char_min , aug_char_max = aug_char_max ,
62
62
aug_char_p = aug_char_p , aug_word_min = aug_word_min , aug_word_max = aug_word_max , aug_word_p = aug_word_p ,
@@ -68,7 +68,7 @@ def __init__(self, action=Action.SUBSTITUTE, name='RandomChar_Aug', aug_char_min
68
68
self .include_numeric = include_numeric
69
69
self .swap_mode = swap_mode
70
70
self .spec_char = spec_char
71
- self .candidiates = candidiates
71
+ self .candidates = candidates
72
72
73
73
self .model = self .get_model ()
74
74
@@ -248,8 +248,8 @@ def delete(self, data):
248
248
return self .reverse_tokenizer (doc .get_augmented_tokens ())
249
249
250
250
def get_model (self ):
251
- if self .candidiates :
252
- return self .candidiates
251
+ if self .candidates :
252
+ return self .candidates
253
253
254
254
candidates = []
255
255
if self .include_upper_case :
0 commit comments