https://openreview.net/forum?id=pgU3k7QXuz0
conda create -n snn python=3.7
conda activate snn
pip install -r requirements.txt
pip install -r textattack_r.txt
cd data_preprocess
python tensor_encoder.py
python chinese_tensor_encoder.py
python main.py \
--mode train
--model_mode ann
--model_type textcnn
python main.py \
--mode conversion
--model_mode snn
--model_type textcnn
--conversion_mode normalize
--conversion_normalize_type model_base or data_base
python main.py \
--mode conversion
--model_mode snn
--model_type textcnn
--conversion_mode tune
cd data_preprocess
python sent2id.py
cd data_preprocess
python snn_wopretrain_tensor_encoder.py
- Please prepare dateset files and pre-trained word embedding in yourself.
- Shell commands above only show how to run the program in different modes. Detailed hyper-parameters can be set as you want.
- Set parameter random_tensor to True when doing conversion + Normalization or fine-tune if you use random initial embedding.
- Some large files are uploaded here: link: https://pan.baidu.com/s/19l81POzDUj4mBAmncCGkiA, code: cehb