import json
import os
import argparse
from common.util.log_helper import LogHelper


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('--input', help='/path/to/input/jsonl', required=True)
    parser.add_argument(
        '--output', help='/path/to/output/jsonl', required=True)
    args = parser.parse_args()
    LogHelper.setup()
    logger = LogHelper.get_logger("prefect_prediction")
    with open(args.input) as input_file:
        # os.makedirs(os.path.dirname(args.output), exist_ok=True)
        with open(args.output, "w") as output_file:
            for line in input_file.readlines():
                data_in = json.loads(line)
                data = {'predicted': data_in['label'],
                        'actual': data_in['label']}
                output_file.write(json.dumps(data) + "\n")
    logger.debug("Finished")

import json
import os
import argparse
from common.util.log_helper import LogHelper


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('--input', help='/path/to/input/jsonl', required=True)
    parser.add_argument(
        '--output', help='/path/to/output/jsonl', required=True)
    args = parser.parse_args()
    LogHelper.setup()
    logger = LogHelper.get_logger("prefect_prediction")
    with open(args.input) as input_file:
        # os.makedirs(os.path.dirname(args.output), exist_ok=True)
        with open(args.output, "w") as output_file:
            for line in input_file.readlines():
                data_in = json.loads(line)
                data = {'predicted': data_in['label'],
                        'actual': data_in['label']}
                output_file.write(json.dumps(data) + "\n")
    logger.debug("Finished")

# os.makedirs(os.path.dirname(args.output), exist_ok=True)