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 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 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.

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,

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.