π Berkeley Function Calling Leaderboard (Multi Turn Setup) - Parallel Multiple V3ΒΆ
The Berkeley function calling leaderboard is a live leaderboard to evaluate the ability of different LLMs to call functions (also referred to as tools). We built this dataset from our learnings to be representative of most usersβ function calling use-cases, for example, in agents, as a part of enterprise workflows, etc. To this end, our evaluation dataset spans diverse categories, and across multiple languages.
Tags: annotations_creators:expert-generated, language:['en'], license:apache-2.0, size_categories:['10K<n<100K'], task_categories:['question-answering', 'reading-comprehension', 'tool-calling', 'multi-turn-tool-calling'], task_ids:['tool-calling', 'multi-turn-tool-calling', 'reading-comprehension'], category:dataset
cards.bfcl.multi_turn.parallel_multiple_v3
TaskCard(
loader=LoadJsonFile(
files={
"questions": "https://raw.githubusercontent.com/ShishirPatil/gorilla/70b6a4a2144597b1f99d1f4d3185d35d7ee532a4/berkeley-function-call-leaderboard/data/BFCL_v3_parallel_multiple.json",
"answers": "https://raw.githubusercontent.com/ShishirPatil/gorilla/70b6a4a2144597b1f99d1f4d3185d35d7ee532a4/berkeley-function-call-leaderboard/data/possible_answer/BFCL_v3_parallel_multiple.json",
},
lines=True,
data_classification_policy=[
"public",
],
),
preprocess_steps=[
JoinStreams(
left_stream="questions",
right_stream="answers",
how="inner",
on="id",
new_stream_name="test",
),
Copy(
field="question/*/0",
to_field="dialog",
),
Copy(
field="function",
to_field="tools",
),
"operators.fix_json_schema",
ExecuteExpression(
expression="[{"name": k, "arguments": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() for vals in itertools.product(*v.values())]",
to_field="reference_calls",
imports_list=[
"itertools",
],
),
],
task="tasks.tool_calling.multi_turn",
templates=[
"templates.tool_calling.multi_turn",
],
__title__="Berkeley Function Calling Leaderboard (Multi Turn Setup) - Parallel Multiple V3",
)
[source]from unitxt.loaders import LoadJsonFile
from unitxt.operators import Copy, ExecuteExpression
from unitxt.stream_operators import JoinStreams
Explanation about TaskCardΒΆ
TaskCard delineates the phases in transforming the source dataset into model input, and specifies the metrics for evaluation of model output.
- Args:
- 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 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 LoadJsonFileΒΆ
Loads data from JSON files.
Supports streaming and can handle large files by loading them in chunks.
- Args:
files (Dict[str, str]): A dictionary mapping names to file paths. chunksize : Size of the chunks to load at a time. loader_limit: Optional integer to specify a limit on the number of records to load. streaming: Bool indicating if streaming should be used. lines: Bool indicate if it is json lines file structure. Otherwise, assumes a single json object in the file. data_field: optional field within the json object, that contains the list of instances.
- Example:
Loading json lines
load_csv = LoadJsonFile(files={'train': 'path/to/train.jsonl'}, line=True, chunksize=100)
Explanation about ExecuteExpressionΒΆ
Compute an expression, specified as a string to be eval-uated, over the instanceβs fields, and store the result in field to_field.
Raises an error if a field mentioned in the query is missing from the instance.
- Args:
expression (str): an expression to be evaluated over the fields of the instance to_field (str): the field where the result is to be stored into imports_list (List[str]): names of imports needed for the eval of the query (e.g. βreβ, βjsonβ)
- Examples:
When instance {βaβ: 2, βbβ: 3} is process-ed by operator ExecuteExpression(expression=βa+bβ, to_field = βcβ) the result is {βaβ: 2, βbβ: 3, βcβ: 5}
When instance {βaβ: βhelloβ, βbβ: βworldβ} is process-ed by operator ExecuteExpression(expression = βa+β β+bβ, to_field = βcβ) the result is {βaβ: βhelloβ, βbβ: βworldβ, βcβ: βhello worldβ}
Explanation about CopyΒΆ
Copies values from specified fields to specified fields.
- Args (of parent class):
field_to_field (Union[List[List], Dict[str, str]]): A list of lists, where each sublist contains the source field and the destination field, or a dictionary mapping source fields to destination fields.
- Examples:
An input instance {βaβ: 2, βbβ: 3}, when processed by
Copy(field_to_field={"a": "b"})would yield {βaβ: 2, βbβ: 2}, and when processed byCopy(field_to_field={"a": "c"})would yield {βaβ: 2, βbβ: 3, βcβ: 2}with field names containing / , we can also copy inside the field:
Copy(field="a/0",to_field="a")would process instance {βaβ: [1, 3]} into {βaβ: 1}
Explanation about JoinStreamsΒΆ
Join multiple streams into a single stream.
- Args:
left_stream (str): The stream that will be considered the βleftβ in the join operations. right_stream (str): The stream that will be considered the βrightβ in the join operations. how (Literal[βleftβ, βrightβ, βinnerβ, βouterβ, βcrossβ]): The type of join to be performed. on (Optional[List[str]]): Column names to join on. These must be found in both streams. left_on (Optional[List[str]]): Column names to join on in the left stream. right_on (Optional[List[str]]): Column names to join on in the right streasm. new_stream_name (str): The name of the new stream resulting from the merge.
- Examples:
JoinStreams(left_stream = βquestionsβ, right_stream = βanswersβ, how=βinnerβ, on=βquestion_idβ, new_stream_name=βquestion_with_answersβ ) Join the βquestionβ and βanswerβ stream based on the βquestion_idβ field using inner join, resulting with a new stream named βquestion_with_answersβ. JoinStreams(left_stream = βquestionsβ, right_stream = βanswersβ, how=βinnerβ, on_left=βquestion_idβ, on_right=βquestionβ new_stream_name=βquestion_with_answersβ ) Join the βquestionβ and βanswerβ stream based on the βquestion_idβ field in the left stream and the βquestionβ field in the right stream, using inner join, resulting with a new stream named βquestion_with_answersβ. This is suitable when the fields have different labels across the streams.
References: templates.tool_calling.multi_turn, tasks.tool_calling.multi_turn, operators.fix_json_schema
Read more about catalog usage here.