botpress / nlu

This repo contains every ML/NLU related code written by Botpress in the NodeJS environment. This includes the Botpress Standalone NLU Server.
23 stars 21 forks source link

[BUG] Bots with nothing to train stuck forever at needs training #69

Closed charlescatta closed 2 years ago

charlescatta commented 3 years ago
08/04/2021 18:33:19.106 Mod[nlu] Training {"botId":"test","language":"ar"} could not finish because of an unexpected error. [Error, An error occured in NLU server: child "intents" fails because ["intents" at position 0 fails because [child "utterances" fails because ["utterances" is required]]]]
STACK TRACE
Error: An error occured in NLU server: child "intents" fails because ["intents" at position 0 fails because [child "utterances" fails because ["utterances" is required]]]
    at StanEngine._throwError (/home/charles/code/botpress/modules/nlu/dist/backend/stan/index.js:201:11)
    at StanEngine.startTraining (/home/charles/code/botpress/modules/nlu/dist/backend/stan/index.js:105:19)
    at async Bot.train (/home/charles/code/botpress/modules/nlu/dist/backend/application/scoped/bot.js:52:23)
    at async DistributedTrainingQueue._train (/home/charles/code/botpress/modules/nlu/dist/backend/application/training-queue.js:120:25)

This only occurs when a bot has no trainable elements: no intents, no entities and no Q&As

franklevasseur commented 3 years ago

Hi,

There is 2 way to solve this problem:

1) Less strict preconditions in the NLU server 2) Make Botpress mutate the train-set before sending it to make sure it respects the NLU-server preconditions

Personally, I'm a strong believer of the rule "when you must fail, fail noisily and as soon as possible", so I would probably go with option #2.

What do you think about it ?

charlescatta commented 3 years ago

Joi validation change as we discussed!

franklevasseur commented 2 years ago

Fixed in https://github.com/botpress/studio/pull/213.

Not released yet, but should be available soon.