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
Petit webhook manager by moi (wassim)

Webhook Manager By wassim oubliez pas de ⭐ le projet Installations il te faut python sinon quand tu va lancer le start.bat sa va tout installer tout s

wassim 9 Jul 08, 2021
wyscoutapi is an extremely basic API client for the Wyscout API (v2 & v3) for Python

wyscoutapi wyscoutapi is an extremely basic API client for the Wyscout API (v2 & v3). Usage Install with pip install wyscoutapi. To connect to the Wys

Ben Torvaney 11 Nov 22, 2022
A delivery protection and notification system

DeliveryProtect This project builds a delivery protection and notification system, based on integration of Arduino Uno and Raspberry Pi 4. The codes a

2 Dec 13, 2021
Unlimited Filter Bot

Unlimited Filter Bot The Orginel Owner Of This Repo Is ㅤㅤㅤㅤㅤㅤㅤ ㅤㅤㅤㅤㅤㅤㅤ An advanced Filter Bot with nearly unlimitted filters! Features Nearly unlimite

4 Aug 02, 2022
Scheduled Block Checker for Cardano Stakepool Operators

ScheduledBlocks Scheduled Block Checker for Cardano Stakepool Operators Lightweight and Portable Scheduled Blocks Checker for Current Epoch. No cardan

SNAKE (Cardano Stakepool) 4 Oct 18, 2022
A python discord client interaction emulator for the DC29 badge code channel

dc29-discord-signalbot A python discord client interaction emulator for the DC29 badge code channel Prep Open Developer mode Open the developer mode f

8 Aug 23, 2021
Tiktok-bot - A tiktok bot with python

Install the requirements pip install selenium pip install pyfiglet==0.7.5 How ca

Ukis 5 Aug 23, 2022
A python Discord wrapper made in well, python.

discord.why A python Discord wrapper made in well, python. Made to be used by devs who want something a bit more, general. Basic Examples Sending a me

HellSec 6 Mar 26, 2022
Injector/automatic translator (using deepL API) for Tsukihime Remake

deepLuna Extractor/Editor/Translator/Injector for Tsukihime Remake About deepLuna, from "deepL", the machine translation service, and "Luna", the name

30 Dec 15, 2022
Python SDK for interacting with the Frame.io API.

python-frameio-client Frame.io Frame.io is a cloud-based collaboration hub that allows video professionals to share files, comment on clips real-time,

Frame.io 37 Dec 21, 2022
Python based Discord Bot with a simple music player

C32 Discord Bot Discord bot that plays music Table Of Contents About the Project Built With Acknowledgements About The Project Play music using the !p

Christopher Burwell 2 Oct 17, 2021
Minecraft name sniper written in python.

⚠️ IMPORTANT ⚠️ DO NOT USE MCSNIPERPY -- READ BELOW This sniper does not support Microsoft accounts or prename / gc sniping and is MUCH harder to use

MCsniperPY 201 Dec 30, 2022
Script que realiza a identificação de todos os logins e senhas dos wifis conectados em uma máquina e envia os dados para um e-mail especificado.

getWIFIConnection Script que realiza a identificação de todos os logins e senhas dos wifis conectados em uma máquina e envia os dados para um e-mail e

Vinícius Azevedo 3 Nov 27, 2022
Reverse engineered connection to the TradingView ticker in Python

Tradingview-ticker Reverse engineered connection to the TradingView ticker in Python. Makes a websocket connection to the Tradeview website and receiv

Aaron 20 Dec 02, 2022
Implement SAST + DAST through Github actions

Implement SAST + DAST through Github actions The repository is supposed to implement SAST+DAST checks using github actions against a vulnerable python

Syed Umar Arfeen 3 Nov 09, 2022
Python Paxful API wrapper.

PyPaxful Python Paxful API wrapper. Description Just a Paxful exchange API implementation in python. Final objective is to have just one python packag

1 Dec 19, 2021
🖥️ Windows Batch and powershell Discord Token grabber. Made for Troll (lmao)

Batched-Grabber Windows Batch and powershell Discord Token grabber. Made for Troll ! Setup. 1. pip(3) install numpy colored 2. python(3) Batched.py 3.

Ѵιcнч 41 Nov 01, 2022
pyhakuna is a client to access the API of the time keeping service hakuna.ch.

pyhakuna pyhakuna is a client to access the API of the time keeping service hakuna.ch. The Hakuna API is – unfortunately – personal and currently does

Christian Mäder 1 Feb 15, 2022
Slack bot for monitoring your Metaflow flows!

Metaflowbot - Slack Bot for your Metaflow flows! Metaflowbot makes it fun and easy to monitor your Metaflow runs, past and present. Imagine starting a

Outerbounds 21 Dec 07, 2022
An API or getting Optifine VersionsList/Version/Download-URL.

Optifine-API An API for getting Optifine VersionsList/Versions/Download-URL. Table of contents Get Versions List Get Specify Versions Download Optifin

2 Dec 04, 2022