基于百度UNIT2.0 版本,实现简单的多轮人机对话功能
调用技能前提需要创建应用,获取API key 和Secret Key;使用两个key值获取调用api的token。
/**
* 获取token类
*/
public class AuthService {
/**
* 获取权限token
* @return 返回示例:
* {
* "access_token": "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567",
* "expires_in": 2592000
* }
*/
public static String getAuth() {
// 官网获取的 API Key 更新为你注册的
String clientId = "yRPuMmY6vbYVra0w8GhozQBF";
// 官网获取的 Secret Key 更新为你注册的
String clientSecret = "SNNVQ8ZqIob4XAQTEsVMkZ0uXKE9Amys";
return getAuth(clientId, clientSecret);
}
/**
* 获取API访问token
* 该token有一定的有效期,需要自行管理,当失效时需重新获取.
* @param ak - 百度云官网获取的 API Key
* @param sk - 百度云官网获取的 Securet Key
* @return assess_token 示例:
* "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567"
*/
public static String getAuth(String ak, String sk) {
// 获取token地址
String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
String getAccessTokenUrl = authHost
// 1. grant_type为固定参数
+ "grant_type=client_credentials"
// 2. 官网获取的 API Key
+ "&client_id=" + ak
// 3. 官网获取的 Secret Key
+ "&client_secret=" + sk;
try {
URL realUrl = new URL(getAccessTokenUrl);
// 打开和URL之间的连接
HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
connection.setRequestMethod("GET");
connection.connect();
// 获取所有响应头字段
Map<String, List<String>> map = connection.getHeaderFields();
// 遍历所有的响应头字段
// for (String key : map.keySet()) {
// System.err.println(key + "--->" + map.get(key));
// }
// 定义 BufferedReader输入流来读取URL的响应
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String result = "";
String line;
while ((line = in.readLine()) != null) {
result += line;
}
/**
* 返回结果示例
*/
// System.err.println("result:" + result);
JSONObject jsonObject = new JSONObject(result);
String access_token = jsonObject.getString("access_token");
return access_token;
} catch (Exception e) {
System.err.printf("获取token失败!");
e.printStackTrace(System.err);
}
return null;
}
}
result类
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* desc: TODO
* date: 2019-02-28
*
* @author qianxm
*/
@NoArgsConstructor
@Data
public class Result {
/**
* result : {"log_id":"cd96f0d104a240809538ef95ff5b0635","response":{"schema":{"intent_confidence":100,"slots":[{"word_type":"","confidence":100,"length":1,"name":"user_answer1","original_word":"对","sub_slots":[],"session_offset":0,"begin":0,"normalized_word":"对","merge_method":"updated"},{"word_type":"","confidence":100,"length":2,"name":"user_answer1","original_word":"我是","sub_slots":[],"session_offset":0,"begin":1,"normalized_word":"我是","merge_method":"updated"}],"domain_confidence":0,"intent":"INTENTION_2"},"qu_res":{"candidates":[{"intent_confidence":100,"match_info":"{\"group_id\":\"23\",\"id\":\"1958136\",\"informal_word\":\"我\\t是\",\"match_keywords\":\" \",\"match_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_slots\":{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{},\"from_who\":\"smart_qu\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"[D:user_answer1] \\t[D:user_answer1] \",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"我是\",\"word_type\":\"\"}]},\"real_threshold\":1.0,\"threshold\":0.4000000059604645}","slots":[{"word_type":"","father_idx":-1,"confidence":100,"length":1,"name":"user_answer1","original_word":"对","begin":0,"need_clarify":false,"normalized_word":"对"},{"word_type":"","father_idx":-1,"confidence":100,"length":2,"name":"user_answer1","original_word":"我是","begin":1,"need_clarify":false,"normalized_word":"我是"}],"extra_info":{"group_id":"23","real_threshold":"1","threshold":"0.4"},"confidence":100,"domain_confidence":0,"from_who":"pow-slu-lev1","intent":"INTENTION_2","intent_need_clarify":false}],"qu_res_chosen":"{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"23\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"23\\\",\\\"id\\\":\\\"1958136\\\",\\\"informal_word\\\":\\\"我\\\\t是\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"[D:user_answer1] \\\\t[D:user_answer1] \\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"对\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"word_type\":\"\"}]}\n","sentiment_analysis":{"pval":0.904,"label":"1"},"lexical_analysis":[{"etypes":["[D:user_answer1]"],"basic_word":["对"],"weight":0.129,"term":"对","type":"user_answer1"},{"etypes":["[D:user_answer1]"],"basic_word":["我","是"],"weight":0.87,"term":"我是","type":"user_answer1"}],"raw_query":"对我是","status":0,"timestamp":0},"action_list":[{"action_id":"intention_2_satisfy","refine_detail":{"option_list":[],"interact":"","clarify_reason":""},"confidence":100,"custom_reply":"","say":"现在联通公司为回馈老用户推出优惠活动给您推荐99元/月的畅越冰激凌优惠套餐为您介绍一下这项活动好么?","type":"satisfy"}]},"bot_session":"{\"bot_id\":\"37819\",\"bot_views\":{\"bernard_res\":[{\"action_list\":[{\"action_id\":\"\",\"confidence\":0.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"\",\"interact\":\"\",\"option_list\":[]},\"say\":\"\",\"type\":\"understood\"}],\"msg\":\"ok\",\"pre_nlu_outs\":[{\"otags_basic\":[{\"blength\":2,\"boffset\":0,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"user_hello\",\"etypes\":[\"[D:user_hello]\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\"],\"length\":1,\"method\":\"[D:user_hello] == [D:user_hello]\",\"name\":\"喂\",\"offset\":0,\"rstatus\":2,\"type_confidence\":10.50},{\"blength\":4,\"boffset\":4,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"user_hello\",\"etypes\":[\"[D:user_hello]\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\"],\"length\":1,\"method\":\"[D:user_hello] == [D:user_hello]\",\"name\":\"您好\",\"offset\":2,\"rstatus\":2,\"type_confidence\":10.50}],\"otags_wpcomp\":[],\"polarity\":{\"label\":\"1\",\"pval\":0.9970},\"tokens_basic\":[{\"buffer\":\"喂\",\"length\":2,\"norm_degree\":0.9479930996894836,\"offset\":0,\"type\":34,\"weight\":0.4515353739261627},{\"buffer\":\",\",\"length\":2,\"norm_degree\":0.0,\"offset\":2,\"type\":37,\"weight\":0.01189841516315937},{\"buffer\":\"您好\",\"length\":4,\"norm_degree\":0.0,\"offset\":4,\"type\":19,\"weight\":0.5365661978721619}],\"tokens_wpcomp\":[{\"buffer\":\"喂\",\"length\":2,\"norm_degree\":0.0,\"offset\":0,\"type\":34,\"weight\":0.4515353739261627},{\"buffer\":\",\",\"length\":2,\"norm_degree\":0.0,\"offset\":1,\"type\":37,\"weight\":0.2317169010639191},{\"buffer\":\"您好\",\"length\":4,\"norm_degree\":0.0,\"offset\":2,\"type\":19,\"weight\":0.2801815271377563}]}],\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"25\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"25\\\",\\\"id\\\":\\\"1958113\\\",\\\"informal_word\\\":\\\",\\\\t您好\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"喂 \\\\t您好 \\\",\\\"slots\\\":[]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[]}],\"lexical_analysis\":[{\"basic_word\":[\"喂\"],\"etypes\":[\"[D:user_hello]\"],\"term\":\"喂\",\"type\":\"user_hello\",\"weight\":0.4510},{\"basic_word\":[\",\"],\"etypes\":[],\"term\":\",\",\"type\":\"37\",\"weight\":0.0110},{\"basic_word\":[\"您好\"],\"etypes\":[\"[D:user_hello]\"],\"term\":\"您好\",\"type\":\"user_hello\",\"weight\":0.5360}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"25\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"25\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"1958113\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\",\\\\\\\\t您好\\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"喂\\\\\\\\t您好\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"喂\\\\\\\\t您好\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"INTENTION_1\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"喂 \\\\\\\\t您好 \\\\\\\",\\\\\\\"slots\\\\\\\":[]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[]}\\n\",\"raw_query\":\"喂,您好\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9970},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"slots\":[]},\"status\":0},{\"action_list\":[{\"action_id\":\"\",\"confidence\":0.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"\",\"interact\":\"\",\"option_list\":[]},\"say\":\"\",\"type\":\"understood\"}],\"msg\":\"ok\",\"pre_nlu_outs\":[{\"otags_basic\":[{\"blength\":2,\"boffset\":0,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"user_answer1\",\"etypes\":[\"[D:user_answer1]\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\"],\"length\":1,\"method\":\"[D:user_answer1] == [D:user_answer1]\",\"name\":\"对\",\"offset\":0,\"rstatus\":2,\"type_confidence\":10.50},{\"blength\":4,\"boffset\":2,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"user_answer1\",\"etypes\":[\"[D:user_answer1]\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\"],\"length\":2,\"method\":\"[D:user_answer1] == [D:user_answer1]\",\"name\":\"我是\",\"offset\":1,\"rstatus\":2,\"type_confidence\":10.50}],\"otags_wpcomp\":[{\"blength\":2,\"boffset\":2,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"sys_coref_person\",\"etypes\":[\"[D:COREF_PERSON]\",\"sys_coref_person\",\"sys_coref_person\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\",\"\",\"\"],\"length\":1,\"method\":\"prime_nerl\",\"name\":\"我\",\"offset\":1,\"rstatus\":2,\"type_confidence\":5.0}],\"polarity\":{\"label\":\"1\",\"pval\":0.9040},\"tokens_basic\":[{\"buffer\":\"对\",\"length\":2,\"norm_degree\":0.9113681912422180,\"offset\":0,\"type\":28,\"weight\":0.1299898177385330},{\"buffer\":\"我\",\"length\":2,\"norm_degree\":0.0,\"offset\":2,\"type\":30,\"weight\":0.7122635245323181},{\"buffer\":\"是\",\"length\":2,\"norm_degree\":0.0,\"offset\":4,\"type\":34,\"weight\":0.1577466726303101}],\"tokens_wpcomp\":[{\"buffer\":\"对\",\"length\":2,\"norm_degree\":0.0,\"offset\":0,\"type\":28,\"weight\":0.1299898177385330},{\"buffer\":\"我\",\"length\":2,\"norm_degree\":0.0,\"offset\":1,\"type\":30,\"weight\":0.4211266636848450},{\"buffer\":\"是\",\"length\":2,\"norm_degree\":0.0,\"offset\":2,\"type\":34,\"weight\":0.7122635245323181}]}],\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"23\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"23\\\",\\\"id\\\":\\\"1958136\\\",\\\"informal_word\\\":\\\"我\\\\t是\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"[D:user_answer1] \\\\t[D:user_answer1] \\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"对\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"word_type\":\"\"}]}],\"lexical_analysis\":[{\"basic_word\":[\"对\"],\"etypes\":[\"[D:user_answer1]\"],\"term\":\"对\",\"type\":\"user_answer1\",\"weight\":0.1290},{\"basic_word\":[\"我\",\"是\"],\"etypes\":[\"[D:user_answer1]\"],\"term\":\"我是\",\"type\":\"user_answer1\",\"weight\":0.870}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"23\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"23\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"1958136\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\"我\\\\\\\\t是\\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"[D:user_answer1]\\\\\\\\t[D:user_answer1]\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"[D:user_answer1]\\\\\\\\t[D:user_answer1]\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"INTENTION_2\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"[D:user_answer1] \\\\\\\\t[D:user_answer1] \\\\\\\",\\\\\\\"slots\\\\\\\":[{\\\\\\\"begin\\\\\\\":0,\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"father_idx\\\\\\\":-1,\\\\\\\"length\\\\\\\":2,\\\\\\\"name\\\\\\\":\\\\\\\"user_answer1\\\\\\\",\\\\\\\"need_clarify\\\\\\\":false,\\\\\\\"normalized_word\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"original_word\\\\\\\":\\\\\\\"对\\\\\\\",\\\\\\\"word_type\\\\\\\":\\\\\\\"\\\\\\\"},{\\\\\\\"begin\\\\\\\":2,\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"father_idx\\\\\\\":-1,\\\\\\\"length\\\\\\\":4,\\\\\\\"name\\\\\\\":\\\\\\\"user_answer1\\\\\\\",\\\\\\\"need_clarify\\\\\\\":false,\\\\\\\"normalized_word\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"original_word\\\\\\\":\\\\\\\"我是\\\\\\\",\\\\\\\"word_type\\\\\\\":\\\\\\\"\\\\\\\"}]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"对\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"我是\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]}\\n\",\"raw_query\":\"对我是\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9040},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"slots\":[{\"begin\":2,\"confidence\":100.0,\"length\":4,\"merge_method\":\"updated\",\"name\":\"user_answer1\",\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"session_offset\":0,\"sub_slots\":[],\"word_type\":\"\"},{\"begin\":0,\"confidence\":100.0,\"length\":2,\"merge_method\":\"updated\",\"name\":\"user_answer1\",\"normalized_word\":\"对\",\"original_word\":\"对\",\"session_offset\":0,\"sub_slots\":[],\"word_type\":\"\"}]},\"status\":0}],\"bernard_status\":[{\"index\":0,\"step\":\"AFTER_DM_TRIGGER\"},{\"index\":1,\"step\":\"AFTER_DM_TRIGGER\"}],\"intervention\":{\"interv_qu_res\":\"\",\"interv_query\":\"\",\"qu_res_interved\":\"\",\"qu_res_original\":\"\",\"query_original\":\"\",\"type\":\"\",\"user_id\":\"\"},\"user_slots\":{\"user_answer1\":{\"state\":2,\"static_slot\":{\"default_state\":0,\"default_tag_name\":\"DEFAULT\",\"example_values\":[],\"extensible\":true,\"name\":\"user_answer1\",\"print\":[\"意图1用户肯定回答\"],\"type\":0,\"update_type\":\"single_turn\",\"weight\":1.0},\"tag_map\":{\"对\":{\"begin\":0,\"confidence\":100.0,\"length\":2,\"merge_method\":\"updated\",\"normalized_name\":\"对\",\"original_name\":\"对\",\"state\":2,\"turn\":0,\"word_type\":\"\"},\"我是\":{\"begin\":2,\"confidence\":100.0,\"length\":4,\"merge_method\":\"updated\",\"normalized_name\":\"我是\",\"original_name\":\"我是\",\"state\":2,\"turn\":0,\"word_type\":\"\"}}}}},\"dialog_state\":{\"contexts\":{},\"intents\":[{\"index\":0,\"name\":\"INTENTION_1\"},{\"index\":1,\"name\":\"INTENTION_2\"}],\"user_slots\":{\"user_answer1\":{\"attrs\":{\"default_state\":0,\"default_tag_name\":\"DEFAULT\",\"example_values\":[],\"extensible\":true,\"name\":\"user_answer1\",\"print\":[\"意图1用户肯定回答\"],\"type\":0,\"update_type\":\"single_turn\",\"weight\":1.0},\"state\":2,\"values\":{\"对\":{\"begin\":0,\"confidence\":100.0,\"length\":2,\"merge_method\":\"updated\",\"normalized_name\":\"对\",\"original_name\":\"对\",\"session_offest\":0,\"state\":2,\"word_type\":\"\"},\"我是\":{\"begin\":2,\"confidence\":100.0,\"length\":4,\"merge_method\":\"updated\",\"normalized_name\":\"我是\",\"original_name\":\"我是\",\"session_offest\":0,\"state\":2,\"word_type\":\"\"}}}}},\"interactions\":[{\"interaction_id\":\"interaction-1551324068880-707575714-8013-72\",\"request\":{\"bernard_level\":1,\"client_session\":\"{\\\\\\\\\\\\\\\"candidate_options\\\\\\\\\\\\\\\":[],\\\\\\\\\\\\\\\"client_results\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"}\",\"hyper_params\":{\"slu_tags\":[]},\"query\":\"喂,您好\",\"query_info\":{\"asr_candidates\":[],\"source\":\"KEYBOARD\",\"type\":\"TEXT\"},\"updates\":\"\",\"user_id\":\"UNIT_WEB_37819\"},\"response\":{\"action_list\":[{\"action_id\":\"intention_1_satisfy\",\"confidence\":100.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"\",\"interact\":\"\",\"option_list\":[]},\"say\":\"**先生/女士,您好!我是联通公司客户经理,工号:****,请问您是尾号XXXX机主吗?\",\"type\":\"satisfy\"}],\"msg\":\"ok\",\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"25\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"25\\\",\\\"id\\\":\\\"1958113\\\",\\\"informal_word\\\":\\\",\\\\t您好\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"喂 \\\\t您好 \\\",\\\"slots\\\":[]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[]}],\"lexical_analysis\":[{\"basic_word\":[\"喂\"],\"etypes\":[\"[D:user_hello]\"],\"term\":\"喂\",\"type\":\"user_hello\",\"weight\":0.4510},{\"basic_word\":[\",\"],\"etypes\":[],\"term\":\",\",\"type\":\"37\",\"weight\":0.0110},{\"basic_word\":[\"您好\"],\"etypes\":[\"[D:user_hello]\"],\"term\":\"您好\",\"type\":\"user_hello\",\"weight\":0.5360}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"25\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"25\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"1958113\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\",\\\\\\\\t您好\\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"喂\\\\\\\\t您好\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"喂\\\\\\\\t您好\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"INTENTION_1\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"喂 \\\\\\\\t您好 \\\\\\\",\\\\\\\"slots\\\\\\\":[]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[]}\\n\",\"raw_query\":\"喂,您好\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9970},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"slots\":[]},\"status\":0},\"timestamp\":\"2019-02-28 11:21:08.880\"},{\"interaction_id\":\"interaction-1551324152506-707575714-8013-73\",\"request\":{\"bernard_level\":1,\"client_session\":\"{\\\\\\\\\\\\\\\"candidate_options\\\\\\\\\\\\\\\":[],\\\\\\\\\\\\\\\"client_results\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"}\",\"hyper_params\":{\"slu_tags\":[]},\"query\":\"对我是\",\"query_info\":{\"asr_candidates\":[],\"source\":\"KEYBOARD\",\"type\":\"TEXT\"},\"updates\":\"\",\"user_id\":\"UNIT_WEB_37819\"},\"response\":{\"action_list\":[{\"action_id\":\"intention_2_satisfy\",\"confidence\":100.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"\",\"interact\":\"\",\"option_list\":[]},\"say\":\"现在联通公司为回馈老用户推出优惠活动给您推荐99元/月的畅越冰激凌优惠套餐为您介绍一下这项活动好么?\",\"type\":\"satisfy\"}],\"msg\":\"ok\",\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"23\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"23\\\",\\\"id\\\":\\\"1958136\\\",\\\"informal_word\\\":\\\"我\\\\t是\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"[D:user_answer1] \\\\t[D:user_answer1] \\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":1,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"对\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":1,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"word_type\":\"\"}]}],\"lexical_analysis\":[{\"basic_word\":[\"对\"],\"etypes\":[\"[D:user_answer1]\"],\"term\":\"对\",\"type\":\"user_answer1\",\"weight\":0.1290},{\"basic_word\":[\"我\",\"是\"],\"etypes\":[\"[D:user_answer1]\"],\"term\":\"我是\",\"type\":\"user_answer1\",\"weight\":0.870}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"23\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"23\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"1958136\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\"我\\\\\\\\t是\\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"[D:user_answer1]\\\\\\\\t[D:user_answer1]\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"[D:user_answer1]\\\\\\\\t[D:user_answer1]\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"INTENTION_2\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"[D:user_answer1] \\\\\\\\t[D:user_answer1] \\\\\\\",\\\\\\\"slots\\\\\\\":[{\\\\\\\"begin\\\\\\\":0,\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"father_idx\\\\\\\":-1,\\\\\\\"length\\\\\\\":2,\\\\\\\"name\\\\\\\":\\\\\\\"user_answer1\\\\\\\",\\\\\\\"need_clarify\\\\\\\":false,\\\\\\\"normalized_word\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"original_word\\\\\\\":\\\\\\\"对\\\\\\\",\\\\\\\"word_type\\\\\\\":\\\\\\\"\\\\\\\"},{\\\\\\\"begin\\\\\\\":2,\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"father_idx\\\\\\\":-1,\\\\\\\"length\\\\\\\":4,\\\\\\\"name\\\\\\\":\\\\\\\"user_answer1\\\\\\\",\\\\\\\"need_clarify\\\\\\\":false,\\\\\\\"normalized_word\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"original_word\\\\\\\":\\\\\\\"我是\\\\\\\",\\\\\\\"word_type\\\\\\\":\\\\\\\"\\\\\\\"}]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"对\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"我是\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]}\\n\",\"raw_query\":\"对我是\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9040},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"slots\":[{\"begin\":0,\"confidence\":100.0,\"length\":1,\"merge_method\":\"updated\",\"name\":\"user_answer1\",\"normalized_word\":\"对\",\"original_word\":\"对\",\"session_offset\":0,\"sub_slots\":[],\"word_type\":\"\"},{\"begin\":1,\"confidence\":100.0,\"length\":2,\"merge_method\":\"updated\",\"name\":\"user_answer1\",\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"session_offset\":0,\"sub_slots\":[],\"word_type\":\"\"}]},\"status\":0},\"timestamp\":\"2019-02-28 11:22:32.506\"}],\"session_id\":\"session-1551324068657-707575714-8013-22\"}\n","interaction_id":"interaction-1551324152506-707575714-8013-73","version":"2.0","bot_id":"37819","timestamp":"2019-02-28 11:22:32.506"}
* error_msg : ok
* error_code : 0
*/
private ResultBean result;
private String error_msg;
private int error_code;
@NoArgsConstructor
@Data
public static class ResultBean {
/**
* log_id : cd96f0d104a240809538ef95ff5b0635
* response : {"schema":{"intent_confidence":100,"slots":[{"word_type":"","confidence":100,"length":1,"name":"user_answer1","original_word":"对","sub_slots":[],"session_offset":0,"begin":0,"normalized_word":"对","merge_method":"updated"},{"word_type":"","confidence":100,"length":2,"name":"user_answer1","original_word":"我是","sub_slots":[],"session_offset":0,"begin":1,"normalized_word":"我是","merge_method":"updated"}],"domain_confidence":0,"intent":"INTENTION_2"},"qu_res":{"candidates":[{"intent_confidence":100,"match_info":"{\"group_id\":\"23\",\"id\":\"1958136\",\"informal_word\":\"我\\t是\",\"match_keywords\":\" \",\"match_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_slots\":{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{},\"from_who\":\"smart_qu\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"[D:user_answer1] \\t[D:user_answer1] \",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"我是\",\"word_type\":\"\"}]},\"real_threshold\":1.0,\"threshold\":0.4000000059604645}","slots":[{"word_type":"","father_idx":-1,"confidence":100,"length":1,"name":"user_answer1","original_word":"对","begin":0,"need_clarify":false,"normalized_word":"对"},{"word_type":"","father_idx":-1,"confidence":100,"length":2,"name":"user_answer1","original_word":"我是","begin":1,"need_clarify":false,"normalized_word":"我是"}],"extra_info":{"group_id":"23","real_threshold":"1","threshold":"0.4"},"confidence":100,"domain_confidence":0,"from_who":"pow-slu-lev1","intent":"INTENTION_2","intent_need_clarify":false}],"qu_res_chosen":"{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"23\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"23\\\",\\\"id\\\":\\\"1958136\\\",\\\"informal_word\\\":\\\"我\\\\t是\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"[D:user_answer1] \\\\t[D:user_answer1] \\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"对\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"word_type\":\"\"}]}\n","sentiment_analysis":{"pval":0.904,"label":"1"},"lexical_analysis":[{"etypes":["[D:user_answer1]"],"basic_word":["对"],"weight":0.129,"term":"对","type":"user_answer1"},{"etypes":["[D:user_answer1]"],"basic_word":["我","是"],"weight":0.87,"term":"我是","type":"user_answer1"}],"raw_query":"对我是","status":0,"timestamp":0},"action_list":[{"action_id":"intention_2_satisfy","refine_detail":{"option_list":[],"interact":"","clarify_reason":""},"confidence":100,"custom_reply":"","say":"现在联通公司为回馈老用户推出优惠活动给您推荐99元/月的畅越冰激凌优惠套餐为您介绍一下这项活动好么?","type":"satisfy"}]}
* bot_session : {"bot_id":"37819","bot_views":{"bernard_res":[{"action_list":[{"action_id":"","confidence":0.0,"custom_reply":"","refine_detail":{"clarify_reason":"","interact":"","option_list":[]},"say":"","type":"understood"}],"msg":"ok","pre_nlu_outs":[{"otags_basic":[{"blength":2,"boffset":0,"eid":"","entity_confidence":0.0,"etype":"user_hello","etypes":["[D:user_hello]"],"father_fully_covered":false,"father_index":-1,"features":[],"formal":"","formals":[""],"length":1,"method":"[D:user_hello] == [D:user_hello]","name":"喂","offset":0,"rstatus":2,"type_confidence":10.50},{"blength":4,"boffset":4,"eid":"","entity_confidence":0.0,"etype":"user_hello","etypes":["[D:user_hello]"],"father_fully_covered":false,"father_index":-1,"features":[],"formal":"","formals":[""],"length":1,"method":"[D:user_hello] == [D:user_hello]","name":"您好","offset":2,"rstatus":2,"type_confidence":10.50}],"otags_wpcomp":[],"polarity":{"label":"1","pval":0.9970},"tokens_basic":[{"buffer":"喂","length":2,"norm_degree":0.9479930996894836,"offset":0,"type":34,"weight":0.4515353739261627},{"buffer":",","length":2,"norm_degree":0.0,"offset":2,"type":37,"weight":0.01189841516315937},{"buffer":"您好","length":4,"norm_degree":0.0,"offset":4,"type":19,"weight":0.5365661978721619}],"tokens_wpcomp":[{"buffer":"喂","length":2,"norm_degree":0.0,"offset":0,"type":34,"weight":0.4515353739261627},{"buffer":",","length":2,"norm_degree":0.0,"offset":1,"type":37,"weight":0.2317169010639191},{"buffer":"您好","length":4,"norm_degree":0.0,"offset":2,"type":19,"weight":0.2801815271377563}]}],"qu_res":{"candidates":[{"confidence":100.0,"domain_confidence":0.0,"extra_info":{"group_id":"25","real_threshold":"1","threshold":"0.4"},"from_who":"pow-slu-lev1","intent":"INTENTION_1","intent_confidence":100.0,"intent_need_clarify":false,"match_info":"{\"group_id\":\"25\",\"id\":\"1958113\",\"informal_word\":\",\\t您好\",\"match_keywords\":\" \",\"match_pattern\":\"喂\\t您好\",\"ori_pattern\":\"喂\\t您好\",\"ori_slots\":{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{},\"from_who\":\"smart_qu\",\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"喂 \\t您好 \",\"slots\":[]},\"real_threshold\":1.0,\"threshold\":0.4000000059604645}","slots":[]}],"lexical_analysis":[{"basic_word":["喂"],"etypes":["[D:user_hello]"],"term":"喂","type":"user_hello","weight":0.4510},{"basic_word":[","],"etypes":[],"term":",","type":"37","weight":0.0110},{"basic_word":["您好"],"etypes":["[D:user_hello]"],"term":"您好","type":"user_hello","weight":0.5360}],"qu_res_chosen":"{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"25\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"25\\\",\\\"id\\\":\\\"1958113\\\",\\\"informal_word\\\":\\\",\\\\t您好\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"喂 \\\\t您好 \\\",\\\"slots\\\":[]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[]}\n","raw_query":"喂,您好","sentiment_analysis":{"label":"1","pval":0.9970},"status":0,"timestamp":0},"schema":{"domain_confidence":0.0,"intent":"INTENTION_1","intent_confidence":100.0,"slots":[]},"status":0},{"action_list":[{"action_id":"","confidence":0.0,"custom_reply":"","refine_detail":{"clarify_reason":"","interact":"","option_list":[]},"say":"","type":"understood"}],"msg":"ok","pre_nlu_outs":[{"otags_basic":[{"blength":2,"boffset":0,"eid":"","entity_confidence":0.0,"etype":"user_answer1","etypes":["[D:user_answer1]"],"father_fully_covered":false,"father_index":-1,"features":[],"formal":"","formals":[""],"length":1,"method":"[D:user_answer1] == [D:user_answer1]","name":"对","offset":0,"rstatus":2,"type_confidence":10.50},{"blength":4,"boffset":2,"eid":"","entity_confidence":0.0,"etype":"user_answer1","etypes":["[D:user_answer1]"],"father_fully_covered":false,"father_index":-1,"features":[],"formal":"","formals":[""],"length":2,"method":"[D:user_answer1] == [D:user_answer1]","name":"我是","offset":1,"rstatus":2,"type_confidence":10.50}],"otags_wpcomp":[{"blength":2,"boffset":2,"eid":"","entity_confidence":0.0,"etype":"sys_coref_person","etypes":["[D:COREF_PERSON]","sys_coref_person","sys_coref_person"],"father_fully_covered":false,"father_index":-1,"features":[],"formal":"","formals":["","",""],"length":1,"method":"prime_nerl","name":"我","offset":1,"rstatus":2,"type_confidence":5.0}],"polarity":{"label":"1","pval":0.9040},"tokens_basic":[{"buffer":"对","length":2,"norm_degree":0.9113681912422180,"offset":0,"type":28,"weight":0.1299898177385330},{"buffer":"我","length":2,"norm_degree":0.0,"offset":2,"type":30,"weight":0.7122635245323181},{"buffer":"是","length":2,"norm_degree":0.0,"offset":4,"type":34,"weight":0.1577466726303101}],"tokens_wpcomp":[{"buffer":"对","length":2,"norm_degree":0.0,"offset":0,"type":28,"weight":0.1299898177385330},{"buffer":"我","length":2,"norm_degree":0.0,"offset":1,"type":30,"weight":0.4211266636848450},{"buffer":"是","length":2,"norm_degree":0.0,"offset":2,"type":34,"weight":0.7122635245323181}]}],"qu_res":{"candidates":[{"confidence":100.0,"domain_confidence":0.0,"extra_info":{"group_id":"23","real_threshold":"1","threshold":"0.4"},"from_who":"pow-slu-lev1","intent":"INTENTION_2","intent_confidence":100.0,"intent_need_clarify":false,"match_info":"{\"group_id\":\"23\",\"id\":\"1958136\",\"informal_word\":\"我\\t是\",\"match_keywords\":\" \",\"match_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_slots\":{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{},\"from_who\":\"smart_qu\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"[D:user_answer1] \\t[D:user_answer1] \",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"我是\",\"word_type\":\"\"}]},\"real_threshold\":1.0,\"threshold\":0.4000000059604645}","slots":[{"begin":0,"confidence":100.0,"father_idx":-1,"length":2,"name":"user_answer1","need_clarify":false,"normalized_word":"对","original_word":"对","word_type":""},{"begin":2,"confidence":100.0,"father_idx":-1,"length":4,"name":"user_answer1","need_clarify":false,"normalized_word":"我是","original_word":"我是","word_type":""}]}],"lexical_analysis":[{"basic_word":["对"],"etypes":["[D:user_answer1]"],"term":"对","type":"user_answer1","weight":0.1290},{"basic_word":["我","是"],"etypes":["[D:user_answer1]"],"term":"我是","type":"user_answer1","weight":0.870}],"qu_res_chosen":"{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"23\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"23\\\",\\\"id\\\":\\\"1958136\\\",\\\"informal_word\\\":\\\"我\\\\t是\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"[D:user_answer1] \\\\t[D:user_answer1] \\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"对\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"word_type\":\"\"}]}\n","raw_query":"对我是","sentiment_analysis":{"label":"1","pval":0.9040},"status":0,"timestamp":0},"schema":{"domain_confidence":0.0,"intent":"INTENTION_2","intent_confidence":100.0,"slots":[{"begin":2,"confidence":100.0,"length":4,"merge_method":"updated","name":"user_answer1","normalized_word":"我是","original_word":"我是","session_offset":0,"sub_slots":[],"word_type":""},{"begin":0,"confidence":100.0,"length":2,"merge_method":"updated","name":"user_answer1","normalized_word":"对","original_word":"对","session_offset":0,"sub_slots":[],"word_type":""}]},"status":0}],"bernard_status":[{"index":0,"step":"AFTER_DM_TRIGGER"},{"index":1,"step":"AFTER_DM_TRIGGER"}],"intervention":{"interv_qu_res":"","interv_query":"","qu_res_interved":"","qu_res_original":"","query_original":"","type":"","user_id":""},"user_slots":{"user_answer1":{"state":2,"static_slot":{"default_state":0,"default_tag_name":"DEFAULT","example_values":[],"extensible":true,"name":"user_answer1","print":["意图1用户肯定回答"],"type":0,"update_type":"single_turn","weight":1.0},"tag_map":{"对":{"begin":0,"confidence":100.0,"length":2,"merge_method":"updated","normalized_name":"对","original_name":"对","state":2,"turn":0,"word_type":""},"我是":{"begin":2,"confidence":100.0,"length":4,"merge_method":"updated","normalized_name":"我是","original_name":"我是","state":2,"turn":0,"word_type":""}}}}},"dialog_state":{"contexts":{},"intents":[{"index":0,"name":"INTENTION_1"},{"index":1,"name":"INTENTION_2"}],"user_slots":{"user_answer1":{"attrs":{"default_state":0,"default_tag_name":"DEFAULT","example_values":[],"extensible":true,"name":"user_answer1","print":["意图1用户肯定回答"],"type":0,"update_type":"single_turn","weight":1.0},"state":2,"values":{"对":{"begin":0,"confidence":100.0,"length":2,"merge_method":"updated","normalized_name":"对","original_name":"对","session_offest":0,"state":2,"word_type":""},"我是":{"begin":2,"confidence":100.0,"length":4,"merge_method":"updated","normalized_name":"我是","original_name":"我是","session_offest":0,"state":2,"word_type":""}}}}},"interactions":[{"interaction_id":"interaction-1551324068880-707575714-8013-72","request":{"bernard_level":1,"client_session":"{\\\\\\\"candidate_options\\\\\\\":[],\\\\\\\"client_results\\\\\\\":\\\\\\\"\\\\\\\"}","hyper_params":{"slu_tags":[]},"query":"喂,您好","query_info":{"asr_candidates":[],"source":"KEYBOARD","type":"TEXT"},"updates":"","user_id":"UNIT_WEB_37819"},"response":{"action_list":[{"action_id":"intention_1_satisfy","confidence":100.0,"custom_reply":"","refine_detail":{"clarify_reason":"","interact":"","option_list":[]},"say":"**先生/女士,您好!我是联通公司客户经理,工号:****,请问您是尾号XXXX机主吗?","type":"satisfy"}],"msg":"ok","qu_res":{"candidates":[{"confidence":100.0,"domain_confidence":0.0,"extra_info":{"group_id":"25","real_threshold":"1","threshold":"0.4"},"from_who":"pow-slu-lev1","intent":"INTENTION_1","intent_confidence":100.0,"intent_need_clarify":false,"match_info":"{\"group_id\":\"25\",\"id\":\"1958113\",\"informal_word\":\",\\t您好\",\"match_keywords\":\" \",\"match_pattern\":\"喂\\t您好\",\"ori_pattern\":\"喂\\t您好\",\"ori_slots\":{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{},\"from_who\":\"smart_qu\",\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"喂 \\t您好 \",\"slots\":[]},\"real_threshold\":1.0,\"threshold\":0.4000000059604645}","slots":[]}],"lexical_analysis":[{"basic_word":["喂"],"etypes":["[D:user_hello]"],"term":"喂","type":"user_hello","weight":0.4510},{"basic_word":[","],"etypes":[],"term":",","type":"37","weight":0.0110},{"basic_word":["您好"],"etypes":["[D:user_hello]"],"term":"您好","type":"user_hello","weight":0.5360}],"qu_res_chosen":"{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"25\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"25\\\",\\\"id\\\":\\\"1958113\\\",\\\"informal_word\\\":\\\",\\\\t您好\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"喂 \\\\t您好 \\\",\\\"slots\\\":[]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[]}\n","raw_query":"喂,您好","sentiment_analysis":{"label":"1","pval":0.9970},"status":0,"timestamp":0},"schema":{"domain_confidence":0.0,"intent":"INTENTION_1","intent_confidence":100.0,"slots":[]},"status":0},"timestamp":"2019-02-28 11:21:08.880"},{"interaction_id":"interaction-1551324152506-707575714-8013-73","request":{"bernard_level":1,"client_session":"{\\\\\\\"candidate_options\\\\\\\":[],\\\\\\\"client_results\\\\\\\":\\\\\\\"\\\\\\\"}","hyper_params":{"slu_tags":[]},"query":"对我是","query_info":{"asr_candidates":[],"source":"KEYBOARD","type":"TEXT"},"updates":"","user_id":"UNIT_WEB_37819"},"response":{"action_list":[{"action_id":"intention_2_satisfy","confidence":100.0,"custom_reply":"","refine_detail":{"clarify_reason":"","interact":"","option_list":[]},"say":"现在联通公司为回馈老用户推出优惠活动给您推荐99元/月的畅越冰激凌优惠套餐为您介绍一下这项活动好么?","type":"satisfy"}],"msg":"ok","qu_res":{"candidates":[{"confidence":100.0,"domain_confidence":0.0,"extra_info":{"group_id":"23","real_threshold":"1","threshold":"0.4"},"from_who":"pow-slu-lev1","intent":"INTENTION_2","intent_confidence":100.0,"intent_need_clarify":false,"match_info":"{\"group_id\":\"23\",\"id\":\"1958136\",\"informal_word\":\"我\\t是\",\"match_keywords\":\" \",\"match_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_slots\":{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{},\"from_who\":\"smart_qu\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"[D:user_answer1] \\t[D:user_answer1] \",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"我是\",\"word_type\":\"\"}]},\"real_threshold\":1.0,\"threshold\":0.4000000059604645}","slots":[{"begin":0,"confidence":100.0,"father_idx":-1,"length":1,"name":"user_answer1","need_clarify":false,"normalized_word":"对","original_word":"对","word_type":""},{"begin":1,"confidence":100.0,"father_idx":-1,"length":2,"name":"user_answer1","need_clarify":false,"normalized_word":"我是","original_word":"我是","word_type":""}]}],"lexical_analysis":[{"basic_word":["对"],"etypes":["[D:user_answer1]"],"term":"对","type":"user_answer1","weight":0.1290},{"basic_word":["我","是"],"etypes":["[D:user_answer1]"],"term":"我是","type":"user_answer1","weight":0.870}],"qu_res_chosen":"{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"23\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"23\\\",\\\"id\\\":\\\"1958136\\\",\\\"informal_word\\\":\\\"我\\\\t是\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"[D:user_answer1] \\\\t[D:user_answer1] \\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"对\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"word_type\":\"\"}]}\n","raw_query":"对我是","sentiment_analysis":{"label":"1","pval":0.9040},"status":0,"timestamp":0},"schema":{"domain_confidence":0.0,"intent":"INTENTION_2","intent_confidence":100.0,"slots":[{"begin":0,"confidence":100.0,"length":1,"merge_method":"updated","name":"user_answer1","normalized_word":"对","original_word":"对","session_offset":0,"sub_slots":[],"word_type":""},{"begin":1,"confidence":100.0,"length":2,"merge_method":"updated","name":"user_answer1","normalized_word":"我是","original_word":"我是","session_offset":0,"sub_slots":[],"word_type":""}]},"status":0},"timestamp":"2019-02-28 11:22:32.506"}],"session_id":"session-1551324068657-707575714-8013-22"}
* interaction_id : interaction-1551324152506-707575714-8013-73
* version : 2.0
* bot_id : 37819
* timestamp : 2019-02-28 11:22:32.506
*/
private String log_id;
private ResponseBean response;
private String bot_session;
private String interaction_id;
private String version;
private String bot_id;
private String timestamp;
@NoArgsConstructor
@Data
public static class ResponseBean {
/**
* schema : {"intent_confidence":100,"slots":[{"word_type":"","confidence":100,"length":1,"name":"user_answer1","original_word":"对","sub_slots":[],"session_offset":0,"begin":0,"normalized_word":"对","merge_method":"updated"},{"word_type":"","confidence":100,"length":2,"name":"user_answer1","original_word":"我是","sub_slots":[],"session_offset":0,"begin":1,"normalized_word":"我是","merge_method":"updated"}],"domain_confidence":0,"intent":"INTENTION_2"}
* qu_res : {"candidates":[{"intent_confidence":100,"match_info":"{\"group_id\":\"23\",\"id\":\"1958136\",\"informal_word\":\"我\\t是\",\"match_keywords\":\" \",\"match_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_slots\":{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{},\"from_who\":\"smart_qu\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"[D:user_answer1] \\t[D:user_answer1] \",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"我是\",\"word_type\":\"\"}]},\"real_threshold\":1.0,\"threshold\":0.4000000059604645}","slots":[{"word_type":"","father_idx":-1,"confidence":100,"length":1,"name":"user_answer1","original_word":"对","begin":0,"need_clarify":false,"normalized_word":"对"},{"word_type":"","father_idx":-1,"confidence":100,"length":2,"name":"user_answer1","original_word":"我是","begin":1,"need_clarify":false,"normalized_word":"我是"}],"extra_info":{"group_id":"23","real_threshold":"1","threshold":"0.4"},"confidence":100,"domain_confidence":0,"from_who":"pow-slu-lev1","intent":"INTENTION_2","intent_need_clarify":false}],"qu_res_chosen":"{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"23\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"23\\\",\\\"id\\\":\\\"1958136\\\",\\\"informal_word\\\":\\\"我\\\\t是\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"[D:user_answer1] \\\\t[D:user_answer1] \\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"对\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"word_type\":\"\"}]}\n","sentiment_analysis":{"pval":0.904,"label":"1"},"lexical_analysis":[{"etypes":["[D:user_answer1]"],"basic_word":["对"],"weight":0.129,"term":"对","type":"user_answer1"},{"etypes":["[D:user_answer1]"],"basic_word":["我","是"],"weight":0.87,"term":"我是","type":"user_answer1"}],"raw_query":"对我是","status":0,"timestamp":0}
* action_list : [{"action_id":"intention_2_satisfy","refine_detail":{"option_list":[],"interact":"","clarify_reason":""},"confidence":100,"custom_reply":"","say":"现在联通公司为回馈老用户推出优惠活动给您推荐99元/月的畅越冰激凌优惠套餐为您介绍一下这项活动好么?","type":"satisfy"}]
*/
private SchemaBean schema;
private QuResBean qu_res;
private List action_list;
@NoArgsConstructor
@Data
public static class SchemaBean {
/**
* intent_confidence : 100
* slots : [{"word_type":"","confidence":100,"length":1,"name":"user_answer1","original_word":"对","sub_slots":[],"session_offset":0,"begin":0,"normalized_word":"对","merge_method":"updated"},{"word_type":"","confidence":100,"length":2,"name":"user_answer1","original_word":"我是","sub_slots":[],"session_offset":0,"begin":1,"normalized_word":"我是","merge_method":"updated"}]
* domain_confidence : 0
* intent : INTENTION_2
*/
private int intent_confidence;
private int domain_confidence;
private String intent;
private List slots;
@NoArgsConstructor
@Data
public static class SlotsBean {
/**
* word_type :
* confidence : 100
* length : 1
* name : user_answer1
* original_word : 对
* sub_slots : []
* session_offset : 0
* begin : 0
* normalized_word : 对
* merge_method : updated
*/
private String word_type;
private int confidence;
private int length;
private String name;
private String original_word;
private int session_offset;
private int begin;
private String normalized_word;
private String merge_method;
private List> sub_slots;
}
}
@NoArgsConstructor
@Data
public static class QuResBean {
/**
* candidates : [{"intent_confidence":100,"match_info":"{\"group_id\":\"23\",\"id\":\"1958136\",\"informal_word\":\"我\\t是\",\"match_keywords\":\" \",\"match_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_slots\":{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{},\"from_who\":\"smart_qu\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"[D:user_answer1] \\t[D:user_answer1] \",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"我是\",\"word_type\":\"\"}]},\"real_threshold\":1.0,\"threshold\":0.4000000059604645}","slots":[{"word_type":"","father_idx":-1,"confidence":100,"length":1,"name":"user_answer1","original_word":"对","begin":0,"need_clarify":false,"normalized_word":"对"},{"word_type":"","father_idx":-1,"confidence":100,"length":2,"name":"user_answer1","original_word":"我是","begin":1,"need_clarify":false,"normalized_word":"我是"}],"extra_info":{"group_id":"23","real_threshold":"1","threshold":"0.4"},"confidence":100,"domain_confidence":0,"from_who":"pow-slu-lev1","intent":"INTENTION_2","intent_need_clarify":false}]
* qu_res_chosen : {"confidence":100.0,"domain_confidence":0.0,"extra_info":{"group_id":"23","real_threshold":"1","threshold":"0.4"},"from_who":"pow-slu-lev1","intent":"INTENTION_2","intent_confidence":100.0,"intent_need_clarify":false,"match_info":"{\"group_id\":\"23\",\"id\":\"1958136\",\"informal_word\":\"我\\t是\",\"match_keywords\":\" \",\"match_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_pattern\":\"[D:user_answer1]\\t[D:user_answer1]\",\"ori_slots\":{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{},\"from_who\":\"smart_qu\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"[D:user_answer1] \\t[D:user_answer1] \",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"\",\"original_word\":\"我是\",\"word_type\":\"\"}]},\"real_threshold\":1.0,\"threshold\":0.4000000059604645}","slots":[{"begin":0,"confidence":100.0,"father_idx":-1,"length":2,"name":"user_answer1","need_clarify":false,"normalized_word":"对","original_word":"对","word_type":""},{"begin":2,"confidence":100.0,"father_idx":-1,"length":4,"name":"user_answer1","need_clarify":false,"normalized_word":"我是","original_word":"我是","word_type":""}]}
* sentiment_analysis : {"pval":0.904,"label":"1"}
* lexical_analysis : [{"etypes":["[D:user_answer1]"],"basic_word":["对"],"weight":0.129,"term":"对","type":"user_answer1"},{"etypes":["[D:user_answer1]"],"basic_word":["我","是"],"weight":0.87,"term":"我是","type":"user_answer1"}]
* raw_query : 对我是
* status : 0
* timestamp : 0
*/
private String qu_res_chosen;
private SentimentAnalysisBean sentiment_analysis;
private String raw_query;
private int status;
private int timestamp;
private List candidates;
private List lexical_analysis;
@NoArgsConstructor
@Data
public static class SentimentAnalysisBean {
/**
* pval : 0.904
* label : 1
*/
private double pval;
private String label;
}
@NoArgsConstructor
@Data
public static class CandidatesBean {
/**
* intent_confidence : 100
* match_info : {"group_id":"23","id":"1958136","informal_word":"我\t是","match_keywords":" ","match_pattern":"[D:user_answer1]\t[D:user_answer1]","ori_pattern":"[D:user_answer1]\t[D:user_answer1]","ori_slots":{"confidence":100.0,"domain_confidence":0.0,"extra_info":{},"from_who":"smart_qu","intent":"INTENTION_2","intent_confidence":100.0,"intent_need_clarify":false,"match_info":"[D:user_answer1] \t[D:user_answer1] ","slots":[{"begin":0,"confidence":100.0,"father_idx":-1,"length":2,"name":"user_answer1","need_clarify":false,"normalized_word":"","original_word":"对","word_type":""},{"begin":2,"confidence":100.0,"father_idx":-1,"length":4,"name":"user_answer1","need_clarify":false,"normalized_word":"","original_word":"我是","word_type":""}]},"real_threshold":1.0,"threshold":0.4000000059604645}
* slots : [{"word_type":"","father_idx":-1,"confidence":100,"length":1,"name":"user_answer1","original_word":"对","begin":0,"need_clarify":false,"normalized_word":"对"},{"word_type":"","father_idx":-1,"confidence":100,"length":2,"name":"user_answer1","original_word":"我是","begin":1,"need_clarify":false,"normalized_word":"我是"}]
* extra_info : {"group_id":"23","real_threshold":"1","threshold":"0.4"}
* confidence : 100
* domain_confidence : 0
* from_who : pow-slu-lev1
* intent : INTENTION_2
* intent_need_clarify : false
*/
private int intent_confidence;
private String match_info;
private ExtraInfoBean extra_info;
private int confidence;
private int domain_confidence;
private String from_who;
private String intent;
private boolean intent_need_clarify;
private List slots;
@NoArgsConstructor
@Data
public static class ExtraInfoBean {
/**
* group_id : 23
* real_threshold : 1
* threshold : 0.4
*/
private String group_id;
private String real_threshold;
private String threshold;
}
@NoArgsConstructor
@Data
public static class SlotsBeanX {
/**
* word_type :
* father_idx : -1
* confidence : 100
* length : 1
* name : user_answer1
* original_word : 对
* begin : 0
* need_clarify : false
* normalized_word : 对
*/
private String word_type;
private int father_idx;
private int confidence;
private int length;
private String name;
private String original_word;
private int begin;
private boolean need_clarify;
private String normalized_word;
}
}
@NoArgsConstructor
@Data
public static class LexicalAnalysisBean {
/**
* etypes : ["[D:user_answer1]"]
* basic_word : ["对"]
* weight : 0.129
* term : 对
* type : user_answer1
*/
private double weight;
private String term;
private String type;
private List etypes;
private List basic_word;
}
}
@NoArgsConstructor
@Data
public static class ActionListBean {
/**
* action_id : intention_2_satisfy
* refine_detail : {"option_list":[],"interact":"","clarify_reason":""}
* confidence : 100
* custom_reply :
* say : 现在联通公司为回馈老用户推出优惠活动给您推荐99元/月的畅越冰激凌优惠套餐为您介绍一下这项活动好么?
* type : satisfy
*/
private String action_id;
private RefineDetailBean refine_detail;
private int confidence;
private String custom_reply;
private String say;
private String type;
@NoArgsConstructor
@Data
public static class RefineDetailBean {
/**
* option_list : []
* interact :
* clarify_reason :
*/
private String interact;
private String clarify_reason;
private List> option_list;
}
}
}
}
}
调用技能:
/*
* unit对话服务
*/
public class UnitService {
/**
* 重要提示代码中所需工具类
* FileUtil,Base64Util,HttpUtil,GsonUtils请从
* https://ai.baidu.com/file/658A35ABAB2D404FBF903F64D47C1F72
* https://ai.baidu.com/file/C8D81F3301E24D2892968F09AE1AD6E2
* https://ai.baidu.com/file/544D677F5D4E4F17B4122FBD60DB82B3
* https://ai.baidu.com/file/470B3ACCA3FE43788B5A963BF0B625F3
* 下载
*/
public static String utterance(String query, String botSession) {
// 请求URL
String talkUrl = "https://aip.baidubce.com/rpc/2.0/unit/bot/chat";
//请求的参数用map封装
Map<String , Object> map = new HashMap<>();
Map<String , Object> mapRequest = new HashMap<>();
Map<String , Object> mapQueryInfo = new HashMap<>();
Map<String , Object> mapClientSession = new HashMap<>();
List<String> asrCandidatesList = new ArrayList<>();
List<String> candidateOptionsList = new ArrayList<>();
ObjectMapper objectMapper = new ObjectMapper();
map.put("bot_session",botSession);
map.put("log_id",UUID.randomUUID().toString().replaceAll("-", ""));
map.put("request",mapRequest);
/*
* 技能唯一标识,在『我的技能』的技能列表中第一列数字即为bot_id
*/
map.put("bot_id",37819); // 技能id
map.put("version","2.0");
/**
* 系统自动发现不置信意图/词槽,
* 并据此主动发起澄清确认的敏感程度。
* 取值范围:0(关闭)、1(中敏感度)、2(高敏感度)。
* 取值越高BOT主动发起澄清的频率就越高,建议值为1
*/
mapRequest.put("bernard_level",1);
mapRequest.put("query",query);
mapRequest.put("query_info",mapQueryInfo);
mapRequest.put("updates","");
mapRequest.put("user_id","UNIT_WEB_37819");
mapQueryInfo.put("asr_candidates",asrCandidatesList);
// 请求信息来源,可选值:"ASR","KEYBOARD"。ASR为语音输入,KEYBOARD为键盘文本输入。针对ASR输入,UNIT平台内置了纠错机制,会尝试解决语音输入中的一些常见错误
mapQueryInfo.put("source","KEYBOARD");
mapQueryInfo.put("type","TEXT");
String clientSession = "";
mapClientSession.put("client_results","");
mapClientSession.put("candidate_options",candidateOptionsList);
try {
clientSession = objectMapper.writeValueAsString(mapClientSession).replace("\"", "\\\\\\\"");
} catch (JsonProcessingException e) {
e.printStackTrace();
}
mapRequest.put("client_session",clientSession);
// System.out.println(clientSession);
try {
// 请求参数
String params = objectMapper.writeValueAsString(map);
// System.out.println(params);
String accessToken = AuthService.getAuth();
String result = HttpUtil.post(talkUrl, accessToken, "application/json", params);
// System.out.println(" result: " + result);
return result;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static void main(String[] args) {
// 实现多伦对话需要将上一轮中的bot-session 作为参数传入
// String result = utterance("对我是");
// String result = utterance("对我是");
//
// while true: 如果返回结果中的 意向是: 结束意向 则将session 更改为空,否则继续下一段对话
// 获取到的bot_session
// String botSerssion = "{\"bot_id\":\"37819\",\"bot_views\":{\"bernard_res\":[{\"action_list\":[{\"action_id\":\"\",\"confidence\":0.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"\",\"interact\":\"\",\"option_list\":[]},\"say\":\"\",\"type\":\"understood\"}],\"msg\":\"ok\",\"pre_nlu_outs\":[{\"otags_basic\":[{\"blength\":2,\"boffset\":0,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"user_hello\",\"etypes\":[\"[D:user_hello]\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\"],\"length\":1,\"method\":\"[D:user_hello] == [D:user_hello]\",\"name\":\"喂\",\"offset\":0,\"rstatus\":2,\"type_confidence\":10.50},{\"blength\":4,\"boffset\":4,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"user_hello\",\"etypes\":[\"[D:user_hello]\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\"],\"length\":1,\"method\":\"[D:user_hello] == [D:user_hello]\",\"name\":\"您好\",\"offset\":2,\"rstatus\":2,\"type_confidence\":10.50}],\"otags_wpcomp\":[],\"polarity\":{\"label\":\"1\",\"pval\":0.9970},\"tokens_basic\":[{\"buffer\":\"喂\",\"length\":2,\"norm_degree\":0.9479930996894836,\"offset\":0,\"type\":34,\"weight\":0.4515353739261627},{\"buffer\":\",\",\"length\":2,\"norm_degree\":0.0,\"offset\":2,\"type\":37,\"weight\":0.01189841516315937},{\"buffer\":\"您好\",\"length\":4,\"norm_degree\":0.0,\"offset\":4,\"type\":19,\"weight\":0.5365661978721619}],\"tokens_wpcomp\":[{\"buffer\":\"喂\",\"length\":2,\"norm_degree\":0.0,\"offset\":0,\"type\":34,\"weight\":0.4515353739261627},{\"buffer\":\",\",\"length\":2,\"norm_degree\":0.0,\"offset\":1,\"type\":37,\"weight\":0.2317169010639191},{\"buffer\":\"您好\",\"length\":4,\"norm_degree\":0.0,\"offset\":2,\"type\":19,\"weight\":0.2801815271377563}]}],\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"25\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"25\\\",\\\"id\\\":\\\"1958113\\\",\\\"informal_word\\\":\\\",\\\\t您好\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"喂 \\\\t您好 \\\",\\\"slots\\\":[]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[]}],\"lexical_analysis\":[{\"basic_word\":[\"喂\"],\"etypes\":[\"[D:user_hello]\"],\"term\":\"喂\",\"type\":\"user_hello\",\"weight\":0.4510},{\"basic_word\":[\",\"],\"etypes\":[],\"term\":\",\",\"type\":\"37\",\"weight\":0.0110},{\"basic_word\":[\"您好\"],\"etypes\":[\"[D:user_hello]\"],\"term\":\"您好\",\"type\":\"user_hello\",\"weight\":0.5360}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"25\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"25\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"1958113\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\",\\\\\\\\t您好\\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"喂\\\\\\\\t您好\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"喂\\\\\\\\t您好\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"INTENTION_1\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"喂 \\\\\\\\t您好 \\\\\\\",\\\\\\\"slots\\\\\\\":[]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[]}\\n\",\"raw_query\":\"喂,您好\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9970},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"slots\":[]},\"status\":0},{\"action_list\":[{\"action_id\":\"\",\"confidence\":0.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"\",\"interact\":\"\",\"option_list\":[]},\"say\":\"\",\"type\":\"understood\"}],\"msg\":\"ok\",\"pre_nlu_outs\":[{\"otags_basic\":[{\"blength\":2,\"boffset\":0,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"user_answer1\",\"etypes\":[\"[D:user_answer1]\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\"],\"length\":1,\"method\":\"[D:user_answer1] == [D:user_answer1]\",\"name\":\"对\",\"offset\":0,\"rstatus\":2,\"type_confidence\":10.50},{\"blength\":4,\"boffset\":2,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"user_answer1\",\"etypes\":[\"[D:user_answer1]\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\"],\"length\":2,\"method\":\"[D:user_answer1] == [D:user_answer1]\",\"name\":\"我是\",\"offset\":1,\"rstatus\":2,\"type_confidence\":10.50}],\"otags_wpcomp\":[{\"blength\":2,\"boffset\":2,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"sys_coref_person\",\"etypes\":[\"[D:COREF_PERSON]\",\"sys_coref_person\",\"sys_coref_person\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\",\"\",\"\"],\"length\":1,\"method\":\"prime_nerl\",\"name\":\"我\",\"offset\":1,\"rstatus\":2,\"type_confidence\":5.0}],\"polarity\":{\"label\":\"1\",\"pval\":0.9040},\"tokens_basic\":[{\"buffer\":\"对\",\"length\":2,\"norm_degree\":0.9113681912422180,\"offset\":0,\"type\":28,\"weight\":0.1299898177385330},{\"buffer\":\"我\",\"length\":2,\"norm_degree\":0.0,\"offset\":2,\"type\":30,\"weight\":0.7122635245323181},{\"buffer\":\"是\",\"length\":2,\"norm_degree\":0.0,\"offset\":4,\"type\":34,\"weight\":0.1577466726303101}],\"tokens_wpcomp\":[{\"buffer\":\"对\",\"length\":2,\"norm_degree\":0.0,\"offset\":0,\"type\":28,\"weight\":0.1299898177385330},{\"buffer\":\"我\",\"length\":2,\"norm_degree\":0.0,\"offset\":1,\"type\":30,\"weight\":0.4211266636848450},{\"buffer\":\"是\",\"length\":2,\"norm_degree\":0.0,\"offset\":2,\"type\":34,\"weight\":0.7122635245323181}]}],\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"23\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"23\\\",\\\"id\\\":\\\"1958136\\\",\\\"informal_word\\\":\\\"我\\\\t是\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"[D:user_answer1] \\\\t[D:user_answer1] \\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"对\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"word_type\":\"\"}]}],\"lexical_analysis\":[{\"basic_word\":[\"对\"],\"etypes\":[\"[D:user_answer1]\"],\"term\":\"对\",\"type\":\"user_answer1\",\"weight\":0.1290},{\"basic_word\":[\"我\",\"是\"],\"etypes\":[\"[D:user_answer1]\"],\"term\":\"我是\",\"type\":\"user_answer1\",\"weight\":0.870}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"23\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"23\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"1958136\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\"我\\\\\\\\t是\\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"[D:user_answer1]\\\\\\\\t[D:user_answer1]\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"[D:user_answer1]\\\\\\\\t[D:user_answer1]\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"INTENTION_2\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"[D:user_answer1] \\\\\\\\t[D:user_answer1] \\\\\\\",\\\\\\\"slots\\\\\\\":[{\\\\\\\"begin\\\\\\\":0,\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"father_idx\\\\\\\":-1,\\\\\\\"length\\\\\\\":2,\\\\\\\"name\\\\\\\":\\\\\\\"user_answer1\\\\\\\",\\\\\\\"need_clarify\\\\\\\":false,\\\\\\\"normalized_word\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"original_word\\\\\\\":\\\\\\\"对\\\\\\\",\\\\\\\"word_type\\\\\\\":\\\\\\\"\\\\\\\"},{\\\\\\\"begin\\\\\\\":2,\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"father_idx\\\\\\\":-1,\\\\\\\"length\\\\\\\":4,\\\\\\\"name\\\\\\\":\\\\\\\"user_answer1\\\\\\\",\\\\\\\"need_clarify\\\\\\\":false,\\\\\\\"normalized_word\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"original_word\\\\\\\":\\\\\\\"我是\\\\\\\",\\\\\\\"word_type\\\\\\\":\\\\\\\"\\\\\\\"}]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"对\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"我是\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]}\\n\",\"raw_query\":\"对我是\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9040},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"slots\":[{\"begin\":2,\"confidence\":100.0,\"length\":4,\"merge_method\":\"updated\",\"name\":\"user_answer1\",\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"session_offset\":0,\"sub_slots\":[],\"word_type\":\"\"},{\"begin\":0,\"confidence\":100.0,\"length\":2,\"merge_method\":\"updated\",\"name\":\"user_answer1\",\"normalized_word\":\"对\",\"original_word\":\"对\",\"session_offset\":0,\"sub_slots\":[],\"word_type\":\"\"}]},\"status\":0}],\"bernard_status\":[{\"index\":0,\"step\":\"AFTER_DM_TRIGGER\"},{\"index\":1,\"step\":\"AFTER_DM_TRIGGER\"}],\"intervention\":{\"interv_qu_res\":\"\",\"interv_query\":\"\",\"qu_res_interved\":\"\",\"qu_res_original\":\"\",\"query_original\":\"\",\"type\":\"\",\"user_id\":\"\"},\"user_slots\":{\"user_answer1\":{\"state\":2,\"static_slot\":{\"default_state\":0,\"default_tag_name\":\"DEFAULT\",\"example_values\":[],\"extensible\":true,\"name\":\"user_answer1\",\"print\":[\"意图1用户肯定回答\"],\"type\":0,\"update_type\":\"single_turn\",\"weight\":1.0},\"tag_map\":{\"对\":{\"begin\":0,\"confidence\":100.0,\"length\":2,\"merge_method\":\"updated\",\"normalized_name\":\"对\",\"original_name\":\"对\",\"state\":2,\"turn\":0,\"word_type\":\"\"},\"我是\":{\"begin\":2,\"confidence\":100.0,\"length\":4,\"merge_method\":\"updated\",\"normalized_name\":\"我是\",\"original_name\":\"我是\",\"state\":2,\"turn\":0,\"word_type\":\"\"}}}}},\"dialog_state\":{\"contexts\":{},\"intents\":[{\"index\":0,\"name\":\"INTENTION_1\"},{\"index\":1,\"name\":\"INTENTION_2\"}],\"user_slots\":{\"user_answer1\":{\"attrs\":{\"default_state\":0,\"default_tag_name\":\"DEFAULT\",\"example_values\":[],\"extensible\":true,\"name\":\"user_answer1\",\"print\":[\"意图1用户肯定回答\"],\"type\":0,\"update_type\":\"single_turn\",\"weight\":1.0},\"state\":2,\"values\":{\"对\":{\"begin\":0,\"confidence\":100.0,\"length\":2,\"merge_method\":\"updated\",\"normalized_name\":\"对\",\"original_name\":\"对\",\"session_offest\":0,\"state\":2,\"word_type\":\"\"},\"我是\":{\"begin\":2,\"confidence\":100.0,\"length\":4,\"merge_method\":\"updated\",\"normalized_name\":\"我是\",\"original_name\":\"我是\",\"session_offest\":0,\"state\":2,\"word_type\":\"\"}}}}},\"interactions\":[{\"interaction_id\":\"interaction-1551324068880-707575714-8013-72\",\"request\":{\"bernard_level\":1,\"client_session\":\"{\\\\\\\\\\\\\\\"candidate_options\\\\\\\\\\\\\\\":[],\\\\\\\\\\\\\\\"client_results\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"}\",\"hyper_params\":{\"slu_tags\":[]},\"query\":\"喂,您好\",\"query_info\":{\"asr_candidates\":[],\"source\":\"KEYBOARD\",\"type\":\"TEXT\"},\"updates\":\"\",\"user_id\":\"UNIT_WEB_37819\"},\"response\":{\"action_list\":[{\"action_id\":\"intention_1_satisfy\",\"confidence\":100.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"\",\"interact\":\"\",\"option_list\":[]},\"say\":\"**先生/女士,您好!我是联通公司客户经理,工号:****,请问您是尾号XXXX机主吗?\",\"type\":\"satisfy\"}],\"msg\":\"ok\",\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"25\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"25\\\",\\\"id\\\":\\\"1958113\\\",\\\"informal_word\\\":\\\",\\\\t您好\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"喂 \\\\t您好 \\\",\\\"slots\\\":[]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[]}],\"lexical_analysis\":[{\"basic_word\":[\"喂\"],\"etypes\":[\"[D:user_hello]\"],\"term\":\"喂\",\"type\":\"user_hello\",\"weight\":0.4510},{\"basic_word\":[\",\"],\"etypes\":[],\"term\":\",\",\"type\":\"37\",\"weight\":0.0110},{\"basic_word\":[\"您好\"],\"etypes\":[\"[D:user_hello]\"],\"term\":\"您好\",\"type\":\"user_hello\",\"weight\":0.5360}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"25\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"25\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"1958113\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\",\\\\\\\\t您好\\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"喂\\\\\\\\t您好\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"喂\\\\\\\\t您好\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"INTENTION_1\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"喂 \\\\\\\\t您好 \\\\\\\",\\\\\\\"slots\\\\\\\":[]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[]}\\n\",\"raw_query\":\"喂,您好\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9970},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"slots\":[]},\"status\":0},\"timestamp\":\"2019-02-28 11:21:08.880\"},{\"interaction_id\":\"interaction-1551324152506-707575714-8013-73\",\"request\":{\"bernard_level\":1,\"client_session\":\"{\\\\\\\\\\\\\\\"candidate_options\\\\\\\\\\\\\\\":[],\\\\\\\\\\\\\\\"client_results\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"}\",\"hyper_params\":{\"slu_tags\":[]},\"query\":\"对我是\",\"query_info\":{\"asr_candidates\":[],\"source\":\"KEYBOARD\",\"type\":\"TEXT\"},\"updates\":\"\",\"user_id\":\"UNIT_WEB_37819\"},\"response\":{\"action_list\":[{\"action_id\":\"intention_2_satisfy\",\"confidence\":100.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"\",\"interact\":\"\",\"option_list\":[]},\"say\":\"现在联通公司为回馈老用户推出优惠活动给您推荐99元/月的畅越冰激凌优惠套餐为您介绍一下这项活动好么?\",\"type\":\"satisfy\"}],\"msg\":\"ok\",\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"23\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"23\\\",\\\"id\\\":\\\"1958136\\\",\\\"informal_word\\\":\\\"我\\\\t是\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"[D:user_answer1] \\\\t[D:user_answer1] \\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":1,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"对\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":1,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"word_type\":\"\"}]}],\"lexical_analysis\":[{\"basic_word\":[\"对\"],\"etypes\":[\"[D:user_answer1]\"],\"term\":\"对\",\"type\":\"user_answer1\",\"weight\":0.1290},{\"basic_word\":[\"我\",\"是\"],\"etypes\":[\"[D:user_answer1]\"],\"term\":\"我是\",\"type\":\"user_answer1\",\"weight\":0.870}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"23\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"23\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"1958136\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\"我\\\\\\\\t是\\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"[D:user_answer1]\\\\\\\\t[D:user_answer1]\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"[D:user_answer1]\\\\\\\\t[D:user_answer1]\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"INTENTION_2\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"[D:user_answer1] \\\\\\\\t[D:user_answer1] \\\\\\\",\\\\\\\"slots\\\\\\\":[{\\\\\\\"begin\\\\\\\":0,\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"father_idx\\\\\\\":-1,\\\\\\\"length\\\\\\\":2,\\\\\\\"name\\\\\\\":\\\\\\\"user_answer1\\\\\\\",\\\\\\\"need_clarify\\\\\\\":false,\\\\\\\"normalized_word\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"original_word\\\\\\\":\\\\\\\"对\\\\\\\",\\\\\\\"word_type\\\\\\\":\\\\\\\"\\\\\\\"},{\\\\\\\"begin\\\\\\\":2,\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"father_idx\\\\\\\":-1,\\\\\\\"length\\\\\\\":4,\\\\\\\"name\\\\\\\":\\\\\\\"user_answer1\\\\\\\",\\\\\\\"need_clarify\\\\\\\":false,\\\\\\\"normalized_word\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"original_word\\\\\\\":\\\\\\\"我是\\\\\\\",\\\\\\\"word_type\\\\\\\":\\\\\\\"\\\\\\\"}]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"对\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"我是\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]}\\n\",\"raw_query\":\"对我是\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9040},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"slots\":[{\"begin\":0,\"confidence\":100.0,\"length\":1,\"merge_method\":\"updated\",\"name\":\"user_answer1\",\"normalized_word\":\"对\",\"original_word\":\"对\",\"session_offset\":0,\"sub_slots\":[],\"word_type\":\"\"},{\"begin\":1,\"confidence\":100.0,\"length\":2,\"merge_method\":\"updated\",\"name\":\"user_answer1\",\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"session_offset\":0,\"sub_slots\":[],\"word_type\":\"\"}]},\"status\":0},\"timestamp\":\"2019-02-28 11:22:32.506\"}],\"session_id\":\"session-1551324068657-707575714-8013-22\"}";
String botSession = "";
String result = utterance("喂你好", botSession);
// Result 返回结果json格式解析成java类.
Result resultbean = JSONObject.parseObject(result, Result.class);
// 当前处于那个意图
String intention = resultbean.getResult().getResponse().getSchema().getIntent();
// 答复文本内容
String say = resultbean.getResult().getResponse().getAction_list().get(0).getSay();
botSession = resultbean.getResult().getBot_session();
String errorMsg = resultbean.getError_msg();
int errorCode = resultbean.getError_code();
while ("ok".equals(errorMsg) && errorCode==0) {
// 如果意图部署结束语或者正常的结束就继续调用否则跳出或者挂断
// 如果调用成功则进行下一步操作
System.out.println(say);
/**
* 结束意图分别是:INTENTION_11
*/
if ("INTENTION_11".equals(intention)) {
System.out.println(" 本次对话结束, 如果进行再次话请继续!");
botSession = "";
}
Scanner scanner = new Scanner(System.in);
String userAnswer = scanner.nextLine();
result = utterance(userAnswer, botSession);
resultbean = JSONObject.parseObject(result, Result.class);
// 当前处于那个意图
intention = resultbean.getResult().getResponse().getSchema().getIntent();
// 答复文本内容
say = resultbean.getResult().getResponse().getAction_list().get(0).getSay();
botSession = resultbean.getResult().getBot_session();
errorMsg = resultbean.getError_msg();
errorCode = resultbean.getError_code();
}
"{\"bot_id\":\"37819\",\"bot_views\":{\"bernard_res\":[{\"action_list\":[{\"action_id\":\"\",\"confidence\":0.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"\",\"interact\":\"\",\"option_list\":[]},\"say\":\"\",\"type\":\"understood\"}],\"msg\":\"ok\",\"pre_nlu_outs\":[{\"otags_basic\":[{\"blength\":2,\"boffset\":0,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"user_hello\",\"etypes\":[\"[D:user_hello]\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\"],\"length\":1,\"method\":\"[D:user_hello] == [D:user_hello]\",\"name\":\"喂\",\"offset\":0,\"rstatus\":2,\"type_confidence\":10.50},{\"blength\":4,\"boffset\":4,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"user_hello\",\"etypes\":[\"[D:user_hello]\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\"],\"length\":1,\"method\":\"[D:user_hello] == [D:user_hello]\",\"name\":\"您好\",\"offset\":2,\"rstatus\":2,\"type_confidence\":10.50}],\"otags_wpcomp\":[],\"polarity\":{\"label\":\"1\",\"pval\":0.9970},\"tokens_basic\":[{\"buffer\":\"喂\",\"length\":2,\"norm_degree\":0.9479930996894836,\"offset\":0,\"type\":34,\"weight\":0.4515353739261627},{\"buffer\":\",\",\"length\":2,\"norm_degree\":0.0,\"offset\":2,\"type\":37,\"weight\":0.01189841516315937},{\"buffer\":\"您好\",\"length\":4,\"norm_degree\":0.0,\"offset\":4,\"type\":19,\"weight\":0.5365661978721619}],\"tokens_wpcomp\":[{\"buffer\":\"喂\",\"length\":2,\"norm_degree\":0.0,\"offset\":0,\"type\":34,\"weight\":0.4515353739261627},{\"buffer\":\",\",\"length\":2,\"norm_degree\":0.0,\"offset\":1,\"type\":37,\"weight\":0.2317169010639191},{\"buffer\":\"您好\",\"length\":4,\"norm_degree\":0.0,\"offset\":2,\"type\":19,\"weight\":0.2801815271377563}]}],\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"25\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"25\\\",\\\"id\\\":\\\"1958113\\\",\\\"informal_word\\\":\\\",\\\\t您好\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"喂 \\\\t您好 \\\",\\\"slots\\\":[]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[]}],\"lexical_analysis\":[{\"basic_word\":[\"喂\"],\"etypes\":[\"[D:user_hello]\"],\"term\":\"喂\",\"type\":\"user_hello\",\"weight\":0.4510},{\"basic_word\":[\",\"],\"etypes\":[],\"term\":\",\",\"type\":\"37\",\"weight\":0.0110},{\"basic_word\":[\"您好\"],\"etypes\":[\"[D:user_hello]\"],\"term\":\"您好\",\"type\":\"user_hello\",\"weight\":0.5360}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"25\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"25\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"1958113\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\",\\\\\\\\t您好\\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"喂\\\\\\\\t您好\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"喂\\\\\\\\t您好\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"INTENTION_1\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"喂 \\\\\\\\t您好 \\\\\\\",\\\\\\\"slots\\\\\\\":[]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[]}\\n\",\"raw_query\":\"喂,您好\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9970},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"slots\":[]},\"status\":0},{\"action_list\":[{\"action_id\":\"\",\"confidence\":0.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"\",\"interact\":\"\",\"option_list\":[]},\"say\":\"\",\"type\":\"understood\"}],\"msg\":\"ok\",\"pre_nlu_outs\":[{\"otags_basic\":[{\"blength\":2,\"boffset\":0,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"user_answer1\",\"etypes\":[\"[D:user_answer1]\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\"],\"length\":1,\"method\":\"[D:user_answer1] == [D:user_answer1]\",\"name\":\"对\",\"offset\":0,\"rstatus\":2,\"type_confidence\":10.50},{\"blength\":4,\"boffset\":2,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"user_answer1\",\"etypes\":[\"[D:user_answer1]\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\"],\"length\":2,\"method\":\"[D:user_answer1] == [D:user_answer1]\",\"name\":\"我是\",\"offset\":1,\"rstatus\":2,\"type_confidence\":10.50}],\"otags_wpcomp\":[{\"blength\":2,\"boffset\":2,\"eid\":\"\",\"entity_confidence\":0.0,\"etype\":\"sys_coref_person\",\"etypes\":[\"[D:COREF_PERSON]\",\"sys_coref_person\",\"sys_coref_person\"],\"father_fully_covered\":false,\"father_index\":-1,\"features\":[],\"formal\":\"\",\"formals\":[\"\",\"\",\"\"],\"length\":1,\"method\":\"prime_nerl\",\"name\":\"我\",\"offset\":1,\"rstatus\":2,\"type_confidence\":5.0}],\"polarity\":{\"label\":\"1\",\"pval\":0.9040},\"tokens_basic\":[{\"buffer\":\"对\",\"length\":2,\"norm_degree\":0.9113681912422180,\"offset\":0,\"type\":28,\"weight\":0.1299898177385330},{\"buffer\":\"我\",\"length\":2,\"norm_degree\":0.0,\"offset\":2,\"type\":30,\"weight\":0.7122635245323181},{\"buffer\":\"是\",\"length\":2,\"norm_degree\":0.0,\"offset\":4,\"type\":34,\"weight\":0.1577466726303101}],\"tokens_wpcomp\":[{\"buffer\":\"对\",\"length\":2,\"norm_degree\":0.0,\"offset\":0,\"type\":28,\"weight\":0.1299898177385330},{\"buffer\":\"我\",\"length\":2,\"norm_degree\":0.0,\"offset\":1,\"type\":30,\"weight\":0.4211266636848450},{\"buffer\":\"是\",\"length\":2,\"norm_degree\":0.0,\"offset\":2,\"type\":34,\"weight\":0.7122635245323181}]}],\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"23\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"23\\\",\\\"id\\\":\\\"1958136\\\",\\\"informal_word\\\":\\\"我\\\\t是\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"[D:user_answer1] \\\\t[D:user_answer1] \\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"对\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":2,\"confidence\":100.0,\"father_idx\":-1,\"length\":4,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"word_type\":\"\"}]}],\"lexical_analysis\":[{\"basic_word\":[\"对\"],\"etypes\":[\"[D:user_answer1]\"],\"term\":\"对\",\"type\":\"user_answer1\",\"weight\":0.1290},{\"basic_word\":[\"我\",\"是\"],\"etypes\":[\"[D:user_answer1]\"],\"term\":\"我是\",\"type\":\"user_answer1\",\"weight\":0.870}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"23\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"23\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"1958136\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\"我\\\\\\\\t是\\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"[D:user_answer1]\\\\\\\\t[D:user_answer1]\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"[D:user_answer1]\\\\\\\\t[D:user_answer1]\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"INTENTION_2\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"[D:user_answer1] \\\\\\\\t[D:user_answer1] \\\\\\\",\\\\\\\"slots\\\\\\\":[{\\\\\\\"begin\\\\\\\":0,\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"father_idx\\\\\\\":-1,\\\\\\\"length\\\\\\\":2,\\\\\\\"name\\\\\\\":\\\\\\\"user_answer1\\\\\\\",\\\\\\\"need_clarify\\\\\\\":false,\\\\\\\"normalized_word\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"original_word\\\\\\\":\\\\\\\"对\\\\\\\",\\\\\\\"word_type\\\\\\\":\\\\\\\"\\\\\\\"},{\\\\\\\"begin\\\\\\\":2,\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"father_idx\\\\\\\":-1,\\\\\\\"length\\\\\\\":4,\\\\\\\"name\\\\\\\":\\\\\\\"user_answer1\\\\\\\",\\\\\\\"need_clarify\\\\\\\":false,\\\\\\\"normalized_word\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"original_word\\\\\\\":\\\\\\\"我是\\\\\\\",\\\\\\\"word_type\\\\\\\":\\\\\\\"\\\\\\\"}]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"对\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"我是\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]}\\n\",\"raw_query\":\"对我是\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9040},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"slots\":[{\"begin\":2,\"confidence\":100.0,\"length\":4,\"merge_method\":\"updated\",\"name\":\"user_answer1\",\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"session_offset\":0,\"sub_slots\":[],\"word_type\":\"\"},{\"begin\":0,\"confidence\":100.0,\"length\":2,\"merge_method\":\"updated\",\"name\":\"user_answer1\",\"normalized_word\":\"对\",\"original_word\":\"对\",\"session_offset\":0,\"sub_slots\":[],\"word_type\":\"\"}]},\"status\":0}],\"bernard_status\":[{\"index\":0,\"step\":\"AFTER_DM_TRIGGER\"},{\"index\":1,\"step\":\"AFTER_DM_TRIGGER\"}],\"intervention\":{\"interv_qu_res\":\"\",\"interv_query\":\"\",\"qu_res_interved\":\"\",\"qu_res_original\":\"\",\"query_original\":\"\",\"type\":\"\",\"user_id\":\"\"},\"user_slots\":{\"user_answer1\":{\"state\":2,\"static_slot\":{\"default_state\":0,\"default_tag_name\":\"DEFAULT\",\"example_values\":[],\"extensible\":true,\"name\":\"user_answer1\",\"print\":[\"意图1用户肯定回答\"],\"type\":0,\"update_type\":\"single_turn\",\"weight\":1.0},\"tag_map\":{\"对\":{\"begin\":0,\"confidence\":100.0,\"length\":2,\"merge_method\":\"updated\",\"normalized_name\":\"对\",\"original_name\":\"对\",\"state\":2,\"turn\":0,\"word_type\":\"\"},\"我是\":{\"begin\":2,\"confidence\":100.0,\"length\":4,\"merge_method\":\"updated\",\"normalized_name\":\"我是\",\"original_name\":\"我是\",\"state\":2,\"turn\":0,\"word_type\":\"\"}}}}},\"dialog_state\":{\"contexts\":{},\"intents\":[{\"index\":0,\"name\":\"INTENTION_1\"},{\"index\":1,\"name\":\"INTENTION_2\"}],\"user_slots\":{\"user_answer1\":{\"attrs\":{\"default_state\":0,\"default_tag_name\":\"DEFAULT\",\"example_values\":[],\"extensible\":true,\"name\":\"user_answer1\",\"print\":[\"意图1用户肯定回答\"],\"type\":0,\"update_type\":\"single_turn\",\"weight\":1.0},\"state\":2,\"values\":{\"对\":{\"begin\":0,\"confidence\":100.0,\"length\":2,\"merge_method\":\"updated\",\"normalized_name\":\"对\",\"original_name\":\"对\",\"session_offest\":0,\"state\":2,\"word_type\":\"\"},\"我是\":{\"begin\":2,\"confidence\":100.0,\"length\":4,\"merge_method\":\"updated\",\"normalized_name\":\"我是\",\"original_name\":\"我是\",\"session_offest\":0,\"state\":2,\"word_type\":\"\"}}}}},\"interactions\":[{\"interaction_id\":\"interaction-1551324068880-707575714-8013-72\",\"request\":{\"bernard_level\":1,\"client_session\":\"{\\\\\\\\\\\\\\\"candidate_options\\\\\\\\\\\\\\\":[],\\\\\\\\\\\\\\\"client_results\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"}\",\"hyper_params\":{\"slu_tags\":[]},\"query\":\"喂,您好\",\"query_info\":{\"asr_candidates\":[],\"source\":\"KEYBOARD\",\"type\":\"TEXT\"},\"updates\":\"\",\"user_id\":\"UNIT_WEB_37819\"},\"response\":{\"action_list\":[{\"action_id\":\"intention_1_satisfy\",\"confidence\":100.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"\",\"interact\":\"\",\"option_list\":[]},\"say\":\"**先生/女士,您好!我是联通公司客户经理,工号:****,请问您是尾号XXXX机主吗?\",\"type\":\"satisfy\"}],\"msg\":\"ok\",\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"25\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"25\\\",\\\"id\\\":\\\"1958113\\\",\\\"informal_word\\\":\\\",\\\\t您好\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_pattern\\\":\\\"喂\\\\t您好\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"喂 \\\\t您好 \\\",\\\"slots\\\":[]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[]}],\"lexical_analysis\":[{\"basic_word\":[\"喂\"],\"etypes\":[\"[D:user_hello]\"],\"term\":\"喂\",\"type\":\"user_hello\",\"weight\":0.4510},{\"basic_word\":[\",\"],\"etypes\":[],\"term\":\",\",\"type\":\"37\",\"weight\":0.0110},{\"basic_word\":[\"您好\"],\"etypes\":[\"[D:user_hello]\"],\"term\":\"您好\",\"type\":\"user_hello\",\"weight\":0.5360}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"25\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"INTENTION_1\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"25\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"1958113\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\",\\\\\\\\t您好\\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"喂\\\\\\\\t您好\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"喂\\\\\\\\t您好\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"INTENTION_1\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"喂 \\\\\\\\t您好 \\\\\\\",\\\\\\\"slots\\\\\\\":[]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[]}\\n\",\"raw_query\":\"喂,您好\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9970},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"INTENTION_1\",\"intent_confidence\":100.0,\"slots\":[]},\"status\":0},\"timestamp\":\"2019-02-28 11:21:08.880\"},{\"interaction_id\":\"interaction-1551324152506-707575714-8013-73\",\"request\":{\"bernard_level\":1,\"client_session\":\"{\\\\\\\\\\\\\\\"candidate_options\\\\\\\\\\\\\\\":[],\\\\\\\\\\\\\\\"client_results\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"}\",\"hyper_params\":{\"slu_tags\":[]},\"query\":\"对我是\",\"query_info\":{\"asr_candidates\":[],\"source\":\"KEYBOARD\",\"type\":\"TEXT\"},\"updates\":\"\",\"user_id\":\"UNIT_WEB_37819\"},\"response\":{\"action_list\":[{\"action_id\":\"intention_2_satisfy\",\"confidence\":100.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"\",\"interact\":\"\",\"option_list\":[]},\"say\":\"现在联通公司为回馈老用户推出优惠活动给您推荐99元/月的畅越冰激凌优惠套餐为您介绍一下这项活动好么?\",\"type\":\"satisfy\"}],\"msg\":\"ok\",\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"23\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"23\\\",\\\"id\\\":\\\"1958136\\\",\\\"informal_word\\\":\\\"我\\\\t是\\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_pattern\\\":\\\"[D:user_answer1]\\\\t[D:user_answer1]\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"[D:user_answer1] \\\\t[D:user_answer1] \\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[{\"begin\":0,\"confidence\":100.0,\"father_idx\":-1,\"length\":1,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"对\",\"original_word\":\"对\",\"word_type\":\"\"},{\"begin\":1,\"confidence\":100.0,\"father_idx\":-1,\"length\":2,\"name\":\"user_answer1\",\"need_clarify\":false,\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"word_type\":\"\"}]}],\"lexical_analysis\":[{\"basic_word\":[\"对\"],\"etypes\":[\"[D:user_answer1]\"],\"term\":\"对\",\"type\":\"user_answer1\",\"weight\":0.1290},{\"basic_word\":[\"我\",\"是\"],\"etypes\":[\"[D:user_answer1]\"],\"term\":\"我是\",\"type\":\"user_answer1\",\"weight\":0.870}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"23\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"INTENTION_2\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"23\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"1958136\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\"我\\\\\\\\t是\\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"[D:user_answer1]\\\\\\\\t[D:user_answer1]\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"[D:user_answer1]\\\\\\\\t[D:user_answer1]\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"INTENTION_2\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"[D:user_answer1] \\\\\\\\t[D:user_answer1] \\\\\\\",\\\\\\\"slots\\\\\\\":[{\\\\\\\"begin\\\\\\\":0,\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"father_idx\\\\\\\":-1,\\\\\\\"length\\\\\\\":2,\\\\\\\"name\\\\\\\":\\\\\\\"user_answer1\\\\\\\",\\\\\\\"need_clarify\\\\\\\":false,\\\\\\\"normalized_word\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"original_word\\\\\\\":\\\\\\\"对\\\\\\\",\\\\\\\"word_type\\\\\\\":\\\\\\\"\\\\\\\"},{\\\\\\\"begin\\\\\\\":2,\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"father_idx\\\\\\\":-1,\\\\\\\"length\\\\\\\":4,\\\\\\\"name\\\\\\\":\\\\\\\"user_answer1\\\\\\\",\\\\\\\"need_clarify\\\\\\\":false,\\\\\\\"normalized_word\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"original_word\\\\\\\":\\\\\\\"我是\\\\\\\",\\\\\\\"word_type\\\\\\\":\\\\\\\"\\\\\\\"}]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[{\\\"begin\\\":0,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":2,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"对\\\",\\\"original_word\\\":\\\"对\\\",\\\"word_type\\\":\\\"\\\"},{\\\"begin\\\":2,\\\"confidence\\\":100.0,\\\"father_idx\\\":-1,\\\"length\\\":4,\\\"name\\\":\\\"user_answer1\\\",\\\"need_clarify\\\":false,\\\"normalized_word\\\":\\\"我是\\\",\\\"original_word\\\":\\\"我是\\\",\\\"word_type\\\":\\\"\\\"}]}\\n\",\"raw_query\":\"对我是\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9040},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"INTENTION_2\",\"intent_confidence\":100.0,\"slots\":[{\"begin\":0,\"confidence\":100.0,\"length\":1,\"merge_method\":\"updated\",\"name\":\"user_answer1\",\"normalized_word\":\"对\",\"original_word\":\"对\",\"session_offset\":0,\"sub_slots\":[],\"word_type\":\"\"},{\"begin\":1,\"confidence\":100.0,\"length\":2,\"merge_method\":\"updated\",\"name\":\"user_answer1\",\"normalized_word\":\"我是\",\"original_word\":\"我是\",\"session_offset\":0,\"sub_slots\":[],\"word_type\":\"\"}]},\"status\":0},\"timestamp\":\"2019-02-28 11:22:32.506\"}],\"session_id\":\"session-1551324068657-707575714-8013-22\"}";
代码地址
[1]: https://github.com/langjianwei/futureBaby-springboot/tree/86d28f5d59fc5f0d79662ffeec4c8610fbc53f2c
参考文档
[1]: 百度官方文档-技能对话API文档
[2]: 技能对话接口,API多轮对话的实现