rasa/core/training/interactive.py
async def _predict_till_next_listen(endpoint: EndpointConfig,
                                    sender_id: Text,
                                    finetune: bool,
                                    sender_ids: List[Text],
                                    plot_file: Optional[Text]
                                    ) -> None:
    """Predict and validate actions until we need to wait for a user msg."""

    listen = False
    while not listen:
        result = await request_prediction(endpoint, sender_id)
        predictions = result.get("scores")
        probabilities = [prediction["score"] for prediction in predictions]
        pred_out = int(np.argmax(probabilities))
        action_name = predictions[pred_out].get("action")
        policy = result.get("policy")
        confidence = result.get("confidence")

        await _print_history(sender_id, endpoint)
        await _plot_trackers(sender_ids, plot_file, endpoint,
                             unconfirmed=[ActionExecuted(action_name)])

        listen = await _validate_action(action_name, policy, confidence,
                                        predictions, endpoint, sender_id,
                                        finetune=finetune)

        await _plot_trackers(sender_ids, plot_file, endpoint)
Predict and validate actions until we need to wait for a user msg.
Predict and validate actions until we need to wait for a user msg.
Predict and validate actions until we need to wait for a user msg .
async def _predict_till_next_listen(endpoint: EndpointConfig,
                                    sender_id: Text,
                                    finetune: bool,
                                    sender_ids: List[Text],
                                    plot_file: Optional[Text]
                                    ) -> None:
    listen = False
    while not listen:
        result = await request_prediction(endpoint, sender_id)
        predictions = result.get("scores")
        probabilities = [prediction["score"] for prediction in predictions]
        pred_out = int(np.argmax(probabilities))
        action_name = predictions[pred_out].get("action")
        policy = result.get("policy")
        confidence = result.get("confidence")
        await _print_history(sender_id, endpoint)
        await _plot_trackers(sender_ids, plot_file, endpoint,
                             unconfirmed=[ActionExecuted(action_name)])
        listen = await _validate_action(action_name, policy, confidence,
                                        predictions, endpoint, sender_id,
                                        finetune=finetune)
        await _plot_trackers(sender_ids, plot_file, endpoint)
async def _predict_till_next_listen ( endpoint : EndpointConfig , sender_id : Text , finetune : bool , sender_ids : List [ Text ] , plot_file : Optional [ Text ] ) -> None : listen = False while not listen : result = await request_prediction ( endpoint , sender_id ) predictions = result . get ( "scores" ) probabilities = [ prediction [ "score" ] for prediction in predictions ] pred_out = int ( np . argmax ( probabilities ) ) action_name = predictions [ pred_out ] . get ( "action" ) policy = result . get ( "policy" ) confidence = result . get ( "confidence" ) await _print_history ( sender_id , endpoint ) await _plot_trackers ( sender_ids , plot_file , endpoint , unconfirmed = [ ActionExecuted ( action_name ) ] ) listen = await _validate_action ( action_name , policy , confidence , predictions , endpoint , sender_id , finetune = finetune ) await _plot_trackers ( sender_ids , plot_file , endpoint )
Predict and validate actions until we need to wait for a user msg.
Predict and validate actions until we need to wait for a user msg .
"""Predict and validate actions until we need to wait for a user msg."""
endpoint
EndpointConfig
sender_id
Text
finetune
bool
sender_ids
List[Text]
plot_file
Optional[Text]