1

From the Watson Dialog document, it indicates the configuration setups for connecting with NLC. But it is hard to understand how this works without a running sample application. Most of examples can be googled are without such settings. I were trying to find some examples which using the indicated setups from 'classifier' settings and 'INTENT:{xxxxxx}' settings etc. per docuemnt . It will be great if someone could help on this, very appreciated.

nyker
  • 57
  • 4

1 Answers1

0

Here is an example using the demo NLC training data. Save that text to a CSV file.

  1. Create your NLC service. Name of the service doesn't matter.

  2. Once created, click the "Access Beta Toolkit". You will need to login again, and allow the toolkit access to the NLC service.

  3. Click the "Upload training data" button. Select your CSV file you saved earlier. If it works, you will see your intents + questions. If it fails, most common issue is not giving it a csv file extension.

  4. Click "Create classifier". Name is not important.

  5. Clicking training data/classifiers to see if it has finished compiling. It can take some time to complete.

  6. Once the classifier finishes compiling it should show you the classifier id value. Example: 3d84bfx43-nlc-10356

  7. Copy the text below to an XML file. Where you see CLASSIFIER_ID_GOES_HERE change to your classifier id.

    <?xml version="1.0" encoding="UTF-8"?>
    <dialog xsi:noNamespaceSchemaLocation="WatsonDialogDocument_1.1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <flow>
            <folder label="Main">
                <output>
                    <prompt selectionType="RANDOM">
                        <item>Enter your weather related question.</item>
                    </prompt>
                    <getUserInput>
                        <search ref="folder_200143"/>
                        <default>
                            <output>
                                <prompt selectionType="RANDOM">
                                    <item>I couldn't determine what you are asking about.</item>
                                </prompt>
                            </output>
                        </default>
                    </getUserInput>
                </output>
            </folder>
            <folder label="Library">
                <folder label="NLC Intents" id="folder_200143">
                    <input isAutoLearnCandidate="false" isRelatedNodeCandidate="true">
                        <grammar>
                            <item>conditions</item>
                        </grammar>
                        <output>
                            <prompt selectionType="RANDOM">
                                <item>I believe you are asking about conditions. </item>
                            </prompt>
                        </output>
                    </input>
                    <input>
                        <grammar>
                            <item>temperature</item>
                        </grammar>
                        <output>
                            <prompt selectionType="RANDOM">
                                <item>I believe you are asking about temperture. </item>
                            </prompt>
                        </output>
                    </input>
                </folder>
            </folder>
            <folder label="Global"/>
            <folder label="Concepts"/>
        </flow>
        <constants>
            <var_folder name="Home"/>
        </constants>
        <variables>
            <var_folder name="Home">
                <var name="CLASSIFIER_CLASS_0" type="TEXT" description="auto-created"/>
                <var name="CLASSIFIER_CONF_0" type="TEXT" description="auto-created"/>
                <var name="CLASSIFIER_CLASS_1" type="TEXT" description="auto-created"/>
                <var name="CLASSIFIER_CONF_1" type="TEXT" description="auto-created"/>
            </var_folder>
        </variables>
        <settings>
            <setting name="AUTOLEARN" type="USER">false</setting>
            <setting name="LANGUAGE" type="USER">en-US</setting>
            <setting name="RESPONSETIME" type="USER">-2</setting>
            <setting name="MAXAUTOLEARNITEMS" type="USER">4</setting>
            <setting name="NUMAUTOSETRELATED" type="USER">0</setting>
            <setting name="TIMEZONEID" type="USER">Australia/Sydney</setting>
            <setting name="AUTOSETRELATEDNODEID" type="USER">0</setting>
            <setting name="INPUTMASKTYPE" type="USER">0</setting>
            <setting name="CONCEPTMATCHING" type="USER">0</setting>
            <setting name="DNR_NODE_ID">-15</setting>
            <setting name="MULTISENT">0</setting>
            <setting name="USE_CONCEPTS">3</setting>
            <setting name="ENTITIES_SCOPE">3</setting>
            <setting name="USER_LOGGING">2</setting>
            <setting name="USE_TRANSLATIONS">3</setting>
            <setting name="USE_STOP_WORDS">3</setting>
            <setting name="USE_SPELLING_CORRECTIONS">3</setting>
            <setting name="USE_AUTOMATIC_STOPWORDS_DETECTION">0</setting>
            <setting name="PLATFORM_VERSION">10.1</setting>
            <setting name="UI_COLOUR"></setting>
            <setting name="PARENT_ACCOUNT"></setting>
            <setting name="AL_NONE_LABEL">None of the above</setting>
            <setting name="CLS_SEARCH_MODE">0</setting>
            <setting name="CLS_MODEL">0</setting>
            <setting name="CLS_ENDPOINT"></setting>
            <setting name="CLS_USERNAME"></setting>
            <setting name="CLS_PASSWORD"></setting>
            <setting name="CLS_MODELNAME">CLASSIFIER_ID_GOES_HERE</setting>
            <setting name="CLS_ADVANCED_SETTINGS">false</setting>
            <setting name="CLS_MAXNBEST">3</setting>
            <setting name="CLS_USE_OFFTOPIC">false</setting>
            <setting name="DEFAULT_DNR_RETURN_POINT_CANDIDATE">-1</setting>
        </settings>
        <specialSettings>
            <specialSetting label="DNR Join Statement">
                <variations/>
            </specialSetting>
            <specialSetting label="AutoLearn Statement">
                <variations/>
            </specialSetting>
        </specialSettings>
    </dialog>
    
  8. Upload that file to your dialog service and test it.

Simon O'Doherty
  • 9,259
  • 3
  • 26
  • 54
  • Option 2 is to start using the "Conversation" service. As it makes all this a lot easier to build. It also supports entities as well as intents. – Simon O'Doherty Jul 06 '16 at 07:45
  • Excellent! Option 1 works; Could you tell more detail of Option 2's "Conversation" service? – nyker Jul 06 '16 at 10:10
  • 2
    I would strongly recommend option 2. Conversation service can be found on bluemix here: https://console.ng.bluemix.net/catalog/services/conversation/ and is a new service we've released that combines NLC technology with a leaner, more flexible dialog model. Its much easier to use as the two technologies are combined, and gives an easy to use tooling experience for dialog instead of the XML. Note that currently it is in experimental phase, to go GA shortly. But this means the dialog and entity documentation is not quite ready, and some features arent available yet. – Mitch Jul 06 '16 at 16:09