BiDAG
Prediction and Calibration: Complex Reasoning over Knowledge Graph with Bi-directional Directed Acyclic Graph Neural Network. ACL 2023 finding.
Install / Use
/learn @YaooXu/BiDAGREADME
KGReasoning-BiDAG
This repo is forked from KGReasoning, including the official Pytorch implementation of Prediction and Calibration: Complex Reasoning over Knowledge Graph with Bi-directional Directed Acyclic Graph Neural Network.
models
- BetaE
- Query2Box
- GQE
- BiDAG (Ours)
KG Data
The KG data (FB15k, FB15k-237, NELL995) mentioned in the BetaE paper and the Query2box paper can be downloaded here. Note the two use the same training queries, but the difference is that the valid/test queries in BetaE paper have a maximum number of answers, making it more realistic.
Each folder in the data represents a KG, including the following files.
train.txt/valid.txt/test.txt: KG edgesid2rel/rel2id/ent2id/id2ent.pkl: KG entity relation dictstrain-queries/valid-queries/test-queries.pkl:defaultdict(set), each key represents a query structure, and the value represents the instantiated queriestrain-answers.pkl:defaultdict(set), each key represents a query, and the value represents the answers obtained in the training graph (edges intrain.txt)valid-easy-answers/test-easy-answers.pkl:defaultdict(set), each key represents a query, and the value represents the answers obtained in the training graph (edges intrain.txt) / valid graph (edges intrain.txt+valid.txt)valid-hard-answers/test-hard-answers.pkl:defaultdict(set), each key represents a query, and the value represents the additional answers obtained in the validation graph (edges intrain.txt+valid.txt) / test graph (edges intrain.txt+valid.txt+test.txt)
We represent the query structures using a tuple in case we run out of names :), (credits to @michiyasunaga). For example, 1p queries: (e, (r,)) and 2i queries: ((e, (r,)),(e, (r,))). Check the code for more details.
Examples
Please refer to the train.sh for the scripts of model on all 3 datasets.
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
