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
Bancos de Dados Relacionais (SQL) na AWS com Amazon RDS

Bancos de Dados Relacionais (SQL) na AWS com Amazon RDS Repositório para o Live Coding DIO do dia 24/11/2021 Serviços utilizados Amazon RDS AWS Lambda

Cassiano Ricardo de Oliveira Peres 4 Jul 30, 2022
Python wrapper for eBay API

python-ebay - Python Wrapper for eBay API This project intends to create a simple python wrapper around eBay APIs. Development and Download Sites The

Roopesh 99 Nov 16, 2022
Simple bot to receive feedback,same as livegram bot but with more features & full control over bot

Kontak Simple bot to receive feedback,same as livegram bot but with more features & full control over bot Deploy to VPS

Mahin Ahmed 2 Dec 16, 2021
SEMID - OSINT module with lots of discord functions

SEMID Framework About Semid is a framework with different Discord functions and

Hima 20 Sep 23, 2022
A minimalistic, modern Discord bot for roles and polls using dropdowns

DropBot A minimalistic, modern Discord bot for roles and polls using dropdowns Made by ThatOneCalculator Technologies used Instructions Type /, and na

ModernBots 1 Jun 27, 2022
Maubot azuracast - A maubot to fetch data from your radio station

Maubot Azuracast A maubot to fetch data from your radio station Setup Configure

3 Mar 14, 2022
A python package that fetches tweets and user information in a very pythonic manner.

Tweetsy Tweetsy uses Twitter's underlying API to fetch user information and tweets and present it in a human-friendly way. What makes Tweetsy special

Sakirul Alam 5 Nov 12, 2022
Just another Shiny and Greninja-ash killing preventor for Myuu

Myuu-Anti-Shiny-Discord-Bot Why I made it? Since, I was legit fed up of NebbyBot's lag (not criticising it), I decided to make my own but in python an

5 Nov 12, 2022
Apps related to Odoo it's calendar features

calendar Apps related to Odoo it's calendar/appointments features: online_appointment_locations: allow setting an online URL per employee online_appoi

Yenthe Van Ginneken 3 Oct 27, 2022
🔎 Hunt down social media accounts by username across social networks

Hunt down social media accounts by username across social networks Installation | Usage | Docker Notes | Contributing Installation # clone the repo $

Sherlock 38.2k Jan 01, 2023
Python Client for MLflow Tracking Server

Python Client for MLflow Python client for MLflow REST API. Features: Unlike MLflow Tracking client all REST API methods are exposed to user. All clas

MTS 35 Dec 23, 2022
Monitoring plugin for MikroTik devices

check_routeros - Monitoring MikroTik devices This is a monitoring plugin for Icinga, Nagios and other compatible monitoring solutions to check MikroTi

DinoTools 6 Dec 24, 2022
A quick and dirty script to scan the network, find default credentials on services and post a message to a Slack channel with the results.

A quick and dirty script to scan the network, find default credentials on services and post a message to a Slack channel with the results.

Security Weekly 11 Jun 03, 2022
Python bindings to the Syncthing REST interface.

python-syncthing Python bindings to the Syncthing REST interface. Python API Documentation Syncthing Syncthing REST Documentation Syncthing Forums $ p

Blake VandeMerwe 64 Aug 13, 2022
A telegram user and chat info extractor with pyrogram python module

Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License - https://github.com/FayasNoushad/Telegram-Info/blob/main/LICENSE

Fayas Noushad 8 Dec 22, 2021
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
A Simple and User-Friendly Google Collab Notebook with UI to transfer your data from Mega to Google Drive.

Mega to Google Drive (UI Added! 😊 ) A Simple and User-Friendly Google Collab Notebook with UI to transfer your data from Mega to Google Drive. ⚙️ How

Dr.Caduceus 18 Aug 16, 2022
Python Capfire API wrapper

General CampfireAPI based on Campfire web. Install pip install Campfire-API Quickstart Use it without login: from campfire_api import CampfireAPI cf

Ghost 0 Jan 03, 2022
A Simple modular tool to fetch and parse data related to the stock market.

🐒 stonks-o-fetcher A Simple modular tool to fetch and parse data related to the stock market. Getting started For the moment the only source is this

Daniele 23 May 31, 2021
A pdisk uploader bot written in Python

Pdisk Uploader Bot 🔥 Upload on Pdisk by Url, File and also by direct forward post from other channel... Features Post to Post Conversion Url Upload D

Paritosh Kumar 33 Oct 21, 2022