communications-mining
latest
false
重要 :
请注意,此内容已使用机器翻译进行了本地化。
Communications Mining 开发者指南
Last updated 2024年9月27日

批量上传

重要提示:

可计费操作

对于每个创建的评论或每个更新的评论 (依据其唯一 ID),如果其文本已被修改,您需支付 1 个 AI Unit 的费用。

CLI 允许您批量上传注释(包括预先注释的注释)。 除了在不需要实时连接的情况下将数据导入到 Communications Mining 中外,它还可用于将预先存在的训练数据上传到 Communications Mining 中,或者覆盖 Communications Mining 中的现有注释或标签。

注意:本节假定您已安装配置CLI。

准备数据

CLI 需要 JSONL 格式的数据(也称为以换行符分隔的 JSON),其中每一行都是一个 JSON 值。 许多工具都可以导出 JSONL 文件。 如果您有任何问题,请联系支持团队。

JSONL 文件中的每一行代表一个注释对象。 每个注释对象至少应具有唯一 ID、时间戳和一段文本,但可以具有其他字段,例如元数据。 请参阅注释参考,了解要为数据设置哪些字段。

JSONL 文件中的每一行均应采用以下格式(仅显示必填字段)。 (请注意,为便于阅读,显示时缩进,但应全部占到文件中的一行。)

{
  "comment": {
    "id": "<unique id>",
    "timestamp": "<timestamp>",
    "messages": [
      {
        "body": {
          "text": "<text of the comment>"
        }
      }
    ]
  }
}{
  "comment": {
    "id": "<unique id>",
    "timestamp": "<timestamp>",
    "messages": [
      {
        "body": {
          "text": "<text of the comment>"
        }
      }
    ]
  }
}

如果要与注释一起上传标签,则可以将其包含在内(如上所述,为便于阅读,以缩进显示,但应全部显示在文件的一行中):

{
  "comment": {
    "id": "<unique id>",
    "timestamp": "<timestamp>",
    "messages": [
      {
        "body": {
          "text": "<text of the comment>"
        }
      }
    ]
  },
  "annotating": {
    "assigned": [
      {
        "name": "<Your Label Name>",
        "sentiment": "<positive|negative>"
      },
      {
        "name": "<Another Label Name>",
        "sentiment": "<positive|negative>"
      }
    ]
  }
}{
  "comment": {
    "id": "<unique id>",
    "timestamp": "<timestamp>",
    "messages": [
      {
        "body": {
          "text": "<text of the comment>"
        }
      }
    ]
  },
  "annotating": {
    "assigned": [
      {
        "name": "<Your Label Name>",
        "sentiment": "<positive|negative>"
      },
      {
        "name": "<Another Label Name>",
        "sentiment": "<positive|negative>"
      }
    ]
  }
}

上传数据

上传注释

以下命令会将注释上传到指定的来源。 我们建议将注释上传到新的空源中,因为如果出现问题,这样可以更轻松地回滚 - 您只需删除源即可。

re create comments \
  --source <project_name/source_name> \
  --file <file_name.jsonl>re create comments \
  --source <project_name/source_name> \
  --file <file_name.jsonl>
如果要更新现有注释,则应指定--overwrite标志。 系统将覆盖comment.id字段中的注释。 我们建议您在更新注释之前备份源的副本,以便能够在出现问题时恢复原始注释。

上传带有标签的注释

如果您想与注释一起上传标签,则应指定要将标签上传到的数据集。 在开始上传之前,应将数据集连接到源。

re create comments \
  --source <project_name/source_name> \
  --dataset <project_name/dataset_name> \
  --file <file_name.jsonl>re create comments \
  --source <project_name/source_name> \
  --dataset <project_name/dataset_name> \
  --file <file_name.jsonl>
您可以通过指定--overwrite标志来覆盖现有注释上的标签。 请注意,这会将现有标签替换为新标签(不会将现有标签添加到新标签)。 我们建议您在覆盖标签之前创建数据集的备份副本,以便能够在出现问题时恢复原始标签。
  • 准备数据
  • 上传数据

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo White
信任与安全
© 2005-2024 UiPath。保留所有权利。