IP Library › Granted Patent US 11,847,147
Granted Patent B2
US 11,847,147 · App. 17/311,772 · Granted Dec 19, 2023

Method for building ranking model, query auto-completion method and corresponding apparatuses

Inventors: Jizhou Huang (Beijing, CN); Haifeng Wang (Beijing, CN); Miao Fan (Beijing, CN)
Assignee: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) CO., LTD.
G06F16/3322G06F16/335G06F16/338G06F16/3347G06F18/214G06F18/22G06N3/04
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,847,147
App. No.
17/311,772
Granted
Dec 19, 2023
Kind
B2
Abstract

The present application discloses a method for building a ranking model, a query auto-completion method and corresponding apparatuses, which relates to the technical field of intelligent search. An implementation includes: acquiring from a POI query log a query prefix input when a user selects a POI from query completion suggestions, POIs in the query completion suggestions corresponding to the query prefix and the POI selected by the user in the query completion suggestions; constructing positive and negative example pairs using the POI selected by the user and the POIs not selected by the user in the query completion suggestions corresponding to the same query prefix; and performing a training operation using the query prefix and the positive and negative example pairs corresponding to the query prefix to obtain the ranking model.

Claims (73)

1. A method for building a ranking model for query auto-completion, comprising:

acquiring from a POI query log a query prefix input when a user selects a POI from query completion suggestions, POIs in the query completion suggestions corresponding to the query prefix and the POI selected by the user in the query completion suggestions;

constructing positive and negative example pairs using the POI selected by the user and the POIs not selected by the user in the query completion suggestions corresponding to the same query prefix; and

performing a training operation using the query prefix and the positive and negative example pairs corresponding to the query prefix to obtain the ranking model;

wherein the ranking model has a training target of maximizing the difference between the similarity of vector representation of the query prefix and vector representation of the corresponding positive example POI and the similarity of the vector representation of the query prefix and vector representation of the corresponding negative example POIs,

wherein the ranking model comprises a prefix embedded network, a POI embedded network, and a ranking network; and

the prefix embedded network is configured to obtain the vector representation of the query prefix, the POI embedded network is configured to obtain the vector representation of each POI, and the ranking network is configured to determine the similarity between the vector representation of the query prefix and the vector representation of the corresponding POIs,

wherein the obtaining vector representation of each POI comprises:

encoding attribute information of the POI to obtain the vector representation of the POI,

wherein the POI embedded network comprises a convolutional neural network, a feedforward neural network and a fully connected layer; and

the encoding attribute information of the POI comprises:

encoding name and address information of the POI by the convolutional neural network;

encoding other attribute information of the POI by a feedforward neural network; and

splicing the encoding results of the same POI, and then mapping the splicing result by a fully connected layer to obtain the vector representation of the POI.

2. The method according to claim 1 , wherein the prefix embedded network comprises a recurrent neural network; and

the obtaining the vector representation of the query prefix comprises:

sequentially inputting a character vector corresponding to each character in the query prefix into the recurrent neural network, and obtaining the vector representation of the query prefix using a feature vector for the last character output by the recurrent neural network; or

splicing vectors of attribute features of the user and a character vector corresponding to each character in the query prefix respectively, then sequentially inputting the results into the recurrent neural network, and obtaining the vector representation of the query prefix using a feature vector corresponding to the last character and output by the recurrent neural network.

3. The method according to claim 1 , wherein in the process of training the ranking model, a triple loss function is determined using output of the ranking network, and feedforward is performed using the triple loss function to update model parameters of the prefix embedded network, the POI embedded network and the ranking network until the triple loss function meets a preset requirement or a preset number of times that the model parameters are updated is reached.

4. A query auto-completion method, comprising:

acquiring a query prefix input by a user currently, and determining candidate Points of Interest (POIs) corresponding to the query prefix;

inputting the query prefix and the candidate POIs into a ranking model to obtain a score of each candidate POI by the ranking model, wherein the scores of the candidate POIs are obtained according to the similarity between vector representation of the query prefix and vector representation of the candidate POIs; and

determining query completion suggestions recommended to the user according to the scores of respective candidate POIs;

wherein the ranking model is obtained by performing a pre-training operation with the method according to claim 1 ,

wherein the vector representation of each candidate POI is determined by:

in the ranking model, encoding attribute information of each POI to obtain the vector representation of the POI,

wherein the encoding attribute information of the POI comprises:

in the ranking model, encoding name and address information of the POI by a convolutional neural network;

encoding other attribute information of the POI by a feedforward neural network; and

splicing the encoding results of the same POI, and then mapping the splicing result by a fully connected layer to obtain the vector representation of the POI.

5. The method according to claim 4 , wherein the vector representation of the query prefix is obtained by:

in the ranking model, sequentially inputting a character vector corresponding to each character in the query prefix into a recurrent neural network, and obtaining the vector representation of the query prefix using a feature vector for the last character output by the recurrent neural network; or

in the ranking model, splicing vectors of attribute features of the user and a character vector corresponding to each character in the query prefix respectively, then sequentially inputting the results into a recurrent neural network, and obtaining the vector representation of the query prefix using a feature vector corresponding to the last character and output by the recurrent neural network.

6. An electronic device, comprising:

at least one processor; and

a memory communicatively connected with the at least one processor;

wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform a method for building a ranking model for query auto-completion, wherein the method comprises:

acquiring from a POI query log a query prefix input when a user selects a POI from query completion suggestions, POIs in the query completion suggestions corresponding to the query prefix and the POI selected by the user in the query completion suggestions;

constructing positive and negative example pairs using the POI selected by the user and the POIs not selected by the user in the query completion suggestions corresponding to the same query prefix; and

performing a training operation using the query prefix and the positive and negative example pairs corresponding to the query prefix to obtain a ranking model;

wherein the ranking model has a training target of maximizing the difference between the similarity of vector representation of the query prefix and vector representation of the corresponding positive example POI and the similarity of the vector representation of the query prefix and vector representation of the corresponding negative example POIs,

wherein the ranking model comprises a prefix embedded network, a POI embedded network, and a ranking network; and

the prefix embedded network is configured to obtain the vector representation of the query prefix, the POI embedded network is configured to obtain the vector representation of each POI, and the ranking network is configured to determine the similarity between the vector representation of the query prefix and the vector representation of the corresponding POIs,

wherein the obtaining vector representation of each POI comprises:

encoding attribute information of the POI to obtain the vector representation of the POI,

wherein the POI embedded network comprises a convolutional neural network, a feedforward neural network and a fully connected layer; and

the encoding attribute information of the POI comprises:

encoding name and address information of the POI by the convolutional neural network;

encoding other attribute information of the POI by a feedforward neural network; and

splicing the encoding results of the same POI, and then mapping the splicing result by a fully connected layer to obtain the vector representation of the POI.

7. The electronic device according to claim 6 , wherein the prefix embedded network comprises a recurrent neural network; and

the obtaining the vector representation of the query prefix comprises:

sequentially inputting a character vector corresponding to each character in the query prefix into the recurrent neural network, and obtaining the vector representation of the query prefix using a feature vector for the last character output by the recurrent neural network; or

splicing vectors of attribute features of the user and a character vector corresponding to each character in the query prefix respectively, then sequentially input the results into the recurrent neural network, and obtaining the vector representation of the query prefix using a feature vector corresponding to the last character and output by the recurrent neural network.

8. The electronic device according to claim 6 , wherein in the process of training the ranking model, a triple loss function is determined using output of the ranking network, and feedforward is performed using the triple loss function to update model parameters of the prefix embedded network, the POI embedded network and the ranking network until the triple loss function meets a preset requirement or a preset number of times that the model parameters are updated is reached.

9. A non-transitory computer-readable storage medium storing computer instructions therein, wherein the computer instructions are used to cause the computer to perform a method for building a ranking model for query auto-completion, wherein the method comprises:

acquiring from a POI query log a query prefix input when a user selects a POI from query completion suggestions, POIs in the query completion suggestions corresponding to the query prefix and the POI selected by the user in the query completion suggestions;

constructing positive and negative example pairs using the POI selected by the user and the POIs not selected by the user in the query completion suggestions corresponding to the same query prefix; and

performing a training operation using the query prefix and the positive and negative example pairs corresponding to the query prefix to obtain the ranking model;

wherein the ranking model has a training target of maximizing the difference between the similarity of vector representation of the query prefix and vector representation of the corresponding positive example POI and the similarity of the vector representation of the query prefix and vector representation of the corresponding negative example POIs,

wherein the ranking model comprises a prefix embedded network, a POI embedded network, and a ranking network; and

the prefix embedded network is configured to obtain the vector representation of the query prefix, the POI embedded network is configured to obtain the vector representation of each POI, and the ranking network is configured to determine the similarity between the vector representation of the query prefix and the vector representation of the corresponding POIs,

wherein the obtaining vector representation of each POI comprises:

encoding attribute information of the POI to obtain the vector representation of the POI,

wherein the POI embedded network comprises a convolutional neural network, a feedforward neural network and a fully connected layer; and

the encoding attribute information of the POI comprises:

encoding name and address information of the POI by the convolutional neural network;

encoding other attribute information of the POI by a feedforward neural network; and

splicing the encoding results of the same POI, and then mapping the splicing result by a fully connected layer to obtain the vector representation of the POI.

10. The non-transitory computer-readable storage medium according to claim 9 , wherein the prefix embedded network comprises a recurrent neural network; and

the obtaining the vector representation of the query prefix comprises:

sequentially inputting a character vector corresponding to each character in the query prefix into the recurrent neural network, and obtaining the vector representation of the query prefix using a feature vector for the last character output by the recurrent neural network; or

splicing vectors of attribute features of the user and a character vector corresponding to each character in the query prefix respectively, then sequentially inputting the results into the recurrent neural network, and obtaining the vector representation of the query prefix using a feature vector corresponding to the last character and output by the recurrent neural network.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 8, 2021
From: HUANG, JIZHOU; WANG, HAIFENG; FAN, MIAO
To: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) CO., LTD.
Reel/Frame 056466/0585 →
Priority Claims (1)
CN 202010011383.8 · Jan 6, 2020 · national
Continuity (1)
Related Publication 20220327151A1 · Oct 13, 2022