textaugment
textaugment copied to clipboard
Possibly conflict with gensim 4.0.1
This error yield out when I usse textaugment with gensim 4 but not gensim 3
File "aug.py", line 15, in <module>
data_df['paraphrased_text'] = data_df['text'].progress_apply(lambda x: w2v.augment(x))
File "/home/anhvd/.local/lib/python3.7/site-packages/tqdm/std.py", line 770, in inner
return getattr(df, df_function)(wrapper, **kwargs)
File "/home/anhvd/miniconda3/envs/textaug/lib/python3.7/site-packages/pandas/core/series.py", line 4138, in apply
mapped = lib.map_infer(values, f, convert=convert_dtype)
File "pandas/_libs/lib.pyx", line 2467, in pandas._libs.lib.map_infer
File "/home/anhvd/.local/lib/python3.7/site-packages/tqdm/std.py", line 765, in wrapper
return func(*args, **kwargs)
File "aug.py", line 15, in <lambda>
data_df['paraphrased_text'] = data_df['text'].progress_apply(lambda x: w2v.augment(x))
File "/home/anhvd/miniconda3/envs/textaug/lib/python3.7/site-packages/textaugment/word2vec.py", line 146, in augment
similar_words_and_weights = [(syn, t) for syn, t in self.model.wv.most_similar(w[1])]
AttributeError: 'KeyedVectors' object has no attribute 'wv
Thank you @dinhanhx , @JosephSefara can you take a look.
I suggest that you should write some code to handle gensim 4 and gensim 3 therefore, when users install they don't need to worry about gensim version. Moreover, gensim 3 is more common than gensim 4 as of writing.
This will be fixed in the major release
@dinhanhx Fixed.