mirror of
https://github.com/leon-ai/leon.git
synced 2024-11-23 20:12:08 +03:00
feat(server): introduce resolvers for slot filling (wip)
This commit is contained in:
parent
7e70f41774
commit
334bf393f2
@ -1,18 +0,0 @@
|
||||
{
|
||||
"name": "system.affirm",
|
||||
"utterance_samples": [
|
||||
"Yes",
|
||||
"Yep",
|
||||
"Yup",
|
||||
"Yeah",
|
||||
"Let's do it",
|
||||
"For sure",
|
||||
"Sure thing",
|
||||
"Of course!",
|
||||
"Okay",
|
||||
"OK",
|
||||
"Alright",
|
||||
"Correct",
|
||||
"Indeed"
|
||||
]
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"name": "system.deny",
|
||||
"utterance_samples": [
|
||||
"No",
|
||||
"No no don't",
|
||||
"Nope",
|
||||
"Naa",
|
||||
"No thanks",
|
||||
"No I'm fine",
|
||||
"Hell no"
|
||||
]
|
||||
}
|
35
core/data/en/resolvers/affirm_deny.json
Normal file
35
core/data/en/resolvers/affirm_deny.json
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "affirm_deny",
|
||||
"intents": {
|
||||
"system.affirm": {
|
||||
"utterance_samples": [
|
||||
"Yes",
|
||||
"Yep",
|
||||
"Yup",
|
||||
"Yeah",
|
||||
"Let's do it",
|
||||
"For sure",
|
||||
"Sure thing",
|
||||
"Of course!",
|
||||
"Okay",
|
||||
"OK",
|
||||
"Alright",
|
||||
"Correct",
|
||||
"Indeed"
|
||||
],
|
||||
"value": true
|
||||
},
|
||||
"system.deny": {
|
||||
"utterance_samples": [
|
||||
"No",
|
||||
"No no don't",
|
||||
"Nope",
|
||||
"Naa",
|
||||
"No thanks",
|
||||
"No I'm fine",
|
||||
"Hell no"
|
||||
],
|
||||
"value": false
|
||||
}
|
||||
}
|
||||
}
|
@ -80,14 +80,16 @@ export default () => new Promise(async (resolve, reject) => {
|
||||
/**
|
||||
* TODO:
|
||||
* 1. Merge person, location and organization to the
|
||||
* NER before processing NLU (cf. line 210 in nlu.js)
|
||||
* NER before processing NLU (cf. line 210 in nlu.js): OK
|
||||
* 2. Grab intents with slots
|
||||
* 3. .addSlot() as per the slots config
|
||||
* 4. Train resolvers (affirm_deny)
|
||||
*/
|
||||
if (intent === 'guess_the_number.start') {
|
||||
console.log('iiin')
|
||||
// nlp.slotManager.addSlot(intent, 'number', true, { [lang]: 'How many players?' })
|
||||
nlp.slotManager.addSlot(intent, 'person', true, { [lang]: 'How many players?' })
|
||||
// nlp.slotManager.addSlot(intent, 'person', true, { [lang]: 'How many players?' })
|
||||
nlp.slotManager.addSlot(intent, 'boolean', true, { [lang]: 'How many players?' })
|
||||
}
|
||||
|
||||
for (let l = 0; l < utteranceSamples.length; l += 1) {
|
||||
|
@ -11,7 +11,9 @@
|
||||
"slots": [
|
||||
{
|
||||
"name": "players_nb",
|
||||
"entity": "number",
|
||||
"entity": {
|
||||
"name": "number"
|
||||
},
|
||||
"answers": [
|
||||
"How many players should I set?"
|
||||
]
|
||||
@ -61,34 +63,15 @@
|
||||
"input_context": [
|
||||
"deciding"
|
||||
],
|
||||
"utterance_samples": [
|
||||
"Yes",
|
||||
"Yep",
|
||||
"Yup",
|
||||
"Yeah",
|
||||
"Let's do it",
|
||||
"For sure",
|
||||
"Sure thing",
|
||||
"Of course!",
|
||||
"No",
|
||||
"No no don't",
|
||||
"Nope",
|
||||
"Naa",
|
||||
"No thanks",
|
||||
"No I'm fine",
|
||||
"Okay",
|
||||
"OK",
|
||||
"Alright",
|
||||
"Correct",
|
||||
"Indeed"
|
||||
],
|
||||
"slots": [
|
||||
{
|
||||
"name": "decision",
|
||||
"entity": {
|
||||
"boolean": "confirmations.json"
|
||||
"resolver": {
|
||||
"name": "affirm_deny"
|
||||
},
|
||||
"lifespan": 1
|
||||
"answers": [
|
||||
"Would you like to play another round?"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user