editor.synonyms works very well in general, but I get IndexError: list index out of range when trying on the following pair:
syn_list = editor.synonyms('Is it resetting?', 'resetting')
The code to reproduce the issue is:
from checklist.editor import Editor
editor = Editor()
syn_list = editor.synonyms('Is it resetting?', 'resetting')
The bug happens with the latest version of checklist and pytorch.
Here is the complete error message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/cristian/anaconda3/envs/test/lib/python3.7/site-packages/checklist/editor.py", line 394, in synonyms
return self._wordnet_stuff(templates, word, 'synonyms', threshold=threshold, **kwargs)
File "/home/cristian/anaconda3/envs/test/lib/python3.7/site-packages/checklist/editor.py", line 354, in _wordnet_stuff
return [x[0][0] for x in fn(texts, word, threshold=threshold, pos=pos, depth=depth)]
File "/home/cristian/anaconda3/envs/test/lib/python3.7/site-packages/checklist/text_generation.py", line 262, in synonyms
return self.filter_options(texts, word, options, threshold)
File "/home/cristian/anaconda3/envs/test/lib/python3.7/site-packages/checklist/text_generation.py", line 280, in filter_options
score = [x for x in ret if np.all([y in [word, self.tokenizer.unk_token] for y in x[0]])][0][-1]
IndexError: list index out of range
Hi,
editor.synonyms
works very well in general, but I getIndexError: list index out of range
when trying on the following pair:syn_list = editor.synonyms('Is it resetting?', 'resetting')
The code to reproduce the issue is:
The bug happens with the latest version of checklist and pytorch.
Here is the complete error message:
Thank you in advance for looking into this.