Tutorial: Building Your First Question Answering App

This tutorial guides you through the process of building an English question answering pipeline in the fastest and easiest possible way. It uses the UI to upload the sample dataset and it teaches you how to create a pipeline from the template.

  • Level: Beginner
  • Time to complete: 10 minutes
  • Prerequisites:
    • This tutorial assumes a basic knowledge of language models.
    • You must be an Admin to complete this tutorial.
    • Ensure you have a deepset workspace ready for your question answering pipeline. For help, check the Quick Start Guide.
  • Goal: After completing this tutorial, you will have built a complete English question answering app that can answer various questions about jazz.

Upload Files

You need the files the search will run on. You can use the sample files we prepared or your own dataset. To use the sample files:

  1. Download the .zip file from gdrive and unpack it on your computer.
  2. Log in to deepset AI Platform, switch to the workspace you want to use, and go to Files.
Navigation bar in deepset Cloud with the workspace switch marked as number one and the Files option marked as number two.
  1. Click Upload Files.
  2. Drop the files you unpacked in step 1 into the Upload Files window and click Upload.
  3. Wait until the upload finishes. You should have 344 files. You can check that in the Dashboard.

Result: Your files are in your workspace, and you can see them on the Files page.

A screenshot of the Files page with a list of uploaded files displayed.

Create an Index

Index prepares your files for search by chunking them and storing in a document store, where the query pipeline can access them.

  1. Go to Indexes and click Create Index.

  2. Click the Standard Index (English) template.

  3. Type standard-index as the index name and click Create Index. The index opens in Pipeline Builder.

  4. Click Enable in the top right corner of the Builder.

    The Enable button in pipeline builder

Result: You created and enabled an index you can now connect to your query pipelines to give them access to your files.

Create a Pipeline

In this step, you define how your search is going to run. Let's use a question answering pipeline template to create the pipeline.

  1. Go to Pipeline Templates.

  2. Under All Templates, click Basic QA, find Extractive Question Answering, and click Use Template.

    Screenshot of a webpage with a selection of pipeline templates for question-answering (QA) systems. The page is divided into sections with categories such as 'Recommended', 'Document Search', 'Basic QA', among others. The 'Basic QA' section is highlighted with a red notification bubble indicating '1'. There are two templates visible in detail: 'Extractive Question Answering' and 'Extractive Question Answering (German)', both described as search mechanisms for answers based on semantic similarity to the questions. Two options, 'View Details' and 'Use Template', are available for each template. The interface has a clean, professional look with a color scheme of blues, whites, and reds for notifications
  3. Type Jazz_English_QA as the pipeline name and click Create Pipeline. You're redirected to Pipeline Builder, where you can view and edit your pipeline.

  4. Find the OpenSearchDocumentStore component (it has a warning message prompting you to choose an index) and choose the standard-index index from the list on the component card.

    The OpenSearchDocumentStore component card with the index list expanded
  5. Click Save and then Deploy. This triggers indexing and prepares your pipeline for search. The pipeline status is now Deploying.

    The pipeline details page showing the Jazz English QA pipeline with the status deploying.
  6. Wait until the pipeline status changes to Deployed.

Result: You created and deployed a pipeline that uses a standard index. Your pipeline status is Deployed, and it's ready for use. Your pipeline is at the development service level. We recommend you test it before setting it to the production service level.

Test Your Pipeline

Now, it's time to try out your pipeline.

  1. Go to Playground.
  2. Select Jazz_English_QA as the pipeline you want to use.
  3. Now, search for an answer to this question: "How many people attended Duke Ellington's funeral?"
    You should get several answers.

Result: There! You've built a live question answering system from beginning to end. You can now ask your app questions related to jazz, and it will answer them.

What's Next

Your pipeline is now a development pipeline. Once it's ready for production, change its service level to Production. You can do this on the Pipeline Details page shown after clicking a pipeline name. To learn more, see Pipeline Service Levels.