-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add warnings for wrong values of model_confidence parameter #8014
Conversation
@akelad Could you review the documentation part? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few comments. I think it would also be good if you edit the old changelog to add a bit of a warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you renormalize linearly normalized inner confidences?
No, the normalization outside is only done for softmax model confidences to preserve the old behaviour. Primarily because the normalization for softmax is done slightly differently where it takes ranking length into account and then normalizes, whereas for inner we want to normalize first and then apply ranking length if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few changes to docs pls
docs/docs/components.mdx
Outdated
This parameter allows the user to configure how confidences are computed during inference. It can take two values: | ||
1. `softmax`: Confidences are in the range `[0, 1]` (old behaviour and current default). Computed similarities are normalized with the `softmax` activation function. | ||
2. `linear_norm`: Confidences are in the range `[0, 1]`. Computed dot product similarities are normalized with a linear function. | ||
It is recommended to try using `linear_norm` as the value for `model_confidence` as it should be easier to tune thresholds for fallback then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comments here as above
docs/docs/migration-guide.mdx
Outdated
- name: DIETClassifier | ||
model_confidence: linear_norm | ||
constrain_similarities: True | ||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same edits to this whole thing as the comments I made on the changelog
``` | ||
- name: DIETClassifier | ||
model_confidence: cosine | ||
model_confidence: linear_norm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar edits in this paragraph - but I don't think we should take out all reference to cosine here. We should just add a warning that the below is no longer true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I added back the possibility of adding cosine
but changed the recommendation to linear_norm
. Added an EDIT
at the end about the deprecation.
docs/docs/policies.mdx
Outdated
This parameter allows the user to configure how confidences are computed during inference. It can take two values: | ||
1. `softmax`: Confidences are in the range `[0, 1]` (old behaviour and current default). Computed similarities are normalized with the `softmax` activation function. | ||
2. `linear_norm`: Confidences are in the range `[0, 1]`. Computed dot product similarities are normalized with a linear function. | ||
It is recommended to try using `linear_norm` as the value for `model_confidence` as it should be easier to tune thresholds for fallback then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same edits here
Docs review Co-authored-by: Akela Drissner-Schmid <32450038+akelad@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, but can you please still address the typoCI warnings? There's just a few instances of british vs american spelling
## Rasa 2.3.3 to Rasa 2.3.4 | ||
|
||
:::caution | ||
This is a release **breaking backwards compatibility of machine learning models**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dakshvar22 Couldn't we have made that one non-breaking? Seem less than ideal to do a model breaking change in a micro release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dakshvar22 hey, i saw this warning and wanted to resolve it but it took some digging to understand that the change needed to be made in 3 places: TEDPolicy, DIETClassifier, and ResponseSelector. do you think the warning should clarify which pipeline/policy is triggering the warning? i wasn't able to figure it out until i came across this https://forum.rasa.com/t/model-confidence-linear-norm/42481/3 |
Proposed changes:
model_confidence=cosine
andmodel_confidence=inner
in all ML components.model_confidence=linear_norm
as a replacement which uses a linear normalization scheme on top of dot product similarities.Status (please check what you already did):
black
(please check Readme for instructions)