Model training, application method and computer storage medium

By building training samples containing search text and geolocation information and training a dual-branch machine learning model, the problem that traditional text search methods cannot effectively utilize geospatial information in map search is solved, and more accurate map search results are achieved.

CN114443983BActive Publication Date: 2025-04-18ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210119301.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-08
Publication Date
2025-04-18
Estimated Expiration
2042-02-08

AI Technical Summary

Technical Problem

Traditional text search methods cannot effectively consider geospatial information in map search scenarios, resulting in the model being unable to obtain accurate search results and cannot meet the actual map search needs.

Method used

By obtaining search text for map search and geolocation information obtained based on historical map search behavior data and POI information, a training sample containing search text and geolocation information is constructed to train a dual-branch machine learning model, which can process both semantic information of search text and geospatial information.

Benefits of technology

This method enables the model to better process map search text carrying geospatial information, obtain more accurate map search results, and meet actual map search needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114443983B_ABST
    Figure CN114443983B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a model training, application method and computer storage medium, wherein the model training method includes: obtaining a search text for map search, and obtaining geographic location information based on historical map search behavior data and POI information; constructing a training sample based on the search text and the geographic location information; and using the training sample to train a first machine learning model for map search. Through the embodiment of the present application, a machine learning model that can perform relatively accurate map search can be trained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a model training and application method and a computer storage medium. Background Art

[0002] With the development of communication technology and geographic information technology, more and more map search functions and applications providing map search functions are widely used.

[0003] Usually, the purpose of map search is to first search a geographical area in order to further determine the geographical location of the search target, as well as the surrounding conditions of the search target or the navigation route, etc. However, similar to other searches, map search also searches by entering search text, that is, it is also performed using text search. Traditional text search is based on the semantics of the text to perform query analysis, recall, and sorting operations. Common solutions include query analysis based on manual rules, statistical features, and machine learning, recall based on term matching and semantic vectors, and semantic relevance sorting based on machine learning.

[0004] However, these methods treat all text searches as natural language texts. When applied to map search scenarios, they do not consider the above-mentioned special needs of map search, so that the map search model cannot obtain accurate search results and cannot meet actual map search needs. Summary of the invention

[0005] In view of this, an embodiment of the present application provides a model training and application solution to at least partially solve the above-mentioned problems.

[0006] According to a first aspect of an embodiment of the present application, a model training method is provided, comprising: obtaining a search text for performing a map search, and obtaining geographic location information based on historical map search behavior data and POI information; constructing a training sample based on the search text and the geographic location information; and using the training sample to train a first machine learning model for performing a map search.

[0007] According to a second aspect of an embodiment of the present application, a model application method is provided, including: obtaining a map search request, and determining the requested POI location information based on the map search request; inputting the map search request and the POI location information into a preset first machine learning model, wherein the first machine learning model is a model for performing map search; obtaining search text features and corresponding geographic spatial features of the map search request output by the first machine learning model; and obtaining map search results based on the search text features and the geographic spatial features.

[0008] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method described in the first aspect or the second aspect.

[0009] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect or the second aspect is implemented.

[0010] According to the model training scheme provided in the embodiment of the present application, when training the first machine learning model applied to the map search process, unlike the traditional method of only using search text as training samples, the embodiment of the present application also integrates data that can reflect geographic spatial information, namely geographic location information, into the training samples. As a result, the training samples contain both search text information and geospatial information, so that this information can be fully integrated into the model training process. The model parameters obtained through training can better process map search texts carrying geospatial information, obtain more accurate map search results, and meet actual map search needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0012] Figure 1 A flowchart of the steps of a model training method according to Embodiment 1 of the present application;

[0013] Figure 2A A flowchart of the steps of a model training method according to Embodiment 2 of the present application;

[0014] Figure 2B for Figure 2A A schematic diagram of a model structure in the illustrated embodiment;

[0015] Figure 3 A flowchart of the steps of a model application method according to Embodiment 3 of the present application;

[0016] Figure 4 is a structural block diagram of a model training device according to Embodiment 4 of the present application;

[0017] Figure 5is a structural block diagram of a model application device according to Embodiment 5 of the present application;

[0018] Figure 6 is a structural diagram of a map search system according to Embodiment 6 of the present application;

[0019] Figure 7 This is a schematic diagram of the structure of an electronic device according to Embodiment 7 of the present application. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.

[0021] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.

[0022] Embodiment 1

[0023] Reference Figure 1 , shows a step flow chart of a model training method according to embodiment 1 of the present application.

[0024] The model training method of this embodiment includes the following steps:

[0025] Step S102: Obtain search text for map search, and obtain geographic location information based on historical map search behavior data and POI information.

[0026] The search text may be obtained by any appropriate means, such as online mining or historical search text collection, etc., provided that authorization or permission is obtained for use. The search text may be a text in natural language or a text processed into formatted data, as long as it carries information of geographic elements such as POI. For example, the search text may be "Is there a parking lot near the Forbidden City?" or in a form similar to des = parking lot where location = "Forbidden City".

[0027] In the embodiment of the present application, while obtaining the search text on the one hand, the geographical location information obtained based on the historical map search behavior data and POI (Point Of Interest) information can also be obtained on the other hand. Usually, the historical map search behavior data of the user will correspond to the target location of the search, which can be regarded as a POI. Since the POI has geographical location information, the geographical location information can be determined based on the POI information carried in the search text, the POI corresponding to the historical map search behavior data, and the POI information collected or stored in advance. Among them, in this step, the geographical location information may have a matching relationship with the search text, or may not have a matching relationship. The matching relationship means that the geographical location information is the geographical location information of the POI corresponding to the search text. For example, if the search text is "Is there a parking lot near the Forbidden City?", if the geographical location information is "39 ​​degrees 54 minutes 26.37 seconds north latitude, 116 degrees 23 minutes 29.22 seconds east longitude", the two are considered to match; if it is "89 degrees 54 minutes 26.37 seconds north latitude, 116 degrees 23 minutes 29.22 seconds east longitude", the two are considered to be matched; if it is "89 degrees 54 minutes 26.37 seconds north latitude, 116 degrees 23 minutes 29.22 seconds east longitude", the two are considered to be unmatched. It should be noted that the geographic location information may also be geographic area information, or a geographic area or geographic location name, etc., which is not limited here.

[0028] Step S104: constructing a training sample according to the search text and the geographical location information.

[0029] The search text can represent the user's map search intent, and the geographic location information can represent the geographic spatial location. Therefore, training samples are constructed based on the search text and the geographic location information, so that the constructed training samples contain not only the semantic information of the conventional map search intent but also the geographic spatial information.

[0030] Assume that multiple historical map search behavior data show that some users searched for "the nearest parking lot to the Forbidden City" and finally chose Tiananmen West Parking Lot C, whose geographical location information is "39 ​​degrees 54 minutes 26.37 seconds north latitude, 116 degrees 23 minutes 29.22 seconds east longitude"; multiple historical map search behavior data show that some users searched for "Universal Resort" and finally chose Universal Resort North Gate, whose geographical location information is "37 degrees 14 minutes 26.17 seconds north latitude, 110 degrees 10 minutes 29.32 seconds east longitude"; multiple historical map search behavior data show that some users searched for "Beijing South Railway Station" and finally chose Beijing South Railway Station North 1 Entrance, whose geographical location information is "32 degrees 54 minutes 26.27 seconds north latitude, 120 degrees 30 minutes 29.02 seconds east longitude". Based on this, exemplarily, the constructed training samples can be shown in the following Table 1:

[0031] Table 1

[0032]

[0033]

[0034] As can be seen from the above table, for each search text, the correct geographic location information can be determined based on the correspondence between the POI of the corresponding target location (such as the parking lot near the Forbidden City, the entrance of Universal Studios, Beijing South Railway Station, etc.) and the POI in the historical map search behavior data. Then, a positive sample is constructed based on the search text and its corresponding correct geographic location information. The correct geographic location information for a certain search text can be combined with other search texts to form a negative sample. It should be noted that the above is only a simple schematic explanation. In actual applications, the method for determining the correct geographic location information corresponding to the search text may be more complicated, the amount of data may be larger, and the determined geographic location information may also have multiple candidate geographic location information (which can be sorted according to the data statistics results and selected from them). However, based on the above exemplary principles, the construction of positive and negative samples based on search text and geographic location information can be achieved, which are all within the scope of protection of this application.

[0035] In addition, it should be noted that in the embodiments of the present application, unless otherwise specified, "plurality", "multiple" and other quantities related to "multiple" all mean two or more.

[0036] Step S106: Use the training samples to train a first machine learning model for map search.

[0037] Because the training samples contain both search text and geographic location information, the first machine learning model trained based on this type of training samples can simultaneously learn the semantic information and geographic spatial information of the search text, and can be effectively applied to map search to output accurate map search results.

[0038] Among them, the first machine learning model can be any model that can use the training samples in the embodiments of the present application as input and text features and geographic spatial features as output, including but not limited to CNN models.

[0039] In a preferred embodiment, the first machine learning model is a model including a text feature branch and a spatial feature branch. Then, this step can be implemented as follows: using the search text in the training sample as the input of the text feature branch in the first machine learning model, using the geographic location information in the training sample as the input of the spatial feature branch in the first machine learning model, training the first machine learning model, and obtaining a model that can output map search text features for map search and geographic spatial features that match the map search text features.

[0040] That is, the first machine learning model in the embodiment of the present application includes two branches, namely a text feature branch and a spatial feature branch. Since the two branches are trained simultaneously using training samples, the adjustment of any branch model parameters is affected by the training results of the two branches at the same time, so that the trained model can effectively process different information while also integrating the information of the other branch.

[0041] Among them, the text feature branch takes the search text part in the training sample as input, and is mainly used to extract the semantic features (or text features) of the search text; while the spatial feature branch takes the geographic location information in the training sample as input, and is mainly used to obtain geographic spatial features, including but not limited to latitude and longitude features.

[0042] In a feasible implementation, the first machine learning model can be implemented as a twin-tower model. The twin-tower model is a model that uses two networks to model the input respectively, and performs similarity calculation at the final cross layer, in which two independent networks form two "towers". In this embodiment, the text feature branch and the spatial feature branch form the two "towers" of the twin-tower model, and the two branches are trained using different parts of the training samples, and finally a model that can output map search text features and corresponding geographic spatial features is obtained. It should be noted that the specific implementation form of the twin-tower model can be implemented by those skilled in the art in an appropriate form according to actual needs, including but not limited to the DSSM twin-tower model.

[0043] Optionally, the text feature branch may adopt any appropriate model form for text feature extraction, including but not limited to transformer form, CNN form, RNN form, etc.; and the spatial feature branch may also adopt any appropriate model form for geographic spatial feature extraction, including but not limited to CNN form, RNN form, etc.

[0044] Because the first machine learning model adopts a dual-branch structure, during the training process, on the one hand, each branch performs targeted training for the functions it needs, such as the text feature branch focuses on text feature extraction training, and the spatial feature branch focuses on spatial feature extraction training; on the other hand, because the parameter adjustment of the first machine learning model is based on the training results for overall adjustment, that is, the training of the text feature branch will affect the spatial feature branch, and correspondingly, the training of the spatial feature branch will also affect the text feature branch, the model parameters of the two branches are adjusted as a whole. Therefore, the first machine learning model realizes the targeted processing of different types of data through two branches, and can also affect the training of the other branch, so that the final model can more effectively process the text semantic information and geographic spatial information in the search text. When the trained first machine learning model is applied to the map search scenario, more accurate map search results can be obtained to meet the actual map search needs.

[0045] Through this embodiment, when training the first machine learning model applied to the map search process, unlike the traditional method of only using search text as training samples, this embodiment also integrates data that can reflect geographic spatial information, namely geographic location information, into the training samples. Therefore, the training samples contain both search text information and geospatial information, so that this information can be fully integrated into the model training process. The model parameters obtained through training can better process map search texts carrying geospatial information, obtain more accurate map search results, and meet actual map search needs.

[0046] The model training method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as mobile phones, PADs, etc.) and PCs, etc.

[0047] Embodiment 2

[0048] Reference Figure 2A , shows a step flow chart of a model training method according to Example 2 of the present application.

[0049] The model training method of this embodiment includes the following steps:

[0050] Step S202: Obtain search text for map search, and obtain geographic location information based on historical map search behavior data and POI information.

[0051] The acquisition of the search text and the acquisition of the geographic location information may be performed in any order or in parallel.

[0052] In one feasible method, the corresponding historical map search text can be obtained according to the historical map search behavior data, and the geographical location information of the POI corresponding to the historical map search behavior data can be obtained; the geographical location indicated by the geographical location information is discretized to obtain geographical area information. By discretizing the geographical location, the data processing amount is reduced and the data management is convenient.

[0053] For example, the corresponding relationship between the search text and the geographic location can be mined through the search click behavior in the online search log and the corresponding relationship between the POI name, address and geographic location in the POI library, and then the geographic location can be discretized into a geohash geographic area with a certain specification such as a granularity of 1km*1km or 5km*5km, and a search text-geohash bipartite graph can be constructed. Among them, geohash means the area obtained after the coordinates of the geographic location are discretized at a certain granularity, such as an area with a granularity of 1km*1km or 5km*5km. That is, in a feasible way, the method of obtaining geographic area information based on geographic location can be implemented by geohash encoding. Geohash encoding can convert two-dimensional longitude and latitude into a string, each string represents a certain geographic area, and all points (latitude and longitude coordinates) in the geographic area share the geohash encoding string of the geographic area. The longer the string, the more accurate the range of representation. As a result, privacy can be protected and data caching and subsequent processing can be easily performed. The specific implementation means of generating geohash encoding based on geographic location information can refer to the description in the relevant technology, which will not be repeated here.

[0054] Step S204: constructing a training sample according to the search text and the geographical location information.

[0055] Through this step, the constructed training samples contain both the search text and the geographic space information represented by the geographic location information.

[0056] In one feasible manner, geographic location information that matches the acquired search text and geographic location information that does not match it can be determined respectively; training samples are constructed based on the acquired search text and the matching geographic location information, and the acquired search text and the non-matching geographic location information. Among them, the geographic location information that matches the acquired search text can be considered as a positive sample, and the geographic location information that does not match the acquired search text can be considered as a negative sample. An example training sample is shown in Table 1 above. Training samples are constructed based on positive and negative samples to ensure the comprehensiveness and effectiveness of the constructed training samples. When the geographic location is discretized to obtain geographic area information, this step can be implemented as: constructing a training sample based on the search text and the geographic area information. Exemplarily, assuming that the geographic area information (illustrated as geohash code) obtained based on the geographic location indicated by the geographic location information in Table 1 above is shown in Table 2 below, then the training samples constructed based on it are exemplarily shown in Table 3 below:

[0057] Table 2

[0058] Geographic location information Geohash encoding 39 degrees 54 minutes 26.37 seconds north latitude, 116 degrees 23 minutes 29.22 seconds east longitude WX4ER 32 degrees 54 minutes 26.27 seconds north latitude, 120 degrees 30 minutes 29.02 seconds east longitude WX4G2 37 degrees 14 minutes 26.17 seconds north latitude, 110 degrees 10 minutes 29.32 seconds east longitude WX4G3

[0059] Table 3

[0060]

[0061]

[0062] As can be seen from the above, using geographic area information such as geohash encoding to construct training samples can greatly reduce the amount of training sample data and facilitate data processing in subsequent training.

[0063] In addition, in another feasible manner, the acquired search text can be edited according to the error correction alignment information (such as error correction alignment probability, etc.), wherein the editing operation includes at least one of adding characters, deleting characters, replacing characters, and retaining original characters on the acquired search text; and training samples are constructed according to the search text after the editing operation and the geographic location information. In this way, the training samples can be expanded efficiently, quickly, and at low cost, so that the sample data of the training samples is richer, and thus the trained model can have stronger fault tolerance and error correction capabilities.

[0064] Among them, error correction alignment information such as error correction alignment probability can be obtained based on the statistical results of online big data. Editing operations on the search text based on the error correction alignment probability can make the generated new search text consistent with the actual error distribution, which is more in line with the actual situation where errors occur in the search text and meets the actual error correction needs.

[0065] For example, assuming the search text query=Zhentai Road Vanke Four Seasons Flower City, according to the error correction alignment information, it is determined that the probability of errors in the road name and the community name is relatively high, then characters can be added, such as query'=Zhentai Road Vanke Four Seasons Garden City; characters can be replaced, such as query'=Zhengtai Road Vanke Four Seasons Flower City; or characters can be deleted, such as query'=Zhentai Road Vanke Four Seasons City, and so on.

[0066] Step S206: Use the search text in the training sample as the input of the text feature branch in the first machine learning model, use the geographic location information in the training sample as the input of the spatial feature branch in the first machine learning model, train the first machine learning model, and obtain a model that can output map search text features for map search and geographic spatial features that match the map search text features.

[0067] As mentioned above, the first machine learning model in the embodiment of the present application is a dual-branch model. In one feasible manner, the dual-branch model can be implemented as a dual-tower machine learning model, wherein the text feature branch is a language model branch for obtaining text features of the search text, and the spatial feature branch is a feature vector branch for obtaining geographic spatial features of geographic location information. Thus, the first machine learning model can fully learn a variety of information in the training sample, and can output various feature vectors that meet the requirements, so as to flexibly meet different requirements.

[0068] For example, in the embodiment of the present application, a dual-tower model of DSSM structure is adopted, and the text feature branch thereof adopts a transformer model structure. The self-attention mechanism is introduced in the transformer model structure, which can realize feature extraction more effectively.

[0069] For example, in one example, the first machine learning model adopts a DSSM structure, the left branch uses a transformer to encode the search text and outputs the corresponding features, and the right branch extracts features from the geohash and directly outputs the embedding of the geohash.

[0070] Specifically, on the one hand, we can randomly edit the words in the search text according to the error correction alignment probability obtained by online mining, including adding, deleting, modifying, and retaining the original words. Then, the search text after the editing operation is input into the transformer encoder for processing to obtain the output text features, as well as the word vector of each word in the search text and the classification of the output results of each word, a total of 4 categories, corresponding to adding, deleting, modifying, and retaining.

[0071] On the other hand, the spatial feature branch can be trained according to geohash to obtain the embedding of the output geohash. However, it is not limited to this. In another feasible method, the longitude and latitude in the geographic location information can be discretized respectively and then input into the model to calculate the embedding, which is also applicable to the solution of the embodiment of the present application.

[0072] In addition, the loss functions used in the training of the first machine learning model in the embodiment of the present application include: a loss function for indicating the similarity between the search text and the geographic location information, a loss function for indicating the similarity between adjacent geographic areas in spatial position, and a loss function for indicating the editing operation type of the search text; wherein the editing operation type includes: at least one of: character addition type, character deletion type, character replacement type, and original character retention type.

[0073] Still taking the first machine learning model using the DSSM structure as an example, the corresponding model training loss obtained through the above loss function is divided into three items: the first item is the cross entropy loss of the search text-geohash similarity, which is used to express the similarity between the search text and the geohash; the second item is the cross entropy loss of the similarity between the geohash and the adjacent geohash, which is used to express the similarity between the adjacent geohash in spatial position; the third item is the loss of the text feature branch, which uses the multi-classification cross entropy loss to express the source of the corresponding word (original word or edited word).

[0074] The training of the first machine learning model is an iterative process. After learning each training sample and obtaining the loss, the model can be adjusted based on this, including but not limited to adjusting the model parameters, until the training termination conditions are met, for example, reaching a preset number of training times or the loss reaches a preset target.

[0075] Through the above process, the first machine learning model in the embodiment of the present application can at least output the text features of the search text, the word features of each word in the search text, and the geographic space features such as geohash embedding by training and learning the training samples containing the search text and the geographic location information. Thus, an effective and accurate search basis and basis is provided for map search.

[0076] After the training is completed and the first machine learning model capable of outputting map search text features and corresponding geographic spatial features is obtained, the following operations may optionally be performed.

[0077] Step S208: Based on the output of the trained first machine learning model, train a second machine learning model for assisting map search.

[0078] Although the trained first machine learning model can output the corresponding data for map search, in order to cope with various situations that may occur in actual map search and improve the map search function more efficiently, in the embodiment of the present application, the second machine learning model will also be trained based on the output of the trained first machine learning model. Optionally, the second machine learning model can be any one of a sorting model, an error correction model, and an entity recognition model.

[0079] The following describes the training of the sorting model, error correction model, and entity recognition model, respectively. However, it should be clear to those skilled in the art that, in practical applications, the solution in the embodiment of the present application can be used to train only some of these models, while the other models are still trained in the traditional way, which still has better results than training all models in the traditional way. However, if all three models are trained using the solution in the embodiment of the present application, better results will be achieved.

[0080] (i) based on the output of the first machine learning model that has been trained, training a sorting model for assisting map search, including:

[0081] (1) Constructing a first training sample and a second training sample for training a sorting model, wherein the first training sample includes: a map search text sample and an attribute data sample of a POI to be searched by the map search text sample; and the second training sample includes: a search initiation location data sample corresponding to the map search text sample and a POI location data sample.

[0082] (2) Inputting the first training sample into the text feature branch, obtaining a feature vector for indicating the semantics of the map search text sample and a feature vector for indicating the attribute features of the attribute data sample of the POI; inputting the second training sample into the spatial feature branch, obtaining a feature vector for indicating the search initiation location and a feature vector for indicating the POI location.

[0083] Optionally, the attribute data samples of the POI include: a name data sample and an address data sample of the POI, and the feature vector used to indicate the attribute characteristics of the attribute data samples of the POI includes: a feature vector used to indicate the name of the POI and a feature vector used to indicate the geographic location of the POI.

[0084] In this step, using the branches in the trained first machine learning model, the features of the map search text sample and the features representing the location can be effectively extracted, and the implementation cost can be saved. In addition, the features of the extracted map search text sample can also carry geographic space information due to the model relationship.

[0085] (3) Based on the obtained feature vectors, calculate the relevance between the map search text sample and the POI.

[0086] (4) Training a sorting model based on the correlation.

[0087] In a specific example, the above process can be implemented as follows: on the one hand, the query (map search text sample) and the POI name and address (POI attribute data sample) are input, and the transformer encoder in the first machine learning model that has been trained is used to obtain the text feature vector vt_q (text feature of the map search text sample), vt_pn (POI name feature), and vt_pa (POI geographic location feature). On the other hand, the location where the user initiated the query (search initiation location data sample) and the location of the POI (POI location data sample) are input, and the spatial feature branch of the geohash embedding of the first machine learning model that has been trained is used to obtain the feature vector representing the location of the user and POI, which is recorded as vg_q (search initiation location) and vg_p (POI location). Then, based on vt_q, vt_pn, vt_pa, vg_q, and vg_p, the correlation score between the query and POI is calculated together. For example, in one feasible method, vt_q and vg_q can be spliced ​​to form a first splicing vector, vt_pn, vt_pa, and vg_p can be spliced ​​to form a second splicing vector, and then the first splicing vector and the second splicing vector are inner-producted to obtain a correlation score score. In another feasible method, vt_q, vt_pn, vt_pa, vg_q, and vg_p can be spliced ​​together to form a splicing vector, and then the splicing vector is input into a model for correlation calculation (including but not limited to a model of a transformer structure) to obtain a correlation score score. However, it is not limited to this, and other methods for calculating the correlation score score are also applicable to the solutions of the embodiments of the present application.

[0088] Similar to the training of the first machine learning model mentioned above, the training of the sorting model also needs to be repeated in a loop until the preset number of training times is reached or the score reaches the preset target, etc.

[0089] The ranking model in this embodiment utilizes both the search text and geographic spatial information such as geohash information, and can effectively calculate the correlation between the query and the POI.

[0090] (ii) training an error correction model for assisting map search based on the output of the first machine learning model after training, including:

[0091] (1) Taking a map search text sample as input, obtaining a corresponding correction text and a confidence level corresponding to the correction text through a text translation model used for text correction; and taking the map search text sample as input, obtaining a corresponding sample search text feature through a text feature branch in a trained first machine learning model.

[0092] In the embodiment of the present application, some sample data in the samples used to train the sorting model, error correction model and entity recognition model may overlap. In this step, the text translation model can adopt a traditional text translation model. In this embodiment, the text translation model is used for text error correction. When a map search text sample is input, the corresponding error correction text and the confidence of the error correction text can be output.

[0093] In addition, similar to the training of the sorting model, in the training process of the error correction model, the branches in the first machine learning model that have been trained can be used to effectively extract map search text samples and save implementation costs. In addition, the features of the extracted map search text samples can also carry geographic spatial information due to the model relationship.

[0094] (2) Inputting the error correction text into the text feature branch to obtain corresponding error correction text features.

[0095] The error correction text output by the traditional text translation model is input again into the text feature branch of the trained first machine learning model for feature extraction, so that the error correction text features carrying geographic spatial information can be obtained.

[0096] (3) Training the error correction model according to the similarity between the sample search text features and the error correction text features.

[0097] In one feasible manner, this step can be implemented as follows: obtaining the similarity between the sample search text features and the correction text features; reordering the correction texts according to the similarity and the confidence corresponding to the correction texts, and training the correction model according to the reordering results to achieve better training effects.

[0098] In a specific example, the above process can be implemented as follows: on the one hand, the original query (map search text sample) is input, and after passing through the traditional text translation model, the top k error correction queries and corresponding text scores (i.e., confidence) are obtained, which are respectively recorded as query' and st'. Among them, k can be appropriately set by technical personnel in this field according to actual needs. On the other hand, the original query (map search text sample) is input, and after passing through the transformer encoder in the first machine learning model that has been trained, the corresponding feature vector vg (sample search text features) is obtained. As mentioned above, this feature vector contains both semantic features and geographic spatial features. Then, the error correction query' output by the traditional text translation model is input, and after passing through the transformer encoder in the first machine learning model that has been trained, the corresponding feature vector vg' (error correction text features) is obtained. This feature vector also contains both semantic features and geographic spatial features. Next, the cos similarity of vg and vg' is calculated, and the spatial matching score sg' is output. According to sg' and the previous text score st', the error correction query' is reordered, and the ranking score s = a*sg'+(1-a)*st'. Wherein, a represents the weight, and its specific value can be appropriately set by those skilled in the art according to actual needs. Generally speaking, the weight of sg' is greater than the weight of st'.

[0099] It can be seen that the error correction model in this example adds a spatial consistency check to the query' output by the traditional text translation model to achieve more accurate error correction.

[0100] (iii) training an entity recognition model for assisting map search based on the output of the first machine learning model after training, including:

[0101] (1) Taking the map search text sample as input, the corresponding word vector is obtained through the text feature branch in the trained first machine learning model.

[0102] As mentioned above, the text feature branch of the first machine learning model can not only output the text features of the entire map search text sample, but also output the word vector corresponding to each word therein, and the word vector also contains semantic features and geospatial features.

[0103] (2) Perform entity recognition based on the word vector to obtain an entity recognition result.

[0104] (3) Training the entity recognition model according to the entity recognition result.

[0105] In a specific example, the above process can be implemented as follows: input query (map search text sample), and obtain the encoding vector vw of each word through the trained transformer encoder in the first machine learning model. For each vw, use a layer of full connection to calculate the tag (entity recognition tag) and its score (confidence). Then use CRF decoding to obtain the final entity recognition result.

[0106] It should be noted that, in this embodiment, the specific structures adopted by the sorting model, the error correction model and the entity recognition model are not limited, and any appropriate model that can achieve the corresponding functions can be used.

[0107] Each model obtained through training through the above process described in this embodiment can effectively consider geographic spatial information, is more suitable for map search scenarios, provides users with accurate map search results, and improves user experience.

[0108] The following uses an exemplary model structure to illustrate the relationship between the models involved in the above process. Figure 2B shown.

[0109] Figure 2B In the example, the first machine learning model adopts a dual-tower model structure, which includes a transformer encoder and a geohash embedding branch. The transformer encoder is used to output text features, and the geohash embedding branch can adopt any appropriate structure, including but not limited to CNN, RNN, etc., to output geographic spatial features. In this example, the first machine learning model can output the text features of the search text, the features of each word in the search text, and the geohash embedding features.

[0110] Based on the trained first machine learning model, the sorting model, error correction model and entity recognition model are trained. During the training of these models, the two branches of the trained first machine learning model are used to perform corresponding data processing so that these models can also fully process geospatial information.

[0111] Among them, when training the sorting model, the trained transformer encoder and geohash embedding branch were used; when training the error correction model, the transformer encoder was used; when training the entity recognition model, the transformer encoder was also used. The specific training process of these models is as described above and will not be repeated here.

[0112] The map search system constructed based on the first machine learning model, sorting model, error correction model and entity recognition model that have been trained as mentioned above and can output map search text features and geographic spatial features that match the map search text features can truly reflect the user's map search intention and provide more accurate map search results.

[0113] Through this embodiment, when training the first machine learning model applied to the map search process, unlike the traditional method of only using search text as training samples, this embodiment also integrates data that can reflect geographic spatial information, namely geographic location information, into the training samples. As a result, the training samples contain both search text information and geospatial information, so that this information is fully integrated into the model training process. The model parameters obtained through training can better process the map search text carrying geospatial information, obtain more accurate map search results, and meet the actual map search needs. In addition, the first machine learning model in this embodiment adopts a dual-branch structure, one branch is used to obtain the text features of the search text, and the other branch is used to obtain the geospatial features. The two branches not only perform targeted processing of different types of data, but also affect the training of the other branch, so that the model finally obtained can more effectively process the text semantic information and geospatial information in the search text. Therefore, the first machine learning model can be applied to the map search scenario, effectively meet the actual needs of map search, and reflect the user's real map search intention.

[0114] The model training method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as mobile phones, PADs, etc.) and PCs, etc.

[0115] Embodiment 3

[0116] Reference Figure 3 , shows a step flow chart of a model application method according to Example 3 of the present application.

[0117] The model application method of this embodiment is to apply the machine learning model trained and obtained in the above-mentioned embodiments 1 and 2, and the model application method includes the following steps:

[0118] Step S302: Obtain a map search request, and determine the requested POI location information according to the map search request.

[0119] A map search request is usually in the form of a search text, which usually carries information about a corresponding POI (which may be a specific location or area). Based on this information, geographic location information corresponding to the POI can be retrieved from a preset database.

[0120] Step S304: Input the map search request and the POI location information into a preset first machine learning model.

[0121] Among them, the first machine learning model is a model obtained through training in the aforementioned embodiment one or two.

[0122] Step S306: Obtain the search text features and corresponding geographic spatial features of the map search request output by the first machine learning model.

[0123] The trained first machine learning model can output corresponding search text features and geospatial features.

[0124] Step S308: Obtain map search results based on the search text features and the geographic space features.

[0125] Although map search results corresponding to the map search request can also be obtained based on the output of the first machine learning model, in actual applications, it is usually necessary to sort the results, correct errors that may occur in the map search request, and perform entity recognition based on the map search request before the map search results can be systematically obtained.

[0126] Therefore, in one feasible manner, obtaining map search results based on the search text features and the geographic space features includes: obtaining search ranking results based on the search text features and the geographic space features using the ranking model obtained through training in Example 2.

[0127] For example, a user inputs a map search request "Yuhai Garden Community, Fuxing Road". After determining the corresponding POI location information, the first machine learning model is input. After processing to obtain the corresponding search text features and geographic space features, the model is input into the sorting model. Based on these two parts of features, the sorting model will give four candidate results in order of probability of being selected by the user, such as "North Gate of Yuhai Garden Community, Fuxing Road", "South Gate of Yuhai Garden Community, Fuxing Road", "East Gate of Yuhai Garden Community, Fuxing Road", and "West Gate of Yuhai Garden Community, Fuxing Road". That is, "North Gate of Yuhai Garden Community, Fuxing Road" is ranked the highest, and "East Gate of Yuhai Garden Community, Fuxing Road" is ranked the lowest. Then, the user can make subsequent selections and processes based on the ranking.

[0128] Alternatively, in another feasible embodiment, obtaining map search results based on the search text features and the geographic spatial features includes: based on the search text features and the geographic spatial features, using the error correction model obtained through training in Example 2 to perform error correction processing on the map search request, and obtaining map search results based on the map search request after error correction processing.

[0129] For example, a user inputs a map search request "Fuxing Road Yuhai Garden Community". After determining the corresponding POI location information, it is input into the first machine learning model. After processing to obtain the corresponding search text features and geographic space features, the search text features are input into the error correction model, and after processing by the error correction model, the output is the text features corresponding to "Fuxing Road Yuhai Garden Community". Then, a map search is performed based on the search text features after error correction and the geographic space features output by the first machine learning model to obtain the final search results.

[0130] Alternatively, in another feasible manner, obtaining a map search result based on the search text feature and the geospatial feature includes: based on the search text feature and the geospatial feature, using the entity recognition model obtained through training in Example 2 to perform entity recognition on the map search request, and obtaining a map search result based on the entity recognition result.

[0131] For example, a user inputs a map search request "Fuxing Road Yuhai Garden Community". After determining the corresponding POI location information, it is input into the first machine learning model. After processing to obtain the corresponding search text features and geographic space features, the search text features are input into the entity recognition model to obtain the corresponding entity recognition results, such as "Fuxing Road", "Yuhai Garden Community", etc. Then, a map search is performed based on the entity recognition results and the geographic space features output by the first machine learning model to obtain the final search results.

[0132] In the traditional map search method, only the search text is processed without considering the characteristics of the map search, and the information related to the geographic space is not considered, so it cannot well reflect the user's true intention. The solution of this embodiment can use the first machine learning model that has been trained and includes text feature branches and spatial feature branches to form a general platform for the search engine, and introduce the search text and geographic location information into query analysis and sorting at the same time, so as to more accurately reflect the user's true intention. At the same time, when using geographic space information, it is no longer necessary to consider city analysis, that is, the traditional city analysis is replaced by geographic space analysis, which simplifies the implementation of the map search system and avoids the accuracy and response time problems caused by adding the city level in the middle of the system. Moreover, in this solution, the text feature branch obtained by training based on the error correction alignment probability to form a training sample can explicitly simulate the query with input errors, so that the true intention behind it can be learned more accurately.

[0133] The model training method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as mobile phones, PADs, etc.) and PCs, etc.

[0134] Embodiment 4

[0135] Reference Figure 4 , shows a structural block diagram of a model training device according to Embodiment 4 of the present application.

[0136] The model training device of this embodiment includes: an acquisition module 402, used to obtain search text for map search, and obtain geographic location information obtained based on historical map search behavior data and POI information; a construction module 404, used to construct training samples based on the search text and the geographic location information; a training module 406, used to use the training samples to train a first machine learning model for map search.

[0137] Optionally, the first machine learning model includes a text feature branch and a spatial feature branch; the training module 406 is used to use the search text in the training sample as the input of the text feature branch in the first machine learning model, and use the geographic location information in the training sample as the input of the spatial feature branch in the first machine learning model, to train the first machine learning model, and obtain a model that can output map search text features for map search and geographic spatial features matching the map search text features.

[0138] Optionally, construction module 404 is used to respectively determine geographic location information that matches the acquired search text and geographic location information that does not match it; and construct training samples based on the acquired search text and matching geographic location information, and the acquired search text and non-matching geographic location information.

[0139] Optionally, a construction module 404 is used to respectively determine geographic location information that matches the acquired search text and geographic location information that does not match the acquired search text; perform an editing operation on the acquired search text based on the error correction alignment information, wherein the editing operation includes at least one of the operations of adding characters, deleting characters, replacing characters, and retaining original characters on the acquired search text; and construct a training sample based on the search text after the editing operation and the geographic location information.

[0140] Optionally, the acquisition module 402 is used to obtain search text for map search, and to obtain corresponding historical map search text based on historical map search behavior data, and to obtain geographic location information of POI corresponding to the historical map search behavior data; discretize the geographic location indicated by the geographic location information to obtain geographic area information; and the construction module 404 constructs a training sample based on the search text and the geographic area information.

[0141] Optionally, the first machine learning model is a dual-tower machine learning model, the text feature branch is a language model branch for obtaining text features of the search text, and the spatial feature branch is a feature vector branch for obtaining geographic spatial features of the geographic location information.

[0142] Optionally, the text feature branch adopts a transformer model structure.

[0143] Optionally, the training module 406 trains the first machine learning model, including: training the first machine learning model for map search based on a preset loss function, wherein the loss function includes: a loss function for indicating the similarity between the search text and the geographic location information, a loss function for indicating the similarity between adjacent geographic areas in spatial position, and a loss function for indicating the editing operation type of the search text; wherein the editing operation type includes: at least one of: a character addition type, a character deletion type, a character replacement type, and an original character retention type.

[0144] Optionally, the model training device of this embodiment also includes: an output application module 408, which is used to train a second machine learning model for assisting map search based on the output of the trained first machine learning model.

[0145] Optionally, the second machine learning model is a sorting model; the output application module 408 trains the second machine learning model for map search based on the output of the trained first machine learning model, including: constructing a first training sample and a second training sample for training the sorting model, wherein the first training sample includes: a map search text sample and an attribute data sample of the POI to be searched by the map search text sample; the second training sample includes: a search initiation position data sample and a POI position data sample corresponding to the map search text sample; the first training sample is input into the text feature branch to obtain a feature vector indicating the semantics of the map search text sample and a feature vector indicating the attribute features of the attribute data sample of the POI; the second training sample is input into the spatial feature branch to obtain a feature vector indicating the search initiation position and a feature vector indicating the POI position; based on the obtained feature vectors, the correlation between the map search text sample and the POI is calculated; and the sorting model is trained based on the correlation.

[0146] Optionally, the attribute data samples of the POI include: a name data sample and an address data sample of the POI, and the feature vector used to indicate the attribute characteristics of the attribute data samples of the POI includes: a feature vector used to indicate the name of the POI and a feature vector used to indicate the geographic location of the POI.

[0147] Optionally, the second machine learning model is an error correction model; the output application module 408 trains the second machine learning model for map search based on the output of the trained first machine learning model, including: taking the map search text sample as input, obtaining the corresponding error correction text and the confidence corresponding to the error correction text through the text translation model used for text error correction; and taking the map search text sample as input, obtaining the corresponding sample search text feature through the text feature branch in the trained first machine learning model; inputting the error correction text into the text feature branch to obtain the corresponding error correction text feature; and training the error correction model according to the similarity between the sample search text feature and the error correction text feature.

[0148] Optionally, when the output application module 408 trains the error correction model based on the similarity between the sample search text feature and the error correction text feature: obtain the similarity between the sample search text feature and the error correction text feature; reorder the error correction text according to the similarity and the confidence corresponding to the error correction text, and train the error correction model based on the reordering result.

[0149] Optionally, the second machine learning model is an entity recognition model; the output application module 408 trains the second machine learning model for map search based on the output of the trained first machine learning model, including: taking the map search text sample as input, obtaining the corresponding word vector through the text feature branch in the trained first machine learning model; performing entity recognition based on the word vector to obtain an entity recognition result; and training the entity recognition model based on the entity recognition result.

[0150] The model training device of this embodiment is used to implement the corresponding model training methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here. In addition, the functional implementation of each module in the model training device of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be repeated here.

[0151] Embodiment 5

[0152] Reference Figure 5 , shows a structural block diagram of a model application device according to embodiment 5 of the present application.

[0153] The model application device of this embodiment includes: a data determination module 502, which is used to obtain a map search request, and determine the requested POI location information and the map search request and the POI location information according to the map search request; an input module 504, which is used to input the map search request and the POI location information into a preset first machine learning model, wherein the first machine learning model is a model for performing map search; a feature acquisition module 506, which is used to obtain the search text features and corresponding geographic spatial features of the map search request output by the first machine learning model; and a result module 508, which is used to obtain map search results based on the search text features and the geographic spatial features. The first machine learning model can be a model trained by the model training device according to the fourth embodiment.

[0154] Optionally, in one embodiment, the result module 508 is used to obtain a search ranking result based on the search text feature and the geographic space feature using a ranking model trained by the model training device described in Example 4.

[0155] Optionally, in one method, the result module 508 is used to perform error correction processing on the map search request based on the search text features and the geographic spatial features, using the error correction model obtained by training the model training device described in Example 4, and obtain map search results based on the map search request after error correction processing.

[0156] Optionally, in one embodiment, the result module 508 is used to perform entity recognition on the map search request based on the search text features and the geographic spatial features using the entity recognition model trained by the model training device described in Example 4, and obtain map search results based on the entity recognition results.

[0157] The model application device of this embodiment is used to implement the corresponding model application methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here. In addition, the functional implementation of each module in the model application device of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be repeated here.

[0158] Embodiment 6

[0159] Reference Figure 6 , shows a structural diagram of a map search system according to embodiment six of the present application.

[0160] The map search system of this embodiment includes an offline part and an online part. In the offline part, the first machine learning model part for outputting map search text features and geographic spatial features matching the map search text features is pre-trained based on the training samples constructed after data processing of online logs and POI data, and after the training is completed, the second machine learning model part is trained based on it, including but not limited to the sorting model, error correction model and entity recognition model. The specific training process of these models can be found in the corresponding description of the relevant parts in the aforementioned multiple embodiments, and will not be repeated here.

[0161] After the first machine learning model for outputting map search text features and geographic spatial features matching the map search text features, and the second machine learning model such as the sorting model, the error correction model, and the entity recognition model are trained, they can be deployed to a platform or application or search engine with a map search function to provide online map search services. Accordingly, the online part of the map search system of this embodiment can provide a variety of map search-related functions including entity recognition, error correction, sorting, text recall, spatial recall, etc. based on these trained models.

[0162] It can be seen that the map search system of this embodiment can provide efficient and complete map search services to meet different map search needs.

[0163] Embodiment 7

[0164] Reference Figure 7 , shows a schematic diagram of the structure of an electronic device according to Embodiment 7 of the present application. The specific embodiments of the present application do not limit the specific implementation of the electronic device.

[0165] like Figure 7 As shown, the electronic device may include: a processor (processor) 702 , a communication interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .

[0166] in:

[0167] The processor 702 , the communication interface 704 , and the memory 706 communicate with each other via a communication bus 708 .

[0168] The communication interface 704 is used to communicate with other electronic devices or servers.

[0169] Processor 702 is used to execute program 710, and specifically can execute relevant steps in the above-mentioned model training method embodiment or model application method embodiment.

[0170] Specifically, the program 710 may include program codes, which include computer operation instructions.

[0171] The processor 702 may be a CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0172] The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0173] Program 710 can be specifically used to enable processor 702 to execute the model training method described in Example 1 or 2, or to execute the model application method described in Example 3.

[0174] The specific implementation of each step in program 710 can refer to the corresponding descriptions in the corresponding steps and units in the above-mentioned model training method embodiment or model application method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, and have the corresponding effects of the above-mentioned method embodiment, which will not be repeated here.

[0175] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.

[0176] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a special-purpose processor or programmable or special-purpose hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the model training or application method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the model training or application method shown here, the execution of the code converts the general-purpose computer into a special-purpose computer for executing the model training or application method shown here.

[0177] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.

[0178] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.

Claims

1. A model training method, comprising: Obtain search text for map search, and obtain geographic location information based on historical map search behavior data and POI information; Constructing a training sample according to the search text and the geographic location information; Using the training samples to train a first machine learning model for performing map search; Based on the output of the trained first machine learning model, training a second machine learning model for assisting map search; Wherein, the first machine learning model includes a text feature branch and a spatial feature branch; The using the training sample to train a first machine learning model for performing map search comprises: The search text in the training sample is used as the input of the text feature branch in the first machine learning model, and the geographic location information in the training sample is used as the input of the spatial feature branch in the first machine learning model. The first machine learning model is trained to obtain a model that can output map search text features for map search and geographic spatial features that match the map search text features.

2. The method according to claim 1, wherein: The step of constructing a training sample according to the search text and the geographical location information includes: Respectively determining geographic location information that matches the acquired search text and geographic location information that does not match the acquired search text; A training sample is constructed based on the obtained search text and the matching geographical location information, and the obtained search text and the unmatched geographical location information.

3. The method according to claim 1, wherein: The step of constructing a training sample according to the search text and the geographical location information includes: Performing an editing operation on the acquired search text according to the error correction alignment information, wherein the editing operation includes performing at least one of the operations of adding characters, deleting characters, replacing characters, and retaining original characters on the acquired search text; A training sample is constructed based on the search text after the editing operation and the geographical location information.

4. The method according to claim 1, wherein: The obtaining of geographical location information based on the historical map search behavior data and the POI information includes: obtaining a corresponding historical map search text according to the historical map search behavior data, and obtaining geographical location information of the POI corresponding to the historical map search behavior data; discretizing the geographical location indicated by the geographical location information to obtain geographical area information; The constructing a training sample according to the search text and the geographical location information includes: constructing a training sample according to the search text and the geographical area information.

5. The method according to claim 1, wherein: The first machine learning model is a dual-tower machine learning model, the text feature branch is a language model branch for obtaining text features of the search text, and the spatial feature branch is a feature vector branch for obtaining geographic spatial features of the geographic location information.

6. The method according to claim 5, wherein: The text feature branch adopts the transformer model structure.

7. The method according to claim 5, wherein: The using the training sample to train a first machine learning model for performing map search comprises: The first machine learning model for map search is trained based on a preset loss function, wherein the loss function includes: a loss function for indicating the similarity between the search text and the geographic location information, a loss function for indicating the similarity between adjacent geographic areas in spatial position, and a loss function for indicating the editing operation type of the search text; wherein the editing operation type includes: at least one of a character addition type, a character deletion type, a character replacement type, and an original character retention type.

8. The method according to claim 1, wherein: The second machine learning model is a ranking model; The step of training a second machine learning model for assisting map search based on the output of the first machine learning model after training includes: Constructing a first training sample and a second training sample for training the sorting model, wherein the first training sample includes: a map search text sample and an attribute data sample of a POI to be searched by the map search text sample; the second training sample includes: a search initiation location data sample corresponding to the map search text sample and a POI location data sample; Input the first training sample into the text feature branch to obtain a feature vector indicating the semantics of the map search text sample and a feature vector indicating the attribute features of the attribute data sample of the POI; input the second training sample into the spatial feature branch to obtain a feature vector indicating the search initiation position and a feature vector indicating the POI position; Calculating the relevance between the map search text sample and the POI according to each obtained feature vector; The ranking model is trained according to the relevance.

9. The method according to claim 8, wherein: The attribute data samples of the POI include: a name data sample and an address data sample of the POI, and the feature vector used to indicate the attribute characteristics of the attribute data samples of the POI includes: a feature vector used to indicate the name of the POI and a feature vector used to indicate the geographical location of the POI.

10. The method according to claim 8, wherein: The second machine learning model is an error correction model; The step of training a second machine learning model for assisting map search based on the output of the first machine learning model after training includes: Taking a map search text sample as input, obtaining a corresponding correction text and a confidence level corresponding to the correction text through a text translation model used for text correction; and taking the map search text sample as input, obtaining a corresponding sample search text feature through a text feature branch in the first machine learning model that has been trained; Inputting the error correction text into the text feature branch to obtain corresponding error correction text features; The error correction model is trained according to the similarity between the sample search text features and the error correction text features.

11. The method according to claim 10, wherein: The step of training the error correction model according to the similarity between the sample search text feature and the error correction text feature comprises: Obtaining the similarity between the sample search text feature and the error correction text feature; The error correction texts are reordered according to the similarities and the confidences corresponding to the error correction texts, and the error correction model is trained according to the reordering results.

12. The method according to claim 1, wherein: The second machine learning model is an entity recognition model; The step of training a second machine learning model for assisting map search based on the output of the first machine learning model after training includes: Taking the map search text sample as input, obtaining a corresponding word vector through the text feature branch in the trained first machine learning model; Perform entity recognition according to the word vector to obtain an entity recognition result; The entity recognition model is trained according to the entity recognition result.

13. A model application method, comprising: Obtaining a map search request, and determining requested POI location information according to the map search request; Inputting the map search request and the POI location information into a preset first machine learning model, wherein the first machine learning model is a model for performing map search, and the first machine learning model is trained using the model training method according to any one of claims 1 to 12; Obtaining search text features and corresponding geographic spatial features of the map search request output by the first machine learning model; Based on the search text feature and the geographic space feature, a map search result is obtained.

14. A computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the model training method as described in any one of claims 1 to 12; or, when executed by a processor, implements the model application method as described in claim 13.

Citation Information

Patent Citations

  • Method for extracting spatial relationship of geographic position points and method and device for training extraction model

    CN111737383A

  • Destination region recommendation method and device

    CN113987333A