makcedward / nlpaug

Data augmentation for NLP
https://makcedward.github.io/
MIT License
4.41k stars 460 forks source link

Error in using Glove embeddings - load_word2vec_format() got an unexpected keyword argument 'no_header' #269

Open santwanac opened 2 years ago

santwanac commented 2 years ago

I am trying to use a word embeddings based augmenter using the following code:

aug = naw.WordEmbsAug(model_type='glove',model_path='/content/glove.6B.50d.txt', action='substitute')

I loaded the glove embeddings into the Google colab working directory using the download util provided.

I keep getting the following error.

TypeError: load_word2vec_format() got an unexpected keyword argument 'no_header'

isilberfin commented 2 years ago

Hi there ! I am having the same issue could you fixed it ?

makcedward commented 2 years ago

which nlpaug version and gensim version are you using? I am using gensim 4.1.2

cloudy3 commented 1 year ago

@santwanac @isilberfin hey guys I had the same issue too and solved it by installing gensim. Just add the following code: !pip install --upgrade gensim to your notebooks. Hope that helps!