recommenders-team / recommenders

Best Practices on Recommendation Systems
https://recommenders-team.github.io/recommenders/intro.html
MIT License
19.12k stars 3.1k forks source link

How to generate context embedding for DKN?[ASK] #1246

Open ConnollyLeon opened 3 years ago

ConnollyLeon commented 3 years ago

Description

I notice that context embedding is not used in the dkn_deep_dive.ipynb. But as DKN article describes, context embedding can improve the quality of the model. I wonder how we can generate a context embedding for DKN using MIND dataset?

Other Comments

danyang-liu commented 3 years ago

the context embedding is the average pooling of its neighbor entities in the knowledge graph. here is the link of the knowledge graph: https://mind201910.blob.core.windows.net/knowledge-graph/wikidata-graph.zip

ConnollyLeon commented 3 years ago

@danyang-liu Thanks for your replying, I am now trying to use wikidata-graph.tsv to find all relations connected to a specified node. With all the relations I found, I think I could make good use of the relation_embedding.vec in MIND dataset. I will try to do an average pooling on the relations as my context embedding first. This is based on the idea of TranE.

FanFanFanYang commented 3 years ago

the context embedding is the average pooling of its neighbor entities in the knowledge graph. here is the link of the knowledge graph: https://mind201910.blob.core.windows.net/knowledge-graph/wikidata-graph.zip

Looks like the data is not the latest? The creation time is in 2019. I'm wondering how we can build the latest graph data. Maybe leverage this script? https://github.com/microsoft/recommenders/blob/master/examples/01_prepare_data/wikidata_knowledge_graph.ipynb

danyang-liu commented 3 years ago

the context embedding is the average pooling of its neighbor entities in the knowledge graph. here is the link of the knowledge graph: https://mind201910.blob.core.windows.net/knowledge-graph/wikidata-graph.zip

Looks like the data is not the latest? The creation time is in 2019. I'm wondering how we can build the latest graph data. Maybe leverage this script? https://github.com/microsoft/recommenders/blob/master/examples/01_prepare_data/wikidata_knowledge_graph.ipynb

yes, we did it last year, if you want the latest graph, you can go to the wikidata official website and download the latest graph.

FanFanFanYang commented 3 years ago

@danyang-liu Thanks a lot. Btw, do we have the whole entity_embedding.vec data? I find that in DKN examples, we only have about 40k embedding data in https://mind201910small.blob.core.windows.net/release/MINDlarge_train.zip. But in the paper, it says we have more than 300k entities.