多轮对话报错
非正式行 发布于2019-04 浏览:2191 回复:3
0
收藏
快速回复

{
"result": {
"version": "2.0",
"timestamp": "2019-04-25 17:15:50.228",
"response": {
"msg": "ok",
"schema": {
"intent_confidence": 100.0,
"slots": [],
"domain_confidence": 0.0,
"intent": "WEATHER"
},
"qu_res": {
"candidates": [{
"intent_confidence": 100.0,
"match_info": "{\"group_id\":\"1\",\"id\":\"70356\",\"informal_word\":\" \",\"match_keywords\":\" \",\"match_pattern\":\"天气\",\"ori_pattern\":\"天气\",\"ori_slots\":{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{},\"from_who\":\"smart_qu\",\"intent\":\"WEATHER\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"天气 \",\"slots\":[]},\"real_threshold\":1.0,\"threshold\":0.4000000059604645}",
"slots": [],
"extra_info": {
"group_id": "1",
"real_threshold": "1",
"threshold": "0.4"
},
"confidence": 100.0,
"domain_confidence": 0.0,
"from_who": "pow-slu-lev1",
"intent": "WEATHER",
"intent_need_clarify": false
}],
"qu_res_chosen": "{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"1\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"WEATHER\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"1\\\",\\\"id\\\":\\\"70356\\\",\\\"informal_word\\\":\\\" \\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"天气\\\",\\\"ori_pattern\\\":\\\"天气\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"WEATHER\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"天气 \\\",\\\"slots\\\":[]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[]}\n",
"sentiment_analysis": {
"pval": 0.9990,
"label": "1"
},
"lexical_analysis": [{
"etypes": [],
"basic_word": [" "],
"weight": 0.0,
"term": " ",
"type": "37"
}, {
"etypes": [],
"basic_word": ["天气"],
"weight": 1.0,
"term": "天气",
"type": "21"
}],
"raw_query": " 天气",
"status": 0,
"timestamp": 0
},
"action_list": [{
"action_id": "weather_user_time_clarify",
"refine_detail": {
"option_list": [{
"info": {
"name": "user_time",
"text": "时间"
},
"option": "user_time"
}],
"interact": "ask",
"clarify_reason": "slot_absent"
},
"confidence": 100.0,
"custom_reply": "",
"say": "请澄清一下:时间",
"type": "clarify"
}],
"status": 0
},
"bot_id": "49783",
"log_id": "77585226",
"bot_session": "{\"bot_id\":\"49783\",\"bot_views\":{\"bernard_res\":[{\"action_list\":[{\"action_id\":\"weather_user_time_clarify\",\"confidence\":100.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"slot_absent\",\"interact\":\"ask\",\"option_list\":[{\"info\":{\"name\":\"user_time\",\"text\":\"时间\"},\"option\":\"user_time\"}]},\"say\":\"请澄清一下:时间\",\"type\":\"clarify\"}],\"msg\":\"ok\",\"pre_nlu_outs\":[{\"otags_basic\":[],\"otags_wpcomp\":[],\"polarity\":{\"label\":\"1\",\"pval\":0.9990},\"tokens_basic\":[{\"buffer\":\" \",\"length\":1,\"norm_degree\":0.9486039876937866,\"offset\":0,\"type\":37,\"weight\":0.0},{\"buffer\":\"天气\",\"length\":4,\"norm_degree\":0.9011023044586182,\"offset\":1,\"type\":21,\"weight\":1.0}],\"tokens_wpcomp\":[{\"buffer\":\" \",\"length\":1,\"norm_degree\":0.0,\"offset\":0,\"type\":37,\"weight\":0.0},{\"buffer\":\"天气\",\"length\":4,\"norm_degree\":0.0,\"offset\":1,\"type\":21,\"weight\":1.0}]}],\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"1\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"WEATHER\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"1\\\",\\\"id\\\":\\\"70356\\\",\\\"informal_word\\\":\\\" \\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"天气\\\",\\\"ori_pattern\\\":\\\"天气\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"WEATHER\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"天气 \\\",\\\"slots\\\":[]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[]}],\"lexical_analysis\":[{\"basic_word\":[\" \"],\"etypes\":[],\"term\":\" \",\"type\":\"37\",\"weight\":0.0},{\"basic_word\":[\"天气\"],\"etypes\":[],\"term\":\"天气\",\"type\":\"21\",\"weight\":1.0}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"1\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"WEATHER\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"70356\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"天气\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"天气\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"WEATHER\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"天气 \\\\\\\",\\\\\\\"slots\\\\\\\":[]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[]}\\n\",\"raw_query\":\" 天气\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9990},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"WEATHER\",\"intent_confidence\":100.0,\"slots\":[]},\"status\":0}],\"bernard_status\":[{\"index\":0,\"step\":\"AFTER_DM_TRIGGER\"}],\"intervention\":{\"interv_qu_res\":\"\",\"interv_query\":\"\",\"qu_res_interved\":\"\",\"qu_res_original\":\"\",\"query_original\":\"\",\"type\":\"\",\"user_id\":\"\"},\"user_slots\":{}},\"dialog_state\":{\"contexts\":{},\"intents\":[{\"index\":0,\"name\":\"WEATHER\"}],\"user_slots\":{}},\"interactions\":[{\"interaction_id\":\"interaction-1556183750228-503311927-8013-6\",\"request\":{\"bernard_level\":1,\"client_session\":\"{\\\"client_results\\\":\\\"\\\", \\\"candidate_options\\\":[]}\",\"hyper_params\":{\"slu_tags\":[]},\"query\":\" 天气\",\"query_info\":{\"asr_candidates\":[],\"source\":\"KEYBOARD\",\"type\":\"TEXT\"},\"updates\":\"\",\"user_id\":\"88888\"},\"response\":{\"action_list\":[{\"action_id\":\"weather_user_time_clarify\",\"confidence\":100.0,\"custom_reply\":\"\",\"refine_detail\":{\"clarify_reason\":\"slot_absent\",\"interact\":\"ask\",\"option_list\":[{\"info\":{\"name\":\"user_time\",\"text\":\"时间\"},\"option\":\"user_time\"}]},\"say\":\"请澄清一下:时间\",\"type\":\"clarify\"}],\"msg\":\"ok\",\"qu_res\":{\"candidates\":[{\"confidence\":100.0,\"domain_confidence\":0.0,\"extra_info\":{\"group_id\":\"1\",\"real_threshold\":\"1\",\"threshold\":\"0.4\"},\"from_who\":\"pow-slu-lev1\",\"intent\":\"WEATHER\",\"intent_confidence\":100.0,\"intent_need_clarify\":false,\"match_info\":\"{\\\"group_id\\\":\\\"1\\\",\\\"id\\\":\\\"70356\\\",\\\"informal_word\\\":\\\" \\\",\\\"match_keywords\\\":\\\" \\\",\\\"match_pattern\\\":\\\"天气\\\",\\\"ori_pattern\\\":\\\"天气\\\",\\\"ori_slots\\\":{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{},\\\"from_who\\\":\\\"smart_qu\\\",\\\"intent\\\":\\\"WEATHER\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"天气 \\\",\\\"slots\\\":[]},\\\"real_threshold\\\":1.0,\\\"threshold\\\":0.4000000059604645}\",\"slots\":[]}],\"lexical_analysis\":[{\"basic_word\":[\" \"],\"etypes\":[],\"term\":\" \",\"type\":\"37\",\"weight\":0.0},{\"basic_word\":[\"天气\"],\"etypes\":[],\"term\":\"天气\",\"type\":\"21\",\"weight\":1.0}],\"qu_res_chosen\":\"{\\\"confidence\\\":100.0,\\\"domain_confidence\\\":0.0,\\\"extra_info\\\":{\\\"group_id\\\":\\\"1\\\",\\\"real_threshold\\\":\\\"1\\\",\\\"threshold\\\":\\\"0.4\\\"},\\\"from_who\\\":\\\"pow-slu-lev1\\\",\\\"intent\\\":\\\"WEATHER\\\",\\\"intent_confidence\\\":100.0,\\\"intent_need_clarify\\\":false,\\\"match_info\\\":\\\"{\\\\\\\"group_id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"70356\\\\\\\",\\\\\\\"informal_word\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_keywords\\\\\\\":\\\\\\\" \\\\\\\",\\\\\\\"match_pattern\\\\\\\":\\\\\\\"天气\\\\\\\",\\\\\\\"ori_pattern\\\\\\\":\\\\\\\"天气\\\\\\\",\\\\\\\"ori_slots\\\\\\\":{\\\\\\\"confidence\\\\\\\":100.0,\\\\\\\"domain_confidence\\\\\\\":0.0,\\\\\\\"extra_info\\\\\\\":{},\\\\\\\"from_who\\\\\\\":\\\\\\\"smart_qu\\\\\\\",\\\\\\\"intent\\\\\\\":\\\\\\\"WEATHER\\\\\\\",\\\\\\\"intent_confidence\\\\\\\":100.0,\\\\\\\"intent_need_clarify\\\\\\\":false,\\\\\\\"match_info\\\\\\\":\\\\\\\"天气 \\\\\\\",\\\\\\\"slots\\\\\\\":[]},\\\\\\\"real_threshold\\\\\\\":1.0,\\\\\\\"threshold\\\\\\\":0.4000000059604645}\\\",\\\"slots\\\":[]}\\n\",\"raw_query\":\" 天气\",\"sentiment_analysis\":{\"label\":\"1\",\"pval\":0.9990},\"status\":0,\"timestamp\":0},\"schema\":{\"domain_confidence\":0.0,\"intent\":\"WEATHER\",\"intent_confidence\":100.0,\"slots\":[]},\"status\":0},\"timestamp\":\"2019-04-25 17:15:50.228\"}],\"session_id\":\"session-1556183750122-503311927-8013-2\"}\n",
"interaction_id": "interaction-1556183750228-503311927-8013-6"
},
"error_code": 0,
"error_msg": ""
}第一次请求结束返回的数据。拿到session_id。进行多轮对话

第二次再去请求{"bot_session":"session_id":"session-1556183750122-503311927-8013-2","log_id":"77585226","request":{"bernard_level":1,"client_session":"{\"client_results\":\"\", \"candidate_options\":[]}","query":" 北京天气怎么样","query_info":{"asr_candidates":[],"source":"KEYBOARD","type":"TEXT"},"updates":"","user_id":"88888"},"bot_id":"49783","version":"2.0"}

就会包The request content type is illegal。

收藏
点赞
0
个赞
共3条回复 最后由非正式行回复于2019-04
#4非正式行回复于2019-04

正确格式应该是这样

0
#3非正式行回复于2019-04
#2 I959I回复
在你第二次请求内容的"client_session":"{\"client_results\":\"\", \"candidate_options\":[]}" 改为client_session":"{\"client_results\":\"\", \"candidate_options\":[]},请注意json格式内容不要在最外层{}加上“”号,这样它会无法识别为json
展开

好的谢谢

0
#2I959I回复于2019-04

在你第二次请求内容的"client_session":"{\"client_results\":\"\", \"candidate_options\":[]}"

改为client_session":"{\"client_results\":\"\", \"candidate_options\":[]},请注意json格式内容不要在最外层{}加上“”号,这样它会无法识别为json

0
TOP
切换版块