
Communications Mining 用户指南
可计费操作
对于每个创建的注释或每个更新的注释(基于其唯一 ID),如果其文本已被修改,您需支付 1 个AI Unit或 0.2 个Platform Units费用。
CLI 允许您批量上传注释(包括预批注的注释)。除了在不需要实时连接的情况下将数据导入 Communications Mining™ 外,它还可用于将预先存在的训练数据上传到 Communications Mining,或覆盖 Communications Mining 中的现有注释或标签。
CLI 需要 JSONL 格式的数据(也称为以换行符分隔的 JSON),其中每一行都是一个 JSON 值。 许多工具都可以导出 JSONL 文件。 如果您有任何问题,请联系支持团队。
Each line in the JSONL file represents a comment object. Each comment object should have at least a unique ID, a timestamp, and a piece of text, but can have other fields such as metadata. To learn which fields to set for your data, check the Comment reference.
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>"
}
}
]
},
"labelling": {
"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>"
}
}
]
},
"labelling": {
"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
标志来覆盖现有注释上的标签。 请注意,这会将现有标签替换为新标签(不会将现有标签添加到新标签)。 我们建议您在覆盖标签之前创建数据集的备份副本,以便能够在出现问题时恢复原始标签。