Ask a Question
To get answers from Answer Server, use the Ask action. Specify the question text in the Text
parameter. For example:
http://localhost:12000?Action=Ask&Text=Who won the award for Best Picture in 2012?
The Ask action also has a number of optional parameters to allow you to tune your results.
-
SystemNames restricts the Ask action to particular configured systems or system groups. For example:
http://localhost:12000?Action=Ask&Text=Who won the award for Best Picture in 2012?&SystemNames=MovieFactBank,Answerbank
By default, Answer Server sends the question to all configured systems, in the order in which they are configured in the
[Systems]
section. If you setSystemNames
, Answer Server sends the question only to the specified systems, in the order in which you specify them. -
MaxResults specifies the maximum number of results to retrieve.
http://localhost:12000?Action=Ask&Text=Who won the award for Best Picture in 2012?&SystemNames=MovieFactBank,Answerbank&MaxResults=2
In this case (for default sorting), if Answer Server finds the required number of results from the first system, it does not request answers from further systems.
-
Sort specifies how to sort the results. By default, Answer Server sorts answers in the order of the system that the answer comes from (either the configured order, or the order in
SystemNames
). You can setSort
toConfidence
instead, to sort the results by score.http://localhost:12000?Action=Ask&Text=Who won the award for Best Picture in 2012?&MaxResults=2&Sort=Confidence&SystemNames=MovieFactBank
NOTE: Each answer system in Answer Server scores its answers independently, so scores from one system might not be comparable to scores from another.
-
MinScore specifies the minimum score that an answer must have for it to return as a result.
-
CustomizationData specifies additional information to include in the request. For a fact bank or passage extractor system, you can use this option to include a security info string. In this case, fact bank returns only facts that the user has access to, and passage extractor returns answers only if they appear in documents that the user has access to.
Action=Ask&Text=What is the gift and entertainment policy?&CustomizationData=[{"system_name":"MyPassageExtractor", "security_info": "MTQ0lGDBkNrJvBv0pOi+QDBK1z6y/1/09BqL4Vu/18W7JGCy8Pvm4/wixO/pI99/A=="}]
For an answer bank system, you can use this option to supply additional
FieldText
to provide in the query to the answer bank Agentstore. This option allows you to restrict the Ask action to a subset of your Answer Bank data (for example, content relevant to a particular region), without having to set up multiple Answer Bank systems and Agentstores.Action=Ask&Text=What is the gift and entertainment policy?&CustomizationData=[{"system_name":"MyAnswerBank", "fieldtext": "MATCH{UK,EUROPE}:REGION"}]
TIP: You can add the custom fields to your question equivalence classes as metadata. See Create a Question Equivalence Class and Add an Answer.
You can retrieve the full schema for the JSON object to use in CustomizationData by using the GetResources action. See Find the JSON Schema for Your Update.
For more information about the Ask action, refer to the Answer Server Reference.