πŸ“„ BinaryΒΆ

tasks.rag_eval.faithfulness.binary

Task(
    input_fields={
        "answer": "str",
        "contexts": "List[str]",
        "question": "str",
        "choices": "List[str]",
    },
    outputs={
        "is_faithful": "List[str]",
        "number_val": "Union[float, int]",
    },
    metrics=[
        "metrics.spearman",
        "metrics.kendalltau_b",
        "metrics.roc_auc",
        "metrics.f1_binary",
        "metrics.accuracy_binary",
        "metrics.max_f1_binary",
        "metrics.max_accuracy_binary",
    ],
    prediction_type="float",
    defaults={
        "choices": [
            "yes",
            "no",
        ],
        "is_faithful": [
            "-",
        ],
        "number_val": -1,
    },
)
[source]

Explanation about TaskΒΆ

Task packs the different instance fields into dictionaries by their roles in the task.

Args:
input_fields (Union[Dict[str, str], List[str]]):

Dictionary with string names of instance input fields and types of respective values. In case a list is passed, each type will be assumed to be Any.

reference_fields (Union[Dict[str, str], List[str]]):

Dictionary with string names of instance output fields and types of respective values. In case a list is passed, each type will be assumed to be Any.

metrics (List[str]):

List of names of metrics to be used in the task.

prediction_type (Optional[str]):

Need to be consistent with all used metrics. Defaults to None, which means that it will be set to Any.

defaults (Optional[Dict[str, Any]]):

An optional dictionary with default values for chosen input/output keys. Needs to be consistent with names and types provided in β€˜input_fields’ and/or β€˜output_fields’ arguments. Will not overwrite values if already provided in a given instance.

The output instance contains three fields:
  1. β€œinput_fields” whose value is a sub-dictionary of the input instance, consisting of all the fields listed in Arg β€˜input_fields’.

  2. β€œreference_fields” – for the fields listed in Arg β€œreference_fields”.

  3. β€œmetrics” – to contain the value of Arg β€˜metrics’

References: metrics.max_accuracy_binary, metrics.accuracy_binary, metrics.max_f1_binary, metrics.kendalltau_b, metrics.f1_binary, metrics.spearman, metrics.roc_auc

Read more about catalog usage here.