While running the code for imdb, I get the following error:
Generate perturbation set
Traceback (most recent call last):
File "data_process.py", line 375, in <module>
main()
File "data_process.py", line 372, in main get_perturbation_set(dataset, data_path, similarity_threshold = similarity_threshold, perturbation_constraint = perturbation_constraint) File "data_process.py", line 279, in get_perturbation_set tem_embd_matrix[_, :] = vocab[tem_key_list[_]]['vec']
File "env_safer/lib/python3.6/site-packages/networkx/classes/reportviews.py", line 187, in __getitem__
return self._nodes[n]
File "env_safer/lib/python3.6/site-packages/networkx/classes/coreviews.py", line 284, in __getitem__
raise KeyError(f"Key {key} not found")
KeyError: 'Key 0 not found'
Can you help me fix the error?
I am also trying to run your code on other datasets like stanford sentiment dataset sst-2 and MNLI. It seems the codebase requires some files like *_vocab.pkl and _vocab_pca.pkl etc. Can you please let me know how to generate these files? Or, In general how to run the code on a new dataset?
Hi, i faced this problem, too . Luckily, i found the bug. the type of the tem_key_list is not list. it couldn't to traversal. you should make it to be a list.
Hi @lushleaf ,
Thank you for releasing the code.
imdb
, I get the following error:Can you help me fix the error?
sst-2
andMNLI
. It seems the codebase requires some files like*_vocab.pkl
and_vocab_pca.pkl
etc. Can you please let me know how to generate these files? Or, In general how to run the code on a new dataset?Thank you,