π mbppΒΆ
Note
ID: cards.mbpp | Type: TaskCard
{
"loader": {
"name": "full",
"path": "mbpp",
"split": "test",
"type": "load_hf"
},
"preprocess_steps": [
{
"field_to_field": {
"test_list": "test_list_str"
},
"separator": "\n",
"type": "join_str"
}
],
"task": {
"inputs": [
"text",
"test_list_str"
],
"metrics": [
"metrics.bleu"
],
"outputs": [
"test_list",
"code"
],
"type": "form_task"
},
"templates": {
"items": [
{
"input_format": "\"\"\"{text}\n\n{test_list_str}\"\"\"",
"output_format": "{code}",
"type": "input_output_template"
}
],
"type": "templates_list"
},
"type": "task_card"
}
Explanation about TaskCardΒΆ
TaskCard delineates the phases in transforming the source dataset into a model-input, and specifies the metrics for evaluation of model-output.
- Attributes:
loader: specifies the source address and the loading operator that can access that source and transform it into a unitxt multistream.
preprocess_steps: list of unitxt operators to process the data source into a model-input.
task: specifies the fields (of the already (pre)processed instance) making the inputs, the fields making the outputs, and the metrics to be used for evaluating the model output.
templates: format strings to be applied on the input fields (specified by the task) and the output fields. The template also carries the instructions and the list of postprocessing steps, to be applied to the model output.
Explanation about JoinStrΒΆ
Joins a list of strings (contents of a field), similar to str.join().
- Args:
separator (str): text to put between values
Explanation about FormTaskΒΆ
FormTask packs the different instance fields into dictionaries by their roles in the task.
- Attributes:
- inputs (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.
- outputs (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.
- The output instance contains three fields:
βinputsβ whose value is a sub-dictionary of the input instance, consisting of all the fields listed in Arg βinputsβ. βoutputsβ β for the fields listed in Arg βoutputsβ. βmetricsβ β to contain the value of Arg βmetricsβ
Explanation about InputOutputTemplateΒΆ
Generate field βsourceβ from fields designated as input, and fields βtargetβ and βreferencesβ from fields designated as output, of the processed instance.
Args specify the formatting strings with which to glue together the input and output designated fields of the processed instance into one string (βsourceβ and βtargetβ), and into a list of strings (βreferencesβ).
References: metrics.bleu
Read more about catalog usage here.