textattack.transformations.word_swaps.chn_transformations package
chinese_transformations package
Submodules
Word Swap by chinese homophone
- class textattack.transformations.word_swaps.chn_transformations.chinese_homophone_character_swap.ChineseHomophoneCharacterSwap[source]
Bases:
WordSwapTransforms an input by replacing its words with synonyms provided by a homophone dictionary.
Word Swap by chinese morphonym
- class textattack.transformations.word_swaps.chn_transformations.chinese_morphonym_character_swap.ChineseMorphonymCharacterSwap(**kwargs)[source]
Bases:
WordSwapTransforms an input by replacing its words with synonyms provided by a morphonym dictionary.
Word Swap by chinese hownet
- class textattack.transformations.word_swaps.chn_transformations.chinese_word_swap_hownet.ChineseWordSwapHowNet(topk=5)[source]
Bases:
WordSwapTransforms an input by replacing its words with synonyms provided by OpenHownet http://nlp.csai.tsinghua.edu.cn/.