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

neural tensor network data #11

Open
shuxiaobo opened this issue Apr 13, 2018 · 2 comments
Open

neural tensor network data #11

shuxiaobo opened this issue Apr 13, 2018 · 2 comments

Comments

@shuxiaobo
Copy link

Hi , Thank for your code, I learned a lot from them, especially NTN, now I wana do some new model and eval on new data set, but I don't know how to generate the embedding mat in the experience of neural tensor network, could you please tell me how to do it? thanks

@GauravBh1010tt
Copy link
Owner

@shuxiaobo - You may find Convolution neural tensor network as useful. Here, we are passing question-answer vector embeddings to the NTN model that can compute a similarity score for us.
Also, try out DL-text for quick preprocessing and preparing of embeddings.

@shuxiaobo
Copy link
Author

shuxiaobo commented Apr 14, 2018

I still not find the detail implement, could you tell me what's means of the value in mat_contents described below? 'Word', 'We', and the 'tree', thanks.

\input: Generic function to load embeddings from a .mat file
def load_embeds(file_path):
mat_contents = sio.loadmat(file_path)
words = mat_contents['words']
we = mat_contents['We']
tree = mat_contents['tree']
word_vecs = [[we[j][i] for j in range(embedding_size)] for i in range(len(words[0]))]
entity_words = [map(int, tree[i][0][0][0][0][0]) for i in range(len(tree))]
return (word_vecs, entity_words)

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