The Answer Server configuration file contains information about the subcomponents in your Fact Bank systems.
For any Fact Bank system, you must configure the name of your Question Parser and time normalization Eduction grammars and Lua scripts, and the locations of the Fact Bank coding files. You must also configure the Fact Store.
You can optionally also configure a second Eduction grammar for advanced time normalization. Advanced time normalization extracts dates and times in various formats from questions and normalize them to a consistent format, to improve fact retrieval.
The Fact Store component stores the facts that you want to be able to retrieve. The Fact Store content is structured data, containing the entities and properties for your facts. As such, Micro Focus recommends that you use a SQL database as the backend component for your fact store, because it is optimized for querying structured content.
Alternatively, you can use a Lua script to retrieve facts from an external fact store.
You specify the type of Fact Store that you want to use by configuring the BackendType
configuration parameter in the system configuration section in the Answer Server configuration file. Depending on which back end type you choose, you must also set additional configuration parameters.
The following sections describe how to configure the Fact Bank system in Answer Server, depending on the type of Fact Store you choose.
DEPRECATED: In earlier versions of Answer Server you could use an IDOL Content component fact store. This option is deprecated in Answer Server version 11.5 and later. Micro Focus recommends that you use a SQL database as your fact store.
The IDOL Content component fact store option is still available for existing implementations, but it might be incompatible with new functionality. For information about how to set up the IDOL Content component fact store, refer to the documentation for Answer Server version 11.4.
The following procedure describes the Answer Server configuration you need to set up a Fact Bank system with a SQL database back end. For information about how to set up the SQL database, see Set Up a SQL Backend as Fact Store.
To configure the Fact Bank System for a SQL database backend
Open the Answer Server configuration file in a text editor.
Find the [Systems]
section, or create one if it does not exist. This section contains a list of systems, which refer to the associated configuration sections for each system.
After any existing systems, add an entry for your new Fact Bank system. For example:
[Systems] 0=MyAnswerBank 1=MyFactBank
Create a configuration section for your Fact Bank system, with the name that you specified. For example, [MyFactBank]
.
Set Type
to FactBank
.
Set BackendType
to sqldb
.
Set ConnectionString
to the connection string to use to connect to the RDBMS that contains the fact store content.
Set EductionQuestionGrammars
to the name of your question parser grammar. You can also optionally set EductionEntities
to a list of entities to use from the specified grammars.
Set EductionTimeGrammars
to the name of the Eduction grammar to use for advanced time normalization. You can also optionally set TimeEntities
to a list of entities to use from the specified grammars.
Set EductionLuaScript
and TimeLuaScript
to the file name and path to the Lua scripts to use for question parsing and time normalization.
Specify how Fact Bank must access your coding files by using one of the following methods:
To use coding text files (see Create Coding Files):
CodifierType
to files
.CodingsPath
and CodingsDatPath
to the locations of the coding files.To use a coding database (see Set up a SQL Database for Coding Information):
CodifierType
to odbc
.CodingsConfigSection
to the name of a configuration section where you define the connection information your coding database.[FactBankCodings0]
).ConnectionString
to the connection string to use to connect to the RDBMS that contains the coding information.(Optional) Set the parameter AskParallelizationFactor
to specify the number of threads to use to gather answers (for each ask
action). The default value is 1
but if your Answer Server has sufficient resources you can improve response times by increasing the number.
Save and close the configuration file.
Restart Answer Server for your changes to take effect.
For example:
[MyFactBank] Type=factbank AskParallelizationFactor=4 // Question Parser EductionQuestionGrammars=./resources/grammars/question_grammar_en.ecr EductionLuaScript=./resources/lua/question_grammar_en.lua EductionTimeGrammars=./resources/grammars/datetime_processing.ecr TimeLuaScript=./resources/lua/datetime.lua // Fact Store BackendType=sqldb ConnectionString=Driver={PostgreSQL};Server=sql-host.mycompany.com;Port=5432;Database=factstoredb;Uid=postgres;password=password; // Coding Files CodingsPath=./codings CodingsDatPath=./codings
The following procedure describes the Answer Server configuration you need to set up a Fact Bank system to call a Lua script to retrieve facts. For information about how to write the script, see Use a Lua Scripts to Retrieve Facts and the Answer Server Reference.
To configure the Fact Bank system for a Lua Script backend
Open the Answer Server configuration file in a text editor.
Find the [Systems]
section, or create one if it does not exist. This section contains a list of systems, which refer to the associated configuration sections for each system.
After any existing systems, add an entry for your new Fact Bank system. For example:
[Systems] 0=MyAnswerBank 1=MyFactBank
Create a configuration section for your Fact Bank system, with the name that you specified. For example, [MyFactBank]
.
Set Type
to FactBank
.
Set BackendType
to Lua
.
Set ScriptPath
to the path to the Lua script that you want to run as your Fact Bank. Answer Server calls out to this script whenever it processes an Ask
action that includes the Lua Fact Bank system, and returns the response as an answer.
ScriptFunction
to the entry function in your Lua script that Answer Server must call. The default entry function is called fetch
.Set EductionQuestionGrammars
to the name of your question parser grammar. You can also optionally set EductionEntities
to a list of entities to use from the specified grammars.
Set EductionTimeGrammars
to the name of the Eduction grammar to use for advanced time normalization. You can also optionally set TimeEntities
to a list of entities to use from the specified grammars.
Set EductionLuaScript
and TimeLuaScript
to the file name and path to the Lua scripts to use for question parsing and time normalization.
Specify how Fact Bank must access your coding files by using one of the following methods:
To use coding text files (see Create Coding Files):
CodifierType
to files
.CodingsPath
and CodingsDatPath
to the locations of the coding files.To use a coding database (see Set up a SQL Database for Coding Information):
CodifierType
to odbc
.CodingsConfigSection
to the name of a configuration section where you define the connection information your coding database.[FactBankCodings0]
).ConnectionString
to the connection string to use to connect to the RDBMS that contains the coding information.(Optional) Set the parameter AskParallelizationFactor
to specify the number of threads to use to gather answers (for each ask
action). The default value is 1
but if your Answer Server has sufficient resources you can improve response times by increasing the number.
Save and close the configuration file.
Restart Answer Server for your changes to take effect.