Skip to content

How do I create conversations within a Question Answering process?

Andreas Both edited this page Feb 26, 2022 · 2 revisions

Motivation

Question Answering (QA) is at the core of information gathering by users. A good QA system will provide correct answers for a given question. However, there are several situations where (multi-turn) conversation between user and system would be useful. For example:

  • the input of the user was not clear (disambiguity), i.e., the semantics of the question could not be determined with certainty
  • a user would like to know more details relating to the previous questions/answer
  • the system would like to ask for feedback

Example:

  • Let's assume the first user question was: "Where was Angela Merkel born?"
  • Then a followed second question makes sense only in the context of the first question: "Was she a politician?"

Hence, a Question Answering system needs to know the first question to answer the second question.

Qanary solution for establishing dialogues

In Qanary methodology, each question is processed while storing the information of the QA components (i.e., processing steps) in a specific graph of the Qanary triplestore. Hence, each part of the conversation (i.e., the input of the user) can be identified using a graph ID (i.e., a URI). Therefore, it is sufficient to know the previous graph (e.g., graph urn:graph:1) while processing the user's input in a second input (e.g., graph urn:graph:2). Consequently, it is required to identify the previous graph. In the reference implementation of the Qanary methodology, this is expressed in graph urn:graph:2 using the following pattern:

Hence, any component can use the following SPARQL query to get the previous graph:

PREFIX qa: <http://www.wdaqua.eu/qa#> 
SELECT * 
FROM <urn:graph:2> 
WHERE {
    ?question_id a qa:Question .
    ?question_id qa:priorConversation ?priorConversationGraph .
}

As a result, you will receive the graph URI of the prior conversation (in the example: urn:graph:1)

There is just one requirement for this functionality: the Qanary pipeline needs to know, what is to be considered as previous graph.

How to remember the previous graph?

If you use the Qanary Chatbot UI, then each processing step is already storing the previous graph URI. Of course, the only exception is the first input of the user (in this case, no prior graph is stored in the current graph).

Option 2: Control the behavior by yourself

To the Qanary Pipeline Web service, an optional parameter priorConversationcan be provided while starting a QA process. While providing such a parameter in the Web service request, it is automatically stored in the graph that will be created for the current request.

Examples

Clone this wiki locally