Giter VIP home page Giter VIP logo

cai's Introduction

CAI

This repository is for our paper Unsupervised Domain Adaptation for Sparse Retrieval by Filling Vocabulary and Word Frequency Gaps, which is accepted at AACL-IJCNLP2022.

Installation

$ pip install ./
$ pip install -r  requirements.txt

Preliminary

Prepare Data

  • Get BEIR and MSMARCO from BEIR Repo
  • It is necessary to download BioASK from the original cite.
    • We prepare a script, prepare_bioask.py.

Prepare Corpus

  • Get Domain Corpus
  • Process the corpus. We prepare following scripts
    • proc_pubmed.py
    • proc_s2orc.py

Execution Steps

Apply AdaLM to BERT

$ cd adalm_scripts/run
$ bash add_new_vocab_all.sh
$ bash init_add_vocab_model_all.sh
$ bash run_mlm.sh <model_path> <path_to_outdir> <path_to_corpus_file>
  • Please rewrite path in bash files.

Training SPLADE on MS MARCO

$ cd /path/to/this/repo
$ cd training/run
$ bash train_splade_distil.sh <model_path> <output_dir>
  • Please rewrite path in bash files.
  • We prepare other bash files for training dense retrieval and GPL in the dir. If you experiment with them please check them.

Search to target data with IDF weight

$ cd /path/to/this/repo
$ cd search/run
$ bash search_splade.sh <beir_data_dir> <result_out_dir> <model_path>
  • If you'd like to remove idf weight, change mode val from idf to org in the bash file.
  • If you'd like to run splade-doc, please set d-idf or d-org in the bash file
  • We prepare other bash files for search with dense retrieval and BM25. If you experiment with them please check them.

cai's People

Contributors

meshidenn avatar

Stargazers

 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.