Package com.keenresearch.keenasr
Class KASRResult
java.lang.Object
com.keenresearch.keenasr.KASRResult
An instance of the KIOSResult class, called recognition result, provides
results of the recognition.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the ASR Bundle recognizer was using.final String
recognition result clean text; all tokens of type <TOKEN> are removed (e.g.float
Overall confidence score in [0,1] range.Returns the name of the decoding graph recognizer was using.final String
getText()
Get text of the recognition result.KASRWord[]
getWords()
Returns an Array of KARSRWord objects that comprise this result.boolean
isEmpty()
Is recognition result empty.toJSON()
Returns JSON representation of the KASRResult.toString()
Descriptive representation of the ASR result (can be useful for debugging purposes and logging).
-
Method Details
-
getText
Get text of the recognition result.- Returns:
- text of the result
-
getCleanText
recognition result clean text; all tokens of type <TOKEN> are removed (e.g. <SPOKEN_NOISE>, etc.)- Returns:
- string value of clean text that corresponds to this result
-
getConfidence
public float getConfidence()Overall confidence score in [0,1] range. NOTE: partial results do not have this value set.- Returns:
- confidence value in the range [0,1]
-
getWords
Returns an Array of KARSRWord objects that comprise this result. NOTE: partial results do not have this value set.- Returns:
- an array of KASRWord objects
-
getDecodingGraphName
Returns the name of the decoding graph recognizer was using.- Returns:
- name of the decoding graph that was used to obtain this result
-
getASRBundleName
Returns the name of the ASR Bundle recognizer was using.- Returns:
- asr bundle name
-
isEmpty
public boolean isEmpty()Is recognition result empty. When performing this check, all tag words are ignored.- Returns:
- true if result is empty, false otherwise
-
toString
Descriptive representation of the ASR result (can be useful for debugging purposes and logging). -
toJSON
Returns JSON representation of the KASRResult. NOTE: partial results do not have this value set.- Returns:
- String containing JSON representation of KASRResult. Example: { "words" : [ { "startTime" : 0.52, "duration" : 0.3, "confidence" : 1, "text" : "GO" }, { "startTime" : 0.82, "duration" : 0.3, "confidence" : 1, "text" : "UP" } ], "confidence" : 1, "cleanText" : "GO UP", "text" : "GO UP <SPOKEN_NOISE>" }
-