-
Notifications
You must be signed in to change notification settings - Fork 65
intent api #23
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
Merged
+305
−9
Merged
intent api #23
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c0e8373
intent api
JarbasAl 28effc4
intent api - manifest
JarbasAl f70d842
cleanup
JarbasAl 4c34f9a
add regex
JarbasAl 908da21
padatious fix
JarbasAl 101522a
move to intent_service_interface
JarbasAl b0effa2
get_skill from utterance
JarbasAl 73e3560
fix active skills message
JarbasAl 8fe7fe5
norm utterances
JarbasAl 9d9b495
big cleanup
JarbasAl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Confidence threshold should be read from config so we can make adjustments and keep it in sync with handle_utterance.. Maybe at least put it in a self parameter in this class for now?
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.
this doesnt make sense here, we want it work exactly like in handle_utterance, the whole point is that the intent api behaves exactly like the intent service
notice that this check is only when we have both an adapt intent AND a padatious intent, we only want padatious to take precedence over adapt if it is absolutely sure
if adapt intent is None it always returns the padatious intent, in that case maybe it makes sense to make confidence configurable, which should be done also in the padatious service, that would basically mean a fallback skill is triggered.
Note that padatious service checks for >= 0.8 intents first, then allows fallback skills to try, and then tries again with conf >= 0.5 with lower fallback priority
Either way i think this is out of scope, if we change how padatious works i'd rather do that in a different PR, I'm personally not a big fan of the way mycroft is handling this and want to change it later on. In chatterbox i rewrote this whole piece, we have been talking of open sourcing our "intentBox" repo, in which case it would make sense to also use it here in Neon.
In chatterbox padatious is no longer a fallback skill, IntentBox package takes both kinds of intent into account in a single step
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.
Right, but if we want to set the padatious_intent.conf threshold to something like 0.8, we would want that to change in both handle_utterance and handle_get_intent, right? I only bring it up because I noticed that we have this confidence level set to 0.8 in neon-core (not sure if/why we made that change) and it could be problematic if handle_get_intent returns something different than handle_utterance..
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.
i think you are confusing things, padatious is using 0.8 for thresh
this 0.95 is only to take priority over adapt
also keep in mind the intent api does not take into account the fallback skills, so if padatious conf < 0.8 a fallback skill might trigger, the intent api will still return the padatious match, consumers need to check the conf manually
we do not need to change anything in here, when the IntentQueryApi checks for a padatious intent it will use the padatious service directly
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.
i don't think this 0.95 thresh should be configurable at all, but if thats something you want i can make it read from config
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.
Our core has 0.8 hard-coded in intent_service where this PR has 0.95, which why I think this might need to be changed (I can't remember exactly why we made that change, but I think it was related to our i-like-brands skill and some of the brands entities). I just want to make sure that nobody accidentally breaks something in skills by changing 0.95 in one place but misses the other (either by referencing a single var or a comment stating where else the value needs to be constant).
I will do some testing in our core with that value reset to 0.95 because there's a good chance that our change was compensating for some other problem that has since been resolved. I agree with the concept that Adapt will generally yield fewer false positive matches and should take priority unless there's a high confidence Adapt match. I think you're right about leaving it out of the config; opening this up to variable values could make intent matching/troubleshooting across different installations a nightmare..
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.
well, mycroft changed a bit since then and now padatious is given 3 chances to match
I think it makes more sense to look into that value once i start porting all the skills, then if something is not matching properly we should diagnose if it's bad/old intent design or if we need to tweak these 3 confidences
Adapt is always right, in the sense that it is rule-based, so unless a rule is badly written we always want adapt to take precedence, the very high confidence in padatious also means an exact match, in that case since it is matching a full utterance exactly it makes sense to have priority over adapt