Importing from data sources

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

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. If the URL ends with a web extension, such as .ASPX, it will not import into QnA Maker from SharePoint.

Chit chat content

The Chit chat QnA 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 this content set 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 answer. 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 creating 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.

Next steps

See also

Use the QnA Maker Markdown reference to help you format your answers.

QnA Maker overview

Create and edit a knowledge base with:

Generate an answer with: