$caila.simpleInference
Classifies the text without any additional parameters.
Syntax
The method accepts the text for parsing in the string argument.
- ECMAScript 5
- ECMAScript 6
$caila.simpleInference("hello");
In the ECMAScript 6 runtime, the method is asynchronous:
await $caila.simpleInference("hello");
A JSON object with the phrase classification result is returned in response.
Let us define the hello intent with the following training phrases: hello, hi. The classification result for the hello phrase is:
{
"intent":{
"id":12174, // intent id
"path":"/hello", // the path to the intent
"slots":[
]
},
"confidence":1, // confidence level
"slots":[ // slots
]
}
tip
You can also use the custom
clientId identifier as a method argument. Specify the clientId identifier as the last argument. When $caila.simpleInference() is executed, entities will be recognized for the specified client.How to use
- ECMAScript 5
- ECMAScript 6
state: Example
q!: simpleInference
script:
$reactions.answer(JSON.stringify($caila.simpleInference("hello")));
state: Example
q!: simpleInference
scriptEs6:
$reactions.answer(JSON.stringify(await $caila.simpleInference("hello")));