NlpService
Defined in: service/service.ts:20
Resolves an NlpEngine over whatever providers a Services container has registered, and holds it for the life of that container.
The engine itself takes plain arrays so it can be tested in isolation; this is
the adapter that fetches them from the registry. Setup is deferred to first
use rather than done in the constructor because provider instances resolve
asynchronously and Services constructs synchronously.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NlpService(services): NlpService;Defined in: service/service.ts:24
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
services |
Services |
Returns
Section titled “Returns”NlpService
Methods
Section titled “Methods”[destroy]()
Section titled “[destroy]()”destroy: Promise<void>;Defined in: service/service.ts:64
Returns
Section titled “Returns”Promise<void>
classify()
Section titled “classify()”classify(text, options?): Promise<NlpMatch | undefined>;Defined in: service/service.ts:53
Matches text against every registered provider’s intents.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text |
string |
options |
NlpClassifyOptions |
Returns
Section titled “Returns”Promise<NlpMatch | undefined>
execute()
Section titled “execute()”execute(options): Promise<void>;Defined in: service/service.ts:59
Runs a match’s intent, exactly as NlpService.classify handed it back.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
NlpExecuteOptions |
Returns
Section titled “Returns”Promise<void>
getEngine()
Section titled “getEngine()”getEngine(): Promise<NlpEngine>;Defined in: service/service.ts:45
The engine, trained. The first caller pays for training; everyone after shares it, including the callers that arrive while that first train is still running.
Returns
Section titled “Returns”Promise<NlpEngine>