What are Retrieval based models in transformers?

This recipe explains what are Retrieval based models in transformers.

Recipe Objective - What are Retrieval-based models in transformers?

For open-domain question answering, retrieval-based models leverage documents retrieval during (pre)training and inference.

Types of Retrieval-based model:
DPR:

Dense Passage Retrieval (DPR) is a set of tools and models for open-domain question-answering research at the cutting edge.

DPR is divided into three types:
1. Question encoder: encode questions as vectors
2. Context encoder: encode contexts as vectors
3. Reader: extract the questions' answers, as well as a relevance score, from the retrieved contexts (high if the inferred span actually answers the question).

The DPR pipeline (which has yet to be implemented) employs a retrieval phase to discover the top k contexts for a given question, and then it calls the reader with the query and the retrieved documents to receive the response.

RAG:

Pretrained dense retrieval (DPR) and Seq2Seq models are combined in retrieval-augmented generation (RAG) models. RAG models retrieve documents, feed them to a seq2seq model, and minimise the results to produce outputs. The retriever and seq2seq modules are both fine-tuned together after being initialised from pre-trained models, allowing retrieval and generation to adapt to downstream requirements.

For more related projects -

/projects/data-science-projects/tensorflow-projects
/projects/data-science-projects/keras-deep-learning-projects

What Users are saying..

profile image

Jingwei Li

Graduate Research assistance at Stony Brook University
linkedin profile url

ProjectPro is an awesome platform that helps me learn much hands-on industrial experience with a step-by-step walkthrough of projects. There are two primary paths to learn: Data Science and Big Data.... Read More

Relevant Projects

PyCaret Project to Build and Deploy an ML App using Streamlit
In this PyCaret Project, you will build a customer segmentation model with PyCaret and deploy the machine learning application using Streamlit.

Stock Price Prediction Project using LSTM and RNN
Learn how to predict stock prices using RNN and LSTM models. Understand deep learning concepts and apply them to real-world financial data for accurate forecasting.

Demand prediction of driver availability using multistep time series analysis
In this supervised learning machine learning project, you will predict the availability of a driver in a specific area by using multi step time series analysis.

Learn How to Build a Logistic Regression Model in PyTorch
In this Machine Learning Project, you will learn how to build a simple logistic regression model in PyTorch for customer churn prediction.

Build a Speech-Text Transcriptor with Nvidia Quartznet Model
In this Deep Learning Project, you will leverage transfer learning from Nvidia QuartzNet pre-trained models to develop a speech-to-text transcriptor.

Build Multi Class Text Classification Models with RNN and LSTM
In this Deep Learning Project, you will use the customer complaints data about consumer financial products to build multi-class text classification models using RNN and LSTM.

Topic modelling using Kmeans clustering to group customer reviews
In this Kmeans clustering machine learning project, you will perform topic modelling in order to group customer reviews based on recurring patterns.

End-to-End Snowflake Healthcare Analytics Project on AWS-1
In this Snowflake Healthcare Analytics Project, you will leverage Snowflake on AWS to predict patient length of stay (LOS) in hospitals. The prediction of LOS can help in efficient resource allocation, lower the risk of staff/visitor infections, and improve overall hospital functioning.

Build OCR from Scratch Python using YOLO and Tesseract
In this deep learning project, you will learn how to build your custom OCR (optical character recognition) from scratch by using Google Tesseract and YOLO to read the text from any images.

Learn to Build an End-to-End Machine Learning Pipeline - Part 1
In this Machine Learning Project, you will learn how to build an end-to-end machine learning pipeline for predicting truck delays, addressing a major challenge in the logistics industry.