Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Norrrrrrr lyn WAInjectBench JSONL Results Serialization

From Leeroopedia
Knowledge Sources
Domains Data_Engineering, Evaluation
Last Updated 2026-02-14 16:00 GMT

Overview

A structured output serialization strategy that writes per-dataset detection results to JSONL files for downstream analysis and ensemble aggregation.

Description

Results Serialization converts the in-memory detection result dictionaries into a persistent, line-delimited JSON format. Each detector writes its results to a dedicated {detector_name}.jsonl file in the result directory. This format serves two purposes: (1) it provides a human-readable and machine-parseable record of detector performance, and (2) it enables the ensemble aggregation step to read and combine results from all detectors.

The serialization uses json.dumps(entry, ensure_ascii=False) to preserve Unicode characters in text content.

Usage

Use this pattern after all per-file or per-folder detection evaluations are complete. It is the final step before ensemble aggregation and is the standard output format for all benchmark experiments.

Theoretical Basis

# Serialization pattern
for entry in results:
    output_file.write(json.dumps(entry, ensure_ascii=False) + "\n")

Output schema per line:

{
    "data_name": str,          # Filename or folder name
    "tpr": float,              # OR "fpr": float (mutually exclusive)
    "detect_ids": List[int],   # Flagged sample/file IDs
    "total_num": int           # Total samples/files in dataset
}

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment