14 Question answering with a fine-tuned large language model
This chapter covers
- Building a question-answering application using a Large Language Model (LLM)
- Curating a question-answering dataset for training
- Fine-tuning a transformer-based LLM
- Integrating a deep-learning-based NLP pipeline with Solr to extract and rank answers from search results
With the basics of semantic search using transformers well understood from Chapter 13, we’re now ready to attempt one of the hardest problems in search: Question Answering.
Question Answering is the process of returning an answer for a searcher’s query, rather than just a list of search results. There are two types of question-answering approaches: extractive and abstractive. Extractive question answering is the process of finding exact answers to questions from your documents. It returns snippets from your documents containing the likely answer to the user’s question to prevent them from needing to sift through search results. In contrast, Abstractive question answering is the process of generating responses to a user’s question either as a summary of multiple documents or directly from a Large Language Model with no source documents. In this chapter, we’ll focus primarily on extractive question answering.