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

config doesn't have any attribute called WORD_EMBEDDING_DIM or MAX_NB_WORDS #2

Open
hadifar opened this issue Oct 24, 2017 · 0 comments

Comments

@hadifar
Copy link

hadifar commented Oct 24, 2017

When use decomposable_attention for training model it throws exception because there is no attribute in config called WORD_EMBEDDING_DIM. I think you should change this to following:

nb_words = min(TrainConfig.MAX_NB_WORDS, len(word_index)) + 1
    embedding_matrix = np.zeros((nb_words, TrainConfig.WORD_EMBEDDING_DIM))
    for word, i in word_index.items():
        if word in word2vec.vocab:
            embedding_matrix[i] = word2vec.word_vec(word)
    print('Null word embeddings: %d' % np.sum(np.sum(embedding_matrix, axis=1) == 0))
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

1 participant