mirror of
https://github.com/leon-ai/leon.git
synced 2024-11-27 16:16:48 +03:00
feat: slot filling (wip)
This commit is contained in:
parent
9ce9a8bc4f
commit
76547d9411
@ -1,5 +1,35 @@
|
||||
{
|
||||
"endpoints": [
|
||||
{
|
||||
"method": "GET",
|
||||
"route": "/api/action/leon/birthday/leon_birthday",
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
"method": "GET",
|
||||
"route": "/api/action/leon/birthday/when_birthday",
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
"method": "GET",
|
||||
"route": "/api/action/leon/birthday/my_birthday",
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
"method": "GET",
|
||||
"route": "/api/action/leon/birthday/color_meaning",
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
"method": "GET",
|
||||
"route": "/api/action/leon/birthday/specific_color_meaning",
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
"method": "GET",
|
||||
"route": "/api/action/leon/birthday/why",
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
"method": "GET",
|
||||
"route": "/api/action/leon/color/favorite_color",
|
||||
|
@ -80,7 +80,10 @@ class Ner {
|
||||
const conditionMethod = `add${string.snakeToPascalCase(condition.type)}Condition`
|
||||
|
||||
if (condition.type === 'between') {
|
||||
// e.g. list.addBetweenCondition('en', 'list', 'create a', 'list')
|
||||
/**
|
||||
* Conditions: https://github.com/axa-group/nlp.js/blob/master/docs/v3/ner-manager.md#trim-named-entities
|
||||
* e.g. list.addBetweenCondition('en', 'list', 'create a', 'list')
|
||||
*/
|
||||
this.ner[conditionMethod](lang, entity.name, condition.from, condition.to)
|
||||
} else if (condition.type.indexOf('after') !== -1) {
|
||||
const rule = {
|
||||
|
0
skills/leon/birthday/README.md
Normal file
0
skills/leon/birthday/README.md
Normal file
0
skills/leon/birthday/memory/.gitkeep
Normal file
0
skills/leon/birthday/memory/.gitkeep
Normal file
66
skills/leon/birthday/nlu/en.json
Normal file
66
skills/leon/birthday/nlu/en.json
Normal file
@ -0,0 +1,66 @@
|
||||
{
|
||||
"actions": {
|
||||
"leon_birthday": {
|
||||
"type": "dialog",
|
||||
"utterance_samples": [
|
||||
"What's your birth date?",
|
||||
"How old are you?",
|
||||
"When are you born?",
|
||||
"May I know when is your birthday?"
|
||||
],
|
||||
"answers": [
|
||||
"I'm born in February 2019.",
|
||||
"My first version has been released in February 2019."
|
||||
]
|
||||
},
|
||||
"when_birthday": {
|
||||
"type": "logic",
|
||||
"utterance_samples": [
|
||||
"Do you know when is my birthday?",
|
||||
"Do you remember when I am born?",
|
||||
"Do you know my birth date?",
|
||||
"When is Phoebe's birthday?",
|
||||
"Give me my birth date"
|
||||
],
|
||||
"entities": [
|
||||
{
|
||||
"type": "trim",
|
||||
"name": "person",
|
||||
"conditions": [
|
||||
{
|
||||
"type": "before_last",
|
||||
"to": ["birthday", "birth date"]
|
||||
},
|
||||
{
|
||||
"type": "between",
|
||||
"from": ["when"],
|
||||
"to": ["am","was"]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"slots": [
|
||||
{
|
||||
"name": "birth_date",
|
||||
"type": "date"
|
||||
}
|
||||
],
|
||||
"answers": {
|
||||
"birthday_found": [
|
||||
"%person%'s birthday is the %birth_date%",
|
||||
"%person% is born the %birth_date%"
|
||||
],
|
||||
"birthday_not_found": [
|
||||
"I'm not sure to remember, would you please tell me what is %person%'s birth date?",
|
||||
"I do not know, please share %person% birth date."
|
||||
]
|
||||
}
|
||||
},
|
||||
"my_birthday": {
|
||||
"utterance_samples": [
|
||||
"My birthday is the 6th of August",
|
||||
"I am born the @day of @month "
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
12
skills/leon/birthday/skill.json
Normal file
12
skills/leon/birthday/skill.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "Birthday",
|
||||
"type": "dialog",
|
||||
"bridge": null,
|
||||
"version": "1.0.0",
|
||||
"description": "Leon remembers birthdays and talk about his.",
|
||||
"author": {
|
||||
"name": "Louis Grenard",
|
||||
"email": "louis.grenard@gmail.com",
|
||||
"url": "https://github.com/louistiti"
|
||||
}
|
||||
}
|
0
skills/leon/birthday/test/.gitkeep
Normal file
0
skills/leon/birthday/test/.gitkeep
Normal file
Loading…
Reference in New Issue
Block a user