Code Monkey home page Code Monkey logo

multitask-prompted-search's Introduction

Soft Prompt Transfer for Information Retrieval

Install Requirements

conda create -n prompt python=3.9
conda activate prompt
conda install pytorch==1.12.1 cudatoolkit=11.4 pytorch transformers faiss-gpu -c conda-forge
pip install -r requirements.txt 
pip install sentence-transformers --no-dependencies
pip install nltk
pip install -U scikit-learn --no-dependencies
pip install -U threadpoolctl --no-dependencies
pip install -U PIL --no-dependencies
pip install -U Pillow--no-dependencies
pip install -U Pillow --no-dependencies

Install Openmatch https://github.com/OpenMatch/OpenMatch

git clone https://github.com/OpenMatch/OpenMatch.git
cd OpenMatch
pip install -e .

Optionally install Gradcache

git clone https://github.com/luyug/GradCache
cd GradCache
pip install .

Perform Multitask Pretraining on Dense Encoder

Download DPR

sh scripts/download_dpr_data.sh

Convert to Openmatch Format

sh scripts/process_pretraining_data.sh

Multitask Pretrain the base Model

Train on the multitask mixture of 4 datasets from the DPR paper. Follow the recommended hyperparameters and train for 40 epochs with bs = 128

python -m src.mps.training.train 
--model_name_or_path bert-base-uncased \
--train_n_passages 2 \
--output_dir ./models/base_model \
--use_mapping_dataset False \
--report_to wandb \
--use_delta True \
--untie_encoder True \
--pooling mean \
--normalize True \
--train_dir ./data/pretraining/ 
--overwrite_output_dir True 
--save_steps 1000 \
--per_device_train_batch_size 128 \
--learning_rate 1e-3 \
--num_train_epochs 40 \

Train Dense Encoders for Each Domain

BEIR Datasets

Run the script to train the dense encoder for each publicly available BEIR dataset. Note the subcategories of the CQADupStack dataset are not treated as separate datasets.

sh scripts/train_beir.sh

OAG QA Datasets

Download OAG-QA Data

Download OAG-QA from the link: OAG-QA, and unzip it to ./data/oag_qa

Run the script to train the dense encoder for each OAG-QA dataset

sh scripts/train_oag_qa.sh

multitask-prompted-search's People

Contributors

ethankim00 avatar

Watchers

Xa9aX ใƒ„ avatar  avatar

multitask-prompted-search's Issues

Excited to work with You and Vectorshift

Hey @ethankim00 ,
I am Chirag, a final year CS undergrad and enthusiast of AI & automation space. I truly believe in VectorShift's vision of automating tasks by leveraging LLMs and willing to contribute to it.
I have good foundations with Next.js, CSS, Redux, FastAPI & MongoDB and have previously interned at multiple startups in automation and fintech space where I learnt to apply these technologies at the production level.
I would love to work and learn from you and Vectorshift and join in as a Fullstack Developer Intern as I would be available full time from January 2024. I would highly appreciate if you could forward my resume to the relevant decision makers.

Resume Link -https://drive.google.com/file/d/1aj2AKFDfOnCM0HEHmxMj9til1NDvt4ir/view

Regards
Chirag Gupta
P. S- Sorry for approaching like this but I tried all other ways of contacting but got no response and I really wanted to be part of the team and even company's tech stack is also in line with what I am good at that's why tried this way of contacting.

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.