Creating a New Demo

Once you've created your task, you have the option of setting up a demo for the task. Tutorial 4 shows you what this demo looks like in the sample task.

Step 1: Create a demo.xml file

In your task directory, create an empty file named demo.xml.

Step 2: Name your demo and set up your template

Create a toplevel <demo> element, and give your demo a name:

<demo name="My Widget Demo">

This name is the name the user will see as the heading and title of the demo page.

Step 3: Add a description

You'll probably want to describe the demo to your audience. You can do this using the <description> element, which can contain arbitrary HTML if you mark it explicitly as XML CDATA:

<demo name="My Widget Demo">
<p>This demo shows the widget task.

<p>Contact <a href="">me</a> for more details.

Step 4: Add your activities

There might be a number of activities the user can do on the demo page, especially if you've customized your task. Typically, however, there will be a single activity, namely to tag documents. The <engine_settings> element defines the arguments to MATEngine which maps the input document to the outputs. You can also make it possible to enable blank documents (i.e., allow empty documents that the user can type into):

<activity name="Tag" enable_blank_document="yes">
<description>Automatically locate widgets in the document.</description>
<engine_settings task = "My Widget Task" workflow="Demo" steps="zone,tokenize,tag"/>
<sample_document description="Sample article #1"
file_type = "raw"

You can have multiple sample documents.

One reason to have multiple activities might be if you want to prepare some documents ahead of time, e.g., to zone and tokenize the document.

Note that in order for automated tagging to work, you must either have a default model specified in your task (and already built), or you must provide the path to an existing model as part of the <engine_settings>.

Step 5: Install the demo

If your task isn't already installed, use the MATManagePluginDirs tool to ensure that MAT knows about your task directory. If <dir> is your task directory:


% $MAT_PKG_HOME/bin/MATManagePluginDirs install <dir>

Windows native:

> %MAT_PKG_HOME%\bin\MATManagePluginDirs.cmd install <dir>

Step 6: View the demo

Once you have a task, a demo, and a model specified and built for the task, you can view and interact with your demo by surfing to http://localhost:7801/tasks/<lastpathcomponent>/demo, where <lastpathcomponent> is the last path component of the directory path of your task.