Lens Studio v4.4+
Inherits from VoiceML.BaseNlpModel
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.
addKeywordGroup(String name, String keywords) :
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"]).
Holds group of keywords to be used in the ML model.
addParam(String key, String value) :
Adds additional params to set in the ML engine.
Returns the name of this object’s type.
isOfType(String type) :
Returns true if the object matches or derives from the passed in type.
isSame(ScriptObject other) :
Returns true if this object is the same as
other. Useful for checking if two references point to the same thing.
options = VoiceML.ListeningOptions.create(); nlpKeywordModel = VoiceML.NlpKeywordModelOptions.create(); nlpKeywordModel.addKeywordGroup("fruit", ["orange", "apple"]); nlpKeywordModel.addKeywordGroup("vegtable", ["carrot", "tomato"]); options.nlpModels = [ nlpKeywordModel ];
Still Looking for help?Visit Support