创建数据增强任务
更新时间:2024-07-02
注意: 为提升开发者使用体验,本文内容已合并至对应API文档,请查看API鉴权及调用-数据管理-创建数据增强任务;本文档已于2024年6月28日在千帆大模型平台文档中心下线,内容不再更新。
功能介绍
用于创建数据增强任务。
注意事项
调用本文API,需使用安全认证AK/SK鉴权,调用流程及鉴权介绍详见SDK安装及使用流程。
调用示例
import os
from qianfan.resources import Data
# 使用安全认证AK/SK鉴权,通过环境变量方式初始化;替换下列示例中参数,安全认证Access Key替换your_iam_ak,Secret Key替换your_iam_sk
os.environ["QIANFAN_ACCESS_KEY"] = "your_iam_ak"
os.environ["QIANFAN_SECRET_KEY"] = "your_iam_sk"
resp = Data.create_dataset_augmenting_task(
name='aug_task_01',
source_dataset_id="ds-9tffxxxgdmgh4",
destination_dataset_id="ds-3tfexxxxcdmsh2",
service_name="ERNIE-Bot",
service_url="https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions",
app_id=1431,
num_seed_fewshot=1,
num_instances_to_generate=1,
similarity_threshold=0.5,
)
print(resp)
返回示例
QfResponse(
code = 200,
headers = {...
},
body = {
"log_id": "hfnfguqdesni42mk",
"result":
{
"enhanceTaskId": "task-p2fqh6j75ytje7js"
},
"status": 200,
"success": True
}
)
参数说明
请求参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
name | string | 是 | 增强任务名称 |
source_dataset_id | string | 是 | 源数据集版本ID,注意:该字段新增支持string类型,如果之前使用的是int类型,建议变更为string类型,后续将逐步废弃int类型 |
destination_dataset_id | string | 是 | 目标数据集版本ID,注意:该字段新增支持string类型,如果之前使用的是int类型,建议变更为string类型,后续将逐步废弃int类型 |
service_name | string | 是 | 服务名称,目前支持以下: 目前支持以下: · EB3.5-8k · ERNIE-Lite-8K · ERNIE-4.0-8K · ERNIE-Speed-8K |
dev_api_id | string | 是 | 可选值如下: · 1191:当serviceName为EB3.5-8k,该字段需填写此值 · 1431:当serviceName为ERNIE-Lite-8K,该字段需填写此值 · 1306:当serviceName为ERNIE-4.0-8K,该字段需填写此值 · 1378:当serviceName为ERNIE-Speed-8K,该字段需填写此值 |
service_url | string | 是 | 服务地址,说明: · 当serviceName为 EB3.5-8k ,serviceUrl值为https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions · 当serviceName为 ERNIE-Lite-8K ,serviceUrl值为https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/eb-instant · 当serviceName为 ERNIE-4.0-8K ,serviceUrl值为https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions_pro · 当serviceName为 ERNIE-Speed-8K ,serviceUrl值为https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie_speed |
num_seed_fewshot | int | 是 | 指令生成依赖样本数,说明: · 生成指令时需要从处理前数据集(种子池)选出的样本数量,实际数量可能根据模型允许输入的长度有所调整 · 取值范围:[1,10] |
num_instances_to_generate | int | 是 | 生成样本数,说明: · 建议生成后数据集总样本数大于200,每个任务最多生成不超过2000条样本 · 取值范围:[1,5000] |
similarity_threshold | float | 是 | 过滤相似度阈值,说明: · 只有生成样本的ROUGE-L小于阈值的样本才会添加到种子池,阈值越低,样本重复概率越低 · 取值范围:[0,1] |
返回参数
名称 | 类型 | 描述 |
---|---|---|
log_id | string | 操作记录id |
result | dict | 返回结果 |
status | int | 状态码 |
success | bool | 是否操作成功,说明: · true:成功 · false:失败 |
result说明
名称 | 类型 | 描述 |
---|---|---|
enhanceTaskId | string | 创建的数据增强任务ID |