Giter VIP home page Giter VIP logo

bert-kg's Introduction

BERT-KG

Enriching Language Models Representations via Knowledge Graphs Regularisation

Astract

Novel method for augmenting the representations learned by Transformer-based language models with the symbolic information contained into knowledge graphs. The model first compute the node embeddings of a knowledge graph via a deep graph network. Then it adds a new regularisation term to the loss of BERT that encourages the learned word embeddings to be similar to the node embeddings. The method method is tested on the challenging WordNet and Freebase knowledge graphs. The results show that the regularised embeddings perform better than standard embeddings on the chosen probing tasks.

Authors: Matteo Medioli

Credits: Deepak Nathani, Learning Attention-based Embeddings for Relation Prediction in Knowledge Graphs

Requirements

pip install -r requirements.txt

Data Preprocessing

sh setup.sh

Learn Knowledge Graph Embeddings

WN18RR

python kbgat/run_kbgat.py --get_2hop True --data kbgat/data/WN18RR

FB15K-237

python main.py --epochs_gat 3000 --epochs_conv 200 --weight_decay_gat 0.00001 --get_2hop True --partial_2hop True --batch_size_gat 272115 --margin 1 --out_channels 50 --drop_conv 0.3 --weight_decay_conv 0.000001 --output_folder ./checkpoints/fb/out/ --data kbgat/data/FB15k-237

BERT Training - Masked Language Modeling

sh train_bert.sh

bert-kg's People

Contributors

matteomedioli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.