Android SpeechRecognizer “confidence” values are confusing

后端 未结 3 696
灰色年华
灰色年华 2020-12-31 02:57

I\'m using the SpeechRecognizer via Intent:

Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL         


        
3条回答
  •  我在风中等你
    2020-12-31 03:15

    According to my interpretation of the documentation:

    recognizerIntent.Extra_Results returns an ordered arrayList of strings, each of which is one suggestion as to what was said, with the string at index 0 being the suggestion the Recognizer is most confident of.

    recognizerIntent.Extra_Confidence_Scores returns an array of floats corresponding to each of these suggestions.

    So, if the results you are getting are correct(otherwise this might be a bug), then the recognizer has 1, and only 1, suggestion that it has confidence in and several others that it has only negligible or no confidence in.

    I've been getting similar results. I've never had a set of results in which more than one suggestion had non-negligible confidence, just like you. e.g. 0.7435, 0.0, 0.0, 0.0, ......

    I have however sometimes gotten a set of results in which ALL results have negligible confidence. e.g. 0.0, 0.0, 0.0, 0.0, 0.0, ......

    So yes the first element in Results will always be the one the Recognizer is most confident of.

提交回复
热议问题