documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Fundamental description of Adapt Intent Parsing

Open david-morris opened this issue 4 years ago • 2 comments
trafficstars

Is your feature request related to a problem? Please describe. I spent a lot of time debugging Adapt intents because I did not know the basics of how Adapt intents work. I ended up reading intent.py in Adapt, but I don't think that's an ideal solution.

Describe the solution you'd like I think the Adapt Intents documentation would be more useful with some basic rules about how keywords and regexes combine to form intents, such as:

  • Keywords consume text
  • Regexes do not consume text
  • optionally and one-of terms are in separate lists in Intent objects, activating in the intent strictly after all required terms.
  • There is no way to determine whether a term consumes or does not consume text.
  • There is no way to determine whether a term runs on the utterance or utterance remainder.
  • (It seems) regexes must match the entire utterance remainder.

Also, general pointers would be good. I'm going to try overhauling the skill I'm working on, so that it focuses on keywords and utterance remainders more. Is that what I should have been doing from the start? Maybe there should be a suggestion in the Adapt Intents documentation.

Describe alternatives you've considered Alternatively, intent.py could be linked from the Adapt Intents documentation. If I'd known beforehand that this is the file to understand how to build compound intents, it wouldn't have taken as long to figure it out. In the same vein, links to skills that show good use of adapt would also be useful.

Outside of documentation, having more flexibility in the matching of adapt intents could be useful, as could adding something like self.match_voc for regexes in the basic Skill class. Matching regexes on the utterance rather than the utterance remainder cannot be made default now, but might have better adhered to the rule of least surprise, and would simplify future regex building. Perhaps a switch could be added for this behavior?

Additional context I have been contributing to pcwii's cpkodi-skill.

david-morris avatar Apr 19 '21 11:04 david-morris

I think something in this sense is sorely necessary.

oblitum avatar Apr 20 '21 14:04 oblitum

Very much agree, these need a lot more detail.

This also fits nicely with the push toward Adapt v1.0 :+1:

krisgesling avatar Apr 23 '21 02:04 krisgesling