ACL 2022: CAKE: A Scalable Commonsense-Aware Framework For Multi-View Knowledge Graph Completion

Overview

CAKE

ACL 2022: CAKE: A Scalable Commonsense-Aware Framework For Multi-View Knowledge Graph Completion

Introduction

This is the PyTorch implementation of the CAKE framework. We propose a novel and scalable Commonsense-Aware Knowledge Embedding (CAKE) framework to automatically extract commonsense from factual triples with entity concepts. The generated commonsense augments effective self-supervision to facilitate both high-quality negative sampling and joint commonsense and fact-view link prediction.

An Overview of the CAKE Framework

image

Datasets

We provide four datasets: FB15K_concept, FB15K237_concept, depedia and nell. You can find all the datasets as well as the files corresponding to concept in the folders:

  • train.txt: the file containing all the triples for training. Each line is a triple in the format (head entity name, relation name, tail entity name).
  • test.txt: the file containing all the triples for testing. Each line is a triple in the format (head entity name, relation name, tail entity name).
  • valid.txt: the file containing all the triples for validation. Each line is a triple in the format (head entity name, relation name, tail entity name).
  • dom_ent.json: the dictionary file denoting all the entities that belong to each concept, in the format {domain_1_id: [entity_1_id, entity_2_id, ...]}.
  • ent_dom.json: the dictionary file denoting all the concepts corresponding to each entity, in the format {entity_1_id: [concept_1_id, concept_2_id, ...]}.
  • rel2dom_h.json: the dictionary file denoting all the head concepts corresponding to each relation, in the format {relation_1_id: [concept_1_id, concept_2_id, ...]}.
  • rel2dom_t.json: the dictionary file denoting all the tail concepts corresponding to each relation, in the format {relation_1_id: [concept_1_id, concept_2_id, ...]}.
  • rel2nn.json: rel2dom_h.json: the dictionary file denoting the complex relation property of each relation, in the format {relation_1_id: complex_id}. complex_id: 0: 1-1 relation, 1: 1-N relation, 2: N-1 relation, 3: N-N relation.
  • entities.dict: the dictionary file containing all the entities in the dataset. Each line is an entity and its id: (entity_id, entity name).
  • relations.dict: the dictionary file containing all the relations in the dataset. Each line is an relation and its id: (relation_id, relation name).

Train

In order to reproduce the results of CAKE model on the datasets, you can kindly run the following commands:
TransE+CAKE:

bash run_cake.sh train TransE FB15k-237_concept 0 domain 512 2 1000 12.0 1.0 0.00005 200000 16
bash run_cake.sh train TransE nell 2 mvlp 256 2 500 8.0 0.5 0.0001 250000 8
bash run_cake.sh train TransE dbpedia 0 all 512 2 1000 24.0 1.0 0.0001 200000 8

RotatE+CAKE:

bash run_cake.sh train RotatE FB15k-237_concept 2 0 512 2 1000 20.0 1.0 0.00005 100000 16 -de
bash run_cake.sh train RotatE nell 2 all 256 2 500 8.0 0.5 0.0001 250000 8 -de
bash run_cake.sh train RotatE dbpedia 1 mulp 1024 2 500 24.0 1.0 0.0002 200000 4 -de

Citation

If you use the codes, please cite the following paper:

@inproceedings{niu2022cake,
  author    = {Guanglin Niu and
               Bo Li and
               Yongfei Zhang and
               Shiliang Pu},
  title     = {CAKE: A Scalable Commonsense-Aware Framework For Multi-View Knowledge Graph Completion},
  booktitle = {ACL},
  year      = {2022}
}
Owner
Niu Guanglin
PHD student
Niu Guanglin
A drop-in vanilla discord.py cog to add slash command support with little to no code modifications

discord.py /slash cog A drop-in vanilla discord.py cog that acts as a translation layer to add slash command support with little to no code modificati

marshall 3 Jun 01, 2022
A Characther powerful in saints saiya anime and modular telegram group management bot built using python3

Kaneki Ken A Powerful and Modular Saint Aries is a Characther powerful in saints saiya anime and modular telegram group management bot built using pyt

1 Dec 21, 2021
A Telegram Bot which will ask new Group Members to verify them by solving an emoji captcha.

Emoji-Captcha-Bot A Telegram Bot which will ask new Group Members to verify them by solving an emoji captcha. About API: Using api.abirhasan.wtf/captc

Abir Hasan 52 Dec 11, 2022
A script to automate the process of downloading Markdown and CSV backups of Notion

Automatic-Notion-Backup A script to automate the process of downloading Markdown and CSV backups of Notion. In addition, the data is processed to remo

Jorge Manuel Lozano Gómez 2 Nov 02, 2022
Working TikTok Username Auto-Claimer/Sniper/Swapper which will autoclaim username if it´s available

TikTok-AutoClaimer Working TikTok Username Auto-Claimer/Sniper/Swapper which will autoclaim username if it´s available Usage Python 3.6 or above is re

Kevin 18 Dec 08, 2022
Update your World of Warcraft AddOns hosted on GitHub

AddOns Update Tool Tool to update World of Warcraft AddOns hosted on GitHub Features Pure Python: only Dulwich and Colorlog Multithreaded tasks Manual

Mr. Alchemist 16 Dec 06, 2022
An Advanced Python Playing Card Module that makes creating playing card games simple and easy!

playingcards.py An Advanced Python Playing Card Module that makes creating playing card games simple and easy! Features Easy to Understand Class Objec

Blake Potvin 5 Aug 30, 2022
Async wrapper over hentaichan.live

hentai-chan-api-async is a small asynchronous parser library that will allow you to easily use manga from https://hentaichan.live Recommended to use python3.7+

7 Dec 15, 2022
Simple script to extract useful informations from the combo BloodHound + Neo4j

bloodhound-quickwin Simple script to extract useful informations from the combo BloodHound + Neo4j. Can help to choose a target. Prerequisites python3

140 Dec 21, 2022
A crashbot for Discord

Description A Effective crash bot code How to use Setup First, we need to install the library: pip install discord or (for linux users): pip3 install

3 Sep 17, 2021
An API wrapper for convertio.co written in Python.

An API wrapper for convertio.co written in Python.

Moonrise 9 Sep 27, 2022
A simple, multipurpose Discord bot.

EpicBot 🏅 A simple, multipurpose Discord bot. • Info EpicBot is a multipurpose Discord bot that was designed to make your Discord life easier and coo

Nirlep_5252_ 130 Dec 29, 2022
twtxt is a decentralised, minimalist microblogging service for hackers.

twtxt twtxt is a decentralised, minimalist microblogging service for hackers. So you want to get some thoughts out on the internet in a convenient and

buckket 1.8k Jan 09, 2023
A synchronous, object oriented API wrapper for thecatapi

cats.py A synchronous, object oriented API wrapper for thecatapi Table Of Content cats.py Table Of Content Installation Usage Contributing FAQ License

Marcus 2 Feb 04, 2022
Fast IP address lookup

ipscoop Fast IP Scoop Table of Contents Installation CLI Getting Started Ref Installation To install ipscoop, simply: $ python3 -m pip install -U git+

6 Mar 16, 2022
Yes, it's true :heartbeat: This repository has 337 stars.

Yes, it's true! Inspired by a similar repository from @RealPeha, but implemented using a webhook on AWS Lambda and API Gateway, so it's serverless! If

512 Jan 01, 2023
C Y B Ξ R UserBot is a project that simplifies the use of Telegram.

C Y B Ξ R USΞRBOT 🇦🇿 C Y B Ξ R UserBot is a project that simplifies the use of Telegram. All rights reserved. Automatic Setup Android: open Termux p

FVREED 4 Dec 07, 2022
An API that uses NLP and AI to let you predict possible diseases and symptoms based on a prompt of what you're feeling.

Disease detection API for MediSearch An API that uses NLP and AI to let you predict possible diseases and symptoms based on a prompt of what you're fe

Sebastian Ponce 1 Jan 15, 2022
A python script to extract information from a Microsoft Remote Desktop Web Access (RDWA) application

This python script allow to extract various information from a Microsoft Remote Desktop Web Access (RDWA) application, such as the FQDN of the remote server, the internal AD domain name (from the FQD

Podalirius 60 Dec 09, 2022
Github action for automatically determine the version for next release by using repository tags

This action will automatically determine the version for next release by using repository tags

Igor Gov 7 Oct 25, 2022