US 11,704,326 B2
Generalization processing method, apparatus, device and computer storage medium
Yan Chen, Beijing (CN); Kai Liu, Beijing (CN); and Jing Liu, Beijing (CN)
Assigned to BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD., Beijing (CN)
Filed by BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY CO., LTD., Beijing (CN)
Filed on Aug. 20, 2021, as Appl. No. 17/407,272.
Claims priority of application No. 202011445266.9 (CN), filed on Dec. 8, 2020.
Prior Publication US 2022/0179858 A1, Jun. 9, 2022
Int. Cl. G06F 16/2458 (2019.01); G06F 16/2453 (2019.01); G06F 40/30 (2020.01); G06N 5/02 (2023.01)
CPC G06F 16/2468 (2019.01) [G06F 16/24534 (2019.01); G06F 40/30 (2020.01); G06N 5/02 (2013.01)] 15 Claims
OG exemplary drawing
 
1. A method of generalization processing, comprising:
determining a set of candidate queries in a query library that are similar to a requested query in at least one of a literal matching manner, a semantic matching manner and a query rewriting manner; and
determining a generalized query corresponding to the requested query from the set of candidate queries by using a pre-trained query matching model,
wherein the query matching model is obtained by pre-training based on a cross attention model,
wherein the semantic matching manner comprises:
using a vector representation layer in a dual model obtained by pre-training to determine a feature vector representation of the requested query;
searching, in a vector searching manner, from the query library for queries in a way that a similarity between feature vector representations of the queries and the feature vector representation of the requested query satisfies a preset similarity requirement,
wherein the dual model is obtained by pre-training in the following manner:
obtaining first training data including a relevant query and an irrelevant query corresponding to the same query; and
taking the first training data as input of the dual model to train the dual model; a training target includes: maximizing a difference between a first similarity and a second similarity, wherein the first similarity is a similarity which is between the feature vector representation of the same query and a feature vector representation of the relevant query and is output by a vector representation layer of the dual model, and the second similarity is a similarity which is between the feature vector representation of the same query and a feature vector representation of the irrelevant query and is output by the vector representation layer of the dual model.