Giter Site home page Giter Site logo

procedural-kg-llm's Introduction

Procedural Knowledge Graph extraction with Large Language Models

We introduce a prompt-based pipeline for extracting procedural knowledge graphs from text with LLMs.

This pipeline is able to:

  • extract sequential steps from a procedure in natural language without any formatting or structure
  • extract the tools needed to perform each steps
  • extract the actions to be performed in each step
  • generate a knowledge graph including all triples about the procedure, its steps, actions, and tools, according to an ontology given as reference

PK-CoT-evaluation

Experimental setting

For our experiments, we:

Procedures used in the prompt engineering refinement process, and in the evaluation, are selected from WikiHow

We reuse this JSON dataset available on GitHub

How to navigate this repository

pkg-extraction / notebooks

This folder contains:

  • pkg-extraction.ipynb, the notebook with the whole pipeline of 7 prompts, based on Chain-of-Thought prompting
  • a subfolder previous-prompt-eng-experiments containing the notebooks with previous experiments during the prompt engineering refinement process

The repository defines a docker-compose.yml file to run the Jupyter notebooks as containers via Docker. The containers can be run all at once or separately.

The notebooks can be executed running the container, from the folder with the .yml file, with the command:

docker-compose up --force-recreate

A credentials.json file should be provided in the main folder with a valid key for the OpenAI API.

{
    "OPENAI_API_KEY": "PUT_HERE_YOUR_KEY"
}

data-results

  • wikihow-json: this folder contains the input WikiHow procedures in the original json format
  • ontology: this folder contains the demo procedural ontology used as reference in the experiments
  • clean-flat-panel-monitor, fix-rubbing-door, cook-honey-glazed-parsnips, plant-bare-root-tree: these folders contain input and output data for the 4 procedures
  • previous-prompt-based-experiments: this folder contains the results of previous experiments during the prompt engineering refinement process

human-assessment

This folder contains materials and results from the human assessment of the LLM results

procedural-kg-llm's People

Contributors

valecarriero avatar

Stargazers

Marc Jermaine Pontiveros avatar Mario Scrocca avatar  avatar  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.