Giter Club home page Giter Club logo

kaping_prompt_zero-shot's Introduction

KAPING

This contains script that reimplements KAPING framework (Knowledge-Augmented Language Model Prompting for Zero-Shot Knowledge Graph Question Answering, Baek et al. 2023 URL)

The process for KAPING will work as follows: KAPING

Requirements

  • at least python3.8 (tested on python3.8, python3.10, python 3.11)

  • After cloning the repository, install the requirements

$ pip install -r requirements.txt

Structure

.
├── README.md
├── arguments.py
├── kaping
│   ├── entity_extractor.py
│   ├── entity_injection.py
│   ├── entity_verbalization.py
│   └── model.py
├── qa
│   ├── qa_evaluate.py
│   ├── qa_inference.py
│   └── qa_preprocessing.py
├── requirements.txt
└── run.py 

Simple run

  • With default, this script will run a QA-inference model using Bert-large-uncased with KAPING (retrieved top-10-triples) to create prompt on CPU
$ python run.py --input <mintaka_dataset.json> 
  • To check all arguments
$ python run.py -h
  • Pipeline are designed to treat Question and Context together as a Prompt and fed into the pipeline to request model to generate answer, not find the answer from the given inputs. Thus the inference task used are text2text-generation or text-generation depending on which model is compatible.

  • Available to test is gpt2, t5-small, t5-base, t5-large, but if you have sufficient space resource, you can try larger t5. Also, if you want to try other models, please check back on https://huggingface.co/.

kaping_prompt_zero-shot's People

Contributors

jasmine95dn avatar

Stargazers

 avatar River avatar 聂一可 avatar hejieprobe avatar  avatar  avatar Davy Chen avatar Yimin Ma Damian avatar Han Yang avatar  avatar Xudong Ma avatar Jiang Wenjuan avatar Huangkexin avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

kaping_prompt_zero-shot's Issues

Paper reimplementation metrics?

Dear author,
Thank you for big work for reimplementation paper, I would like to ask you about your results with T* models. Can you share metrics that you achieved by your version? Is it matched with results proposed in paper?

About 'hop_size'

Hello!
I'm truly impressed by the work you've done.

I have a quick question regarding the 'hop_size'. I would like to know what 'hop_size' means in the paper and how it affects the retrieval experiment.

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.