Git Product home page Git Product logo

adversarial-sample-generation's Introduction

Natural Language Adversarial Sample Generation

Model Architecture

  • Overall Model Architecture : cVAE + GAN 模型架构

  • Generator : we implemented two generators respectively with LSTM and GRU (folders: LSTM_VAE and GRU_VAE). 生成器

Model Results

current results are not ideal enough but you can distinguish positive results from negative ones as below.

  • positive:

    • i movie is a of the best films ever ever seen it i the was it to lot of watch a the i was and seen it lot of the the the movie was the movie of not a lot of the and own is i to be a and and the it thing movie is a the the i was enjoyed to see it and have not i to the the movie the i and lot times ago to i a and movie is the i a that the the
  • negative:

    • i this is a of the worst movies ever ever seen the i was it seen favorite was have a disappointed and of the and the minutes of i be the the and was a funny and and existent have the and the not are the and are know the the as the and the of the and and the and the the and are have the of and of the of the the is the that and and br

Data and Pre-training

  • We use the dataset IMDB(25,000 movies reviews, positive comments and negative comments account for half of each).
  • We have trained a textCNN model as the target model, the accuracy of which reaches 98.4%.

Training and evaluation

  • Train
    • Run the file train_with_LSTM.py(recommended because we have trained once) or train_with_GRU.py to train the model with a LSTM/GRU generator.
  • Evaluation
    • Run the file evaluation.py to evaluate the model from three aspects: generation speed, text quality and attack success rate.

Reference

Authors

  • Fang Chen
  • Sang Yuchen

License

  • For academic and non-commercial use only.

adversarial-sample-generation's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.