模型:
facebook/dpr-reader-multiset-base
Model Description: Dense Passage Retrieval (DPR) is a set of tools and models for state-of-the-art open-domain Q&A research. dpr-reader-multiset-base is the reader model trained using the Natural Questions (NQ) dataset , TriviaQA , WebQuestions (WQ) , and CuratedTREC (TREC) .
Use the code below to get started with the model.
from transformers import DPRReader, DPRReaderTokenizer tokenizer = DPRReaderTokenizer.from_pretrained("facebook/dpr-reader-multiset-base") model = DPRReader.from_pretrained("facebook/dpr-reader-multiset-base") encoded_inputs = tokenizer( questions=["What is love ?"], titles=["Haddaway"], texts=["'What Is Love' is a song recorded by the artist Haddaway"], return_tensors="pt", ) outputs = model(**encoded_inputs) start_logits = outputs.start_logits end_logits = outputs.end_logits relevance_logits = outputs.relevance_logits
dpr-reader-multiset-base , dpr-question_encoder-multiset-base , and dpr-ctx_encoder-multiset-base can be used for the task of open-domain question answering.
Misuse and Out-of-scope UseThe 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.
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.
This model was trained using the following datasets:
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.
The following evaluation information is extracted from the associated paper .
Testing Data, Factors and MetricsThe 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 .
ResultsTop 20 | Top 100 | ||||||||
---|---|---|---|---|---|---|---|---|---|
NQ | TriviaQA | WQ | TREC | SQuAD | NQ | TriviaQA | WQ | TREC | SQuAD |
79.4 | 78.8 | 75.0 | 89.1 | 51.6 | 86.0 | 84.7 | 82.9 | 93.9 | 67.6 |
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 .
See the associated paper for details on the modeling architecture, objective, compute infrastructure, and training details.
@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", }
This model card was written by the team at Hugging Face.