All Projects → nesl → Nlp_adversarial_examples

nesl / Nlp_adversarial_examples

Licence: mit
Implementation code for the paper "Generating Natural Language Adversarial Examples"

Projects that are alternatives of or similar to Nlp adversarial examples

Practicaldl
A Practical Guide to Deep Learning with TensorFlow 2.0 and Keras materials for Frontend Masters course
Stars: ✭ 149 (+0%)
Mutual labels:  jupyter-notebook
Deeplab v2
基于v2版本的deeplab,使用VGG16模型,在VOC2012,Pascal-context,NYU-v2等多个数据集上进行训练
Stars: ✭ 149 (+0%)
Mutual labels:  jupyter-notebook
Transformers Ru
A list of pretrained Transformer models for the Russian language.
Stars: ✭ 150 (+0.67%)
Mutual labels:  jupyter-notebook
Predicting Stock Prices With Linear Regression
Stars: ✭ 149 (+0%)
Mutual labels:  jupyter-notebook
Machine Learning
python,机器学习笔记,machine learning,nlp
Stars: ✭ 149 (+0%)
Mutual labels:  jupyter-notebook
Carnd Mercedes Sf Utilities
Tools for Sensor Fusion processing.
Stars: ✭ 149 (+0%)
Mutual labels:  jupyter-notebook
Covid 19 Eda Tutorial
This tutorial's purpose is to introduce people to the [2019 Novel Coronavirus COVID-19 (2019-nCoV) Data Repository by Johns Hopkins CSSE](https://github.com/CSSEGISandData/COVID-19) and how to explore it using some foundational packages in the Scientific Python Data Science stack.
Stars: ✭ 149 (+0%)
Mutual labels:  jupyter-notebook
Slayerpytorch
PyTorch implementation of SLAYER for training Spiking Neural Networks
Stars: ✭ 150 (+0.67%)
Mutual labels:  jupyter-notebook
Pytorch Tutorials Kr
🇰🇷PyTorch에서 제공하는 튜토리얼의 한국어 번역을 위한 저장소입니다. (Translate PyTorch tutorials in Korean🇰🇷)
Stars: ✭ 148 (-0.67%)
Mutual labels:  jupyter-notebook
Testovoe
Home assignments for data science positions
Stars: ✭ 149 (+0%)
Mutual labels:  jupyter-notebook
Project kojak
Training a Neural Network to Detect Gestures and Control Smart Home Devices with OpenCV in Python
Stars: ✭ 147 (-1.34%)
Mutual labels:  jupyter-notebook
Forecasting
Time Series Forecasting Best Practices & Examples
Stars: ✭ 2,123 (+1324.83%)
Mutual labels:  jupyter-notebook
Pyomogallery
A collection of Pyomo examples
Stars: ✭ 149 (+0%)
Mutual labels:  jupyter-notebook
Machinehack
Stars: ✭ 149 (+0%)
Mutual labels:  jupyter-notebook
Time Series Forecasting Of Amazon Stock Prices Using Neural Networks Lstm And Gan
Project analyzes Amazon Stock data using Python. Feature Extraction is performed and ARIMA and Fourier series models are made. LSTM is used with multiple features to predict stock prices and then sentimental analysis is performed using news and reddit sentiments. GANs are used to predict stock data too where Amazon data is taken from an API as Generator and CNNs are used as discriminator.
Stars: ✭ 150 (+0.67%)
Mutual labels:  jupyter-notebook
Covid19
Analyses about the COVID-19 virus
Stars: ✭ 149 (+0%)
Mutual labels:  jupyter-notebook
Phonetic Similarity Vectors
Source code to accompany my paper "Poetic sound similarity vectors using phonetic features"
Stars: ✭ 148 (-0.67%)
Mutual labels:  jupyter-notebook
Machinelearning Watermelonbook
周志华-机器学习
Stars: ✭ 150 (+0.67%)
Mutual labels:  jupyter-notebook
Person Reid Tiny Baseline
Open source person re-identification in Pytorch
Stars: ✭ 150 (+0.67%)
Mutual labels:  jupyter-notebook
Www old.julialang.org
Julia Project web site (Old)
Stars: ✭ 149 (+0%)
Mutual labels:  jupyter-notebook
  1. Download the Imdb dataset
./download_dataset.sh
  1. Download the glove vector embeddings (used by the model)
 ./download_glove.sh 
  1. Download the counter-fitted vectors (used by our attack)
./download_counterfitted_vectors.sh 
  1. Build the vocabulary and embeddings matrix.
python build_embeddings.py

That will take like a minute, and it will tokenize the dataset and save it to a pickle file. It will also compute some auxiliary files like the matrix of the vector embeddings for words in our dictionary. All files will be saved under aux_files directory created by this script.

  1. Train the sentiment analysis model.
python train_model.py

6)Download the Google language model.

./download_googlm.sh
  1. Pre-compute the distances between embeddings of different words (required to do the attack) and save the distance matrix.
python compute_dist_mat.py 

  1. Now, we are ready to try some attacks ! You can do so by running the IMDB_AttackDemo.ipynb Jupyter notebook !

Attacking Textual Entailment model

The model we are using for our experiment is the SNLI model of Keras SNLI Model .

First, Download the dataset using

bash download_snli_data.sh

Download the Glove and Counter-fitted Glove embedding vectors

bash ./download_glove.sh
bash ./download_counterfitted_vectors.sh

Train the NLI model

python sni_rnn.py

Pre-compute the embedding matrix

python nli_compute_dist_matrix.py

Now, you are ready to run the attack using example code provided in NLI_AttackDemo.ipynb Jupyter notebook.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].