Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Refactor intent service #2599

Merged
merged 13 commits into from
Sep 23, 2020
Merged

Conversation

forslund
Copy link
Collaborator

@forslund forslund commented May 29, 2020

Description

The intent handling has been spread out over a bunch of files and this sort of collects it back into a single location makes the entire flow viewable from a single handler for the old recognizer_loop:utterance message.

The resolution order is the same as before only expressed as a single list instead of a series of checks and fallbacks interlaced.

  • Converse
  • Padatious High Confidence
  • Adapt
  • Fallback High priority
  • Padatious Medium Confidence
  • Fallback Medium priority
  • Padatious Last ditch effort
  • Fallback Low priority

This collects the many parts of where intent is handled into a single
location handling the entire flow.

The idea is that, in the end, all the skill calling should be done from
this method. The main intent parsers does this but the converse and
fallback still calls directly.

Future work: Converse and fallback still triggers handlers directly.

How to test

Best way to test this is to make sure the voight kampff tests are still passing.

Contributor license agreement signed?

CLA [ Yes ]

@forslund forslund added the Status: Work in progress PR being actively worked on, not yet ready for review. label May 29, 2020
@devs-mycroft devs-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label May 29, 2020
@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

1 similar comment
@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@forslund forslund removed the Status: Work in progress PR being actively worked on, not yet ready for review. label Jul 6, 2020
@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@krisgesling krisgesling self-requested a review July 13, 2020 01:50
@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

1 similar comment
@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

Copy link
Contributor

@krisgesling krisgesling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall loving this refactor! Great to see the intent services extracted and the new flow of looping through each matching function is far more straight forward.

mycroft/skills/intent_service.py Outdated Show resolved Hide resolved
mycroft/skills/intent_service.py Show resolved Hide resolved
mycroft/skills/intent_service.py Outdated Show resolved Hide resolved
mycroft/skills/intent_service.py Show resolved Hide resolved
mycroft/skills/intent_services/padatious_service.py Outdated Show resolved Hide resolved
mycroft/skills/intent_services/padatious_service.py Outdated Show resolved Hide resolved
mycroft/skills/intent_services/fallback_service.py Outdated Show resolved Hide resolved
mycroft/skills/fallback_skill.py Outdated Show resolved Hide resolved
mycroft/skills/intent_service.py Outdated Show resolved Hide resolved
mycroft/skills/intent_service.py Outdated Show resolved Hide resolved
@forslund
Copy link
Collaborator Author

Good catches all over. Will update the PR during the day

@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@forslund forslund force-pushed the refactor/intent-service branch 2 times, most recently from a4f4d18 to d84956b Compare August 11, 2020 05:26
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

If no range is provided it defaults to 0-100 to be backwards compatible
Simplify the handle_utterance into a list of intent matching functions
run in order until a match is found.

The resolution order is

- Converse
- Padatious High Confidence
- Adapt
- Fallback High priority
- Padatious Medium Confidence
- Fallback Medium priority
- Padatious Last ditch effore
- Fallback Low priority

This collects the many parts of where intent is handled into a single
location handling the entire flow.

The idea is that, in the end, all the skill calling should be done from
this method. The main intent parsers does this but the converse and
fallback still calls directly.
This issue was properly fixed in Adapt 0.3.5.
- Move setting original utterance to the respective intent service
- Remove botch limiting the intent service to a single STT hypothesis
- imports
- All docstring
- AdaptService method warnings
- Add missing docstrings
- fix short variable names
- restructure return code
@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@krisgesling
Copy link
Contributor

Thanks again for this huge clean up Ake, it's fantastic work!

I'm going to leave the commits unsquashed as they each represent a significant change and are already well structured.

@krisgesling krisgesling merged commit ae72ebd into MycroftAI:dev Sep 23, 2020
@forslund forslund removed the Status: Work in progress PR being actively worked on, not yet ready for review. label Sep 23, 2020
@JarbasAl JarbasAl mentioned this pull request Dec 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants