Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于generate_emb #12

Open
zwlily opened this issue Nov 5, 2018 · 2 comments
Open

关于generate_emb #12

zwlily opened this issue Nov 5, 2018 · 2 comments

Comments

@zwlily
Copy link

zwlily commented Nov 5, 2018

id_list = [ [ wordtoidx[i] for i in l] for l in name_list]
value_list = [ [ opt.W_emb[i] for i in l] for l in id_list]

@zwlily
Copy link
Author

zwlily commented Nov 5, 2018

您好:
对于generate_emb文件中的代码有个问题,非常希望得到您的回复!
id_list = [ [ wordtoidx[i] for i in l] for l in name_list]这里面应该是wordtoix吧,好像多了个d
value_list = [ [ opt.W_emb[i] for i in l] for l in id_list]这个里面的opt.W_emb是什么呢?

@greeness
Copy link

greeness commented May 3, 2019

I guess you are right, the variable should be wordtoix which is defined above.

Regarding opt.W_emb:

See https://github.com/guoyinwang/LEAM/blob/master/main.py#L162, it should be the word embedding matrix pre-trained with GloVe or word2vec. Here it is loaded into a numpy array so that it could be passed to tf.variable as the initializer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants