Skip to content

Latest commit

 

History

History

Iciclecreek.Bot.Builder.Dialogs.Recognizers.Lucy

LucyRecognizer

Lucy is an Entity Recognition engine which defines a simple syntax for recognizing entities in text.
See

Usage

Add nuget package

Add Iciclecreek.Bot.Builder.Dialogs.Recognizers.Lucy nuget reference to your project.

Register

To add to your schema for usage in Bot Framework Composer from cli:

bf dialog:merge -p yourproj.proj -o your.schema

Defining a model

This package adds a new recognizer kind Iciclecreek.LucyRecognizer.

Declaratively in .dialog files you can define the Lucy model in 3 ways:

Define as JSON inline to the .dialog file

"recognizer": {
    "$kind": "Iciclecreek.LucyRecognizer",
    "model": {
        "locale": "en",
        "entities": [
            {
                "name": "colors",
                "patterns": [
                    [ "red", "rojo" ],
                    "green",
                    "blue",
                    "yellow",
                    "purple",
                    "white",
                    "orange"
                ]
            },
            ...
        ]
    }
},

Storing model in a seperate a resource

Or you can put the model in a .json resource such as example.json

"recognizer": {
    "$kind": "Iciclecreek.LucyRecognizer",
    "resourceId": "example.json"
},

Or in a .yaml resource such as example.yaml. example.yaml:

locale: en
entities:
  - name: '@colors'
    patterns:
       - [red, rojo]
       - green
       - blue
       - yellow
       - purple
       - white
       - orange
"recognizer": {
    "$kind": "Iciclecreek.LucyRecognizer",
    "resourceId": "example.yaml"
},

Intents

The default is that if any entities are found then an intent of "Matched" is returned.

You can promote any named entity to an intent by adding it to the the intents array.

"recognizer": {
    "$kind": "Iciclecreek.LucyRecognizer",
    "resourceId": "example.yaml",
    "intents": [ "drinkOrder",... ] 
},