We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Semantic vs keyword search as context for GPT

Formal Metadata

Title
Semantic vs keyword search as context for GPT
Title of Series
Number of Parts
60
Author
Contributors
License
CC Attribution 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date2023
LanguageEnglish

Content Metadata

Subject Area
Genre
Abstract
The OpenAI ChatGPT has taken the world by storm and people want to be able to offer the same type of chat bot experience on their own data. Such a bot can answer questions based on your documentation or knowledge base. This can be done with the OpenAI API by providing the right context, extracted from your data, to the model. You can do this in two steps: * the search step: perform a search to select the documentation pages that are likely to contain the answer. * the GPT step: provide these pages as context with a prompt like "With this context: .... answer this questions: ...". For the search step, semantic search is often used, because it makes use of the LLM capabilities. However, we have found that in practice keyword search (e.g. BM25 based) has some advantages when it comes to tuning the search step, and it tends to be more "explainable".