Lucy is an Entity Recognition engine which defines a simple syntax for recognizing entities in text.
See
- Lucy Documentation
- LucyPad2 - online editor for working with Lucy models.
Add Iciclecreek.Bot.Builder.Dialogs.Recognizers.Lucy
nuget reference to your project.
To add to your schema for usage in Bot Framework Composer from cli:
bf dialog:merge -p yourproj.proj -o your.schema
This package adds a new recognizer kind Iciclecreek.LucyRecognizer.
Declaratively in .dialog files you can define the Lucy model in 3 ways:
"recognizer": {
"$kind": "Iciclecreek.LucyRecognizer",
"model": {
"locale": "en",
"entities": [
{
"name": "colors",
"patterns": [
[ "red", "rojo" ],
"green",
"blue",
"yellow",
"purple",
"white",
"orange"
]
},
...
]
}
},
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"
},
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",... ]
},