Coder Social home page Coder Social logo

kkt's Introduction

Multi-turn Dialogue Reading Comprehension with Pivot Turns and Knowledge

Part of codes and data for the paper Multi-turn Dialogue Reading Comprehension with Pivot Turns and Knowledge

KKT PART

Overview

Requirements

(Our experiment environment for reference)

Python 3.7

PyTorch (1.0.0)

NLTK (3.4.5)

Data

Raw data can be downloaded from the following urls:

​ DREAM: https://github.com/nlpdata/dream

​ ConceptNet: https://s3.amazonaws.com/conceptnet/downloads/2018/edges/conceptnet-assertions-5.6.0.csv.gz

We provides a processed version of DREAM and ConceptNet used in our experiment.

DREAM: in .KKT_code/dream_data/

​ We have written the relevance score and rank of each turn corresponding to QA in the json file.

​ We also have written the related knowledge IDs in ConceptNet for each example in the json file.

ConceptNet: in .KKT_code/conceptnet/

​ We have made a smaller version of ConceptNet, which only contains the English part.

Instructions

Here is a simple example of our experiment:

  1. Get knowledge representation
python get_knowledge_representation.py 
--data_dir=../conceptnet/ 
--model_type=albert 
--model_name_or_path=albert-xxlarge-v2 
--task_name=knowledge 
--max_seq_length=40 
--do_lower_case 
--per_gpu_eval_batch_size=256

​ 2. Run the model

python run_multiple_choice.py 
--data_dir=../dream_data 
--model_type=albert_all 
--model_mode=kp 
--model_name_or_path=albert-xxlarge-v2 
--knowledge_file=../conceptnet/albert-xxlarge-v2_concept_knowledge_representations 
--task_name=dream 
--output_dir=../results/albert_xxlarge_dream 
--warmup_steps=0
--max_seq_length=512 
--top_k=6 
--do_train 
--do_eval 
--do_test 
--do_lower_case 
--per_gpu_train_batch_size=2 
--per_gpu_eval_batch_size=16 
--learning_rate=1e-5 
--num_train_epochs=2 
--save_steps=383 
--max_contexts_knowledge=30 
--eval_all_checkpoints 
--overwrite_output_dir 
--overwrite_cache

The results will be saved in ./results/albert_xxlarge_dream/my_eval_results.txt

Please kindly cite this paper if you use this repo.

@ARTICLE{9352490,  
  author={Zhang, Zhuosheng and Li, Junlong and Zhao, Hai},  
  journal={IEEE/ACM Transactions on Audio, Speech, and Language Processing},   
  title={Multi-Turn Dialogue Reading Comprehension With Pivot Turns and Knowledge},  
  year={2021},  
  volume={29},  
  number={},  
  pages={1161-1173},  
  doi={10.1109/TASLP.2021.3058616}
}

kkt's People

Contributors

lockon-n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

cooelf

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.