def transformation()

in Medical_Text_Analysis_Resources/docker_containers/model_container/model_scripts/predictor.py [0:0]


def transformation():
    """ this specifies the transformation that will be performed with the raw data from the moment the request was receieved to the moment the response was returned"""
    data = None
    #get input data from flask request
    data = flask.request.data.decode('utf-8')
    logging.debug(f"raw data supplied: {data}")
    #instantiate the MedicalBertModel class
    mbm=MedicalBertModel(run_null_model=False)
    #run model
    result=mbm.run_model_and_null(data)
    result=json.dumps(result)
    logging.debug(f"result of model: {result}")
    return flask.Response(response=result, status=200)