ערוך

שתף באמצעות


Importing from data sources

A knowledge base consists of question and answer pairs brought in by public URLs and files.

Note

The QnA Maker service is being retired on the 31st of March, 2025. A newer version of the question and answering capability is now available as part of Azure AI Language. For question answering capabilities within the Language Service, see question answering. Starting 1st October, 2022 you won’t be able to create new QnA Maker resources. For information on migrating existing QnA Maker knowledge bases to question answering, consult the migration guide.

Data source locations

Content is brought into a knowledge base from a data source. Data source locations are public URLs or files, which do not require authentication.

SharePoint files, secured with authentication, are the exception. SharePoint resources must be files, not web pages.

QnA Maker supports public URLs ending with a .ASPX web extension which are not secured with authentication.

Chit-chat content

The chit-chat content set is offered as a complete content data source in several languages and conversational styles. This can be a starting point for your bot's personality, and it will save you the time and cost of writing them from scratch. Learn how to add chit-chat content to your knowledge base.

Structured data format through import

Importing a knowledge base replaces the content of the existing knowledge base. Import requires a structured .tsv file that contains questions and answers. This information helps QnA Maker group the question-answer pairs and attribute them to a particular data source.

Question Answer Source Metadata (1 key: 1 value)
Question1 Answer1 Url1 Key1:Value1 | Key2:Value2
Question2 Answer2 Editorial Key:Value

Structured multi-turn format through import

You can create the multi-turn conversations in a .tsv file format. The format provides you with the ability to create the multi-turn conversations by analyzing previous chat logs (with other processes, not using QnA Maker), then create the .tsv file through automation. Import the file to replace the existing knowledge base.

Conceptual model of 3 levels of multi-turn question

The column for a multi-turn .tsv, specific to multi-turn is Prompts. An example .tsv, shown in Excel, show the information to include to define the multi-turn children:

[
    {"displayOrder":0,"qnaId":2,"displayText":"Level 2 Question A"},
    {"displayOrder":0,"qnaId":3,"displayText":"Level 2 - Question B"}
]

The displayOrder is numeric and the displayText is text that shouldn't include markdown.

Multi-turn question example as shown in Excel

Export as example

If you are unsure how to represent your QnA pair in the .tsv file:

  • Use this downloadable example from GitHub
  • Or create the pair in the QnA Maker portal, save, then export the knowledge base for an example of how to represent the pair.

Unstructured data format

You can also create a knowledge base based on unstructured content imported via a file. Currently this functionality is available only via document upload for documents that are in any of the supported file formats.

Important

The support for unstructured content via file upload is available only in question answering.

Content types of documents you can add to a knowledge base

Content types include many standard structured documents such as PDF, DOC, and TXT.

File and URL data types

The table below summarizes the types of content and file formats that are supported by QnA Maker.

Source Type Content Type Examples
URL FAQs
(Flat, with sections or with a topics homepage)
Support pages
(Single page how-to articles, troubleshooting articles etc.)
Plain FAQ,
FAQ with links,
FAQ with topics homepage
Support article
PDF / DOC FAQs,
Product Manual,
Brochures,
Paper,
Flyer Policy,
Support guide,
Structured QnA,
etc.
Without Multi-turn
Structured QnA.docx,
Sample Product Manual.pdf,
Sample semi-structured.docx,
Sample white paper.pdf,
Unstructured blog.pdf,
Unstructured white paper.pdf

Multi-turn:
Surface Pro (docx)
Contoso Benefits (docx)
Contoso Benefits (pdf)
*Excel Structured QnA file
(including RTF, HTML support)
Without Multi-turn:
Sample QnA FAQ.xls

Multi-turn:
Structured simple FAQ.xls
Surface laptop FAQ.xls
*TXT/TSV Structured QnA file Sample chit-chat.tsv

If you need authentication for your data source, consider the following methods to get that content into QnA Maker:

  • Download the file manually and import into QnA Maker
  • Add the file from authenticated SharePoint location

URL content

Two types of documents can be imported via URL in QnA Maker:

  • FAQ URLs
  • Support URLs

Each type indicates an expected format.

File-based content

You can add files to a knowledge base from a public source, or your local file system, in the QnA Maker portal.

Content format guidelines

Learn more about the format guidelines for the different files.

Next steps

Learn how to edit QnAs.