Giter Club home page Giter Club logo

eg3p's Introduction

$EG^3P$: Explanation Graph Generation via Generative Pre-training over Synthetic Graphs

The repository which contains the code and pre-trained models for our paper: Explanation Graph Generation via Generative Pre-training over Synthetic Graphs.(ACL2023-Findings)

📑Overview

In this paper, we present $EG^3P$ (for Explanation Graph Generation via Generative Pre-training over Synthetic Graphs), a pre-training structure for explanation graph generation. As shown in the Figure 1, $EG^3P$ contains a pre-training method in the form of "text-to-graph", and an automated process for automatically synthesizing aligning corpus.

Figure 1

Figure 1: Overview of EG3P

In the process of pre-training, we input the synthesized query and simulated knowledge base, and the model will output the reasoning graph. In addition, we have constructed a large number of composite graphs and natural language queries based on external structured knowledge bases, and the specific synthesis process is shown in the following Figure 2.

Figure 2: Construction of the synthetic corpus.

▶︎Quickstart

Prepara the environment

conda creative -n EG3P python=3.8 
pip install -r requirement.txt

Data and Models

You could check the pre-training data and pre-trained model in the following link: EG3P_Data_Model

For detailed info, you could check the README.md in the dir of data.

Training

  • Process the data
bash process_dataset.sh DATASET_PATH MODEL_DIR_PATH

where DATASET_PATH is the path of the dataset path(.src/.tgt), and MODEL_DIR_PATH is the path of the model dir.

  • Pretraining
bash pretrain.sh DATASET_PATH MODEL_PATH

where DATASET_PATH is the path of the dataset path(processed), and MODEL_PATH is the path of the model file(xx.pt)

  • Fine-tuning
bash finetune.sh TASK_NAME DATASET_PATH MODEL_NAME MODEL_PATH 

In the script:

  • TASK_NAME: The name of downstream task: ExplaGraphs / CSQA / OBQA
  • DATASET_PATH: The path of the dataset path(processed)
  • MODEL_NAME: The name of the pre-trained model. (only used for naming the checkpoint_dir)
  • MODEL_PATH: The path of the model file(xx.pt)

Evaluate

bash eval.sh DATASET_DIR MODEL_PATH PREDICT_DIR

In this script:

  • DATASET_DIR: The path of the dataset path ( processed, and containing the test.src )
  • MODEL_PATH: The path of the model file(xx.pt)
  • PREDICT_DIR: The path of the result of output

eg3p's People

Contributors

hanselcui avatar shz-li avatar

Stargazers

Ferdinand Su avatar Jeff Carpenter 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.