A search result reordering method, device, equipment and storage medium
By calculating the similarity, fuzzy matching and longest information matching between the search results and the search statement in the search engine, determining the reordering score and reordering, the problem of poor sorting effect in the prior art is solved, and the user experience and sorting robustness is improved.
Patent Information
- Application Number
- CN202210423418.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-21
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2042-04-21
AI Technical Summary
When sorting, the machine learning model training results are not ideal, the word vector distance sorting lacks explanatory, and the basis is too single, resulting in poor sorting effect, especially in the case of synonyms, polyphony words, expression differences and grammatical diversity.
Reorder by obtaining the text content in the target field and search statement in multiple search results, calculating similarity, fuzzy match, and longest information match, combining these metrics to determine the reorder score of each search result.
It improves the sorting effect of search results, improves users' experience of search engines, and enhances the robustness and explanatory nature of sorting.
Smart Images

Figure CN114880459B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a search result reordering method, device, equipment and storage medium. Background Art
[0002] With the development of digital technology, people are exposed to massive amounts of information data every day. How to quickly and accurately obtain data of interest from this data is a problem that various search engines need to solve during the development process.
[0003] After receiving the search statement input by the user, the existing search engine first selects some results that meet the search conditions from the massive candidate result set according to the search statement, and then sorts the selected multiple search results and displays them to the user. When sorting, the existing search engine usually uses a machine learning model to predict the score of the search results, or converts the search results and search statements into multiple word vectors based on word embedding, and re-sorts the search results according to the word vector distance.
[0004] However, since the machine learning model training process requires a large amount of sample data, the user behavior data obtained by existing search engines is limited, resulting in unsatisfactory machine learning model training results; when sorting based on word vector distance, since the word vector distance is calculated based on the overall text of the search results, the ranking lacks explanatory power, resulting in a gap between the sorting results and user needs; secondly, the existing search result sorting basis is too single. When the search results and search statements contain synonyms, multiple meanings of a word, differences in expression methods, and diverse sentence structures and grammar, the sorting effect is poor. Summary of the invention
[0005] The embodiments of the present invention provide a search result reordering method, apparatus, device and storage medium, which can improve the ordering effect of search results and enhance the user experience of using the search engine.
[0006] In a first aspect, an embodiment of the present invention provides a method for reordering search results, the method comprising:
[0007] Respectively obtaining a plurality of target fields from the plurality of search results, and determining the similarity and fuzzy matching degree between each of the target fields and the search statement according to the text content included in the target field and the search statement;
[0008] Respectively obtaining the longest continuous text information included in the target field and the search statement, and determining the longest information matching degree between each of the target fields and the search statement according to the longest continuous text information;
[0009] According to the similarity, fuzzy matching and longest information matching between the target field and the search statement in each search result, a re-ranking score corresponding to each search result is determined, and the multiple search results are re-ranked according to the re-ranking score.
[0010] In a second aspect, an embodiment of the present invention further provides a device for reordering search results, the device comprising:
[0011] A field acquisition module, used to respectively acquire multiple target fields from multiple search results, and determine the similarity and fuzzy matching degree between each of the target fields and the search statement according to the text content included in the target field and the search statement;
[0012] An information acquisition module, used to respectively acquire the longest continuous text information included in the target field and the search statement, and determine the longest information matching degree between each of the target fields and the search statement according to the longest continuous text information;
[0013] The sorting module is used to determine the re-ranking score corresponding to each search result according to the similarity, fuzzy matching and longest information matching between the target field and the search statement in each search result, and re-rank multiple search results according to the re-ranking score.
[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0015] one or more processors;
[0016] A storage device for storing one or more programs;
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the search result reordering method provided by any embodiment of the present invention when executing the programs.
[0018] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the program is executed by a processor, the method for reordering search results provided by any embodiment of the present invention is implemented.
[0019] In a fifth aspect, an embodiment of the present invention further provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the method for reordering search results provided by any embodiment of the present invention is implemented.
[0020] The technical solution of the embodiment of the present invention obtains multiple target fields from multiple search results respectively, and determines the similarity and fuzzy matching degree between each target field and the search statement according to the text content included in the target field and the search statement; obtains the longest continuous text information included in the target field and the search statement respectively, and determines the longest information matching degree between each target field and the search statement according to the longest continuous text information; determines the re-ranking score corresponding to each search result according to the similarity, fuzzy matching degree and longest information matching degree between the target field and the search statement in each search result, and re-ranks multiple search results according to the re-ranking score. The technical means can improve the sorting effect of the search results and enhance the user experience of the search engine.
[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 is a flowchart of a method for reordering search results provided according to Embodiment 1 of the present invention;
[0024] Figure 2 is a flowchart of a method for reordering search results provided according to Embodiment 2 of the present invention;
[0025] Figure 3 is a flowchart of a method for reordering search results provided in accordance with Embodiment 3 of the present invention;
[0026] Figure 4 is a schematic diagram of the structure of a search result reordering device provided according to a fourth embodiment of the present invention;
[0027] Figure 5 It is a structural schematic diagram of an electronic device for implementing the search result reordering method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0029] Embodiment 1
[0030] Figure 1 This is a flowchart of a search result reordering method provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of reordering search results recalled by a search engine. The method can be performed by a search result reordering device. The search result reordering device can be implemented by software and / or hardware, and can generally be integrated in an electronic device with data processing function, and specifically includes the following steps:
[0031] Step 110: Obtain multiple target fields from multiple search results respectively, and determine the similarity and fuzzy matching degree between each target field and the search statement according to the text content included in the target field and the search statement.
[0032] In this embodiment, the search results can be obtained from a preset database by the search engine according to the search statement input by the user, and the search results may include articles, comments, and news reports, etc. After obtaining multiple search results recalled by the search engine according to the search statement, multiple target fields can be obtained in the search results according to the text search scenario matched by the search results, and the target fields are used to summarize the text content expressed by the search results.
[0033] In a specific embodiment, assuming that the search result is an article, the title and abstract in the search result can be used as the target field; assuming that the search result is a comment or a news report, the tag in the search result can be used as the target field.
[0034] In this step, optionally, after obtaining multiple target fields in the search results, the text content in the target field can be compared with the text content in the search statement, and the similarity and fuzzy matching degree between the target field and the search statement can be calculated based on the comparison result. Among them, if the target field and the search statement have more identical characters, it can be considered that the similarity between the target field and the search statement is higher; if the semantic difference between the target field and the search statement is smaller, it can be considered that the fuzzy matching degree between the target field and the search statement is higher.
[0035] Step 120: respectively obtain the longest continuous text information included in the target field and the search statement, and determine the longest information matching degree between each of the target fields and the search statement according to the longest continuous text information.
[0036] In this step, the longest continuous text information may be the longest text composed of uninterrupted words. After obtaining the longest continuous text information respectively included in the target field and the search sentence, the longest continuous text information in the target field may be optionally compared with the longest continuous text information in the search sentence, and the longest information matching degree between the target field and the search sentence is determined according to the comparison result.
[0037] In a specific embodiment, if the longest continuous text information of the target field includes more identical words as the longest continuous text information of the search sentence, it can be considered that the longest information matching degree between the target field and the search sentence is higher.
[0038] Step 130: Determine a re-ranking score corresponding to each search result based on the similarity, fuzzy matching and longest information matching between the target field and the search statement in each search result, and re-rank the multiple search results based on the re-ranking score.
[0039] In this embodiment, after determining the similarity, fuzzy match and longest information match between each target field in the search results and the search statement, optionally, a weighted summation of the similarities between each target field in the search results and the search statement can be performed to obtain the similarity between the search results and the search statement; then a weighted summation of the fuzzy match between each target field and the search statement is performed to obtain the fuzzy match between the search results and the search statement; then a weighted summation of the longest information match between each target field and the search statement is performed to obtain the longest information match between the search results and the search statement; then a weighted summation of the similarity, fuzzy match and longest information match between the search results and the search statement is performed to obtain a re-ranking score corresponding to the search result; finally, multiple search results are re-ranked according to the re-ranking score corresponding to each search result.
[0040] In this embodiment, after the multiple search results are re-sorted, a preset number of search results can be selected as target search results according to the sorting order from front to back, and the multiple target search results can be displayed to the user through the search engine.
[0041] In this embodiment, by calculating the fuzzy matching degree between the search results and the search statement, the problem of inaccurate search result sorting when there are synonyms, multiple meanings of a word, differences in expression methods, diversified sentence grammar, etc. in the search results and the search statement can be avoided, thereby improving the robustness of the search result re-sorting method; secondly, by calculating the longest information matching degree between the search results and the search statement, the correlation between the re-sorting score and the key text information can be improved. Compared with the sorting method of the existing search engine, the search results with higher matching accuracy with the search statement can be ranked at a front position, thereby improving the user experience of the search engine; by combining the similarity, fuzzy matching degree and longest information matching degree to determine the re-sorting score of the search result, the problem of poor sorting effect caused by too single sorting basis can be avoided.
[0042] The technical solution of the embodiment of the present invention obtains multiple target fields from multiple search results respectively, and determines the similarity and fuzzy matching degree between each target field and the search statement according to the text content included in the target field and the search statement; obtains the longest continuous text information included in the target field and the search statement respectively, and determines the longest information matching degree between each target field and the search statement according to the longest continuous text information; determines the re-ranking score corresponding to each search result according to the similarity, fuzzy matching degree and longest information matching degree between the target field and the search statement in each search result, and re-ranks multiple search results according to the re-ranking score. The technical means can improve the sorting effect of the search results and enhance the user experience of the search engine.
[0043] Embodiment 2
[0044] This embodiment is a further refinement of the above embodiment. The explanation of terms that are the same or corresponding to those in the above embodiment will not be repeated in this embodiment. Figure 2 This is a flow chart of a search result reordering method provided in the second embodiment. In this embodiment, the technical solution of this embodiment can be combined with one or more methods in the solutions of the above embodiments, such as Figure 2 As shown, the method provided in this embodiment may also include:
[0045] Step 210: Obtain multiple target fields from the multiple search results respectively, and determine the similarity and fuzzy matching degree between each target field and the search statement according to the text content included in the target field and the search statement.
[0046] In one implementation of the embodiment of the present invention, determining the similarity between each target field and the search statement according to the text content included in the target field and the search statement includes:
[0047] Step 211: Perform word segmentation on the text content included in the target field and the search statement respectively to obtain multiple target word segments and search word segments, and calculate the word vectors corresponding to each target word segment and search word segment.
[0048] In this step, a preset word segmentation technique can be used to perform word segmentation on the text content included in the target field and the search statement, then eliminate the invalid word segments in the target word segments and search word segments, and calculate the word vectors corresponding to the remaining target word segments and search word segments using the word vector model word2vec. Among them, the invalid word segments can be common modal particles or structural particles, such as "de", "le", "ma", etc.
[0049] Step 212: Calculate the word vector distance between each target word segment and search word segment according to the word vectors corresponding to each target word segment and search word segment, and calculate the transfer distance between each target word segment and search word segment.
[0050] In this step, optionally, the Euclidean distance between the word vector of the target word segment and the word vector of the search word segment can be calculated, and the Euclidean distance is used as the word vector distance between the target word segment and the search word segment. Then, the word mover's distance algorithm (Word Mover's Distance, WMD) is used to calculate the transfer distance between each target word segment and search word segment.
[0051] Step 213: Multiply the word vector distance and the transfer distance between each target word segment and search word segment to obtain the word mover's distance between each target word segment and search word segment; among them, the word mover's distance between each target word segment and search word segment in the target field is used to represent the similarity between the target field and the search statement.
[0052] In this embodiment, after calculating the word mover's distance between each target word segment and search word segment in the target field, the minimum word mover's distance can be used as the word mover's distance between the target field and the search statement. Among them, the greater the word mover's distance between the target field and the search statement, the lower the similarity between the target field and the search statement can be considered; on the contrary, the smaller the word mover's distance between the target field and the search statement, the higher the similarity between the target field and the search statement can be considered.
[0053] The advantage of this setting is that by calculating the word shift distance between the target field and the search statement, the domain migration capability of the word2vec model can be fully utilized to improve the accuracy of the text similarity calculation results; secondly, since the word2vec model is an unsupervised model, it does not require a large amount of labeled data, which can reduce manpower investment and there is no cold start problem; finally, since the word2vec model only requires word vectors as input and does not require any hyperparameters to be tuned, it can improve the calculation efficiency of similarity and the flexibility of the similarity algorithm.
[0054] In one implementation of an embodiment of the present invention, the fuzzy matching degree between each target field and the search statement is determined based on the text content included in the target field and the search statement, including: calculating the minimum edit distance between each target word and the search word in the target field, and the minimum edit distance is used to characterize the fuzzy matching degree between the target field and the search statement.
[0055] In this embodiment, the minimum edit distance (MED) algorithm can be used to calculate the minimum edit distance between each target word and the search word in the target field. The minimum edit distance refers to the minimum number of single-character edit operations required to convert one word into another word between two words, where editing includes deleting a character, inserting a character, rewriting a character into another character, etc.
[0056] The advantage of this setting is that when there are synonyms, multiple meanings of a word, large differences in expression methods, and diverse sentence grammar in the search statements and search results, the matching degree of each search result of the search statement can be accurately measured, thereby enhancing the robustness of the search result sorting method and expanding the application coverage of the search result sorting method.
[0057] Step 220: Obtain the longest continuous text information included in each target field and search statement respectively.
[0058] Step 230: Obtain the first information length corresponding to the longest continuous text information in each target field, and obtain the second information length corresponding to the longest continuous text information in the search statement.
[0059] Step 240: Calculate the longest information matching degree between each target field and the search statement using the Wilson interval algorithm according to each of the first information length and the second information length.
[0060] In a specific embodiment, taking the target field as a title as an example, assuming that the length of the longest continuous text information in the title is Cand i·title·lststr·len, the length of the longest continuous text information in the search sentence is L, then the longest information matching degree between the title and the search sentence is Cand i ·title·lmr can be calculated using the lower limit of the Wilson interval. The specific calculation method is as follows:
[0061]
[0062] in, is the attribute distribution probability, which can be calculated by the following formula:
[0063]
[0064] in, The z statistic corresponding to a certain confidence level is a preset constant. Generally, at a 95% confidence level, the value of the z statistic is 1.96.
[0065] Step 250: Determine a re-ranking score corresponding to each search result based on the similarity, fuzzy matching and longest information matching between the target field and the search statement in each search result, and re-rank the multiple search results based on the re-ranking score.
[0066] The technical solution of the embodiment of the present invention obtains multiple target fields from multiple search results respectively, determines the similarity and fuzzy matching between each target field and the search statement according to the text content included in the target field and the search statement, obtains the longest continuous text information included in each target field and the search statement respectively, obtains the first information length corresponding to the longest continuous text information in each target field, obtains the second information length corresponding to the longest continuous text information in the search statement, calculates the longest information matching degree between each target field and the search statement according to the first information length and the second information length, determines the re-ranking score corresponding to each search result according to the similarity, fuzzy matching degree and longest information matching degree between the target field and the search statement in each search result, and re-ranks multiple search results according to the re-ranking score. The technical solution can improve the sorting effect of the search results and enhance the user experience of the search engine.
[0067] Embodiment 3
[0068] This embodiment is a further refinement of the above embodiment. The explanation of terms that are the same or corresponding to those in the above embodiment will not be repeated in this embodiment. Figure 3 This is a flowchart of a search result reordering method provided in the third embodiment. In this embodiment, the technical solution of this embodiment can be combined with one or more methods in the solutions of the above embodiments, such as Figure 3As shown, the method provided in this embodiment may also include:
[0069] Step 310: Obtain multiple target fields from multiple search results respectively, perform word segmentation processing on the text content included in each target field and the search statement respectively, obtain multiple target word segments and search word segments, and calculate the word vectors corresponding to each target word segment and search word segment.
[0070] Step 320: Calculate the word vector distance between each target word and the search word according to the word vectors corresponding to each target word and the search word, and calculate the transfer distance between each target word and the search word.
[0071] Step 330: multiply the word vector distance between each target word segment and the search word segment by the transfer distance to obtain the word transfer distance between each target word segment and the search word segment.
[0072] Step 340: Calculate the minimum edit distance between each target word and the search word in the target field.
[0073] Step 350: Obtain the longest continuous text information included in the target field and the search statement respectively, and determine the longest information matching degree between each target field and the search statement according to the longest continuous text information.
[0074] Step 360: Calculate the relevance between each target field and the search statement based on the word shift distance, the minimum edit distance and the longest information matching degree between each target field and the search statement.
[0075] In this embodiment, optionally, the word shift distance, minimum edit distance and maximum information matching degree between the target field and the search statement can be weighted and summed according to a preset weighting ratio to obtain the correlation degree between the target field and the search statement.
[0076] In a preferred implementation of this embodiment, the correlation between each target field and the search statement is calculated according to the word shift distance, the minimum edit distance and the maximum information matching degree between each target field and the search statement, including:
[0077] Step 361: Determine a weighted ratio matching the target field according to the text search scenario corresponding to the target field.
[0078] Step 362: perform weighted summation of the word shift distance, the minimum edit distance and the longest information matching degree between the target field and the search statement according to the weighted ratio to obtain the correlation degree between the target field and the search statement.
[0079] In a specific embodiment, the title and abstract in the search results are taken as target fields, and it is assumed that the word shift distance between the title and the search statement is Cand i ·title·WMD, the longest information match is Cand i ·title·lmr, minimum edit distance is Cand i ·title·NMED, then the relevance between the title and the search statement Cand i Title relevance can be calculated using the following formula:
[0080] Cand i ·title·relevance
[0081] =α*Cand i ·title·WMD+β*Cand i ·title·lmr+γ*Cand i ·title·NMED
[0082] Accordingly, assuming that the word shift distance between the abstract and the search statement is Cand i ·abstract·WMD, the longest information match is Cand i ·abstract·lmr, minimum edit distance is Cand i ·abstract·NMED, then the relevance between the abstract and the search statement Cand i Abstract relevance can be calculated using the following formula:
[0083] Cand i ·abstract·relevance
[0084] =α*Cand i ·abstract·WMD+β*Cand i ·abstract·lmr+γ*Cand i ·abstract·NMED
[0085] Among them, α+β+γ=1. If the text search scenario corresponding to the above search results is a short text scenario, the value of β in the weighted ratio can be increased (specifically, it can be increased to more than 50%); if the text search scenario corresponding to the above search results is a long text scenario, the value of α in the weighted ratio can be increased (specifically, it can be increased to more than 50%); if the text search scenario corresponding to the above search results is a content diversity scenario, the value of γ in the weighted ratio can be increased (specifically, it can be increased to more than 50%).
[0086] Step 370: Calculate the re-ranking score corresponding to each search result according to the relevance between each target field and the search statement.
[0087] In this step, optionally, the relevance between each target field in the search results and the search statement may be accumulated to obtain a re-ranking score corresponding to the search results.
[0088] In a preferred implementation of this embodiment, the re-ranking score corresponding to each search result is calculated according to the relevance between each target field and the search statement, including:
[0089] Step 371: Determine a weight factor corresponding to each target field in the search result according to the text search scenario corresponding to the search result;
[0090] In this embodiment, the title and abstract in the search results are taken as the target fields as an example, assuming that the weight factor corresponding to the title is δ and the weight factor corresponding to the abstract is λ. If the search results are news reports or blogs, that is, when the text search scenario corresponding to the search results is mainly based on the title, δ≥10λ can be configured; if the search results are articles or comments, that is, when the title accounts for a small proportion of the text search scenario corresponding to the search results, δ≥λ can be configured.
[0091] Step 372: performing weighted summation of the relevance between each target field and the search statement according to the weight factor corresponding to each target field to obtain the target relevance;
[0092] In this embodiment, it is assumed that the correlation between the title and the search phrase in the search results is Cand i · title· relevance, the relevance between the summary and the search statement is Cand i ·abstract·relevance, then δ*Cand i ·title·relevance+λ*Cand i ·abstract·relevance as the relevance of the target.
[0093] Step 373: Obtain the original ranking score determined by the search engine for the search result, and calculate the re-ranking score corresponding to the search result according to the original ranking score and the target relevance.
[0094] In this embodiment, it is assumed that the original ranking score determined by the search engine for the search results is Cand i score, the re-ranking score Cand corresponding to the search result i Rerank can be calculated using the following formula:
[0095] Cand i rerank
[0096] =Cand i score*(∈+δ*Cand i ·title·relevance+λ*Cand i ·abstract·relevance)
[0097] Among them, ∈ is a preset reconciliation factor. When the text search scenario corresponding to the search result is a short text scenario, ∈ can be set to a value between [0, 1]; when the text search scenario corresponding to the search result is a long text scenario, ∈ can be set to a larger value greater than 10.
[0098] Step 380: reorder the multiple search results according to the reordering score corresponding to each search result.
[0099] The technical solution of the embodiment of the present invention obtains multiple target fields from multiple search results, performs word segmentation processing on the text content included in each target field and the search statement, calculates the word vector distance between each target word segmentation and the search word segmentation, calculates the transfer distance between each target word segmentation and the search word segmentation, multiplies the word vector distance and the transfer distance to obtain the word transfer distance, calculates the minimum edit distance between each target word segmentation and the search word segmentation, obtains the longest continuous text information included in the target field and the search statement, determines the longest information matching degree between each target field and the search statement, calculates the correlation between each target field and the search statement according to the word transfer distance, the minimum edit distance and the longest information matching degree between each target field and the search statement, calculates the reordering score corresponding to each search result according to the reordering score, and reorders multiple search results according to the reordering score. The technical means can improve the sorting effect of search results and enhance the user experience of search engines.
[0100] Embodiment 4
[0101] Figure 4A schematic diagram of the structure of a search result reordering device provided in Embodiment 4 of the present invention, such as Figure 4 As shown, the device includes: a field acquisition module 410, an information acquisition module 420 and a sorting module 430.
[0102] The field acquisition module 410 is used to respectively acquire multiple target fields from multiple search results, and determine the similarity and fuzzy matching degree between each target field and the search statement according to the text content included in the target field and the search statement;
[0103] The information acquisition module 420 is used to respectively acquire the longest continuous text information included in the target field and the search sentence, and determine the longest information matching degree between each of the target fields and the search sentence according to the longest continuous text information;
[0104] The sorting module 430 is used to determine the re-ranking score corresponding to each search result according to the similarity, fuzzy matching and longest information matching between the target field and the search statement in each search result, and re-rank the multiple search results according to the re-ranking score.
[0105] The technical solution provided by the embodiment of the present invention obtains multiple target fields from multiple search results respectively, determines the similarity and fuzzy matching degree between each target field and the search statement according to the text content included in the target field and the search statement, obtains the longest continuous text information included in each target field and the search statement respectively, obtains the first information length corresponding to the longest continuous text information in each target field, obtains the second information length corresponding to the longest continuous text information in the search statement, calculates the longest information matching degree between each target field and the search statement according to the first information length and the second information length, determines the re-ranking score corresponding to each search result according to the similarity, fuzzy matching degree and longest information matching degree between the target field and the search statement in each search result, and re-ranks multiple search results according to the re-ranking score. The technical means can improve the sorting effect of the search results and enhance the user experience of the search engine.
[0106] Based on the above embodiment, the field acquisition module 410 includes:
[0107] A word segmentation unit is used to perform word segmentation processing on the text content included in the target field and the search statement, obtain multiple target word segments and search word segments, and calculate the word vectors corresponding to each target word segment and search word segment;
[0108] A distance calculation unit, used to calculate the word vector distance between each target word and the search word according to the word vectors corresponding to each target word and the search word, and calculate the transfer distance between each target word and the search word;
[0109] A distance processing unit, used for multiplying the word vector distance between each of the target segmentation words and the search segmentation words with the transfer distance to obtain the word transfer distance between each of the target segmentation words and the search segmentation words; wherein the word transfer distance between each of the target segmentation words and the search segmentation words in the target field is used to represent the similarity between the target field and the search statement;
[0110] The edit distance calculation unit is used to calculate the minimum edit distance between each target word and the search word in the target field, and the minimum edit distance is used to represent the fuzzy matching degree between the target field and the search statement.
[0111] The information acquisition module 420 includes:
[0112] A length acquisition unit, used to acquire a first information length corresponding to the longest continuous text information in the target field, and acquire a second information length corresponding to the longest continuous text information in the search statement;
[0113] The length processing unit is used to calculate the longest information matching degree between the target field and the search statement by using the Wilson interval algorithm according to the first information length and the second information length.
[0114] The sorting module 430 includes:
[0115] A relevance calculation unit, used to calculate the relevance between each target field and the search sentence according to the word shift distance, the minimum edit distance and the maximum information matching degree between each target field and the search sentence;
[0116] A score calculation unit, used to calculate a re-ranking score corresponding to each search result according to the relevance between each target field and the search statement;
[0117] A ratio determination unit, configured to determine a weighted ratio matching the target field according to a text search scenario corresponding to the target field;
[0118] A weighted summing unit, configured to perform weighted summing of the word shift distance, the minimum edit distance and the maximum information matching degree between the target field and the search sentence according to the weighted ratio, so as to obtain the correlation degree between the target field and the search sentence;
[0119] A weight factor determination unit, used to determine a weight factor corresponding to each target field in the search result according to a text search scenario corresponding to the search result;
[0120] A target relevance calculation unit, configured to perform a weighted summation of the relevance between each target field and the search statement according to a weight factor corresponding to each target field, to obtain a target relevance;
[0121] The score acquisition unit is used to acquire the original ranking score determined by the search engine for the search result, and calculate the re-ranking score corresponding to the search result according to the original ranking score and the target relevance.
[0122] The above device can execute the methods provided by all the above embodiments of the present invention, and has the corresponding functional modules and beneficial effects of executing the above methods. For technical details not fully described in the embodiments of the present invention, please refer to the methods provided by all the above embodiments of the present invention.
[0123] Embodiment 5
[0124] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0125] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0126] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0127] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for re-ranking search results.
[0128] In some embodiments, the method for reordering search results may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for reordering search results described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the method for reordering search results in any other appropriate manner (e.g., by means of firmware).
[0129] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0130] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0131] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0132] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0133] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0134] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0135] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0136] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for re-ranking search results, characterized in that: The method comprises: Respectively obtaining a plurality of target fields from the plurality of search results, and determining the similarity and fuzzy matching degree between each of the target fields and the search statement according to the text content included in the target field and the search statement; Respectively obtaining the longest continuous text information included in the target field and the search sentence; wherein the longest continuous text information is the longest text composed of uninterrupted words; Obtaining a first information length corresponding to the longest continuous text information in the target field, and obtaining a second information length corresponding to the longest continuous text information in the search statement; According to the first information length and the second information length, the Wilson interval algorithm is used to calculate the longest information matching degree between the target field and the search statement; Determine a re-ranking score corresponding to each search result according to the similarity, fuzzy matching degree and longest information matching degree between the target field and the search statement in each search result, and re-rank the multiple search results according to the re-ranking score; The step of determining the fuzzy matching degree between each target field and the search statement according to the text content included in the target field and the search statement includes: Perform word segmentation processing on the target field and the text content included in the search statement respectively to obtain multiple target word segments and search word segments; The minimum edit distance between each target word and the search word is calculated, and the minimum edit distance is used to characterize the fuzzy matching degree between the target field and the search statement.
2. The method according to claim 1, characterized in that: Determining the similarity between each target field and the search sentence according to the text content included in the target field and the search sentence includes: Calculate the word vectors corresponding to each target word and search word; According to the word vectors corresponding to each of the target word and the search word, the word vector distance between each target word and the search word is calculated, and the transfer distance between each target word and the search word is calculated; Multiply the word vector distance between each of the target word segments and the search word segments by the transfer distance to obtain the word transfer distance between each of the target word segments and the search word segments; The word shift distance between each target word and the search word in the target field is used to represent the similarity between the target field and the search statement.
3. The method according to claim 1, characterized in that: According to the similarity, fuzzy match and longest information match between the target field and the search statement in each search result, the re-ranking score corresponding to each search result is determined, including: Calculating the relevance between each target field and the search statement according to the word shift distance, the minimum edit distance and the maximum information matching degree between each target field and the search statement; According to the relevance between each of the target fields and the search statement, a re-ranking score corresponding to each search result is calculated.
4. The method according to claim 3, characterized in that Calculating the relevance between each target field and the search statement according to the word shift distance, the minimum edit distance and the maximum information matching degree between each target field and the search statement, including: Determining a weighted ratio matching the target field according to a text search scenario corresponding to the target field; According to the weighted ratio, the word shift distance, the minimum edit distance and the longest information matching degree between the target field and the search sentence are weightedly summed to obtain the correlation degree between the target field and the search sentence.
5. The method according to claim 3, characterized in that: According to the relevance between each of the target fields and the search statement, a re-ranking score corresponding to each search result is calculated, including: Determining a weight factor corresponding to each target field in the search results according to the text search scenario corresponding to the search results; According to the weight factors corresponding to the target fields, weighted summation is performed on the relevance between the target fields and the search statement to obtain the target relevance; An original ranking score determined by the search engine for the search result is obtained, and a re-ranking score corresponding to the search result is calculated according to the original ranking score and the target relevance.
6. A search result reordering device, characterized in that: The device comprises: A field acquisition module, used to respectively acquire multiple target fields from multiple search results, and determine the similarity and fuzzy matching degree between each of the target fields and the search statement according to the text content included in the target field and the search statement; The information acquisition module includes: a length acquisition unit and a length processing unit; The length acquisition unit is used to respectively acquire the longest continuous text information included in the target field and the search sentence; wherein the longest continuous text information is the longest text composed of uninterrupted words; acquire the first information length corresponding to the longest continuous text information in the target field, and acquire the second information length corresponding to the longest continuous text information in the search sentence; The length processing unit is used to calculate the longest information matching degree between the target field and the search statement by using the Wilson interval algorithm according to the first information length and the second information length; A sorting module, used to determine a re-ranking score corresponding to each search result according to the similarity, fuzzy matching degree and longest information matching degree between the target field and the search statement in each search result, and re-rank the multiple search results according to the re-ranking score; The field acquisition module includes: A word segmentation unit is used to perform word segmentation processing on the target field and the text content included in the search statement, respectively, to obtain multiple target word segments and search word segments; The edit distance calculation unit is used to calculate the minimum edit distance between each target word and the search word, and the minimum edit distance is used to represent the fuzzy matching degree between the target field and the search statement.
7. An electronic device, comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the search result reordering method as described in any one of claims 1 to 5 when executing the programs.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for reordering search results as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Sorting method and device, electronic equipment and computer readable storage medium
CN110659389A
Address matching method based on address coding and similarity calculation
CN112835894A
Multi-attribute text matching method and device, equipment and storage medium
CN113268567A
Online shop matching method and device thereof, equipment, medium and product
CN113947456A