Traceback (most recent call last):
File "bert_discriminator.py", line 474, in <module>
main()
File "bert_discriminator.py", line 290, in main
vocab_list)
File "C:\Users\janma\Documents\bert-defender\bert_utils.py", line 502, in convert_examples_to_features_flaw
label, tok_flaw = random_attack(tok, embeddings, emb_index, words) #embeddings
File "C:\Users\janma\Documents\bert-defender\bert_utils.py", line 786, in random_attack
tok_flaw = attack_word(tok, p, emb_dict, vocab_list)
File "C:\Users\janma\Documents\bert-defender\bert_utils.py", line 770, in attack_word
most_similar_word_id = query_most_similar_word_id_from_embedding(p, tok_emb, 20)
UnboundLocalError: local variable 'tok_emb' referenced before assignment
I used crawl-300d-2M.vec as my embedding dictionary and your provided sst-2 dataset as training data.
I think in the attack_word method, some code is missing, as the case of a not found embedding does not seem to be handled correctly.
Hi I have tried training the discriminator with the following command:
and i get the following error message:
I used crawl-300d-2M.vec as my embedding dictionary and your provided sst-2 dataset as training data.
I think in the attack_word method, some code is missing, as the case of a not found embedding does not seem to be handled correctly.
Yours sincerely, Jan Mackensen