-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: improve misclassifciations #62
Conversation
WalkthroughThe changes refine the intent matching logic within the match_high method of the PersonaService class. The method now extracts the persona variable from the entities dictionary only when the intent is "ask.intent" and the persona is non-empty, reducing misclassifications. For "summon.intent", the check is updated to verify the presence of the persona instead of a previously used variable. Comments have been updated for clarity, while overall control flow remains unchanged. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant PersonaService
User->>PersonaService: Call match_high(utterances, lang, message)
alt Intent is "ask.intent" with non-empty persona
PersonaService->>PersonaService: Extract persona from entities
PersonaService-->>User: Return valid intent match
else Intent is "summon.intent" with persona present
PersonaService->>PersonaService: Check for persona presence
PersonaService-->>User: Return valid intent match
else
PersonaService-->>User: Return no match
end
Possibly related PRs
Poem
Tip 🌐 Web search-backed reviews and chat
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
ovos_persona/__init__.py (1)
318-321
: Fix indentation for better readability.The indentation of these lines should be consistent with the surrounding code.
Apply this diff to fix the indentation:
- # override regular intent parsing, handle utterance until persona is released - if self.active_persona: - LOG.debug(f"Persona is active: {self.active_persona}") - return self.match_low(utterances, lang, message) + # override regular intent parsing, handle utterance until persona is released + if self.active_persona: + LOG.debug(f"Persona is active: {self.active_persona}") + return self.match_low(utterances, lang, message)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
ovos_persona/__init__.py
(3 hunks)
🔇 Additional comments (2)
ovos_persona/__init__.py (2)
291-292
: LGTM! Improved validation for summon intent.The additional validation ensures that the persona name is present in the match, preventing misclassifications.
307-309
: LGTM! Enhanced validation for ask intent.The additional validation ensures that both the persona name and query are present in the match, preventing misclassifications.
Summary by CodeRabbit