Authoring
Customize your NLI
No matter if it is remote or stand-alone, you will probably want to improve the quality of your initial NLI by customizing it. This is achieved using the tree editor of the Admin Interface to attach phrases to database elements and to set special properties on table columns. It may also involve setting NLI parameters to best fit performance, recall and precision tradeoffs. While you may need to specify some regular expressions and some SQL templates, there is no grammar to specify, nor are there training sets that need to be managed.
Tables in Catch-Phrase correspond exactly to the SQL notion of tables and include columns, primary keys, foreign keys, etc. Still, we encourage administrators to consider tables as representing either entities or many-to-many relationships in some ER model of the database domain (foreign keys represent many-to-one and one-to-many relationships).
A simple example entity table element from geo.cphrase
is:
<table id="Lake" lex="lake,lakes,sjö,sjöar"> <column id="name" type="text"/> <column id="area" type="int"/> <primary_key key="name"/> </table>
A many-to-many relationship between Lake
and State
is represented in the table:
<table id="Lakeinstate" silent="true" lex="lake-state membership record,lake-state membership records,accesses,within,has within,is within"> <column id="state" type="text" properties="none"/> <column id="lake" type="text" properties="none"/> <foreign_key from="state" to="State"/> <foreign_key from="lake" to="Lake"/> </table>
Finally, to complete the example, the many-to-one relationship between mountains and states is represented directly on the
Mountain
table element as a foreign key:
<table id="Mountain" lex="mountain,mountains,mount,peak,summit"> <column id="state" type="text" lex="state,states,located,where" properties="none"/> <column id="name" type="text"/> <column id="height" type="int" lex="height,heights,how tall" units="meters"> <max lex="highest,tallest"/> <min lex="shortest"/> </column> <primary_key key="name"/> <foreign_key from="state" to="State" lex="in,that have,of"/> </table>
We find that distinguishing tables as entities (nouns) or relationships (verbs) fits very well with NLIs. Still these are only recommended design principles and are not enforced in any way within Catch-Phrase.
Considering that you have a reasonable model of the data as represented in tables, the act of configuring starts with the very simple process of associating phrases with database elements.