Code Monkey home page Code Monkey logo

peacok-personachat's Introduction

PeaCoK Augmented PersonaChat based on BART

This is the repository for ConvAI2 PersonaChat dialogue modeling with BART and PeaCoK knowledge graph augmentation.

Gathering the data

Our data can be downloaded from this link, please unzip the file and place the folder data under this root repository.

Our data include:

  • Original PersonaChat (with either original or revised PersonaChat profiles):
    • Training set (original profiles): data/persona_peacok/train_persona_original_chat_convai2.json
    • Validation set (original profiles): data/persona_peacok/valid_persona_original_chat_convai2.json
    • Training set (revised profiles): data/persona_peacok/train_persona_revised_chat_convai2.json
    • Validation set (revised profiles): data/persona_peacok/valid_persona_revised_chat_convai2.json
  • PersonaChat with profiles augmented with PeaCoK facts (up to 5 randomly chosen to augment each profile):
    • Training set (augmented original profiles): data/persona_peacok/train_persona_original_chat_ext.json
    • Validation set (augmented original profiles): data/persona_peacok/valid_persona_original_chat_ext.json
    • Training set (augmented revised profiles): data/persona_peacok/train_persona_revised_chat_ext.json
    • Validation set (augmented revised profiles): data/persona_peacok/valid_persona_revised_chat_ext.json
  • Full set of PeaCoK facts linked to each PersonaChat profile:
    • For original profiles: data/persona_peacok/persona_extend_full_original.json
    • For revised profiles: data/persona_peacok/persona_extend_full_revised.json
  • Full PeaCoK knowledge graph:
    • data/peacok_kg.json

Environment setup

conda env create -f workstation_setup/bart_peacok.yml
conda activate bart_peacok

Preparing datasets for train/eval

To save time prior to running training and evaluation, run the following the prepare the required datasets:

python save_datasets.py --dataset {dataset}

Supported options for the dataset are: persona_chat, persona_chat_peacok, persona_chat_peacok_retrieved, persona_chat_peacok_induced, persona_chat_peacok_random_induced, persona_chat_peacok_retrieved_induced

The first two options can be computed right away (given you obtained the datasets from the first section). For the remaining options you need to run the retrieved-induced components (instruction in the next section).

Computing induced and retrieved

cd induce_retrieve_pipeline

# Compute all required embeddings in advance
python embed_full_personas.py
python embed_utterances.py
python embed_peacok.py

# Run the induce-retrieve pipeline
python induce_and_retrieve.py

# Update the data based on the pipeline output
extend_persona_chat_with_induced_and_retrieved.py

Run training or eval

To run the training and evaluation scripts, please refer to the Makefile. Prior to running it, set the desired arguments in the Makefile. The following options are supported:

make train-pc
make train-peacok

make eval-ppl
make eval-f1
make eval-hits1

peacok-personachat's People

Contributors

gojkoc54 avatar silin159 avatar saidineshpola 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.