Git Product home page Git Product logo

coted's Introduction

COTED: Curriculum Contrastive Context Denoising for Few-shot Conversational Dense Retrieval

This is a temporary anonymous repository of the paper "Curriculum Contrastive Context Denoising for Few-shot Conversational Dense Retrieval""

image

Prerequisites

Install dependencies:

pip install -r requirements.txt

Data

We provide two raw and preprocessed CAsT datasets in the datasets folder. Besides, the human annotation data is in the annotation_data folder. Please note that, although there are part of turn dependency annotations in the original dataset of CAsT 20, we find that it is not very accurate and sufficient. Therefore, we refine the original annnotation by our team.

Main Files

  • train.py: curriculum_sampling, two-step multi-task learning
  • test.py: test with Faiss
  • my_utils.py: useful functions
  • models.py: CQE model architecture (i.e., ANCE)
  • db_lib.py: data strctures, conversational data augmentation, curriculum_sampling
  • running scripts:
    • train_cast19.sh
    • test_cast19.sh
    • train_cast20.sh
    • test_cast20.sh

Training

First download the public pre-trained ANCE model to the checkpoints folder.

mkdir checkpoints
wget https://webdatamltrainingdiag842.blob.core.windows.net/semistructstore/OpenSource/Passage_ANCE_FirstP_Checkpoint.zip
wget https://data.thunlp.org/convdr/ad-hoc-ance-orquac.cp
unzip Passage_ANCE_FirstP_Checkpoint.zip
mv "Passage ANCE(FirstP) Checkpoint" ad-hoc-ance-msmarco

To train our COTED, run the following scripts.

# params: training_epoch, aug_ratio, loss_weight

# CAsT-19
bash train_cast19.sh 6 2 0.01

# CAsT-20
bash train_cast20.sh 6 3 0.01

Testing

For testing, you should first generate passages embeddings.

Use

python gen_tokenized_doc.py --config=gen_tokenized_doc.toml

python gen_doc_embedding.py --config=gen_doc_embedding.toml

Then, run the following scripts for testing.

The passages embeddings are expected to stored at ./datasets/collections/cast_shared/passage_embeddings.

# param: test_epoch

# CAsT-19
bash test_cast19.sh 6 
or
bash test_cast19.sh final

# CAsT-20
bash test_cast20.sh 6
or
bash test_cast20.sh final

coted's People

Contributors

kyriemao avatar liangcaisu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  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.