Giter Club home page Giter Club logo

nlp_adversarial_attack's Introduction

NLP Adversarial Attack

Course Project for COMS 6998-10: Robustness and Security in ML Systems, Spring 2020 at Columbia University.

Group members:

  • Weifan Jiang (wj2301)
  • Haoxuan Wu (hw2754)

Dependencies

Please install dependencies including stanford NLP with English models, keras-preprocessing, google cloud translation API (may need to set up an account and provide credit card information), and tensorflow version 1 (our project is incompatible with version 2 or greater), etc.

Other dependencies can be downloaded following prompt.

Input data

Please download this zip file from google drive (Columbia account required), and unzip it in the root of repository.

Usage

Our implementation of the Sentence-level genetic algorithm with salency analysis, along with other helper functions is in sentence_level_genetic_attack.py. Please change the envrionmental variables in the script accordingly (dataset name, google cloud API credentials, etc.).

A demostration on how to use our attack is in sentence_level_genetic_attack_demo.ipynb. The example model used is a WordCNN trained with imdb dataset. sentence_level_genetic_attack_demo.pdf is the result of the notebook exported to pdf.

Document

  • presentation slides

  • Report for project at: report/Sentence_Level_Adversarial_Attack_on_Natural_Language_Processing_Models.pdf

Credit

The pretrained models and preprocessing of input data are from Alzantot Et Al.. Our forked version of their original repo is here.

nlp_adversarial_attack's People

Contributors

weifanjiang avatar whx1508 avatar

Watchers

 avatar  avatar  avatar

nlp_adversarial_attack's Issues

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.