An NLP model used to detect keywords in the transcript of the input audio. For example, you can have keyword detection which will trigger every time the word "red" is said, and another trigger for the word "yellow".

var options = VoiceML.ListeningOptions.create();

var nlpKeywordModel = VoiceML.NlpKeywordModelOptions.create();
nlpKeywordModel.addKeywordGroup("Fruit", ["orange", "apple"]);
nlpKeywordModel.addKeywordGroup("Vegetable", ["carrot", "tomato"]);

options.nlpModels = [ nlpKeywordModel ];
interface KeywordModelGroup {
    keywords: string[];
    name: string;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
}

Hierarchy (view full)

Properties

keywords: string[]

Array of keywords that are being sent to the ML model for detection with similar meaning. For example, putting the word "yellow" would trigger a response in the sentence "I saw a yellow bird". The keyword detection model supports slight variation in the word transcription. We recommend adding possible synonyms of the same keyword. So for example, should you want to detect "movie", you might want to consider adding "video" and possibly "feature" and "flick" as well to the list resulting in ["movie", "video", "feature","flick"] as different people might express themselves differently.

name: string

Name of the keyword group.

Methods

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean