rasa/core/server.py
async def evaluate_intents(request: Request):
        """Evaluate intents against a Rasa NLU model."""

        # create `tmpdir` and cast as str for py3.5 compatibility
        tmpdir = str(tempfile.mkdtemp())

        zipped_model_path = os.path.join(tmpdir, 'model.tar.gz')
        write_request_body_to_file(request, zipped_model_path)

        model_path, nlu_files = \
            await nlu_model_and_evaluation_files_from_archive(
                zipped_model_path, tmpdir)

        if len(nlu_files) == 1:
            data_path = os.path.abspath(nlu_files[0])
            try:
                evaluation = run_evaluation(data_path, model_path)
                return response.json(evaluation)
            except ValueError as e:
                return ErrorResponse(400, "FailedIntentEvaluation",
                                     "Evaluation could not be created. "
                                     "Error: {}".format(e))
        else:
            return ErrorResponse(400, "FailedIntentEvaluation",
                                 "NLU evaluation file could not be found. "
                                 "This endpoint requires a single file ending "
                                 "on `.md` or `.json`.")
Evaluate intents against a Rasa NLU model.
Evaluate intents against a Rasa NLU model.
Evaluate intents against a Rasa NLU model .
async def evaluate_intents(request: Request):
        tmpdir = str(tempfile.mkdtemp())
        zipped_model_path = os.path.join(tmpdir, 'model.tar.gz')
        write_request_body_to_file(request, zipped_model_path)
        model_path, nlu_files = \
            await nlu_model_and_evaluation_files_from_archive(
                zipped_model_path, tmpdir)
        if len(nlu_files) == 1:
            data_path = os.path.abspath(nlu_files[0])
            try:
                evaluation = run_evaluation(data_path, model_path)
                return response.json(evaluation)
            except ValueError as e:
                return ErrorResponse(400, "FailedIntentEvaluation",
                                     "Evaluation could not be created. "
                                     "Error: {}".format(e))
        else:
            return ErrorResponse(400, "FailedIntentEvaluation",
                                 "NLU evaluation file could not be found. "
                                 "This endpoint requires a single file ending "
                                 "on `.md` or `.json`.")
async def evaluate_intents ( request : Request ) : tmpdir = str ( tempfile . mkdtemp ( ) ) zipped_model_path = os . path . join ( tmpdir , 'model.tar.gz' ) write_request_body_to_file ( request , zipped_model_path ) model_path , nlu_files = await nlu_model_and_evaluation_files_from_archive ( zipped_model_path , tmpdir ) if len ( nlu_files ) == 1 : data_path = os . path . abspath ( nlu_files [ 0 ] ) try : evaluation = run_evaluation ( data_path , model_path ) return response . json ( evaluation ) except ValueError as e : return ErrorResponse ( 400 , "FailedIntentEvaluation" , "Evaluation could not be created. " "Error: {}" . format ( e ) ) else : return ErrorResponse ( 400 , "FailedIntentEvaluation" , "NLU evaluation file could not be found. " "This endpoint requires a single file ending " "on `.md` or `.json`." )
Evaluate intents against a Rasa NLU model.
Evaluate intents against a Rasa NLU model .
"""Evaluate intents against a Rasa NLU model.""" # create `tmpdir` and cast as str for py3.5 compatibility
request
Request