pyrit.score.ScorerMetrics#

class ScorerMetrics[source]#

Bases: object

__init__() None#

Methods

__init__()

from_json(file_path)

Load the metrics from a JSON file.

to_json()

Convert the metrics to a JSON string.

classmethod from_json(file_path: str | Path) T[source]#

Load the metrics from a JSON file.

Parameters:

json_path (str) – The path to the JSON file.

Returns:

An instance of ScorerMetrics with the loaded data.

Return type:

ScorerMetrics

to_json() str[source]#

Convert the metrics to a JSON string.

Returns:

The JSON string representation of the metrics.

Return type:

str