TextAttack icon indicating copy to clipboard operation
TextAttack copied to clipboard

Implement custom tokenizer trouble

Open zhy605420954 opened this issue 2 years ago • 1 comments

Hi I want to implement use textattack to attack my lstm model for detect vulnerability in python code. So I need to use custom tokenizer to tokenize python source code.Could you please tell me how to implement a custom tokenizer? Really thank you!

zhy605420954 avatar Mar 29 '23 01:03 zhy605420954

Hi! Textattack relies on an abstraction we call model wrappers which take text and output the model predictions. So you need to write a custom model wrapper that calls your custom tokenizer. It should look very similar to the existing model wrappers.

jxmorris12 avatar May 10 '23 20:05 jxmorris12