NluService

nlu.NluService

Service for standalone using and testing NLU. Provides the API for training custom datasets, using pretrained skills and performing recognition requests.

Properties

skillInfo

Readonly skillInfo: Record<string, SkillInformation>= {}

Mapping of skill names to information about skills used for recognition

Accessors

isClosed

• get isClosed(): boolean

Check if nlu service is closed

Returns: boolean

true if service is closed, false otherwise

Methods

close

close(): void

Close nlu service if it is alive

Returns: void


loadSkills

loadSkills(skills: SkillInformation[]): Promise<void>

Check if provided skills are available and use them in further recognitions

Parameters:

NameType
skillsSkillInformation[]

Returns: Promise<void>


recognize

recognize(text: string): Promise<RecognitionResult>

Process text in nlu service and return recognition result

Parameters:

NameTypeDescription
textstringText to be recognized

Returns: Promise<RecognitionResult>

recognition result


train

train(nluDatasetPath: string, language: string): Promise<string>

Train provided nlu dataset

Parameters:

NameTypeDescription
nluDatasetPathstringPath to nlu dataset
languagestringBCP 47 language tag denoting language of dataset (e. g. "en-US"). @see https://en.wikipedia.org/wiki/IETF_language_tag

Returns: Promise<string>

id of trained skill

train(nluContent: NluContent, language: string): Promise<string>

Train provided nlu dataset

Parameters:

NameTypeDescription
nluContentNluContentContent of nlu dataset
languagestringBCP 47 language tag denoting language of dataset (e. g. "en-US"). @see https://en.wikipedia.org/wiki/IETF_language_tag

Returns: Promise<string>

id of trained skill


create

Staticcreate(nluContent?: NluContent, language?: string, options?: NluOptions): Promise<NluService>

Create instance of NLU service Optionally train dataset @param nluContent with language @param language if provided

Parameters:

NameTypeDefault valueDescription
nluContent?NluContent-Intents file content
language?string-BCP 47 language tag denoting language of dataset (e. g. "en-US"). @see https://en.wikipedia.org/wiki/IETF_language_tag
optionsNluOptions{}Launch options

Returns: Promise<NluService>

Found a mistake? Let us know.

Enroll in beta

Request invite to our private Beta program for developers to join the waitlist. No spam, we promise.