Downloads · 30 days
49
1% of all-time downloads
vblagoje/dpr-ctx_encoder-single-lfqa-base
dpr-ctx_encoder-single-lfqa-base is a machine learning model from vblagoje. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
The context/passage encoder model based on DPRContextEncoder architecture. It uses the transformer's pooler outputs as context/passage representations.
Downloads · 30 days
49
1% of all-time downloads
All-time downloads
7.2K
Public
Parameters
110M
3.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.bin438 MB · 50%
How the weights are stored.
F32110M · 100%
From the Hugging Face model README
The context/passage encoder model based on DPRContextEncoder architecture. It uses the transformer's pooler outputs as context/passage representations.
We trained vblagoje/dpr-ctx_encoder-single-lfqa-base using FAIR's dpr-scale starting with PAQ based pretrained checkpoint and fine-tuned the retriever on the question-answer pairs from the LFQA dataset. As dpr-scale requires DPR formatted training set input with positive, negative, and hard negative samples - we created a training file with an answer being positive, negatives being question unrelated answers, while hard negative samples were chosen from answers on questions between 0.55 and 0.65 of cosine similarity.
LFQA DPR-based retriever (vblagoje/dpr-question_encoder-single-lfqa-base and vblagoje/dpr-ctx_encoder-single-lfqa-base) had a score of 6.69 for R-precision and 14.5 for Recall@5 on KILT benchmark.
from transformers import DPRContextEncoder, DPRContextEncoderTokenizer
model = DPRQuestionEncoder.from_pretrained("vblagoje/dpr-question_encoder-single-lfqa-base").to(device)
tokenizer = AutoTokenizer.from_pretrained("vblagoje/dpr-question_encoder-single-lfqa-base")
input_ids = tokenizer("Why do airplanes leave contrails in the sky?", return_tensors="pt")["input_ids"]
embeddings = model(input_ids).pooler_output