All Projects â†’ xwhan â†’ Deeppath

xwhan / Deeppath

code and docs for my EMNLP paper "DeepPath: A Reinforcement Learning Method for Knowledge Graph Reasoning"

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Deeppath

Developer Zero To Mastery
📚 To Be Professional Developer From Zero To Mastery, Interactive MindMap, RoadMap(Learning Path/Interview Questions), xCompass, Weekly for Developer, to Learn Everything in ITCS đŸ’Ģ į¨‹åēå‘˜įš„æŠ€æœ¯č§†é‡Žã€įŸĨč¯†įŽĄį†ä¸ŽčŒä¸šč§„划īŧŒæéĢ˜ä¸Ēäēē与å›ĸ队įš„į ”发效čƒŊ
Stars: ✭ 2,892 (+626.63%)
Mutual labels:  knowledge-graph
Smore
SMORe: Modularize Graph Embedding for Recommendation
Stars: ✭ 307 (-22.86%)
Mutual labels:  knowledge-graph
Semanticmediawiki
🔗 Semantic MediaWiki turns MediaWiki into a knowledge management platform with query and export capabilities
Stars: ✭ 359 (-9.8%)
Mutual labels:  knowledge-graph
Go Cyber
Your đŸ”ĩ Superintelligence
Stars: ✭ 270 (-32.16%)
Mutual labels:  knowledge-graph
Graphbrain
Language, Knowledge, Cognition
Stars: ✭ 294 (-26.13%)
Mutual labels:  knowledge-graph
Ccks2019 el
CCKS 2019 中文įŸ­æ–‡æœŦ厞äŊ“铞指比čĩ›æŠ€æœ¯åˆ›æ–°åĨ–č§Ŗå†ŗæ–šæĄˆ
Stars: ✭ 326 (-18.09%)
Mutual labels:  knowledge-graph
Kenlg Reading
Reading list for knowledge-enhanced text generation, with a survey
Stars: ✭ 257 (-35.43%)
Mutual labels:  knowledge-graph
Dynamic Kg
Dynamic (Temporal) Knowledge Graph Completion (Reasoning)
Stars: ✭ 381 (-4.27%)
Mutual labels:  knowledge-graph
Dkn
A tensorflow implementation of DKN (Deep Knowledge-aware Network for News Recommendation)
Stars: ✭ 305 (-23.37%)
Mutual labels:  knowledge-graph
Nlp Projects
word2vec, sentence2vec, machine reading comprehension, dialog system, text classification, pretrained language model (i.e., XLNet, BERT, ELMo, GPT), sequence labeling, information retrieval, information extraction (i.e., entity, relation and event extraction), knowledge graph, text generation, network embedding
Stars: ✭ 360 (-9.55%)
Mutual labels:  knowledge-graph
Dgp
Rethinking Knowledge Graph Propagation for Zero-Shot Learning, in CVPR 2019
Stars: ✭ 277 (-30.4%)
Mutual labels:  knowledge-graph
Knowledge representation pytorch
Several knowledge graph representation algorithms implemented with pytorch
Stars: ✭ 285 (-28.39%)
Mutual labels:  knowledge-graph
Casrel
A Novel Cascade Binary Tagging Framework for Relational Triple Extraction. Accepted by ACL 2020.
Stars: ✭ 329 (-17.34%)
Mutual labels:  knowledge-graph
Entity alignment papers
Must-read papers on entity alignment published in recent years
Stars: ✭ 268 (-32.66%)
Mutual labels:  knowledge-graph
Awesome Search
Awesome Search - this is all about the (e-commerce) search and its awesomeness
Stars: ✭ 361 (-9.3%)
Mutual labels:  knowledge-graph
Kg Bert
KG-BERT: BERT for Knowledge Graph Completion
Stars: ✭ 254 (-36.18%)
Mutual labels:  knowledge-graph
Logseq
A privacy-first, open-source platform for knowledge management and collaboration. Desktop app download link: https://github.com/logseq/logseq/releases, roadmap: https://trello.com/b/8txSM12G/roadmap
Stars: ✭ 8,210 (+1962.81%)
Mutual labels:  knowledge-graph
Athens
Free self-hosted desktop app: https://github.com/athensresearch/athens/releases; Try the demo at https://athensresearch.github.io/athens; Docs viewable at https://athensresearch.github.io/docs/
Stars: ✭ 5,501 (+1282.16%)
Mutual labels:  knowledge-graph
Awesome Knowledge Graph
A curated list of Knowledge Graph related learning materials, databases, tools and other resources
Stars: ✭ 382 (-4.02%)
Mutual labels:  knowledge-graph
Schema Dts
JSON-LD TypeScript types for Schema.org vocabulary
Stars: ✭ 338 (-15.08%)
Mutual labels:  knowledge-graph

Deep Reinforcement Learning for Knowledge Graph Reasoning

We study the problem of learning to reason in large scale knowledge graphs (KGs). More specifically, we describe a novel reinforcement learning framework for learning multi-hop relational paths: we use a policy-based agent with continuous states based on knowledge graph embeddings, which reasons in a KG vector-space by sampling the most promising relation to extend its path. In contrast to prior work, our approach includes a reward function that takes the accuravy, diversity, and efficiency into consideration. Experimentally, we show that our proposed method outperforms a path-ranking based algorithm and knowledge graph embedding methods on Freebase and Never-Ending Language Learning datasets.

Access the dataset

Download the knowledge graph dataset NELL-995 FB15k-237

How to run our code

  1. unzip the data, put the data folder in the code directory

  2. run the following scripts within scripts/

    • ./pathfinder.sh ${relation_name} # find the reasoning paths, this is RL training, it might take sometime
    • ./fact_prediction_eval.py ${relation_name} # calculate & print the fact prediction results
    • ./link_prediction_eval.sh ${relation_name} # calculate & print the link prediction results

    Examples (the relation_name can be found in NELL-995/tasks/):

    • ./pathfinder.sh concept_athletehomestadium
    • ./fact_prediction_eval.py concept_athletehomestadium
    • ./link_prediction_eval.sh concept_athletehomestadium
  3. Since we already put the reasoning paths in the dataset, you can directly run fact_prediction_eval.py or link_prediction_eval.sh to get the final results for each reasoning task

Format of the dataset

  1. raw.kb: the raw kb data from NELL system
  2. kb_env_rl.txt: we add inverse triples of all triples in raw.kb, this file is used as the KG for reasoning
  3. entity2vec.bern/relation2vec.bern: transE embeddings to represent out RL states, can be trained using TransX implementations by thunlp
  4. tasks/: each task is a particular reasoning relation
    • tasks/${relation}/*.vec: trained TransH Embeddings
    • tasks/${relation}/*.vec_D: trained TransD Embeddings
    • tasks/${relation}/*.bern: trained TransR Embedding trained
    • tasks/${relation}/*.unif: trained TransE Embeddings
    • tasks/${relation}/transX: triples used to train the KB embeddings
    • tasks/${relation}/train.pairs: train triples in the PRA format
    • tasks/${relation}/test.pairs: test triples in the PRA format
    • tasks/${relation}/path_to_use.txt: reasoning paths found the RL agent
    • tasks/${relation}/path_stats.txt: path frequency of randomised BFS

If you use our code, please cite the paper

@InProceedings{wenhan_emnlp2017,
  author    = {Xiong, Wenhan and Hoang, Thien and Wang, William Yang},
  title     = {DeepPath: A Reinforcement Learning Method for Knowledge Graph Reasoning},
  booktitle = {Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing (EMNLP 2017)},
  month     = {September},
  year      = {2017},
  address   = {Copenhagen, Denmark},
  publisher = {ACL}
}

Acknowledgement

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].