()
| 150 | |
| 151 | |
| 152 | def test_chinese_word_swap_masked(): |
| 153 | from textattack.augmentation import Augmenter |
| 154 | from textattack.transformations.word_swaps.chn_transformations import ( |
| 155 | ChineseWordSwapMaskedLM, |
| 156 | ) |
| 157 | |
| 158 | augmenter = Augmenter( |
| 159 | transformation=ChineseWordSwapMaskedLM(), |
| 160 | pct_words_to_swap=0.1, |
| 161 | transformations_per_example=5, |
| 162 | ) |
| 163 | s = "自然语言处理。" |
| 164 | augmented_text_list = augmenter.augment(s) |
| 165 | augmented_s = "自然语言文字。" |
| 166 | assert augmented_s or s in augmented_text_list |
nothing calls this directly
no test coverage detected