Merge pull request #624 from Hexastack/fix/nlu-helper-format

fix: nlu format return
This commit is contained in:
Med Marrouchi 2025-01-24 07:40:42 +01:00 committed by GitHub
commit fe5420e3f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,5 @@
/* /*
* Copyright © 2024 Hexastack. All rights reserved. * Copyright © 2025 Hexastack. All rights reserved.
* *
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms: * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission. * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
@ -120,7 +120,10 @@ export default abstract class BaseNlpHelper<
* *
* @returns The formatted NLP training set * @returns The formatted NLP training set
*/ */
async format(samples: NlpSampleFull[], entities: NlpEntityFull[]) { async format(
samples: NlpSampleFull[],
entities: NlpEntityFull[],
): Promise<Record<string, any>[] | Record<string, any>> {
const entityMap = NlpEntity.getEntityMap(entities); const entityMap = NlpEntity.getEntityMap(entities);
const valueMap = NlpValue.getValueMap( const valueMap = NlpValue.getValueMap(
NlpValue.getValuesFromEntities(entities), NlpValue.getValuesFromEntities(entities),