Bert attack using textattack and getting ValueError(f"Failed to import file {args.dataset_from_file}")

42 Views Asked by At

I want to produce adversarial samples using textattack on my pre-trained model and dataset. So i run this command:

textattack attack --model-from-file model --dataset-from-file data/data.csv --attack-recipe bert-attack --log-to-txt data/output.txt

However, I get this error

raise ValueError(f"Failed to import file {args.dataset_from_file}")
ValueError: Failed to import file data/data.csv`

I thought it might be file path so I used the absolute path but still the same error. My model file contains both model and tokenizer. I also check my csv content and I don't think there is any issue.

My csv content:

text
"my wife and i stayed at the affinia chicago last week in a studio suite which was not worth the extra payment it was an absolute nightmare to begin with the room is listed as 'oversized' when it's nothing of the sort we've previously stayed in the hotel and the regular guest room is only about 2 square feet smaller i believe the only extra space was in the closet which isn't very useful unless you plan on living there we had our two sons with us so we had to make extra sleeping space our oldest son slept on the couch and woke up multiple times in the time complaining of bugs moving around he must have been umcomfortable also as i sat on the couch during the day and it was like a rock the room service is horrible they took 47 minutes to deliver a pillow for my wife around 10pm and she had to wait up for that my family would never go back to this hotel and i highly recommend you also stay well away
"
"affinia chicago is one of the worst hotels i have ever stayed at not in my life have i been treated so poorly as a guest the front desk was very unaccommodating when i asked for a smoke free room when they had made an error in my reservation there was no bellhop available for some strange reason so i had to move all my luggage to the elevator and down a long hallway to my room by myself if it wasn't already a bad stay i ordered room service and it took over an hour and a half to be delivered if they didn't have air conditioning in the room i would say just about everything about this stay was completely miserable if you are traveling to chicago for any kind of business i hope you decide not to choose this hotel i was quite surprised i like chicago as a city but this stay definitely made my trip quite a negative experience

So I was expecting to get adversarial output after I run the command but I am facing the error.

0

There are 0 best solutions below