adversarial-examples icon indicating copy to clipboard operation
adversarial-examples copied to clipboard

How I can extract the adversarial java code?

Open eghannoum opened this issue 1 year ago • 5 comments

Hello,

Thank you for your work!

Sorry for this tedious question, but I am trying to get the adversarial java source code but did not mange to?

eghannoum avatar May 30 '23 19:05 eghannoum

Hi @eghannoum , Thank you for your interest in our work!

Can you please clarify your question? The adversarial java source code is the output of our approach, given a benign source code snippet and a specific model.

Best, Uri

urialon avatar May 30 '23 19:05 urialon

Hi @eghannoum , Thank you for your interest in our work!

Can you please clarify your question? The adversarial Java source code is the output of our approach, given a benign source code snippet and a specific model.

Best, Uri

So basically, I want to generate new adversarial examples using your models. My dataset contains Java source code snippets but I do not know the steps to use the model with my dataset.
I hope you understand my problem.

Thank you

eghannoum avatar May 30 '23 19:05 eghannoum

Did you look at the README here? https://github.com/tech-srl/adversarial-examples/tree/master/code2vec

urialon avatar May 30 '23 19:05 urialon

Did you look at the README here? https://github.com/tech-srl/adversarial-examples/tree/master/code2vec

I have followed the instructions and ran the model on the provided preprocessed dataset,

Where I can find the resulting samples?

image

eghannoum avatar May 30 '23 20:05 eghannoum

In the file log.txt.

The code that writes to this file is at: https://github.com/tech-srl/adversarial-examples/blob/master/code2vec/model.py#L425-L605 So if you want to log additional information, you can change the code there.

I hope it helps. Best, Uri

urialon avatar May 30 '23 20:05 urialon