File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 9
9
from pythainlp .phayathaibert .core import ThaiTextProcessor
10
10
11
11
12
- _model_name = "clicknext/phayathaibert"
12
+ _MODEL_NAME = "clicknext/phayathaibert"
13
13
14
14
15
15
class ThaiTextAugmenter :
16
16
def __init__ (self ,) -> None :
17
17
from transformers import (AutoTokenizer ,
18
18
AutoModelForMaskedLM ,
19
19
pipeline ,)
20
- self .tokenizer = AutoTokenizer .from_pretrained (_model_name )
21
- self .model_for_masked_lm = AutoModelForMaskedLM .from_pretrained (_model_name )
20
+ self .tokenizer = AutoTokenizer .from_pretrained (_MODEL_NAME )
21
+ self .model_for_masked_lm = AutoModelForMaskedLM .from_pretrained (_MODEL_NAME )
22
22
self .model = pipeline ("fill-mask" , tokenizer = self .tokenizer , model = self .model_for_masked_lm )
23
23
self .processor = ThaiTextProcessor ()
24
24
@@ -88,7 +88,7 @@ def augment(self,
88
88
augment_list .append (processed_text )
89
89
90
90
return augment_list
91
-
91
+
92
92
raise ValueError (
93
93
f"augmentation of more than { num_augs } is exceeded the default limit: { MAX_NUM_AUGS } "
94
94
)
You can’t perform that action at this time.
0 commit comments