US 11,816,443 B2
Method, device, and storage medium for generating response
Xiaojun Zhao, Beijing (CN); Meng Wang, Beijing (CN); and Qingwei Huang, Beijing (CN)
Assigned to BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY CO., LTD., Beijing (CN)
Filed by BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY CO., LTD., Beijing (CN)
Filed on Jul. 22, 2021, as Appl. No. 17/382,829.
Claims priority of application No. 202011554184.8 (CN), filed on Dec. 24, 2020.
Prior Publication US 2021/0350085 A1, Nov. 11, 2021
Int. Cl. G06F 40/35 (2020.01); G06F 16/332 (2019.01); G06F 40/279 (2020.01); G06F 11/34 (2006.01); G06F 18/22 (2023.01)
CPC G06F 40/35 (2020.01) [G06F 11/3438 (2013.01); G06F 16/3325 (2019.01); G06F 16/3329 (2019.01); G06F 18/22 (2023.01); G06F 40/279 (2020.01)] 14 Claims
OG exemplary drawing
 
1. A method for generating a response, comprising:
obtaining a current user request in a current conversation from information input by a user in a current conversation box through an electronic device and historical coreference information in the current conversation from a server;
extracting content matching the current user request from the historical coreference information;
updating the current user request based on the content to obtain an updated current user request; and
generating a response of the current user request based on the updated current user request;
wherein the historical coreference information comprises one or more historical user requests triggering coreference, and a plurality of coreference options corresponding to each historical user request,
wherein extracting the content matching the current user request from the historical coreference information, comprises:
when the current user request comprises an entity represented by an ordinal number, obtaining sequentially, in order of time from nearest to far, a historical user request from the historical coreference information as a to-be-processed historical user request;
removing the entity represented by the ordinal number and a meaningless word from the current user request to generate a rewritten current user request;
determining a second similarity of the rewritten current user request and the to-be-processed historical user request; and
taking the to-be-processed historical request whose second similarity satisfies a second similarity threshold as the content matching the current user request;
wherein, extracting the content matching the current user request from the historical coreference information, further comprises:
when there is no to-be-processed historical request whose second similarity satisfies the second similarity threshold, determining whether the current user request satisfies a preset coreference inheritance condition;
when the current user request satisfies the preset coreference inheritance condition, taking a historical user request closest to a current time point in the historical coreference information as the content matching the current user request; and
when the current user request does not satisfy the preset coreference inheritance condition, determining that there is no content matching the current user request.