Functions for working with NLU are designed to recognize intentions and entities in texts received from the user. These functions allow the bot to understand what the user wants to say, as well as extract meaningful information from the text, such as dates, locations, or other entities.
Performs intent and entity recognition in the specified text using an NLU agent.
Signature: nlu.parse(text string, agentId string, timezoneOffset int = 0, version int = 1, confidenceThreshold float = -1) -> Sentence
Arguments:
text — the text of the message for which recognition is to be performed.agentId — the unique identifier of the NLU agent that will be used for recognition.timezoneOffset — the time zone offset required for the correct identification of temporal entities. The default offset is used for UTC.version — NLU version. Can be only set to 11 (other versions are deprecated).confidenceThreshold — a value from 0 to 0.99 that determines the confidence threshold for recognized intents.Result: The Sentence object, which contains the recognition result, including the intent and entities.
Example of use:
$sentence = nlu.parse(“Good morning!”, “d926726a-5acb-4233-8c1e-ce4300921de0”)