Coder Social home page Coder Social logo

buntingsim's Introduction

Bunting: Efficient Token Sparsification Through the Lens of Infused Knowledge

The code for Bi-Stage Prefix Tuning framework will be updated in this repo. The novelty of this paper is that text-based KG reasoning can be speeded up with Bi-Stage Prefix Tuning using the same LLM (either a BERT or GPT). To measure semantic transferability, we develop an Antiphrasis Evaluation Protocol where understanding of novel relations is measured by performance drop. Hence, down is up! Welcome to check our implementation and predictive examples for more details.

Fig. 1 Bi-stage Prefix-Tuning of KG reasoning.

Download all files within the repo

unzip all_files.zip -d DESTINATION

Data Preparation

Extract knowledge graphs to the data folder similar as follows:

wiki5m_ind
├── train.txt
├── valid.txt
├── test.txt
├── wikidata5m_entity.txt
├── wikidata5m_relation.txt
└── wikidata5m_text.txt 

Prepare Environment

pip install -r requirement.txt

Data Preprocessing

bash scripts/preprocess.sh WN18RR

Checkpoints

Dataset Checkpoints
WN18RR Bunting BERT Checkpoint
WN18RR Bunting GPT Checkpoint
Wikidata5M-transductive Checkpoint
mv ${CHECKPOINT_BI-LINK_WN18RR} checkpoint/bilink_bert

Evaluation

To evaluate the model, please run

bash scripts/eval.sh ${CHECKPOINT} WN18RR

Please chage pretrained-model from bert-base-uncased to gpt-2 when evaluating Bunting GPT

Model Comparison

Fig. 3 Comparison between wrongly predicted tails' relevance scores with labels.

buntingsim's People

Watchers

Bohua Peng 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.