Class KASRResult

java.lang.Object
com.keenresearch.keenasr.KASRResult

public class KASRResult extends Object
An instance of the KIOSResult class, called recognition result, provides results of the recognition.
  • Method Details

    • getText

      public final String getText()
      Get text of the recognition result.
      Returns:
      text of the result
    • getCleanText

      public final String 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

      public KASRWord[] 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

      public String 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

      public String 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

      public String toString()
      Descriptive representation of the ASR result (can be useful for debugging purposes and logging).
      Overrides:
      toString in class Object
      Returns:
      string that contains the information about this result
    • toJSON

      public String 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>" }