Matching text deduplication method, device, and electronic device

By constructing a text connectivity graph and performing graph coloring processing, the problem of high misjudgment rate in short text deduplication processing in the existing technology is solved, and more efficient matching text deduplication is achieved, with a wider applicable field and better deduplication effect.

CN112287655BActive Publication Date: 2024-10-25BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011063538.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-30
Publication Date
2024-10-25
Estimated Expiration
2040-09-30

AI Technical Summary

Technical Problem

The existing technology has a high misjudgment rate in short text deduplication processing, has limited application scenarios, and cannot effectively solve the problem of semantic duplication of matched text.

Method used

By constructing a text connectivity graph, constructing edges between nodes based on similarity, and performing graph coloring processing, texts with the same semantics are identified as the same unique identifier, and deduplication is performed according to preset indicators.

Benefits of technology

It improves the accuracy of matching text deduplication processing, reduces the display of redundant information, and improves the efficiency of users in obtaining information and the utilization efficiency of display resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112287655B_ABST
    Figure CN112287655B_ABST
Patent Text Reader

Abstract

The present application discloses a matching text deduplication method, which belongs to the field of computer technology and helps to improve the accuracy of matching text deduplication processing. The method includes: obtaining a list of matching texts to be processed; constructing nodes corresponding to the texts according to each text in the matching text list, and constructing edges between the nodes corresponding to the texts based on the similarity between the two texts to obtain a text connection graph; coloring all sub-connection graphs included in the text connection graph, and processing the texts corresponding to the nodes in each sub-connection graph as having the same unique identifier; and deduplicating the texts in the matching text list with the same unique identifier according to preset indicators. The matching text deduplication method disclosed in the present application identifies duplicate texts based on text similarity and graph coloring technology, and deduplicates the recommended texts based on the identification results. It has a wider range of applications and better deduplication effects.
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 matching text deduplication method, device, electronic device, and computer-readable storage medium. Background Art

[0002] In the fields of search guidance and recommendation based on query words, the search background usually recalls several texts matching the query text according to the query text, which are used to be displayed to the user on the front end to enrich the recalled query content and guide the user to perform search operations, etc. The text matching the query text recalled by the search background is usually recalled after matching based on the historical search records of platform users based on strategies such as semantic similarity and text similarity. Therefore, the recalled text may have the same semantics as the current query text but different expressions. For example, the recalled matching text may contain query data such as "How to make braised pork" and "Braised pork recipe". That is, when guiding user searches based on the historical search vocabulary, there will be a problem of semantic duplication of matching texts. The semantic duplication of matching texts will result in a small amount of overall information displayed to the user in the matching text list displayed in a limited space. Therefore, it is necessary to deduplicate the matching text.

[0003] The commonly used method for deduplication of matching text in the prior art is to segment the matching text to obtain segmented phrases, then calculate the hash value of each segmented word, and calculate a weighted digital string based on the hash value of each segmented word, which is used as the hash signature of each matching text, and finally, by calculating the distance between the hash signatures, it is determined whether the two texts are repeated, thereby achieving deduplication of matching text. The matching text deduplication method in the prior art has a high misjudgment rate in the short text deduplication processing scenario and has limited application scenarios.

[0004] It can be seen that the matching text deduplication processing method in the prior art needs to be improved. Summary of the invention

[0005] The embodiment of the present application provides a matching text deduplication method, which helps to improve the accuracy of matching text deduplication processing.

[0006] In order to solve the above problems, in a first aspect, an embodiment of the present application provides a matching text deduplication method, comprising:

[0007] Get the list of matching texts to be processed;

[0008] According to each text in the matching text list, a node corresponding to the text is constructed respectively, and based on the similarity between the two texts, edges between the nodes corresponding to the two texts are constructed to obtain a text connection graph;

[0009] Performing coloring processing on all sub-connected graphs included in the text connected graph, processing the text corresponding to the nodes in each of the sub-connected graphs to have the same unique identifier;

[0010] The texts in the matching text list that have the same unique identifier are deduplicated according to preset indicators.

[0011] In a second aspect, an embodiment of the present application provides a matching text deduplication device, comprising:

[0012] A matching text list acquisition module is used to acquire a matching text list to be processed;

[0013] A text connection graph construction module, used to construct a node corresponding to each text in the matching text list, and to construct edges between the nodes corresponding to the two texts based on the similarity between the two texts, so as to obtain a text connection graph;

[0014] A graph coloring processing module, used to perform coloring processing on all sub-connected graphs included in the text connected graph, and process the text corresponding to the nodes in each sub-connected graph to have the same unique identifier;

[0015] The deduplication processing module is used to perform deduplication processing on the texts with the same unique identifier in the matching text list according to preset indicators.

[0016] In a third aspect, an embodiment of the present application further discloses an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the matching text deduplication method described in the embodiment of the present application is implemented.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the matching text deduplication method disclosed in the embodiment of the present application are performed.

[0018] The matching text deduplication method disclosed in the embodiment of the present application obtains a list of matching texts to be processed; constructs a node corresponding to each text in the matching text list, and constructs edges between the nodes corresponding to the two texts based on the similarity between the two texts to obtain a text connection graph; performs coloring on all sub-connection graphs included in the text connection graph, and processes the texts corresponding to the nodes in each sub-connection graph to have the same unique identifier; performs deduplication processing on the texts in the matching text list that have the same unique identifier according to preset indicators, which helps to improve the accuracy of matching text deduplication processing.

[0019] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution 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 part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0021] Figure 1 This is a flow chart of the matching text deduplication method of the first embodiment of the present application;

[0022] Figure 2 It is a schematic diagram of a connection diagram in the matching text deduplication method of the first embodiment of the present application;

[0023] Figure 3 This is a schematic diagram of the display effect of the matching text list before deduplication in Example 1 of the present application;

[0024] Figure 4 This is a schematic diagram of the display effect of the matched text list after deduplication in Example 1 of the present application;

[0025] Figure 5 This is one of the structural schematic diagrams of the matching text deduplication device of the second embodiment of the present application;

[0026] Figure 6 This is the second structural diagram of the matching text deduplication device of the second embodiment of the present application;

[0027] Figure 7 A block diagram schematically shows an electronic device for executing the method according to the present application; and

[0028] Figure 8 A storage unit for holding or carrying a program code for implementing the method according to the present application is schematically shown. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0030] Embodiment 1

[0031] The present application discloses a matching text deduplication method, such as Figure 1 As shown, the method includes: steps 110 to 140.

[0032] Step 110, obtaining a list of matching texts to be processed.

[0033] The matching text list described in the embodiment of the present application can be a list of texts matching the query text recalled by the backend server according to the query text currently input by the user in the search scenario, or a list of texts matching the determined target text in other scenarios. Each text in the matching text list matches the same text. For example, in the search scenario, the user enters the query text "Kung Pao Chicken", and the matching text list recalled by the backend server includes the texts: "Kung Pao Chicken Rice", "How to Make Kung Pao Chicken", "How to Make Kung Pao Chicken Delicious", "How to Make Kung Pao Chicken", etc. It can be seen that the texts included in the matching text list: "Kung Pao Chicken Rice", "How to Make Kung Pao Chicken", "How to Make Kung Pao Chicken Delicious", "How to Make Kung Pao Chicken" all match the query text "Kung Pao Chicken".

[0034] In different application scenarios, the existing technology in the application scenario can be used to obtain the list of matching texts to be processed, which will not be listed one by one in the embodiments of this application. This application does not limit the specific implementation method of obtaining the list of matching texts to be processed.

[0035] In some embodiments of the present application, the obtained matching text list is arranged from front to back in the order of the matching degree of the target texts that match the texts in the matching text list from high to low. For example, when the user inputs the query text "Kung Pao Chicken", the backend server first determines the matching degree of each historical query text with the query text input by the user, and then arranges the historical query texts that meet the preset matching degree conditions from front to back in the order of matching degree from high to low, to generate a matching text list.

[0036] In some embodiments of the present application, each text in the obtained matching text list also carries a click-through rate or a recommendation score. For example, when a user enters the query text "Kung Pao Chicken", the backend server first determines the matching degree of each historical query text with the query text entered by the user, and then adds the historical query text whose matching degree meets the preset matching degree condition to the matching text list, and at the same time, records the click-through rate or recommendation score of each text in the matching text list.

[0037] The specific implementation method of the backend server determining the matching degree of each historical query text with the user input query text is referred to the prior art, which will not be repeated in this embodiment. The specific implementation method of the backend server determining the recommendation score and click rate of each historical query text is referred to the prior art, which will not be repeated in this embodiment.

[0038] Step 120, constructing a node corresponding to each text in the matching text list, and constructing edges between the nodes corresponding to the two texts based on the similarity between the two texts to obtain a text connection graph.

[0039] Next, a text connectivity graph is constructed according to the matching text list.

[0040] First, a node of the text connection graph is constructed according to each text in the matching text list, and the corresponding relationship between each node and the text is stored.

[0041] The edge in the text connection graph is used to indicate that the texts corresponding to the two nodes connected by the edge have similarity. In some embodiments of the present application, a unique identifier is randomly initialized for each text in the matching text list, and the unique identifier is stored in the node corresponding to the text, thereby establishing a corresponding relationship between the node and the unique identifier.

[0042] Then, based on the similarity between each two texts in the matching text list, an edge between the nodes corresponding to the two texts is constructed, that is, based on the similarity between each two texts in the matching text list, it is determined whether to construct an edge between the nodes corresponding to the two texts to connect the nodes corresponding to the two texts.

[0043] In some embodiments of the present application, the step of constructing an edge between the nodes corresponding to the two texts based on the similarity between the two texts includes: the step of constructing an edge between the nodes corresponding to the two texts based on the similarity between the two texts includes: determining whether the two texts satisfy at least one preset similarity condition; in response to the similarity between the two texts satisfying at least one of the preset similarity conditions, constructing an edge connecting the nodes corresponding to the two texts; wherein the preset similarity conditions include: the sets of knowledge entities contained in the two texts are the same, the edit distance between the two texts is less than a preset distance threshold, and the semantic similarity score between the two texts is greater than a preset similarity score threshold.

[0044] When the present application is implemented, there are many cases of text similarity. For example, there are cases where the semantics are the same but the descriptions are different. For example, "Mahjong Hall near Beixinjing" and "Chess and Card Room near Beixinjing". The literal similarity of these two texts is not high, but the actual semantics are the same. For another example,

[0045] There are also cases where the words are very similar but the semantics are different, for example: "beef near Zhongshan Park" and "beef noodles near Zhongshan Park". Therefore, simply matching based on text encoding will lead to errors in similarity judgment. For another example, the text "Zhongshan Park Food" and "Food near Zhongshan Park" are different in terms of the words, but the semantics are the same. In response to similar problems mentioned above, in the embodiments of the present application, multiple similarity conditions can be pre-set. As long as two texts meet one of the similarity conditions, the two texts can be considered to be similar, and an edge can be constructed between the nodes corresponding to the two texts.

[0046] The following describes the judgment schemes for different preset similarity conditions.

[0047] The first preset similarity condition is that the sets of knowledge entities contained in the two texts are the same.

[0048] In some embodiments of the present application, determining whether the two texts satisfy at least one preset similarity condition includes: determining the sets of knowledge entities respectively contained in the two texts; in response to the knowledge entity sets respectively contained in the two texts being the same, determining that the two texts satisfy the preset similarity condition that the sets of knowledge entities contained in the two texts are the same.

[0049] For example, for texts A and B, first determine the knowledge entity set D included in text A A {} and determine the knowledge entity set D included in text B B {}, then compare whether the knowledge entity sets DA{} and DB{} are the same. If the knowledge entity sets DA{} and DB{} are the same, it is considered that texts A and B meet the first preset similarity condition mentioned above (that is, the knowledge entity sets contained in the two texts are the same).

[0050] In specific application scenarios, repeated texts with the order of user expressions reversed often appear, for example, "hot pot near Zhongshan Park" and "hot pot near Zhongshan Park". By adopting the method of judging similarity based on knowledge entity sets in the embodiment of the present application, it is possible to effectively identify that two texts have similarities. For example, through knowledge entity recognition, it can be determined that the knowledge entity sets included in the texts "hot pot near Zhongshan Park" and "hot pot near Zhongshan Park" are both {Zhongshan Park, nearby, hot pot}, that is, the two texts have the same knowledge entity set, then it can be considered that the two texts meet the preset similarity conditions, and an edge can be constructed to connect the nodes corresponding to the two texts.

[0051] The second preset similarity condition: the edit distance between two texts is less than a preset distance threshold.

[0052] In some embodiments of the present application, determining whether the two texts satisfy at least one preset similarity condition includes: determining an edit distance between the two texts; and in response to the edit distance being less than a preset distance threshold, determining that the two texts satisfy a preset similarity condition that the edit distance between the two texts is less than a preset distance threshold.

[0053] For example, for text A and B, first determine the edit distance D between text A and text B AB , then compare the edit distance D AB Is it greater than the preset distance threshold? If less than, it is considered that text A and B meet the above second preset similarity condition (that is, the edit distance between the two texts is less than the preset distance threshold).

[0054] In some embodiments of the present application, determining the edit distance between the two texts includes: combining the Levenshtein edit distance and the Jaro-Winkler edit distance between the two texts as the edit distance between the two texts. For example, when determining the edit distance between text A and text B, first determine the Levenshtein edit distance D between text A and text B respectively. L and the Jaro-Winkler edit distance D w , then the Levenshtein edit distance D between text A and text B is determined L and the Jaro-Winkler edit distance D w The sum of the two is the edit distance D between text A and text B. AB .

[0055] The Levenshtein edit distance is used to indicate the minimum number of single-character conversions required to convert text A to text B, while the Jaro-Winkler edit distance indicates the minimum number of single-character conversions required to convert text A to text B while highlighting the length of the common prefix of the two texts. In the recommendation guidance business scenario, the prefix representation is more important. The Jaro-Winkler edit distance can highlight the importance of the prefix, that is, if the first few characters of two texts are the same, the two texts will have a higher similarity. The smaller the Jaro-Winkler edit distance, the more similar the two texts are.

[0056] For example, for two given texts S1 and S2, their Jaro-Winkler edit distance is calculated by the following formula: w = +lp(1-sim j ), where l represents the number of common prefix characters of the two texts, P is the scaling constant factor, and sim j Indicates Jaro similarity, simj Calculated by the following formula:

[0057] Among them, |s1| and |s2| represent the length of text S1 and S2, m represents the number of matching characters of text S1 and S2, and t represents half of the number of transpositions.

[0058] In an embodiment of the present application, the Levenshtein edit distance is introduced to limit the number of single-character conversions required to modify text A into text B, and the Jaro-Winkler edit distance is introduced to limit the number of single-character conversions and the common prefix length required to modify text A into text B. The similarity judgment is performed by comprehensively combining the Levenshtein edit distance and the Jaro-Winkler edit distance between the texts to improve the accuracy of the similarity judgment.

[0059] In specific application scenarios, repeated texts with different literal expressions but the same semantics often appear, such as "Zhongshan Park Food" and "Zhongshan Park Nearby Food". When the method based on edit distance to judge similarity in the embodiment of the present application is adopted, the Levenshtein edit distance between "Zhongshan Park Food" and "Zhongshan Park Nearby Food" is determined as D L and the Jaro-Winkler edit distance D w After that, we further calculate the Levenshtein edit distance D L and the Jaro-Winkler edit distance D w The sum of the distances is used to represent the similarity between two texts (such as "Zhongshan Park Food" and "Zhongshan Park Food"). The smaller the edit distance between the two texts, the higher the text similarity. When the edit distance is less than the preset distance threshold, it can be determined that the two texts meet the second preset similarity condition. Furthermore, an edge can be constructed to connect the nodes corresponding to the two texts.

[0060] The calculation of the Levenshtein edit distance between two texts can be found in the prior art and will not be described in detail in the embodiments of the present application.

[0061] The third preset similarity condition: the semantic similarity score between the two texts is greater than a preset similarity score threshold.

[0062] In some embodiments of the present application, determining whether the two texts satisfy at least one preset similarity condition includes: determining a semantic similarity score between the two texts; in response to the semantic similarity score being greater than a preset similarity score threshold, determining that the two texts satisfy the preset similarity condition that the semantic similarity score between the two texts is greater than a preset similarity score threshold.

[0063] For example, for text A and B, first determine the semantic similarity score of text A and text B, then compare whether the semantic similarity score is greater than the preset similarity score threshold, if the semantic similarity score of text A and text B is greater than the preset similarity score threshold, then it is considered that text A and B meet the above-mentioned third preset similarity condition, and an edge can be constructed to connect the nodes corresponding to the two texts. In some embodiments of the present application, the semantic similarity score of text A and text B can be determined by the BERT model trained in advance. The specific training method of the BERT model for identifying the semantic similarity score of the input text, referring to the prior art, will not be repeated in the embodiments of the present application.

[0064] In specific application scenarios, there are often situations where the words are similar in meaning but different in meaning (such as "beef near Zhongshan Park" and "beef noodles near Zhongshan Park"), and situations where the words are different in meaning but the same in meaning (such as "mahjong hall near Beixinjing" and "chess and card room near Beixinjing"). By using the method of judging similarity based on semantics in the embodiments of the present application, it is possible to effectively identify that two texts have similarities.

[0065] In some embodiments of the present application, two texts can be compared and judged with each of the above-mentioned preset similarity conditions respectively. Finally, as long as one preset similarity condition is met, the two texts can be considered to have similarity. In other embodiments of the present application, it is also possible to judge whether two texts meet the current preset similarity condition in a certain preset similarity condition order. If they do, the two texts can be considered to have similarity without having to compare and judge with other preset similarity conditions.

[0066] By executing the above steps, a text connection graph corresponding to the matching text list can be obtained. Since some of the texts in the matching text list have similarities and some do not, the nodes corresponding to the texts with similarities are connected by edges to form sub-connection graphs, while the nodes corresponding to the texts with no similarities are isolated. In this way, the text connection graph includes multiple sub-connection graphs, and in each sub-connection graph, two nodes connected on an edge have similarities.

[0067] Step 130, coloring is performed on all sub-connected graphs included in the text connected graph, and the texts corresponding to the nodes in each of the sub-connected graphs are processed to have the same unique identifier.

[0068] In some embodiments of the present application, all sub-connected graphs included in the textual connection graph are subjected to coloring processing, and the text corresponding to the nodes in each of the sub-connected graphs is processed to have the same unique identifier, including: splitting all sub-connected graphs included in the textual connection graph into a set of node pairs connected by edges; randomly storing the node pairs in the set to a distributed computing and processing device; and coloring the node pairs stored locally by the computing and processing device, and processing the text corresponding to the nodes in each of the sub-connected graphs to have the same unique identifier. For example, all sub-connected graphs in the textual connection graph are split according to the edges, and the two nodes connected by each edge form a node pair, so that a set of several node pairs can be obtained. Afterwards, all node pairs in the obtained set can be uniformly and randomly sent to two or more computing and processing devices with distributed deployment. Afterwards, each computing and processing device performs coloring processing on the node pairs received, and each node pair is colored to have the same unique identifier, and further the node pairs containing the same node are colored to have the same unique identifier, so that the nodes in each sub-connected graph are colored to have the same unique identifier, and the unique identifiers of the nodes in different sub-connected graphs are different. In some embodiments of the present application, two or more computing and processing devices with distributed deployment perform node pair coloring processing based on the Spark framework. By sending the node pairs to the distributed computing and processing devices for coloring processing and making full use of parallel processing resources, the speed of text deduplication can be improved, which is of great significance for massive data.

[0069] In some embodiments of the present application, before constructing the edges between the nodes corresponding to the two texts based on the similarity between the two texts, it also includes: initializing a unique identifier for each text in the matching text list. After obtaining the matching text list, first initialize a unique identifier (such as a unique numerical value) for each text in the matching text list, and then, when constructing a text connection graph based on the matching text list, correspond each node to the unique identifier of the text corresponding to the node, for example, store the unique identifier of the text corresponding to the node in each node.

[0070] Since there will be sub-connected graphs such as "Escape from the Room" -> "Escape from the Room Xu" -> "Escape from the Room Xujia" -> "Escape from the Room Xujiahui" in the sub-connected graph, after the coloring process, the text "Escape from the Room" and the text "Escape from the Room Xujiahui" will be colored with the same unique identifier, resulting in the text "Escape from the Room" and the text "Escape from the Room Xujiahui" being misjudged as duplicate texts when performing deduplication processing. In order to solve this problem, when the present application is implemented, the maximum number of iterations for performing the coloring process can be set to limit the length of the text for similarity judgment. Taking the aforementioned sub-connected graph as an example, when the maximum number of iterations is set to less than 3, the coloring process of the nodes corresponding to the text "Escape from the Room" and the text "Escape from the Room Xujiahui" will not be executed to correspond to the same unique identifier, thereby avoiding the misjudgment that "Escape from the Room" and "Escape from the Room Xujiahui" are similar.

[0071] In some embodiments of the present application, the coloring process of the node pairs stored locally by the computing and processing device includes: iteratively performing corresponding rounds of coloring process on each node pair stored locally by the computing and processing device, wherein the coloring process includes: setting the unique identifier of each node in the node pair to the minimum value of the unique identifier of each node in the node pair; or, setting the unique identifier of each node in the node pair to the maximum value of the unique identifier of each node in the node pair; the corresponding round is less than or equal to the maximum value of the shortest path between any two nodes in the text connection graph, and is less than a preset iteration number threshold. Taking the preset iteration number threshold as 4 as an example, for Figure 2 In the text connectivity graph shown, the maximum value of the shortest path between nodes is 4, so at most 4 rounds of iterative coloring will be performed in the end, that is, the maximum similarity order of the text is limited to 4, thereby reducing the misjudgment rate of texts with the same or similar prefixes.

[0072] For example, Figure 2The text connection graph shown will be split into 5 node pairs, AB, AC, BC, CD, DE. Assuming that the unique identifiers corresponding to these 5 nodes are numbers 1 to 5, the nodes can be represented as: A(1)-B(2), A(1)-C(3), B(2)-C(3), C(3)-D(4), D(4)-E(5). Taking the coloring process as: setting the unique identifier of each node in the node pair to the minimum value of the unique identifier of each node in the node pair as an example, when the computer performs the first coloring process, the results obtained after the coloring process of these 5 node pairs are: A(1)-B(1), A(1)-C(1), B(2)-C(2), C(3)-D(3), D(4)-E(4). After the second coloring process, the results obtained after the coloring process of these 5 node pairs are: A(1)-B(1), A(1)-C(1), B(1) -C(1), C(3)-D(3), D(4)-E(4); after the third coloring process, the results of the coloring process of these 5 node pairs are: A(1)-B(1), A(1)-C(1), B(1)-C(1), C(1)-D(1), D(4)-E(4); after the fourth coloring process, the results of the coloring process of these 5 node pairs are: A(1)-B(1), A(1)-C(1), B(1)-C(1), C(1)-D(1), D(1)-E(1). That is, the computer will perform the next round of coloring according to the coloring results of the previous node pair, and perform 4 rounds in total.

[0073] If the preset iteration number threshold is set to 3, Figure 2 Taking the text connectivity graph shown as an example, since the maximum value of the shortest path between nodes is 4, three rounds of iterative coloring will eventually be performed, that is, node E will not be colored, and the text corresponding to node E will not be considered to be similar to nodes A, B, C, and D.

[0074] Step 140: De-duplicate the texts in the matching text list that have the same unique identifier according to a preset indicator.

[0075] After determining the texts with the same unique identifier in the matching text list, the texts with the same unique identifier can be considered as duplicate texts and need to be deduplicated. Specifically, the texts can be deduplicated according to certain indicators. The preset indicators described in the embodiments of the present application can be selected from any one of the following: click-through rate, recommendation score, list sorting position. In other embodiments of the present application, other indicators can also be selected as the basis for deduplicating the texts, which will not be listed one by one in the embodiments of the present application.

[0076] The following three examples illustrate the specific technical solution for deduplication of text according to the above preset indicators.

[0077] For example, in some embodiments of the present application, each of the texts in the matching text list includes: the click-through rate of the text match, and the texts in the matching text list having the same unique identifier are deduplicated according to preset indicators, including: removing the texts with click-through rates other than the maximum click-through rate among the texts in the matching text list having the same unique identifier from the matching text list. Click-through rate can usually effectively reflect the popularity of a text. In search recommendation applications, users usually select search results with higher click-through rates. Therefore, in some embodiments of the present application, when obtaining a matching text list, the click-through rate of each text in the matching text list is also obtained. When deduplicating texts, for the texts in the matching text list that are colored as having the same unique identifier, only the texts with the highest click-through rate are retained, and other texts are deleted, thereby achieving deduplication of the texts in the matching text list.

[0078] For example, when a user enters the query text "Kung Pao Chicken", the user enters the query text "Kung Pao Chicken", and the matching text list recalled by the backend server includes the texts: "Kung Pao Chicken Rice", "How to make Kung Pao Chicken", "How to make delicious Kung Pao Chicken", "Kung Pao Chicken Recipe" and other matching texts. Figure 3 As shown. After the text connectivity graph is constructed based on the text components included in the matching text list and coloring is performed, if the texts "How to make Kung Pao Chicken", "How to make delicious Kung Pao Chicken", and "How to make Kung Pao Chicken" are colored as the same unique identifier, when the recommended search results of the query text "Kung Pao Chicken" are displayed to the user, only the one with the highest click-through rate among the texts "How to make Kung Pao Chicken", "How to make delicious Kung Pao Chicken", and "How to make Kung Pao Chicken" (such as "How to make Kung Pao Chicken") will be recommended, and the other two will not be displayed. Figure 3 The effect of deduplication of the matching text list shown in Figure 4 As shown. Figure 4 It can be seen that only one recommendation result with the same semantics is displayed, which avoids redundant information in the recommendation results. At the same time, it can save display space to display more diversified information and improve the utilization rate of display resources.

[0079] For another example, each of the texts in the matching text list includes: a recommendation score for the text match, and the texts in the matching text list having the same unique identifier are deduplicated according to preset indicators, including: removing the texts with the same unique identifier in the matching text list whose recommendation scores are not the maximum recommendation scores from the matching text list. The recommendation score is the recommendation score of the recall result calculated by the recommendation engine according to the query input according to a preset strategy. Generally, the higher the recommendation score, the higher the match between the recall result and the user. Therefore, in some embodiments of the present application, when obtaining the matching text list, the recommendation score of each text in the matching text list is obtained at the same time. When deduplicating texts, for the texts in the matching text list that are colored as having the same unique identifier, only the text with the highest recommendation score is retained, and other texts are deleted, thereby achieving deduplication of the texts in the matching text list.

[0080] For example, when a user enters the query text "Kung Pao Chicken", the user enters the query text "Kung Pao Chicken", and the matching text list recalled by the background server includes texts such as "Kung Pao Chicken Rice", "How to make Kung Pao Chicken", "How to make delicious Kung Pao Chicken", and "How to make Kung Pao Chicken". After the text connection graph based on the text components included in the matching text list and coloring processing, if the text "How to make Kung Pao Chicken", "How to make delicious Kung Pao Chicken", and "How to make Kung Pao Chicken" are colored as the same unique identifier, when the recommended search results of the query text "Kung Pao Chicken" are displayed to the user, only the one with the highest recommendation score among the text "How to make Kung Pao Chicken", "How to make delicious Kung Pao Chicken", and "How to make Kung Pao Chicken" (such as "How to make Kung Pao Chicken") will be recommended, and the other two will not be displayed.

[0081] For another example, the texts in the matching text list are arranged in order (such as arranged from front to back in order of matching degree from high to low, and arranged from front to back in order of recommendation score from high to low), and the texts in the matching text list with the same unique identifier are deduplicated according to preset indicators, including: removing the texts except the first text in the texts with the same unique identifier in the matching text list from the matching text list. Usually, the texts in the matching text list returned by the background server are sorted according to a preset strategy, for example, sorted from front to back in order of matching degree with the query text from high to low, and sorted from front to back in order of recommendation score from high to low. When deduplicating texts, for the texts in the matching text list that are colored as having the same unique identifier, only the first text (i.e., the text with the highest matching degree or the highest recommendation score) is retained, and other texts are deleted, thereby achieving deduplication of the texts in the matching text list.

[0082] The matching text deduplication method disclosed in the embodiment of the present application obtains a list of matching texts to be processed; constructs nodes corresponding to each text in the matching text list, and constructs edges between the nodes corresponding to the two texts based on the similarity between the two texts to obtain a text connection graph; performs coloring on all sub-connection graphs included in the text connection graph, and processes the texts corresponding to the nodes in each sub-connection graph to have the same unique identifier; performs deduplication processing on the texts in the matching text list with the same unique identifier according to preset indicators, which helps to improve the accuracy of matching text deduplication processing. Taking the search recommendation application scenario as an example, the matching text deduplication method disclosed in the embodiment of the present application identifies duplicate texts based on text similarity and graph coloring technology, and deduplication processing is performed on the recommended text based on the identification results. It is not limited by the length of the text, has a wider range of applications, and has a better deduplication effect.

[0083] Furthermore, by deduplicating the recommended matching texts, redundant information displayed to users can be reduced, thereby improving the efficiency of users in obtaining information and the efficiency of utilizing display resources.

[0084] Furthermore, the matching text deduplication method disclosed in the embodiment of the present application combines multiple similarity conditions to perform text similarity judgment, constructs the edges of the text connectivity graph, expands the applicable scenarios of matching text deduplication processing, improves the robustness of the method, and helps to improve the accuracy of text deduplication processing.

[0085] On the other hand, by building a text connectivity graph based on the matching text list, and then splitting the edge-connected nodes into node pairs for distributed coloring, the parallel processing capability of the system is fully utilized, and the speed of text deduplication processing can be significantly improved when deduplicating massive matching texts. In addition, by setting the maximum number of iterations of the coloring process, the maximum similarity order of the text can be adjusted to achieve controllable error rate.

[0086] Embodiment 2

[0087] The present application discloses a matching text deduplication device, such as Figure 5 As shown, the device comprises:

[0088] A matching text list acquisition module 510 is used to acquire a matching text list to be processed;

[0089] A text connection graph construction module 520 is used to construct a node corresponding to each text in the matching text list, and to construct edges between the nodes corresponding to the two texts based on the similarity between the two texts, so as to obtain a text connection graph;

[0090] A graph coloring processing module 530 is used to perform coloring processing on all sub-connected graphs included in the textual connected graph, and process the texts corresponding to the nodes in each of the sub-connected graphs to have the same unique identifier;

[0091] The deduplication processing module 540 is used to perform deduplication processing on the texts with the same unique identifier in the matching text list according to preset indicators.

[0092] In some embodiments of the present application, constructing an edge between nodes corresponding to the two texts based on the similarity between the two texts includes:

[0093] Determining whether the two texts meet at least one preset similarity condition;

[0094] In response to the similarity between the two texts satisfying at least one of the preset similarity conditions, an edge connecting the nodes corresponding to the two texts is constructed; wherein the preset similarity conditions include: the sets of knowledge entities contained in the two texts are the same, the edit distance between the two texts is less than a preset distance threshold, and the semantic similarity score between the two texts is greater than a preset similarity score threshold.

[0095] In some embodiments of the present application, determining whether the two texts meet at least one preset similarity condition includes:

[0096] Determine the knowledge entity sets respectively contained in the texts of the two parties;

[0097] In response to the knowledge entity sets respectively included in the two texts being the same, it is determined that the two texts satisfy a preset similarity condition that the knowledge entity sets included in the two texts are the same.

[0098] In some embodiments of the present application, determining whether the two texts meet at least one preset similarity condition includes:

[0099] Determining the edit distance between the two texts;

[0100] In response to the edit distance being less than a preset distance threshold, it is determined that the two texts satisfy a preset similarity condition that the edit distance between the two texts is less than a preset distance threshold.

[0101] In some embodiments of the present application, determining the edit distance between the two texts includes:

[0102] The Levenshtein edit distance and the Jaro-Winkler edit distance between the two texts are combined to obtain the edit distance between the two texts.

[0103] In some embodiments of the present application, determining whether the two texts meet at least one preset similarity condition includes:

[0104] Determining a semantic similarity score between the two texts;

[0105] In response to the semantic similarity score being greater than a preset similarity score threshold, it is determined that the two texts satisfy a preset similarity condition that the semantic similarity score between the two texts is greater than a preset similarity score threshold.

[0106] In some embodiments of the present application, the image coloring processing module 530 is further used to:

[0107] Splitting all sub-connected graphs included in the text connected graph into sets of node pairs connected by edges;

[0108] Randomly storing the node pairs in the set to distributed computing and processing devices;

[0109] The node pairs stored locally are subjected to coloring processing by the computing and processing device, and the text corresponding to the node in each of the sub-connected graphs is processed to have the same unique identifier.

[0110] In some embodiments of the present application, Figure 6 As shown, the device also includes:

[0111] A unique identifier setting module 550, used to initialize a unique identifier for each text in the matching text list;

[0112] Accordingly, the coloring process of the node pairs stored locally by the computing and processing device includes:

[0113] The computing and processing device is used to iteratively perform corresponding rounds of coloring processing on each of the node pairs stored locally, wherein the coloring processing includes: setting the unique identifier of each node in the node pair to the minimum value of the unique identifier of each node in the node pair; or, setting the unique identifier of each node in the node pair to the maximum value of the unique identifier of each node in the node pair; the corresponding round is less than or equal to the maximum value of the shortest path between any two nodes in the text connection graph, and is less than a preset threshold of the number of iterations.

[0114] In some embodiments of the present application, Figure 6 As shown, the deduplication processing module 540 further includes any one of the following submodules:

[0115] The first deduplication processing submodule 5401 is used for, when each of the texts in the matching text list includes: a click rate matched by the text, removing the text whose click rate is not the maximum click rate from the texts in the matching text list that have the same unique identifier;

[0116] The second deduplication processing submodule 5402 is configured to, when each of the texts in the matching text list includes a recommendation score for the text match, remove the texts in the matching text list whose recommendation scores are not the maximum recommendation scores among the texts in the matching text list that have the same unique identifier from the matching text list;

[0117] The third deduplication processing submodule 5403 is used to remove the texts in the matching text list with the same unique identifier, except for the first text, from the matching text list when the texts in the matching text list are arranged in order.

[0118] The matching text deduplication device disclosed in the embodiment of the present application is used to implement the matching text deduplication method described in the first embodiment of the present application. The specific implementation methods of each module of the device will not be repeated here, and reference can be made to the specific implementation methods of the corresponding steps in the method embodiment.

[0119] The matching text deduplication device disclosed in the embodiment of the present application obtains a list of matching texts to be processed; constructs nodes corresponding to the texts according to each text in the matching text list, and constructs edges between the nodes corresponding to the texts based on the similarity between the texts, to obtain a text connection graph; performs coloring on all sub-connection graphs included in the text connection graph, and processes the texts corresponding to the nodes in each sub-connection graph to have the same unique identifier; performs deduplication processing on the texts in the matching text list with the same unique identifier according to preset indicators, which helps to improve the accuracy of matching text deduplication processing. Taking the search recommendation application scenario as an example, the matching text deduplication method disclosed in the embodiment of the present application identifies duplicate texts based on text similarity and graph coloring technology, and performs deduplication processing on the recommended text based on the identification results. It is not limited by the length of the text, has a wider range of applications, and has a better deduplication effect.

[0120] Furthermore, by deduplicating the recommended matching texts, redundant information displayed to users can be reduced, thereby improving the efficiency of users in obtaining information and the efficiency of utilizing display resources.

[0121] Furthermore, the matching text deduplication method disclosed in the embodiment of the present application combines multiple similarity conditions to perform text similarity judgment, constructs the edges of the text connectivity graph, expands the applicable scenarios of matching text deduplication processing, improves the robustness of the method, and helps to improve the accuracy of text deduplication processing.

[0122] On the other hand, by building a text connectivity graph based on the matching text list, and then splitting the edge-connected nodes into node pairs for distributed coloring, the parallel processing capability of the system is fully utilized, and the speed of text deduplication processing can be significantly improved when deduplicating massive matching texts. In addition, by setting the maximum number of iterations of the coloring process, the maximum similarity order of the text can be adjusted to achieve controllable error rate.

[0123] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0124] The above is a detailed introduction to a matching text deduplication method and device provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0125] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0126] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components in the electronic device according to the embodiment of the present application. The present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0127] For example, Figure 7 An electronic device that can implement the method according to the present application is shown. The electronic device can be a PC, a mobile terminal, a personal digital assistant, a tablet computer, etc. The electronic device traditionally includes a processor 710 and a memory 720 and a program code 730 stored on the memory 720 and can be run on the processor 710, and the processor 710 implements the method described in the above embodiment when executing the program code 730. The memory 720 can be a computer program product or a computer-readable medium. The memory 720 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. The memory 720 has a storage space 7201 for the program code 730 of the computer program for executing any method step in the above method. For example, the storage space 7201 for the program code 730 can include various computer programs for implementing the various steps in the above method respectively. The program code 730 is a computer-readable code. These computer programs can be read from one or more computer program products or written into the one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. The computer program includes a computer readable code, and when the computer readable code is executed on an electronic device, the electronic device is caused to execute the method according to the above embodiment.

[0128] The embodiment of the present application also discloses a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the matching text deduplication method described in the first embodiment of the present application are implemented.

[0129] Such a computer program product may be a computer-readable storage medium, which may have a computer-readable storage medium having a Figure 7 The memory 720 in the electronic device shown in the figure is similar to the storage segment, storage space, etc. The program code can be compressed and stored in the computer-readable storage medium in an appropriate form. The computer-readable storage medium is generally as shown in the reference Figure 8 The portable or fixed storage unit. Generally, the storage unit includes computer readable code 730', which is a code read by a processor. When the code is executed by the processor, each step in the method described above is implemented.

[0130] The term "one embodiment", "embodiment" or "one or more embodiments" herein means that a particular feature, structure or characteristic described in conjunction with the embodiment is included in at least one embodiment of the present application. In addition, please note that the examples of the term "in one embodiment" here do not necessarily all refer to the same embodiment.

[0131] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0132] In the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application may be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.

[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for removing duplicate matching texts. It is characterized in that include: Get the list of matching texts to be processed; According to each text in the matching text list, a node corresponding to the text is constructed respectively, and based on the similarity between the two texts, edges between the nodes corresponding to the two texts are constructed to obtain a text connection graph; Performing coloring processing on all sub-connected graphs included in the text connected graph, processing the text corresponding to the nodes in each of the sub-connected graphs to have the same unique identifier; For the texts in the matching text list having the same unique identifier, deduplication is performed according to a preset index; The step of coloring all sub-connected graphs included in the text connected graph and processing the texts corresponding to the nodes in each sub-connected graph to have the same unique identifier includes: Splitting all sub-connected graphs included in the text connected graph into sets of node pairs connected by edges; Randomly storing the node pairs in the set to distributed computing and processing devices; The node pairs stored locally are subjected to coloring processing by the computing and processing device, and the text corresponding to the nodes in each of the sub-connected graphs is processed to have the same unique identifier; Before the step of constructing the edge between the nodes corresponding to the two texts based on the similarity between the two texts, the method further includes: Initialize a unique identifier for each text in the matching text list; The step of performing coloring processing on the node pairs stored locally by the computing and processing device comprises: The computing and processing device is used to iteratively perform corresponding rounds of coloring processing on each of the node pairs stored locally, wherein the coloring processing includes: setting the unique identifier of each node in the node pair to the minimum value of the unique identifier of each node in the node pair; or, setting the unique identifier of each node in the node pair to the maximum value of the unique identifier of each node in the node pair; the corresponding round is less than or equal to the maximum value of the shortest path between any two nodes in the text connection graph, and is less than a preset threshold of the number of iterations.

2. The method according to claim 1, It is characterized in that The step of constructing an edge between nodes corresponding to the two texts based on the similarity between the two texts comprises: Determining whether the two texts meet at least one preset similarity condition; In response to the similarity between the two texts satisfying at least one of the preset similarity conditions, an edge connecting the nodes corresponding to the two texts is constructed; wherein the preset similarity conditions include: the sets of knowledge entities contained in the two texts are the same, the edit distance between the two texts is less than a preset distance threshold, and the semantic similarity score between the two texts is greater than a preset similarity score threshold.

3. The method according to claim 2, It is characterized in that The step of determining whether the two texts meet at least one preset similarity condition comprises: Determine the knowledge entity sets respectively contained in the texts of the two parties; In response to the knowledge entity sets respectively included in the two texts being the same, it is determined that the two texts satisfy a preset similarity condition that the knowledge entity sets included in the two texts are the same.

4. The method according to claim 2, It is characterized in that The step of determining whether the two texts meet at least one preset similarity condition comprises: Determining the edit distance between the two texts; In response to the edit distance being less than a preset distance threshold, it is determined that the two texts satisfy a preset similarity condition that the edit distance between the two texts is less than a preset distance threshold.

5. The method according to claim 4, It is characterized in that The step of determining the edit distance between the two texts comprises: The Levenshtein edit distance and the Jaro-Winkler edit distance between the two texts are combined to serve as the edit distance between the two texts.

6. The method according to claim 2, It is characterized in that The step of determining whether the two texts meet at least one preset similarity condition comprises: Determining a semantic similarity score between the two texts; In response to the semantic similarity score being greater than a preset similarity score threshold, it is determined that the two texts satisfy a preset similarity condition that the semantic similarity score between the two texts is greater than a preset similarity score threshold.

7. The method according to any one of claims 1 to 6, It is characterized in that The step of performing deduplication processing on the texts having the same unique identifier in the matching text list according to preset indicators includes any one of the following methods: The first one is that each of the texts in the matching text list includes: the click rate of the text match, and the texts with the same unique identifier in the matching text list and the texts with a click rate that is not the maximum click rate are removed from the matching text list; The second method is that each of the texts in the matching text list includes: a recommendation score for the text match, and the texts in the matching text list having the same unique identifier and having a recommendation score that is not a maximum recommendation score are removed from the matching text list; The third type is that the texts in the matching text list are arranged in order, and the texts in the matching text list with the same unique identifier, except for the first text, are removed from the matching text list.

8. A matching text deduplication device, It is characterized in that include: A matching text list acquisition module is used to acquire a matching text list to be processed; A text connection graph construction module, used to construct a node corresponding to each text in the matching text list, and to construct edges between the nodes corresponding to the two texts based on the similarity between the two texts, so as to obtain a text connection graph; A graph coloring processing module, used to perform coloring processing on all sub-connected graphs included in the text connected graph, and process the text corresponding to the nodes in each sub-connected graph to have the same unique identifier; A deduplication processing module, used for performing deduplication processing on the texts having the same unique identifier in the matching text list according to a preset index; The step of coloring all sub-connected graphs included in the text connected graph and processing the texts corresponding to the nodes in each sub-connected graph to have the same unique identifier includes: Splitting all sub-connected graphs included in the text connected graph into sets of node pairs connected by edges; Randomly storing the node pairs in the set to distributed computing and processing devices; The node pairs stored locally are subjected to coloring processing by the computing and processing device, and the text corresponding to the nodes in each of the sub-connected graphs is processed to have the same unique identifier; Before the step of constructing the edge between the nodes corresponding to the two texts based on the similarity between the two texts, the method further includes: Initialize a unique identifier for each text in the matching text list; The step of performing coloring processing on the node pairs stored locally by the computing and processing device comprises: The computing and processing device is used to iteratively perform corresponding rounds of coloring processing on each of the node pairs stored locally, wherein the coloring processing includes: setting the unique identifier of each node in the node pair to the minimum value of the unique identifier of each node in the node pair; or, setting the unique identifier of each node in the node pair to the maximum value of the unique identifier of each node in the node pair; the corresponding round is less than or equal to the maximum value of the shortest path between any two nodes in the text connection graph, and is less than a preset threshold of the number of iterations.

9. An electronic device comprising a memory, a processor, and a program code stored in the memory and executable on the processor, It is characterized in that When the processor executes the program code, the matching text deduplication method described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having program code stored thereon, It is characterized in that When the program code is executed by a processor, the steps of the matching text deduplication method described in any one of claims 1 to 7 are implemented.