facebook / dpr-ctx_encoder-single-nq-base

huggingface.co
Total runs: 83.1K
24-hour runs: 6.1K
7-day runs: 16.4K
30-day runs: 35.0K
Model's Last Updated: December 21 2022

Introduction of dpr-ctx_encoder-single-nq-base

Model Details of dpr-ctx_encoder-single-nq-base

dpr-ctx_encoder-single-nq-base

Table of Contents
Model Details

Model Description: Dense Passage Retrieval (DPR) is a set of tools and models for state-of-the-art open-domain Q&A research. dpr-ctx_encoder-single-nq-base is the Context Encoder trained using the Natural Questions (NQ) dataset ( Lee et al., 2019 ; Kwiatkowski et al., 2019 ).

How to Get Started with the Model

Use the code below to get started with the model.

>>> from transformers import DPRContextEncoder, DPRContextEncoderTokenizer
>>> tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base")
>>> model = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base")
>>> input_ids = tokenizer("Hello, is my dog cute ?", return_tensors="pt")["input_ids"]
>>> embeddings = model(input_ids).pooler_output
Uses
Direct Use

dpr-ctx_encoder-single-nq-base , dpr-question-encoder-single-nq-base , and dpr-reader-single-nq-base can be used for the task of open-domain question answering.

Misuse and Out-of-scope Use

The model should not be used to intentionally create hostile or alienating environments for people. In addition, the set of DPR models was not trained to be factual or true representations of people or events, and therefore using the models to generate such content is out-of-scope for the abilities of this model.

Risks, Limitations and Biases

CONTENT WARNING: Readers should be aware this section may contain content that is disturbing, offensive, and can propogate historical and current stereotypes.

Significant research has explored bias and fairness issues with language models (see, e.g., Sheng et al. (2021) and Bender et al. (2021) ). Predictions generated by the model can include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups.

Training
Training Data

This model was trained using the Natural Questions (NQ) dataset ( Lee et al., 2019 ; Kwiatkowski et al., 2019 ). The model authors write that:

[The dataset] was designed for end-to-end question answering. The questions were mined from real Google search queries and the answers were spans in Wikipedia articles identified by annotators.

Training Procedure

The training procedure is described in the associated paper :

Given a collection of M text passages, the goal of our dense passage retriever (DPR) is to index all the passages in a low-dimensional and continuous space, such that it can retrieve efficiently the top k passages relevant to the input question for the reader at run-time.

Our dense passage retriever (DPR) uses a dense encoder EP(·) which maps any text passage to a d- dimensional real-valued vectors and builds an index for all the M passages that we will use for retrieval. At run-time, DPR applies a different encoder EQ(·) that maps the input question to a d-dimensional vector, and retrieves k passages of which vectors are the closest to the question vector.

The authors report that for encoders, they used two independent BERT ( Devlin et al., 2019 ) networks (base, un-cased) and use FAISS ( Johnson et al., 2017 ) during inference time to encode and index passages. See the paper for further details on training, including encoders, inference, positive and negative passages, and in-batch negatives.

Evaluation

The following evaluation information is extracted from the associated paper .

Testing Data, Factors and Metrics

The model developers report the performance of the model on five QA datasets, using the top-k accuracy (k ∈ {20, 100}). The datasets were NQ , TriviaQA , WebQuestions (WQ) , CuratedTREC (TREC) , and SQuAD v1.1 .

Results
Top 20 Top 100
NQ TriviaQA WQ TREC SQuAD NQ TriviaQA WQ TREC SQuAD
78.4 79.4 73.2 79.8 63.2 85.4 85.0 81.4 89.1 77.2
Environmental Impact

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019) . We present the hardware type and based on the associated paper .

  • Hardware Type: 8 32GB GPUs
  • Hours used: Unknown
  • Cloud Provider: Unknown
  • Compute Region: Unknown
  • Carbon Emitted: Unknown
Technical Specifications

See the associated paper for details on the modeling architecture, objective, compute infrastructure, and training details.

Citation Information
  @inproceedings{karpukhin-etal-2020-dense,
    title = "Dense Passage Retrieval for Open-Domain Question Answering",
    author = "Karpukhin, Vladimir and Oguz, Barlas and Min, Sewon and Lewis, Patrick and Wu, Ledell and Edunov, Sergey and Chen, Danqi and Yih, Wen-tau",
    booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
    month = nov,
    year = "2020",
    address = "Online",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/2020.emnlp-main.550",
    doi = "10.18653/v1/2020.emnlp-main.550",
    pages = "6769--6781",
}
Model Card Authors

This model card was written by the team at Hugging Face.

Runs of facebook dpr-ctx_encoder-single-nq-base on huggingface.co

83.1K
Total runs
6.1K
24-hour runs
12.4K
3-day runs
16.4K
7-day runs
35.0K
30-day runs

More Information About dpr-ctx_encoder-single-nq-base huggingface.co Model

More dpr-ctx_encoder-single-nq-base license Visit here:

https://choosealicense.com/licenses/cc-by-nc-4.0

dpr-ctx_encoder-single-nq-base huggingface.co

dpr-ctx_encoder-single-nq-base huggingface.co is an AI model on huggingface.co that provides dpr-ctx_encoder-single-nq-base's model effect (), which can be used instantly with this facebook dpr-ctx_encoder-single-nq-base model. huggingface.co supports a free trial of the dpr-ctx_encoder-single-nq-base model, and also provides paid use of the dpr-ctx_encoder-single-nq-base. Support call dpr-ctx_encoder-single-nq-base model through api, including Node.js, Python, http.

dpr-ctx_encoder-single-nq-base huggingface.co Url

https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base

facebook dpr-ctx_encoder-single-nq-base online free

dpr-ctx_encoder-single-nq-base huggingface.co is an online trial and call api platform, which integrates dpr-ctx_encoder-single-nq-base's modeling effects, including api services, and provides a free online trial of dpr-ctx_encoder-single-nq-base, you can try dpr-ctx_encoder-single-nq-base online for free by clicking the link below.

facebook dpr-ctx_encoder-single-nq-base online free url in huggingface.co:

https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base

dpr-ctx_encoder-single-nq-base install

dpr-ctx_encoder-single-nq-base is an open source model from GitHub that offers a free installation service, and any user can find dpr-ctx_encoder-single-nq-base on GitHub to install. At the same time, huggingface.co provides the effect of dpr-ctx_encoder-single-nq-base install, users can directly use dpr-ctx_encoder-single-nq-base installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

dpr-ctx_encoder-single-nq-base install url in huggingface.co:

https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base

Url of dpr-ctx_encoder-single-nq-base

dpr-ctx_encoder-single-nq-base huggingface.co Url

Provider of dpr-ctx_encoder-single-nq-base huggingface.co

facebook
ORGANIZATIONS

Other API from facebook

huggingface.co

Total runs: 8.3M
Run Growth: -9.0M
Growth Rate: -107.03%
Updated:September 15 2023
huggingface.co

Total runs: 8.0M
Run Growth: 386.1K
Growth Rate: 4.83%
Updated:January 20 2022
huggingface.co

Total runs: 4.0M
Run Growth: -137.2K
Growth Rate: -3.32%
Updated:September 06 2023
huggingface.co

Total runs: 3.2M
Run Growth: 997.1K
Growth Rate: 30.98%
Updated:January 17 2024
huggingface.co

Total runs: 2.8M
Run Growth: -507.9K
Growth Rate: -18.04%
Updated:December 28 2021
huggingface.co

Total runs: 2.3M
Run Growth: 847.1K
Growth Rate: 36.55%
Updated:January 25 2024
huggingface.co

Total runs: 2.1M
Run Growth: 84.5K
Growth Rate: 4.27%
Updated:March 23 2023
huggingface.co

Total runs: 1.9M
Run Growth: 40.7K
Growth Rate: 2.04%
Updated:November 21 2025
huggingface.co

Total runs: 696.7K
Run Growth: -225.4K
Growth Rate: -32.23%
Updated:September 06 2023
huggingface.co

Total runs: 483.5K
Run Growth: -117.9K
Growth Rate: -24.39%
Updated:May 22 2023
huggingface.co

Total runs: 441.6K
Run Growth: 70.8K
Growth Rate: 16.61%
Updated:February 29 2024
huggingface.co

Total runs: 429.4K
Run Growth: -69.0K
Growth Rate: -16.06%
Updated:March 17 2025
huggingface.co

Total runs: 416.2K
Run Growth: -121.6K
Growth Rate: -28.61%
Updated:January 12 2024
huggingface.co

Total runs: 358.3K
Run Growth: -46.6K
Growth Rate: -12.80%
Updated:January 12 2024
huggingface.co

Total runs: 313.7K
Run Growth: 35.6K
Growth Rate: 11.28%
Updated:September 15 2023
huggingface.co

Total runs: 308.9K
Run Growth: 26.6K
Growth Rate: 8.63%
Updated:November 17 2022
huggingface.co

Total runs: 308.8K
Run Growth: -9.4K
Growth Rate: -3.09%
Updated:September 06 2023
huggingface.co

Total runs: 284.1K
Run Growth: 76.5K
Growth Rate: 26.97%
Updated:June 15 2023
huggingface.co

Total runs: 263.4K
Run Growth: 138.9K
Growth Rate: 53.10%
Updated:May 22 2023
huggingface.co

Total runs: 236.9K
Run Growth: 14.3K
Growth Rate: 6.02%
Updated:July 23 2024
huggingface.co

Total runs: 218.6K
Run Growth: -133.6K
Growth Rate: -58.12%
Updated:July 25 2023
huggingface.co

Total runs: 190.3K
Run Growth: 111.7K
Growth Rate: 57.72%
Updated:February 12 2023
huggingface.co

Total runs: 176.5K
Run Growth: 67.9K
Growth Rate: 40.58%
Updated:September 06 2023
huggingface.co

Total runs: 173.6K
Run Growth: -235.8K
Growth Rate: -137.83%
Updated:November 17 2023
huggingface.co

Total runs: 163.1K
Run Growth: 6.0K
Growth Rate: 3.67%
Updated:September 01 2023
huggingface.co

Total runs: 149.2K
Run Growth: 132.6K
Growth Rate: 87.56%
Updated:November 16 2023
huggingface.co

Total runs: 125.6K
Run Growth: 6.5K
Growth Rate: 5.13%
Updated:June 03 2022
huggingface.co

Total runs: 114.2K
Run Growth: 19.4K
Growth Rate: 16.18%
Updated:June 13 2023
huggingface.co

Total runs: 111.8K
Run Growth: -16.1K
Growth Rate: -15.73%
Updated:September 15 2023
huggingface.co

Total runs: 110.9K
Run Growth: 16.2K
Growth Rate: 15.89%
Updated:November 20 2023
huggingface.co

Total runs: 110.1K
Run Growth: 17.7K
Growth Rate: 17.30%
Updated:January 25 2023
huggingface.co

Total runs: 96.6K
Run Growth: -212.3K
Growth Rate: -201.98%
Updated:June 13 2023
huggingface.co

Total runs: 84.3K
Run Growth: 43.5K
Growth Rate: 65.57%
Updated:February 12 2023
huggingface.co

Total runs: 60.1K
Run Growth: -13.7K
Growth Rate: -22.87%
Updated:March 28 2026
huggingface.co

Total runs: 59.0K
Run Growth: 16.6K
Growth Rate: 27.79%
Updated:January 25 2023
huggingface.co

Total runs: 57.4K
Run Growth: 15.7K
Growth Rate: 25.40%
Updated:June 13 2023
huggingface.co

Total runs: 55.2K
Run Growth: -14.7K
Growth Rate: -26.55%
Updated:January 29 2026