-
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
IntentTEDPolicy
: rasa interactive
updates
#8906
Changes from all commits
53e2c77
5176880
7107ca6
78979f8
e3ebbd7
9576277
b30eae8
c2e13b6
81e486f
2dd39f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Print an information about `action_unlikely_intent` when in gets predicted in the interactive mode. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ | |
LOOP_REJECTED, | ||
REQUESTED_SLOT, | ||
LOOP_INTERRUPTED, | ||
ACTION_UNLIKELY_INTENT_NAME, | ||
) | ||
from rasa.core import run, utils | ||
import rasa.core.train | ||
|
@@ -60,7 +61,12 @@ | |
UserUtteranceReverted, | ||
) | ||
import rasa.core.interpreter | ||
from rasa.shared.constants import INTENT_MESSAGE_PREFIX, DEFAULT_SENDER_ID, UTTER_PREFIX | ||
from rasa.shared.constants import ( | ||
INTENT_MESSAGE_PREFIX, | ||
DEFAULT_SENDER_ID, | ||
UTTER_PREFIX, | ||
DOCS_URL_POLICIES, | ||
) | ||
from rasa.shared.core.trackers import EventVerbosity, DialogueStateTracker | ||
from rasa.shared.core.training_data import visualization | ||
from rasa.shared.core.training_data.visualization import ( | ||
|
@@ -1130,9 +1136,23 @@ async def _validate_action( | |
|
||
Returns `True` if the prediction is correct, `False` otherwise.""" | ||
|
||
question = questionary.confirm(f"The bot wants to run '{action_name}', correct?") | ||
if action_name == ACTION_UNLIKELY_INTENT_NAME: | ||
question = questionary.confirm( | ||
f"The bot wants to run '{action_name}' " | ||
f"to indicate that the last user message was unexpected " | ||
f"at this point in the conversation. " | ||
f"Check out IntentTEDPolicy ({DOCS_URL_POLICIES}/#intent-ted-policy) " | ||
f"to learn more." | ||
) | ||
else: | ||
question = questionary.confirm( | ||
f"The bot wants to run '{action_name}', correct?" | ||
) | ||
|
||
is_correct = await _ask_questions(question, conversation_id, endpoint) | ||
is_correct = ( | ||
await _ask_questions(question, conversation_id, endpoint) | ||
or action_name == ACTION_UNLIKELY_INTENT_NAME | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this line imply that regardless of user answer to the query, the action is always correct for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It means that the choice (Y/N) doesn't affect what's gonna be happening next. |
||
) | ||
|
||
if not is_correct: | ||
action_name, is_new_action = await _request_action_from_user( | ||
|
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 we need to ask the user here to press Y/N to continue?
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.
That's what we've decided to do, yes (to keep it consistent with the rest)
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.
Ah ok, then maybe it should be explicitly stated? Unless
questionary
takes care of this 😄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.
IMO this should instead be written in docs with the explanation what
action_unlikely_intent
is and how it works. We can also write it here but I am afraid the message will be too long in this case.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.
Ah I meant maybe it's not obvious what keys to press from the question and that should be explicitly stated, thats all 👍
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.
Oh, got it! Actually,
questionary
handles that and shows the available options automatically :)