// 后端发给前端的格式
const oldObj = {
"total_count": 1,
"data": [
{
"conversation_id": 1,
"deal_name": deal_name,
"account_name": account_name,
"participants": participants,
"account_label": [{
"res": [
{
"entity_id": 8683,
"name": "杨仪潇",
"entity_type": "host_salesman",
"content": "喂您好,李女士您好,您这边那个这边是植发专科医院的吗?之前和您那个。",
"begin_time": 0.66,
"end_time": 9.55,
"begin_percent": 0.6775067750677507,
"end_percent": 9.803317730147,
"order": 1,
"nlp_results": None,
"question": True,
"key_question": True,
"qa": [1, 2],
"keywords": [
{ "begin_pos": 9, "end_pos": 10, "word": "男" },
{ "begin_pos": 5, "end_pos": 7, "word": "男士" },
{ "begin_pos": 0, "end_pos": 1, "word": "男" },
],
}
],
"tag_value": "男,男士",
"style_type": "account_tag",
"id": 1894,
"rule_id": 1063,
"rule_name": "男士",
"rule_path": ["男士", "性别", "客户画像"],
"tag_type": "性别",
"tag_id": 102
}]
}
]
};
// 前端能用的格式
const newObj = {
"total_count": 1,
"deal_name": deal_name,
"account_name": account_name,
"items": [
{
"conversation_id": 1,
"participants": participants,
"sentences": [{
"data": [
{
"entity_id": 8683,
"name": "杨仪潇",
"entity_type": "host_salesman",
"content": "喂您好,李女士您好,您这边那个这边是植发专科医院的吗?之前和您那个。",
"begin_time": 0.66,
"end_time": 9.55,
"begin_percent": 0.6775067750677507,
"end_percent": 9.803317730147,
"order": 1,
"nlp_results": None,
"question": True,
"key_question": True,
"qa": [1, 2],
"keywords": [
{ "begin_pos": 9, "end_pos": 10, "word": "男" },
{ "begin_pos": 5, "end_pos": 7, "word": "男士" },
{ "begin_pos": 0, "end_pos": 1, "word": "男" },
],
}
],
"tag_value": "男,男士",
"style_type": "account_tag",
"id": 1894,
"rule_id": 1063,
"rule_name": "男士",
"rule_path": ["男士", "性别", "客户画像"],
"tag_type": "性别",
"tag_id": 102
}]
}
]
}
console