Closed eyuansu62 closed 4 years ago
I got the error: Traceback (most recent call last): File "/home/q/Downloads/otalign/scripts/main_gw_bli.py", line 402, in main() File "/home/q/Downloads/otalign/scripts/main_gw_bli.py", line 355, in main acc_dict['coupling'] = BLI.test_accuracy(verbose=True, score_type = 'coupling') File "/home/q/Downloads/otalign/src/bilind.py", line 175, in test_accuracy accs = self.score_translations(self.test_dict, verbose = verbose > 1) File "/home/q/Downloads/otalign/src/bilind.py", line 380, in score_translations seeds = [self.src_words[s] for s,t in gold_dict.items() if s < len(self.src_words)] AttributeError: 'NoneType' object has no attribute 'items' It seems like you set the test_dict is NONE in blind.py and do not assign any value to it.
have you solved it?I got the same error
Hi, what task are you running this on? Did you provide test dictionaries? The test_dict is passed to gromov_bilind during construction as src2trg
, so if it's None it probably means that it wasn't found when loading the data.
Hi, what task are you running this on? Did you provide test dictionaries? The test_dict is passed to gromov_bilind during construction as
src2trg
, so if it's None it probably means that it wasn't found when loading the data.
Sorry I am completely new to thie field.How to pass the test_dict to gromov_bilind during construction as src2trg
???
You need to make a folder crosslingual/dictionaries/
inside the MUSE folder. Then cd to dictionaries folder and wget the cross lingual embedding for train
split from: https://github.com/facebookresearch/MUSE#ground-truth-bilingual-dictionaries. For example: for english to spanish, you can do wget https://dl.fbaipublicfiles.com/arrival/dictionaries/en-es.0-5000.txt
. Things should now run well.
Also if you face some errors later, you might need to downgrade your pot library: pip install pot==0.5.1
I got the error: Traceback (most recent call last): File "/home/q/Downloads/otalign/scripts/main_gw_bli.py", line 402, in
main()
File "/home/q/Downloads/otalign/scripts/main_gw_bli.py", line 355, in main
acc_dict['coupling'] = BLI.test_accuracy(verbose=True, score_type = 'coupling')
File "/home/q/Downloads/otalign/src/bilind.py", line 175, in test_accuracy
accs = self.score_translations(self.test_dict, verbose = verbose > 1)
File "/home/q/Downloads/otalign/src/bilind.py", line 380, in score_translations
seeds = [self.src_words[s] for s,t in gold_dict.items() if s < len(self.src_words)]
AttributeError: 'NoneType' object has no attribute 'items'
It seems like you set the test_dict is NONE in blind.py and do not assign any value to it.