Skip to content

Commit

Permalink
fix(nlu): only train models for languages that are loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
slvnperron committed Jun 27, 2019
1 parent 47f530c commit ab768fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/nlu/src/backend/engine.ts
Expand Up @@ -224,7 +224,9 @@ export default class ScopedEngine implements Engine {
getTrainingLanguages = (intents: sdk.NLU.IntentDefinition[]) =>
_.chain(intents)
.flatMap(intent =>
Object.keys(intent.utterances).filter(lang => (intent.utterances[lang] || []).length >= MIN_NB_UTTERANCES)
Object.keys(intent.utterances)
.filter(lang => this.languages.includes(lang))
.filter(lang => (intent.utterances[lang] || []).length >= MIN_NB_UTTERANCES)
)
.uniq()
.value()
Expand Down

0 comments on commit ab768fe

Please sign in to comment.