materialsintelligence / mat2vec

Supplementary Materials for Tshitoyan et al. "Unsupervised word embeddings capture latent knowledge from materials science literature", Nature (2019).
MIT License
616 stars 180 forks source link

TypeError: __init__() got an unexpected keyword argument 'common_terms' #25

Closed TasnimGh closed 3 years ago

TasnimGh commented 3 years ago

Hi, I tried to train a model and I got this error:

Traceback (most recent call last): File "C:\Users\T\desktop\backup\mat2vec-master\mat2vec\training\phrase2vec.py", line 164, in sentences, phraser = wordgrams(processed_sentences, File "C:\Users\T\desktop\backup\mat2vec-master\mat2vec\training\phrase2vec.py", line 43, in wordgrams phrases = Phrases( TypeError: init() got an unexpected keyword argument 'common_terms'

booleank commented 3 years ago

I have the same issue. Did you end up fixing it?

TasnimGh commented 3 years ago

Yes, you need to have gensim version= 3.7 or 3.8.

booleank commented 3 years ago

How did you go about changing the version. Mine is on 4.0.1.

TasnimGh commented 3 years ago

conda install gensim==3.8

hasan-sayeed commented 3 years ago

I tried gensim 3.7.3 and 3.8 but still having this problem.

@TasnimGh did you solve this? err

TasnimGh commented 3 years ago

I think you need to use python 3.6.

Sent from Yahoo Mail for iPhone

On Wednesday, August 4, 2021, 2:52 AM, Hasan Muhammad Sayeed @.***> wrote:

I tried gensim 3.7.3 and 3.8 but still having this problem.

@TasnimGh could you solve this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

hasan-sayeed commented 3 years ago

Tried downgrading python to 3.6.13 and still having this problem. Also tried to install the whole thing again using python 3.6 but then got an error- ERROR: No matching distribution found for numpy>=1.20.1. Numpy 1.20.1 seems to have dropped support for python 3.6. It requires =>3.7 now. Can anyone suggest what should I do? Thanks.

jdagdelen commented 3 years ago

Try using python 3.8. I think the issue with DAWG that caused us to require python 3.6 has been resolved.

hasan-sayeed commented 3 years ago

Just tried. The same thing happened.

Edit: Forgot to install gensim 3.8. Tried it, and the problem is solved! Thank you guys!

JJery-web commented 1 year ago

Yes, you need to have gensim version= 3.7 or 3.8.

pip install gensim==3.7 helps me