Description

Used to detect usage of certain keywords from the input audio.

Keyword detection (whose results will be returned in NlpKeywordResponse in the ListeningUpdateEventArgs) can happen in the mid input sentence (and in such case the the isFinalTranscription=false) or can happen at the end of the sentence (isFinalTranscription=true). Mid sentence detection have closer proximity to the time the word was spoken, but might be less accurate.

Example

var options = VoiceML.ListeningOptions.create();

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

options.nlpModels = [ nlpKeywordModel ];
interface NlpKeywordModel {
    keywordGroups: KeywordModelGroup[];
    addKeywordGroup(name, keywords): void;
    addParam(key, value): void;
    getTypeName(): string;
    isOfType(type): boolean;
    isSame(other): boolean;
}

Hierarchy (view full)

Properties

keywordGroups: KeywordModelGroup[]

Description

Holds group of keywords to be used in the ML model.

Methods

  • Parameters

    • name: string
    • keywords: string[]

    Returns void

    Description

    Adds a keyword group to the keywords model, the group name will be returned in NlpKeywordResponse to indicate one of the keywords in the group has been detected. Groups are used to include synonyms, or context similar words. addKeywordGroup("walk", ["walk", "jog", "strolls"]).

  • Parameters

    • key: string
    • value: string

    Returns void

    Description

    Adds additional params to set in the ML engine.

  • Returns string

    Description

    Returns the name of this object's type.

  • Parameters

    • type: string

    Returns boolean

    Description

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

  • Parameters

    Returns boolean

    Description

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

Generated using TypeDoc