Skip to content

Commit f53c4d8

Browse files
author
jimmy.xj
committed
Update README.md
1 parent e197e98 commit f53c4d8

File tree

4 files changed

+177
-1
lines changed

4 files changed

+177
-1
lines changed

Diff for: README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,9 @@ explanation: According to the analysis, the value 265 in the given time series a
249249
```
250250
#### 🔧 ToolLearning Sample Example
251251

252-
👀 👀The data format is compatible with OpenAI's Function Calling. Please refer to [category_mapping.json](resources/categroy_mapping.json) for details.
252+
👀 👀The data format of ToolLearning samples is compatible with OpenAI's Function Calling.
253+
254+
Please refer to [tool_learning_info.md](resources/tool_learning_info.md) for details.
253255

254256

255257
## 🚀 How to Evaluate

Diff for: images/toolLearning_performance_metrics.png

215 KB
Loading

Diff for: resources/tool_learning_info.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
### 数据样例
2+
在数据上我们完全兼容了 OpenAI Function Calling,具体格式如下:
3+
4+
**Function Call的数据格式**
5+
6+
| Input Key | Input Type | Input Description |
7+
| --- | --- | --- |
8+
| functions | List[Swagger] | 工具集合 |
9+
| chatrounds | List[chatround] | 多轮对话数据 |
10+
11+
**chatrounds的数据格式**
12+
13+
| Input Key | Input Type | Input Description |
14+
| --- | --- | --- |
15+
| role | string | 角色名称,包含三种类别,user、assistant、function |
16+
| name | string | 若role为function,则存在name字段,为function的名称 |
17+
| content | string | role的返回内容 |
18+
| function_call | dict | 工具调用 |
19+
20+
```
21+
{
22+
"functions":
23+
[
24+
{
25+
"name": "get_fudan_university_scoreline",
26+
"description": "查询复旦大学往年分数线,例如:查询2020年复旦大学的分数线",
27+
"parameters":
28+
{
29+
"type": "object",
30+
"properties":
31+
{
32+
"year":
33+
{
34+
"type": "string",
35+
"description": "年份,例如:2020,2019,2018"
36+
}
37+
},
38+
"required":
39+
[
40+
"year"
41+
]
42+
}
43+
}
44+
],
45+
"chatrounds":
46+
[
47+
{
48+
"role": "system",
49+
"content": "CodeFuse是一个面向研发领域的智能助手,旨在中立的、无害的帮助用户解决开发相关的问题,所有的回答均使用Markdown格式返回。\n你能利用许多工具和功能来完成给定的任务,在每一步中,你需要分析当前状态,并通过执行函数调用来确定下一步的行动方向。你可以进行多次尝试。如果你计划连续尝试不同的条件,请每次尝试一种条件。若给定了Finish函数,则以Finish调用结束,若没提供Finish函数,则以不带function_call的对话结束。"
50+
},
51+
{
52+
"role": "user",
53+
"content": "查询2020年复旦大学的分数线"
54+
},
55+
{
56+
"role": "assistant",
57+
"content": null,
58+
"function_call":
59+
{
60+
"name": "get_fudan_university_scoreline",
61+
"arguments": "{\n \"year\": \"2020\"\n}"
62+
}
63+
},
64+
{
65+
"role": "function",
66+
"name": "get_fudan_university_scoreline",
67+
"content": "{\n \"scoreline\":{\n \"文科一批\": 630, \n \"文科二批\": 610, \n \"理科一批\": 650, \n \"理科二批\": 630 \n }\n}"
68+
},
69+
{
70+
"role": "assistant",
71+
"content": "2020年复旦大学的分数线如下:\n\n- 文科一批:630分\n- 文科二批:610分\n- 理科一批:650分\n- 理科二批:630分"
72+
}
73+
]
74+
}
75+
```
76+
77+
上述Function Call的数据样例为给定特定工具集后,用于回答用户查询某高校录取分数线的问题。
78+
79+
80+
### 评测指标
81+
由于一般通用模型无法具备工具调用的能力,因此在进行Tool Learn-Eval评测之前需要对通用模型进行微调,先让模型学会工具使用的基本范式
82+
83+
下面,我们定义了几种评估工具使用的指标:
84+
85+
<p align="center"> <img src="images/images/toolLearning_performance_metrics.png" style="width: 100%;" id="title-icon"> </p>
86+
87+
②③④⑤的和为1,代表工具调用失败的总数,⑤工具幻觉是工具名识别失败的一种特殊情况

Diff for: resources/tool_learning_info_zh.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
### 数据样例
2+
在数据上我们完全兼容了 OpenAI Function Calling,具体格式如下:
3+
4+
**Function Call的数据格式**
5+
6+
| Input Key | Input Type | Input Description |
7+
| --- | --- | --- |
8+
| functions | List[Swagger] | 工具集合 |
9+
| chatrounds | List[chatround] | 多轮对话数据 |
10+
11+
**chatrounds的数据格式**
12+
13+
| Input Key | Input Type | Input Description |
14+
| --- | --- | --- |
15+
| role | string | 角色名称,包含三种类别,user、assistant、function |
16+
| name | string | 若role为function,则存在name字段,为function的名称 |
17+
| content | string | role的返回内容 |
18+
| function_call | dict | 工具调用 |
19+
20+
```
21+
{
22+
"functions":
23+
[
24+
{
25+
"name": "get_fudan_university_scoreline",
26+
"description": "查询复旦大学往年分数线,例如:查询2020年复旦大学的分数线",
27+
"parameters":
28+
{
29+
"type": "object",
30+
"properties":
31+
{
32+
"year":
33+
{
34+
"type": "string",
35+
"description": "年份,例如:2020,2019,2018"
36+
}
37+
},
38+
"required":
39+
[
40+
"year"
41+
]
42+
}
43+
}
44+
],
45+
"chatrounds":
46+
[
47+
{
48+
"role": "system",
49+
"content": "CodeFuse是一个面向研发领域的智能助手,旨在中立的、无害的帮助用户解决开发相关的问题,所有的回答均使用Markdown格式返回。\n你能利用许多工具和功能来完成给定的任务,在每一步中,你需要分析当前状态,并通过执行函数调用来确定下一步的行动方向。你可以进行多次尝试。如果你计划连续尝试不同的条件,请每次尝试一种条件。若给定了Finish函数,则以Finish调用结束,若没提供Finish函数,则以不带function_call的对话结束。"
50+
},
51+
{
52+
"role": "user",
53+
"content": "查询2020年复旦大学的分数线"
54+
},
55+
{
56+
"role": "assistant",
57+
"content": null,
58+
"function_call":
59+
{
60+
"name": "get_fudan_university_scoreline",
61+
"arguments": "{\n \"year\": \"2020\"\n}"
62+
}
63+
},
64+
{
65+
"role": "function",
66+
"name": "get_fudan_university_scoreline",
67+
"content": "{\n \"scoreline\":{\n \"文科一批\": 630, \n \"文科二批\": 610, \n \"理科一批\": 650, \n \"理科二批\": 630 \n }\n}"
68+
},
69+
{
70+
"role": "assistant",
71+
"content": "2020年复旦大学的分数线如下:\n\n- 文科一批:630分\n- 文科二批:610分\n- 理科一批:650分\n- 理科二批:630分"
72+
}
73+
]
74+
}
75+
```
76+
77+
上述Function Call的数据样例为给定特定工具集后,用于回答用户查询某高校录取分数线的问题。
78+
79+
80+
### 评测指标
81+
由于一般通用模型无法具备工具调用的能力,因此在进行Tool Learn-Eval评测之前需要对通用模型进行微调,先让模型学会工具使用的基本范式
82+
83+
下面,我们定义了几种评估工具使用的指标:
84+
85+
<p align="center"> <img src="images/images/toolLearning_performance_metrics.png" style="width: 100%;" id="title-icon"> </p>
86+
87+
②③④⑤的和为1,代表工具调用失败的总数,⑤工具幻觉是工具名识别失败的一种特殊情况

0 commit comments

Comments
 (0)