The Admin Interface
You use the Admin Interface to create, edit, launch and monitor natural language interfaces (NLIs). The interface consists of several pages, each accessible from the navbar at the top (see top of figure 1). On the navbar, from left to right, NLIs is where you launch natural language interfaces, Create is where you create new configurations and Edit is where you edit and extend existing configurations. On the far right part of the navbar, there is a memory usage meter, a link to documentation and the C-Phrase logo which, if hovered over, shows the current version of C-Phrase. Finally, there is a logout button.
The NLIs page
The NLIs page lets you launch natural language interfaces (NLIs) and shows those currently running.
To launch an NLI, select
configuration/examples/port combinations and click 'Launch'.
In figure 1, the administrator has already launched four NLIs using four different
configurations. These NLIs can be accessed through the browser via the given NLI
link on the left
of each table entry. The home button will take you to the home of each configuration. The .cphrase file,
examples, port and parameters
buttons will take you to the corresponding files for the given configuration. The checkbox on the far left lets
you terminate or restart a given NLI.
The Create page
Figure 2 shows the Create page where you can create or upload new configurations.
In the left half of the page you can create a configuration for a remote database by specifying the
configuration name, database engine, connection parameters and some characterization of the size
of the remote database. Here we see this being specified for the example World
database.
In the upper right portion of the Create Page you can create empty stand-alone configurations that you can
later extend via editing. Finally, in the bottom right portion of the Create Page,
you can upload earlier or backed-up configurations.
You will need to do this when you upgrade to newer versions of C-Phrase.
The Edit page
Figure 3 shows the Edit page where you do the bulk of your work. On the left is the file navigator
where you select configuration folders or individual files. In the screen above the
world
configuration has been selected and thus we are in its home where a set of nine action buttons
are available for selection. By clicking the action button Edit,
you can open the tree editor for the .cphrase
file for world
(see figure 4). The
Copy,Rename and Remove actions apply to the entire directory of the current configuration.
Launch NLI takes you to the NLIs page with the current configuration selected. Add Question Set
lets you build up a set of example natural language questions to present to users. You can click
Build DB from .cphrase and the tables and state within the .cphrase file will be added to the existing database
(Note since the account on the remote database is readonly, this would fail for world). For stand-alone
configurations,
if it does not already exist, an SQLite database is built
directly from the .cphrase configuration. A related operation is to Copy DB into .db_xml. This builds a
.db_xml
file with the state of the current database. This operation is dangerous for
very large databases because it literally will copy the entire contents of the database into the
.db_xml
file. The Download ZIP action downloads a .zip
file containing the
entire configuration directory. This operation lets administrators back-up their configurations as well as
migrate configurations to newer versions of C-Phrase . Finally, in the zone at the bottom, administrators
may upload specific files and sub-directories into the currently selected configuration directory. Normally this
will be CSV files that the administrator is ingesting into the database.
Managing .cphrase files
The <configuration-name>.cphrase
file is where you specify which tables and views of the
underlying database can be accessed and with what phrases. A detailed description of the
.cphrase
file format is presented The Format Manual.
In figure 4, the administrator has clicked on the edit action and the .cphrase tree editor is brought up
for the world
configuration. This is where you build and edit a
.cphrase
file.
The operations in this editor are fairly straightforward provided one has studied in detail the
.cphrase file format. Once you have updated and saved a configuration, you
must launch or restart an NLI for users to make use it.
Managing .corpus files
A .corpus
file represents question sets that may be presented as examples to users. Corpus
files can either be edited directly or tree edited. A detailed description of the
.corpus
format is presented The Format Manual.
In figure 5 we see the tree editor for corpus files where we specify a set of pre-build example questions to present to users as examples or as constants directives that can be used in explorer of the NLI Portal to help users click construct questions and commands.
In addition to providing examples, corpus files can also be used in testing.
New corpus files are obtained by opening a log
file, clicking on Q and then running the corpus.xql
routine. The result of this
can then be pasted into the XML that defines the corpus. One can build tests from corpus files
and then later re-run such tests to check whether behaviour has changed.
This is particularly useful for testing whether extensions to
the configuration have broken any previously working questions.
Managing other files
In the above figures 4 the contents of the world
configuration directory are displayed in the file
navigator. There are several distinct file types other than the .cphrase
and .corpus
files
that are relevant:
- The
.log
files are XML-based logs of user sessions over the NLI. When opened, the full log in all its detail is shown. You can then run various in-built XQuery routines to better view and analyse these logs. These XQuery routines have self-explanatory names. -
The
<configuration-name>.py
file is a special initialization files that C-Phrase executes when an NLI is launched. This sets configuration specific NLI parameters . -
The
config.json
file is where you may fix user name/password authentication to control which users have access to launched NLIs. One also specifies the default port and proxies of a given NLI as well as the number of simultaneous users (threads) the NLI can support. - The
.db
files are binary files are SQLite databases that are used in stand-alone configurations . After building up a.cphrase
file, administrators create these SQLite database (.db file) directly. - The
.db_xml
files are XML files representing the entire contents of a database. These are used to migrate databases and evolve databases in highly agile use cases. See this video for an example use of this to migrate a remote Oracle database to a stand-alone SQLite database.
Finally the config.json
file at the root of file navigator
is where you can change the administration user and password of the
Admin Server
.
Changing the administrator user name and password
If you wish to change the username/password for Admin Server
, navigate to the Edit page and
then click on the config.json
at the top left and edit the username and password values. In
the screen below, we have changed the username to "michael" and the password to "monGOOSE-123". Save this
file by clicking on the red save button. After this restart the Admin Server.
Documentation Page
The documentation page always points to the latest version of the documentation hosted at https://c-phrase.com/documentation
Migrating to newer versions of the C-Phrase AMI
Periodically there will be new releases of the C-Phrase that include new features, performance improvements
and bug fixes.
To migrate to a new version, first download all of your configurations as .zip files via the Admin Interface on
your old C-Phrase host.
Then extract these .zip files onto your local file system. Now launch a new version of C-Phrase.
Once you log into
the Admin Interface on this new instance, navigate to the Create
page and drag your extracted
directories in the
"Drop configuration folder here" zone at the bottom right of the screen. This is how you will be able to migrate
your
configurations to newer versions of C-Phrase.