W3C home > Mailing lists > Public > public-speech-api@w3.org > June 2012

RE: Confidence property

From: Young, Milan <Milan.Young@nuance.com>
Date: Mon, 4 Jun 2012 19:09:26 +0000
To: Glen Shires <gshires@google.com>
CC: Satish S <satish@google.com>, "public-speech-api@w3.org" <public-speech-api@w3.org>
Message-ID: <B236B24082A4094A85003E8FFB8DDC3C1A469D19@SOM-EXCH04.nuance.com>
Comments inline...

From: Glen Shires [mailto:gshires@google.com]
Sent: Friday, June 01, 2012 6:46 PM
To: Young, Milan
Cc: Satish S; public-speech-api@w3.org
Subject: Re: Confidence property

Can you please clarify your proposal:

- Does it pass a string or a float to the recognizer?
[Milan] String.

- Can the developer inquire (read) the current confidence value? Is the value returned relative (with plus/minus prefix) or absolute? A string or a float?
[Milan] Yes, the property could be read and it would return the absolute value.  We would just document that if the recognizer is remote, this would trigger a trip to the server.  Developers would choose whether the cost is worth the reward.

- If the developer sets recognizer.confidence = "+.1", then later sets recognizer.confidence = "+.2", would the result be summed "+.3" or overwritten "+.2" ?
[Milan] I figured they would be cumulative, but could be swayed.

The main question is what to do with an out of bounds event (eg default value is 0.5 and developer sets +0.6).  I suggest the recognizer internally truncate on the [0.0-1.0] range (essentially a scaling operation similar to your proposal).  The important thing is that higher thresholds must always generate >= number of results than lower thresholds.

- Is there a defined range for the increments? (Example, is "+0.5" valid? is "+1.0" valid? is "+10.0" valid?)
[Milan] The UA would enforce syntax and limit the range to [-1.0,1.0].

- It seems that what you are defining is an offset from a recognizer-dependent default value, which seems very similar to the confidenceThresholdAdjustment I propose.  What are the advantages of your proposal over the syntax I proposed?
[Milan] Yes, the functionality from a developer perspective is essentially the same.  The advantage of my proposal:

*       Minimize work on the engine side with the implementation of a scaling system.

*       Confidence scores in the result have a direct correspondence to the values pushed through the UA.

*       Tuning tools can continue to use the actual threshold instead of having to special case applications developed for HTML Speech.

I disagree with your contention that confidenceThresholdAdjustment that I proposed "is just as recognizer-dependent as the much simpler mechanism of just setting the value".  Because the range is defined, a confidenceThresholdAdjustment = 0.3 indicates, in a recognizer-independent manner, that the confidence is substantially greater than the recognizer's default, but still far from the maximum possible setting.  In contrast, the meaning of recognizer.confidence = "+.3" may vary greatly, for example, the recognizer's default may be 0.2 (meaning the new setting is still nowhere near maximum confidence) or it may be 0.7 (meaning the new setting is the maximum confidence.)
[Milan] All true, but at the end of the day calling it a "adjustment" instead of a "threshold" doesn't add any testable assertions.

I agree that confidenceThresholdAdjustment is not perfect, but it's the most recognizer-independent solution I have seen to date, and I believe that the majority of web developers will be able to use it to accomplish the majority of tasks without resorting to any recognition-dependent programming.
[Milan] I think this is the fundamental disconnect between us.  A developer who sets an adjustment of 0.3 on recognizer A must not assume that behavior will be the same on recognizer B.  If they want to support multiple engines they must test on each engine and tune accordingly.  Otherwise they risk undefined/incorrect behavior.

I also agree that for the subset of developers that want to fine-tune their application for specific recognizers by using engine logs and training tools, this introduces an abstraction. However, for this subset of developers, either of two simple solutions can be used: (a) the recognition vendor could provide the engine-specific mapping so that the developer can easily convert the values, or (b) the vendor could provide a recognizer-specific custom setting that overrides confidenceThresholdAdjustment.
[Milan] These work-abounds would be worth the cost if we were defining a truly recognizer-independent solution.  But since we are not, I view the proposal as a pointless exercise in semantic juggling.

I believe it's crucial that we define all attributes in the spec in a recognizer-independent manner, or at least recognizer-independent enough that most developers don't have to resort to recognizer-dependent programming.  If there are attributes that cannot be defined in a recognizer-independent manner, then I believe such inherently recognizer-specific settings should be just that, recognizer-specific custom settings.
[Milan] I could point to 100s of examples in W3C and IETF specifications where expected behavior is not 100% clear and I assure you these ambiguities were not the product of careless editing.  There is good reason and precedent behind the industry definition of confidence.  Please don't throw the baby out with the bathwater.

Glen Shires
[Milan] Thank you too for keeping this discussion active.

On Fri, Jun 1, 2012 at 5:20 PM, Young, Milan <Milan.Young@nuance.com<mailto:Milan.Young@nuance.com>> wrote:
Glen, it's clear that you put a lot of thought into trying to come up with a compromise.  I appreciate the effort.

My contention, however, is that this new mechanism for manipulating confidence is just as recognizer dependent as the much simpler mechanism of just setting the value.  All you have done is precisely define a new term using existing terminology that has no precise definition.  An "adjustment" of 0.3 doesn't have any more of grounded or recognizer independent meaning than a "threshold" of 0.3.

Furthermore, you've introduced yet another parameter to jiggle, and this will cause all sorts of headaches during the tuning phase.  That's because the engine, logged results, and training tools will all be based on absolute confidence thresholds, and the user will need to figure out how to map those absolute thresholds onto the relative scale.  And they still need to perform this exercise independently for each engine.

One of the things I do like about your proposal is that it circumvents the need to read the confidence threshold before setting it in incremental mode.  But this could just as easily be accomplished with syntax such as recognizer.confidence = "+.1".  If I added such a plus/minus prefix to my previous proposal would you be satisfied?


From: Glen Shires [mailto:gshires@google.com<mailto:gshires@google.com>]
Sent: Friday, June 01, 2012 9:01 AM
To: Young, Milan
Cc: Satish S; public-speech-api@w3.org<mailto:public-speech-api@w3.org>
Subject: Re: Confidence property

I propose the following definition:

attribute float confidenceThresholdAdjustment;

- confidenceThresholdAdjustment attribute - This attribute defines a relative threshold for rejecting recognition results based on the estimated confidence score that they are correct.  The value of confidenceThresholdAdjustment ranges from -1.0 (least confidence) to 1.0 (most confidence), with 0.0 mapping to the default confidence threshold as defined by the recognizer. confidenceThresholdAdjustment is monotonically increasing such that larger values will return an equal or fewer number of results than lower values.  (Note that the confidence scores reported within the SpeechRecognitionResult and within the EMMA results use a 0.0 - 1.0 scale, and the correspondence between these scores and confidenceThresholdAdjustment may vary across UAs, recognition engines, and even task to task.) Unlike maxNBest, there is no defined mapping between the value of the threshold and how many results will be returned.

This definition has these advantages:

For web developers, it provides flexibility and simplicity in a recognizer-independent manner. It covers the vast majority of the ways in which developers use confidence values:

- Developers can easily adjust the threshold for certain tasks. For example, to confirm a transaction, the developer may increase the threshold to be more stringent than the recognizer's default, e.g. confidenceThresholdAdjustment = 0.3

- Developer can adjust the threshold based on prior usage. For example, if not getting enough (or any) results, he may bump down the confidence to be more lenient, e.g: confidenceThreshold -= 0.1 (Developers should ensure they don't underflow/overflow the -1.0 - 1.0 scale.)

- Developers can perform their own processing of the results by comparing confidence scores in the normal manner.  (The confidence scores in the results use the recognizer's native scale, so they are not mapped or skewed and so relative comparisons are not affected by "inflated" or "deflated" ranges.)

It provides clear semantics that are recognizer-independent:

- It avoids all issues of latency and asynchrony issues. The UA does not have to inquire the recognizer's default threshold value from the [potentially remote] recognizer before the UA returns the value when this JavaScript attribute is read. Instead, the UA maintains the value of this attribute, and simply sends it to the recognizer along with the recognition request.

- It avoids all issues of threshold values change due to changes in the selected recognizer or task or grammar.

- It allows recognition engines the freedom to define any mapping that is appropriate, and use any internal default threshold value they choose (which may vary from engine to engine and/or from task to task).

The one drawback is that the confidenceThresholdAdjustment mapping may "require significant skewing of the range" and "squeeze" and "inflate". However, I see this as a minimal disadvantage, particularly when weighed against all the advantages above.

Earlier in this thread we looked at four different options [1]. This solution is a variation of option 1 in that list. All the other options in that list have significant drawbacks:

Option 2) Let speech recognizers define the default: has these disadvantages:

- If a new recognizer is selected, it's default threshold needs to be retrieved, an operation that may have latency. If the developer then reads the confidenceThreshold attribute, the read can't stall until the threshold is read. Fixing this requires defining an asynchronous event to indicate that the confidenceThreshold value is now available to be read. All very messy for both the web developer and the UA implementer.

- The semantics are unclear and recognizer-dependent. If the developer set the confidenceThreshold = 0.4, then selects a new recognizer (or perhaps a new task or grammar), does the confidenceThreshold change? When, and if so, how does the developer know to what value - does it get reset to the recognizer's default? If not, what does 0.4 now mean in this new context?

Option 3) Make it write-only (not readable): has these disadvantages:

- A developer must write recognizer-dependent code. Since he can't read the value, he can't increment/decrement it, so he must blindly set it. He must know what set confidenceThreshold = 0.4 means for the current recognizer.

Thus I propose the solution above, with it's many advantages and only a minor drawback.

[1] http://lists.w3.org/Archives/Public/public-speech-api/2012Apr/0051.html

On Wed, May 23, 2012 at 3:56 PM, Young, Milan <Milan.Young@nuance.com<mailto:Milan.Young@nuance.com>> wrote:
>> The benefit of minimizing deaf periods is therefore again recognizer specific

Most (all?) of the recognition engines which can be embedded within an HTML browser currently operate over a network.  In fact if you study the use cases, you'd find that the majority of those transactions are over a 3G network which is notoriously latent.

It's possible that this may begin to change over the next few year, but it's surely not going to be in the lifetime of our 1.0 spec (at least I hope we can come to agreement before then :)).  Thus the problem can hardly be called engine specific.

Yes, the semantics are unclear, but that wouldn't be any different than a quasi-standard which would undoubtedly emerge in the absence of a specification.

From: Satish S [mailto:satish@google.com<mailto:satish@google.com>]
Sent: Wednesday, May 23, 2012 6:28 AM
To: Young, Milan
Cc: public-speech-api@w3.org<mailto:public-speech-api@w3.org>
Subject: Re: Confidence property

Hi Milan,

Summarizing previous discussion, we have:
  Pros:  1) Aids efficient application design, 2) minimizes deaf periods, 3) avoids a proliferation of semi-standard custom parameters.
  Cons: 1) Semantics of the value are not precisely defined, and 2) Novice users may not understand how confidence differs from maxnbest.

My responses to the cons are: 1) Precedent from the speech industry, and 2) Thousands of VoiceXML developers do understand the difference and will balk at an API that does not accommodate their needs.

This was well debated in the earlier thread and it is clear that confidence threshold semantics are tied to the recognizer (not portable). The benefit of minimizing deaf periods is therefore again recognizer specific and not portable. This is a well suited use case for custom parameters and I'd suggest we start with that.

Thousands of VoiceXML developers do understand the difference and will balk at an API that does not accommodate their needs.

I hope we aren't trying to replicate VoiceXML in the browser. If it is indeed a must have feature for web developers we'll be receiving requests for it from them very soon, so it would be easy to discuss and add it in future.
Received on Monday, 4 June 2012 19:10:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 4 June 2012 19:10:34 GMT