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

Question about the outputs #16

Closed Wushengyao closed 4 years ago

Wushengyao commented 4 years ago

I have successfully installed the mat2vec in the conda environment (python=3.6) and tried to reproduce your work. However, when I followed the directions under Processing and Pretrained Embeddings, no output appeared (and no error message).

For example, I run test.txt in the root folder of this repository, after serveral seconds running, no outputs (like pic1.jpg).

test.txt pic1

I am an freshman in machine learning, hoping to get your guidance. Thank you!

jdagdelen commented 4 years ago

Hi! Could you please include what is in test.txt? Without knowing what is in there we cannot offer guidance. Also, as a side note, you might want to change the file's extension to ".py" (e.g. "test.py") to be consistent with the naming conventions for python files.

Wushengyao commented 4 years ago

In test.txt:

from gensim.models import Word2Vec w2v_model = Word2Vec.load("mat2vec/training/models/pretrained_embeddings") w2v_model.wv.most_similar("thermoelectric")

And I have tried the .py extension, the result was the same.

jdagdelen commented 4 years ago

Try adding a print statement around the last line or running those lines in an interactive python shell. Although it will print the result in interactive mode, python won't write anything to the terminal when it evaluates a statement like w2v_model.wv.most_similar("thermoelectric") in a script.

Wushengyao commented 4 years ago

I get it. Thank you very much!

jdagdelen commented 4 years ago

You're welcome. :)