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

Encode the relation and entity ? #22

Closed
ProQianXiao opened this issue Feb 15, 2019 · 4 comments
Closed

Encode the relation and entity ? #22

ProQianXiao opened this issue Feb 15, 2019 · 4 comments

Comments

@ProQianXiao
Copy link

Hello, I read your paper and codes and there is a confusion.

About encoding relation and entity, here is my understanding.
You don't encode them as vectors, instead using embedding matrices r and e and looking up in the embedding matrices according to their ids. And tf.nn.embedding_lookup() function could train the parameters in the embedding matrices.

Is that right?

@shehzaadzd
Copy link
Owner

I'm not sure I understand your question. How is this different from encoding e and r as vectors?

@ProQianXiao
Copy link
Author

Sorry, maybe I didn't describe my question clearly. My understangding is that (taking encoding relation as an example): you initialize a relation matrice r randomly like this:
default
and when you encode relation (such as "LocatedIn" in the country dataset), you will find the corresponding id in the "relation_vocab.json" file, assume its id is 2. Then using tf.nn.embedding_lookup(r,2) will get the third line in the matrice, and that is the encode of the relation "LocatedIn".

I said that "You don't encode them as vectors" means that you didn't encode them using NLP, without considering their semantic information.

Is that right?

@shehzaadzd
Copy link
Owner

If by NLP you mean we didn't use sentences "Boston is located in the US" to encode the vector for LocatedIn, then you're correct. We created relation embeddings from random and trained the embedding parameters using the RL objective. I hope that helps! :)

@ProQianXiao
Copy link
Author

Thanks very much, that helps.

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