Text similarity detection method and device, equipment and storage medium
By constructing a text statement collection and calculating similarity using triple extraction models, classification models and entity extraction, the problem of time-consuming and labor-consuming text similarity detection in the prior art is solved, and efficient and accurate text similarity detection is achieved.
Patent Information
- Application Number
- CN202510681357.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-09-02
Smart Images

Figure CN120579531A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a text similarity detection method, apparatus, device, and storage medium. Background Art
[0002] In the development of the Internet, plagiarism and infringement occur frequently. To deal with this phenomenon, it is necessary to perform text similarity detection.
[0003] Existing technologies typically use keywords or phrases to compare texts for similarity, followed by manual determination of plagiarism or copyright infringement. This detection method typically consumes significant manpower and resources. Specifically for text similarity detection in the financial sector, it requires the involvement of financial experts. Summary of the Invention
[0004] The present invention provides a text similarity detection method, apparatus, device and storage medium to improve the accuracy of text similarity detection.
[0005] In a first aspect, an embodiment of the present invention provides a method for detecting text similarity, comprising:
[0006] Determine a first sentence set corresponding to the first text and a second sentence set corresponding to the second text;
[0007] determining a first similarity between the first text and the second text based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set;
[0008] determining a second similarity between the first text and the second text based on a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set;
[0009] determining a third similarity between the first text and the second text based on similarities between each entity corresponding to the first text and each entity corresponding to the second text;
[0010] A target similarity between the first text and the second text is determined according to the first similarity, the second similarity, and the third similarity between the first text and the second text.
[0011] The technical solution of an embodiment of the present invention provides a text similarity detection method, including: determining a first sentence set corresponding to a first text and a second sentence set corresponding to a second text; determining a first similarity between the first text and the second text based on triples corresponding to each sentence in the first sentence set and triples corresponding to each sentence in the second sentence set; determining a second similarity between the first text and the second text based on a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set; determining a third similarity between the first text and the second text based on the similarity between each entity corresponding to the first text and each entity corresponding to the second text; and determining a target similarity between the first text and the second text based on the first similarity, the second similarity, and the third similarity between the first text and the second text. The above technical solution can first determine the sentences corresponding to the first text and the sentences corresponding to the second text by extracting sentences from the first text and the second text, construct a first sentence set based on the sentences extracted from the first text, and construct a second sentence set based on the sentences extracted from the second text, thereby realizing the rapid construction of the first sentence set corresponding to the first text and the second sentence set corresponding to the second text. Secondly, the first similarity between the first text and the second text can be determined based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set. The second similarity between the first text and the second text can also be determined based on the category comparison results of each sentence in the first sentence set and each sentence in the second sentence set. The third similarity between the first text and the second text can also be determined based on the entities corresponding to each sentence in the first sentence set and the entities corresponding to each sentence in the second sentence set. The first similarity, the second similarity and the third similarity can then be integrated to obtain the target similarity, thereby realizing a more accurate target similarity between the first text and the second text.
[0012] Furthermore, determining a first sentence set corresponding to the first text and a second sentence set corresponding to the second text includes:
[0013] By performing sentence extraction on the first text, the first sentence set corresponding to the first text is determined; by performing sentence extraction on the second text, the second sentence set corresponding to the second text is determined.
[0014] Furthermore, determining a first similarity between the first text and the second text based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set includes:
[0015] Each of the sentences is input into a pre-trained triple extraction model so that the triple extraction model determines the triple corresponding to each of the sentences; the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set are input into a pre-trained comparison model so that the comparison model determines the first similarity between the first text and the second text by analyzing the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set.
[0016] Furthermore, determining a second similarity between the first text and the second text based on a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set includes:
[0017] Input each sentence in the first sentence set and each sentence in the second sentence set into a pre-trained classification model so that the classification model determines a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set; and determine a second similarity between the first text and the second text based on each category comparison result.
[0018] Furthermore, determining a third similarity between the first text and the second text according to the similarity between each entity corresponding to the first text and each entity corresponding to the second text includes:
[0019] By performing entity extraction on the first text and the second text, the entities corresponding to the first text and the entities corresponding to the second text are determined; the similarities between the entities corresponding to the first text and the entities corresponding to the second text are determined based on the depth information of the entities corresponding to the first text in the entity tree and the depth information of the entities corresponding to the second text in the entity tree; and the third similarity between the first text and the second text is determined based on the similarities between the entities corresponding to the first text and the entities corresponding to the second text.
[0020] Furthermore, before determining the target similarity between the first text and the second text according to the first similarity, the second similarity, and the third similarity between the first text and the second text, the method further includes:
[0021] The first weight is determined according to the number of triples corresponding to the sentences in the first sentence set and the second sentence set; the second weight is determined according to the number of word encodings corresponding to the sentences in the first sentence set and the second sentence set; and the third weight is determined according to the number of entities corresponding to the first text and the second text.
[0022] Furthermore, determining a target similarity between the first text and the second text according to the first similarity, the second similarity, and the third similarity between the first text and the second text includes:
[0023] The first similarity, the second similarity, and the third similarity are weightedly summed based on the first weight, the second weight, and the third weight to obtain the target similarity.
[0024] In a second aspect, an embodiment of the present invention further provides a text similarity detection device, comprising:
[0025] A splitting module, configured to determine a first sentence set corresponding to the first text and a second sentence set corresponding to the second text;
[0026] a first determining module, configured to determine a first similarity between the first text and the second text based on a triple corresponding to each sentence in the first sentence set and a triple corresponding to each sentence in the second sentence set;
[0027] a second determining module, configured to determine a second similarity between the first text and the second text based on a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set;
[0028] a third determining module, configured to determine a third similarity between the first text and the second text based on similarities between each entity corresponding to the first text and each entity corresponding to the second text;
[0029] An execution module is configured to determine a target similarity between the first text and the second text according to the first similarity, the second similarity, and the third similarity between the first text and the second text.
[0030] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising:
[0031] at least one processor; and a memory communicatively coupled to the at least one processor;
[0032] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the text similarity detection method as described in any one of the first aspects.
[0033] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to perform the text similarity detection method as described in any one of the first aspects.
[0034] In a fifth aspect, the present application provides a computer program product, which includes computer instructions. When the computer instructions are executed on a computer, the computer executes the text similarity detection method provided in the first aspect.
[0035] It should be noted that the above-mentioned computer instructions may be stored in whole or in part on a computer-readable storage medium. The computer-readable storage medium may be packaged together with the processor of the text similarity detection device or separately from the processor of the text similarity detection device, and this application does not limit this.
[0036] The descriptions of the second, third, fourth and fifth aspects of this application can refer to the detailed description of the first aspect; and the beneficial effects of the descriptions of the second, third, fourth and fifth aspects can refer to the analysis of the beneficial effects of the first aspect, which will not be repeated here.
[0037] In this application, the name of the above-mentioned text similarity detection device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of this application, they fall within the scope of the claims of this application and their equivalents.
[0038] These and other aspects of the present application will become more readily apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] 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.
[0040] Figure 1 A flowchart of a text similarity detection method provided by an embodiment of the present invention;
[0041] Figure 2 A flowchart of another text similarity detection method provided by an embodiment of the invention;
[0042] Figure 3 A schematic diagram of a triple extraction model in another text similarity detection method provided by an embodiment of the invention;
[0043] Figure 4 A schematic diagram of a classification model in another text similarity detection method provided by an embodiment of the invention;
[0044] Figure 5A schematic diagram of a term tree in another text similarity detection method provided by an embodiment of the invention;
[0045] Figure 6 A schematic diagram of the structure of a text similarity detection device provided by an embodiment of the present invention;
[0046] Figure 7 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.
[0048] The term "and / or" in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0049] The terms "first" and "second" and the like in the specification and drawings of this application are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.
[0050] Furthermore, the terms "including," "having," and any variations thereof, as used in the description of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not limited to the listed steps or units but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to the process, method, product, or apparatus.
[0051] It should be mentioned before discussing exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although flow charts describe various operations (or steps) as sequential processes, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of various operations can be rearranged. When its operation is completed, the process can be terminated, but can also have additional steps not included in the accompanying drawings. The process can correspond to methods, functions, procedures, subroutines, subprograms, etc. In addition, the features in the embodiments of the present invention and the embodiments can be combined with each other without conflict.
[0052] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being more preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0053] In the description of the present application, unless otherwise specified, “plurality” means two or more.
[0054] Figure 1 This is a flowchart of a text similarity detection method provided by an embodiment of the present invention. This embodiment is applicable to situations where text similarity detection is required. The method can be executed by a text similarity detection device, such as Figure 1 As shown, the specific steps include:
[0055] Step 110: Determine a first sentence set corresponding to the first text and a second sentence set corresponding to the second text.
[0056] The first text and the second text can be understood as texts that need to be tested for similarity. The first sentence set includes all sentences corresponding to the first text, and the second sentence set includes all sentences corresponding to the second text.
[0057] Specifically, the sentences corresponding to the text can be determined by performing sentence extraction on the text. Therefore, for the first text and the second text that need to be similar, sentence extraction can first be performed on the first text and the second text respectively to determine the sentences corresponding to the first text and the sentences corresponding to the second text. All sentences corresponding to the first text can constitute a first sentence set, and all sentences corresponding to the second text can constitute a second sentence set.
[0058] In an embodiment of the present invention, sentences corresponding to the first text and the second text that need to be tested for similarity are extracted to determine the sentences corresponding to the first text, a first sentence set is constructed based on the sentences extracted from the first text, and a second sentence set is constructed based on the sentences extracted from the second text, thereby achieving rapid construction of a first sentence set corresponding to the first text and a second sentence set corresponding to the second text.
[0059] Step 120: Determine a first similarity between the first text and the second text based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set.
[0060] In order to determine a more accurate similarity between the first text and the second text, multiple similarities may be determined based on multiple methods, and an accurate target similarity may be determined based on an average of the similarities.
[0061] Triples corresponding to sentences typically refer to structured (subject, predicate, object) or (entity, relation, entity) structures extracted from natural language text and used for knowledge graph construction or information structuring. By representing sentences as triples, redundant information can be removed while preserving their semantic meaning. Therefore, based on the triples corresponding to sentences, the similarity between sentences can be quickly and accurately determined.
[0062] For a first text composed of sentences in a first sentence set and a second text composed of sentences in a second sentence set, a first similarity between the first text and the second text can be determined based on the triples corresponding to the sentences in the first sentence set and the triples corresponding to the sentences in the second sentence set.
[0063] Specifically, it is first necessary to determine the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set. Specifically, the triples corresponding to each sentence can be determined based on rule matching. Since triples are usually expressed in the form of (subject, predicate, object), the triples corresponding to each sentence can be determined by performing semantic role labeling and dependency syntactic analysis on each sentence. For example, for each sentence, the core entity corresponding to the sentence and the action or attribute relationship between the entities can be determined by semantic role labeling, and then the entity and the action or attribute relationship between the entities can be combined by dependency syntactic analysis to obtain the triples corresponding to each sentence. Then, the first similarity between the first text and the second text can be determined based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set. Specifically, under the premise of determining the triples corresponding to each sentence in the first sentence set corresponding to the first text and the triples corresponding to each sentence in the second sentence set corresponding to the second text, the first similarity between the first text and the second text can be determined based on triple overlap, semantic embedding similarity, graph structure similarity, etc.
[0064] When determining the first similarity based on triple overlap, the first similarity can be determined based on the ratio of the intersection and union of a first triple set consisting of triples corresponding to each sentence in the first sentence set and a third triple set consisting of triples corresponding to each sentence in the second sentence set. When determining the first similarity based on semantic embedding similarity, the triples corresponding to each sentence in the first sentence set can be encoded as a first triple vector, and the triples corresponding to each sentence in the second sentence set can be encoded as a second triple vector.
[0065] A first text vector corresponding to the first text is constructed based on each first triple vector corresponding to the first text, a second text vector corresponding to the second text is constructed based on each second triple vector corresponding to the second text, and the similarity between the first text vector and the second text vector is determined as the first similarity. When determining the first similarity based on graph structure similarity, a first directed graph is constructed based on the triples corresponding to each sentence in the first sentence set, a second directed graph is constructed based on the triples corresponding to each sentence in the second sentence set, and the similarity between the first directed graph and the second directed graph is determined as the first similarity.
[0066] In the embodiment of the present invention, a first similarity between a first text and a second text is determined based on triples corresponding to each sentence in the first sentence set and triples corresponding to each sentence in the second sentence set.
[0067] Step 130: Determine a second similarity between the first text and the second text based on a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set.
[0068] The similarity between the first text and the second text can also be determined based on the category comparison results of each sentence contained in the first text and each sentence contained in the second text. The category comparison result between the sentences can be determined by inputting the sentences into a pre-trained classification model. When the input of the classification model is two sentences, the output can be the category comparison result between the two sentences, and the category comparison result can be similar or dissimilar.
[0069] Specifically, any sentence in the first sentence set and any sentence in the second sentence set can be input into the classification model as input information, and the classification model can determine a category comparison result between the two sentences. Furthermore, the total number of similarities in these category comparison results can be counted, and the second similarity between the first text and the second text can be determined based on the ratio of the total number of similarities in these category comparison results to the total number of category comparison results.
[0070] In the embodiment of the present invention, the second similarity between the first text and the second text is determined based on the category comparison result of each sentence in the first sentence set and each sentence in the second sentence set.
[0071] Step 140: Determine a third similarity between the first text and the second text based on the similarities between the entities corresponding to the first text and the entities corresponding to the second text.
[0072] The entity can be understood as a domain term. For example, when the first text and the second text that need to be tested for similarity are texts in the financial field, the entity can be understood as a term in the financial field.
[0073] The similarity between the first text and the second text may also be determined based on the similarity between each entity corresponding to the first text and each entity corresponding to the second text.
[0074] Specifically, first, entity extraction can be performed on the first text and the second text based on the terminology library of the corresponding fields of the first text and the second text to determine the entities corresponding to the first text and the second text. Secondly, the similarity between each entity corresponding to the first text and each entity corresponding to the second text can be calculated, and the third similarity between the first text and the second text can be determined based on the average of the non-zero similarities between each entity.
[0075] In the embodiment of the present invention, the third similarity between the first text and the second text is determined based on the entities corresponding to the sentences in the first sentence set and the entities corresponding to the sentences in the second sentence set.
[0076] Step 150: Determine a target similarity between the first text and the second text according to the first similarity, the second similarity, and the third similarity between the first text and the second text.
[0077] After determining the three similarities between the first text and the second text according to the three aforementioned methods, the target similarity can be determined by fusing the three similarities.
[0078] Specifically, the target similarity can be determined based on the average of the first similarity, the second similarity, and the third similarity. Of course, to improve the accuracy of the target similarity, the first similarity, the second similarity, and the third similarity can be weighted averaged to determine the target similarity. The weights of the first similarity, the second similarity, and the third similarity can be set according to actual needs and are not specifically limited here.
[0079] In an embodiment of the present invention, a more accurate target similarity between the first text and the second text is determined by fusing a first similarity between the first text and the second text determined based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set, a second similarity between the first text and the second text determined based on the category comparison results of each sentence in the first sentence set and the second sentence set, and a third similarity between the first text and the second text determined based on the entities corresponding to each sentence in the first sentence set and the entities corresponding to each sentence in the second sentence set.
[0080] The text similarity detection method provided by an embodiment of the present invention includes: determining a first sentence set corresponding to a first text and a second sentence set corresponding to a second text; determining a first similarity between the first text and the second text based on triples corresponding to each sentence in the first sentence set and triples corresponding to each sentence in the second sentence set; determining a second similarity between the first text and the second text based on a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set; determining a third similarity between the first text and the second text based on the similarity between each entity corresponding to the first text and each entity corresponding to the second text; and determining a target similarity between the first text and the second text based on the first similarity, the second similarity, and the third similarity between the first text and the second text. The above technical solution can first determine the sentences corresponding to the first text and the sentences corresponding to the second text by extracting sentences from the first text and the second text, construct a first sentence set based on the sentences extracted from the first text, and construct a second sentence set based on the sentences extracted from the second text, thereby realizing the rapid construction of the first sentence set corresponding to the first text and the second sentence set corresponding to the second text. Secondly, the first similarity between the first text and the second text can be determined based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set. The second similarity between the first text and the second text can also be determined based on the category comparison results of each sentence in the first sentence set and each sentence in the second sentence set. The third similarity between the first text and the second text can also be determined based on the entities corresponding to each sentence in the first sentence set and the entities corresponding to each sentence in the second sentence set. The first similarity, the second similarity and the third similarity can then be integrated to obtain the target similarity, thereby realizing a more accurate target similarity between the first text and the second text.
[0081] Figure 2 This is a flowchart of another text similarity detection method provided by an embodiment of the present invention. This embodiment is specific based on the above embodiment. Figure 2 As shown, in this embodiment, the method may further include:
[0082] Step 210: Determine a first sentence set corresponding to the first text and a second sentence set corresponding to the second text.
[0083] In one implementation, step 210 may specifically include:
[0084] By performing sentence extraction on the first text, the first sentence set corresponding to the first text is determined; by performing sentence extraction on the second text, the second sentence set corresponding to the second text is determined.
[0085] As mentioned above, by performing sentence extraction on the first text, the sentences corresponding to the first text are determined, and a first sentence set is constructed based on all the sentences corresponding to the first text. By performing sentence extraction on the second text, the sentences corresponding to the second text are determined, and a second sentence set is constructed based on all the sentences corresponding to the second text.
[0086] In an embodiment of the present invention, sentences corresponding to the first text and the second text that need to be tested for similarity are extracted to determine the sentences corresponding to the first text, a first sentence set is constructed based on the sentences extracted from the first text, and a second sentence set is constructed based on the sentences extracted from the second text, thereby achieving rapid construction of a first sentence set corresponding to the first text and a second sentence set corresponding to the second text.
[0087] Step 220: Determine a first similarity between the first text and the second text based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set.
[0088] In one implementation, step 220 may specifically include:
[0089] Each of the sentences is input into a pre-trained triple extraction model so that the triple extraction model determines the triple corresponding to each of the sentences; the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set are input into a pre-trained comparison model so that the comparison model determines the first similarity between the first text and the second text by analyzing the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set.
[0090] Figure 3 A schematic diagram of a triple extraction model in another text similarity detection method provided by an embodiment of the invention, such as Figure 3 As shown in the figure, the model consists of an embedding layer, a bidirectional long short-term memory layer (BiLSTM layer), an attention mechanism, and a fully connected layer. Furthermore, the triple extraction model is trained using sentences and their corresponding triples as a training dataset, outputting the triples corresponding to the sentences. The triples corresponding to the sentences in the training dataset are determined using the ROT algorithm and then manually labeled.
[0091] Therefore, after the sentence is input into the triple extraction model, the triple extraction model can output the triple corresponding to the sentence.
[0092] The comparison model is obtained by training a convolutional neural network model using the triples corresponding to each sentence of the two texts that need to be tested for similarity and the similarity between the texts as a training set. It is used to determine and output the similarity between the two texts based on the triples corresponding to each sentence of the two texts that need to be tested for similarity.
[0093] Therefore, after determining the triples corresponding to each sentence in the first sentence set corresponding to the first text and the second sentence set corresponding to the second text based on the triple extraction model, each sentence in the first sentence set and each sentence in the second sentence set are input into the comparison model as input information, and the comparison model can output the first similarity between the first text and the second text.
[0094] In the embodiment of the present invention, a first similarity between a first text and a second text is determined based on triples corresponding to each sentence in the first sentence set and triples corresponding to each sentence in the second sentence set.
[0095] Step 230: Determine a second similarity between the first text and the second text based on a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set.
[0096] In one implementation, step 230 may specifically include:
[0097] Input each sentence in the first sentence set and each sentence in the second sentence set into a pre-trained classification model so that the classification model determines a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set; and determine a second similarity between the first text and the second text based on each category comparison result.
[0098] Figure 4 A schematic diagram of a classification model in another text similarity detection method provided by an embodiment of the invention, such as Figure 4 As shown, the classification model is composed of a convolutional neural network model ( Figure 4 Left side of the middle), bidirectional converter model ( Figure 4 The classification model is obtained by training the model using the category comparison results of sentences and sentences as the training data set, which is used to determine the category comparison results between the two sentences input into the model.
[0099] The category comparison result between two statements is determined by the similarity between the statements. If the similarity between the statements is greater than a preset threshold, the category comparison result between the statements is determined to be similar, and a category label of "1" is assigned to them. If the similarity between the statements is not greater than the preset threshold, the category comparison result between the statements is determined to be dissimilar, and a category label of "0" is assigned to them.
[0100] Specifically, after any sentence in the first sentence set and any sentence in the second sentence set are input into the classification model, the classification model can first determine the word vector encoding corresponding to each sentence based on the first encoding model, and can also determine the character vector encoding corresponding to each sentence based on the second encoding model. After determining the word vector encoding and character vector encoding corresponding to each sentence, the word vector encoding and the character vector encoding can be fused to obtain the word-character encoding. The word-character encoding obtained by fusion of the word vector encoding and the character vector encoding can reflect the more accurate semantics and logical relationship of the sentence. Then, the similarity between each sentence can be determined based on the word-character encoding corresponding to each sentence. If the similarity between the sentences is greater than a preset threshold, the category comparison result between the sentences is determined to be similar, and a category label of "1" is assigned to them. If the similarity between the sentences is not greater than the preset threshold, the category comparison result between the sentences is determined to be dissimilar, and a category label of "0" is assigned to them.
[0101] After determining the category comparison results of each sentence in the first sentence set and each sentence in the second sentence set, the total number of similarities in these category comparison results can be counted, and the second similarity between the first text and the second text can be determined based on the ratio of the total number of similarities in these category comparison results to the total number of all category comparison results.
[0102] In the embodiment of the present invention, the second similarity between the first text and the second text is determined based on the category comparison result of each sentence in the first sentence set and each sentence in the second sentence set.
[0103] Step 240: Determine a third similarity between the first text and the second text based on the similarities between the entities corresponding to the first text and the entities corresponding to the second text.
[0104] In one implementation, step 240 may specifically include:
[0105] By performing entity extraction on the first text and the second text, the entities corresponding to the first text and the entities corresponding to the second text are determined; the similarities between the entities corresponding to the first text and the entities corresponding to the second text are determined based on the depth information of the entities corresponding to the first text in the entity tree and the depth information of the entities corresponding to the second text in the entity tree; and the third similarity between the first text and the second text is determined based on the similarities between the entities corresponding to the first text and the entities corresponding to the second text.
[0106] Specifically, first, entity extraction can be performed on the first and second texts based on the terminology library of the fields corresponding to the first and second texts to determine the entities corresponding to the first and second texts. Specifically, the word segmentation corresponding to the first text and the word segmentation corresponding to the second text can be determined, and each word segmentation can be searched in the terminology library of the fields corresponding to the first and second texts. If any word segmentation exists in the terminology library, the word segmentation is determined to be the entity corresponding to the text, thereby determining the entity corresponding to the first text and the entity corresponding to the second text. The similarity between each entity corresponding to the first text and each entity corresponding to the second text can then be calculated, and the third similarity between the first and second texts can be determined based on the average of the non-zero similarities between the entities.
[0107] It should be noted that each entity in the terminology database is stored based on the term tree. The hierarchy of the term tree and the parent-child relationship of each node are set according to the hierarchy and parent-child relationship of the terms in the corresponding field. Figure 5 A schematic diagram of a term tree in another text similarity detection method provided by an embodiment of the invention, such as Figure 5 As shown, for two entities, the corresponding nodes of the two entities must have the same ancestor node in the terminology tree. For example, the node corresponding to "Agricultural Bank" is the ancestor node of the nodes corresponding to "R&D Department 1" and "Personal Finance Department." Therefore, the similarity between the two entities can be determined based on the depth information of the corresponding nodes of the two entities in the terminology tree and the depth information of the ancestor nodes of the corresponding nodes of the two entities in the terminology tree.
[0108] For example, the similarity between two entities can be determined based on the following formula, where Sim(c i ,c j ) represents entity c i and entity c j The similarity between them, depth(c i ) represents the depth of the node corresponding to entity ci in the term tree, depth(c j ) represents the depth of the node corresponding to entity cj in the term tree, depth(c lcs ) represents the depth of the ancestor node of entity ci and entity cj in the term tree.
[0109]
[0110] In the embodiment of the present invention, the third similarity between the first text and the second text is determined based on the entities corresponding to the sentences in the first sentence set and the entities corresponding to the sentences in the second sentence set.
[0111] Step 250: determine a first weight based on the number of triples corresponding to the sentences in the first sentence set and the second sentence set; determine a second weight based on the number of word codes corresponding to the sentences in the first sentence set and the second sentence set; determine a third weight based on the number of entities corresponding to the first text and the second text.
[0112] Specifically, after determining the triples corresponding to each statement in the first statement set and the second statement set, the maximum number of triples corresponding to each statement can be determined, and a first value can be determined based on the product of the total number of statements in the first statement set and the second statement set and the maximum number of triples corresponding to each statement, and then a first weight can be determined based on the ratio of the number of triples corresponding to the statements in the first statement set and the second statement set and the first value. After determining the word-character encoding corresponding to each statement in the first statement set and the second statement set, the maximum number of word-character encodings corresponding to each statement can be determined, and a second value can be determined based on the product of the total number of statements in the first statement set and the second statement set and the maximum number of word-character encodings corresponding to each statement, and then a second weight can be determined based on the ratio of the number of word-character encodings corresponding to the statements in the first statement set and the second statement set and the second value. After determining the entities corresponding to each statement in the first statement set and the second statement set, the maximum number of entities corresponding to each statement can be determined, and a third value can be determined based on the product of the total number of statements in the first statement set and the second statement set and the maximum number of word-character encodings corresponding to each statement, and then a third weight can be determined based on the ratio of the number of word-character encodings corresponding to the statements in the first statement set and the second statement set and the third value.
[0113] Step 260: Determine a target similarity between the first text and the second text based on the first similarity, the second similarity, and the third similarity between the first text and the second text.
[0114] In one implementation, step 260 may specifically include:
[0115] The first similarity, the second similarity, and the third similarity are weightedly summed based on the first weight, the second weight, and the third weight to obtain the target similarity.
[0116] Specifically, after determining the first weight, the second weight and the third weight, the first weight, the second weight and the third weight can be normalized, and then the first similarity, the second similarity and the third similarity can be weighted summed based on the normalized first weight, the second weight and the third weight to achieve the fusion of the first weight, the second weight and the third weight to obtain the target similarity.
[0117] In the embodiment of the present invention, a more accurate target similarity between the first text and the second text is determined by fusing the first similarity, the second similarity, and the third similarity.
[0118] The text similarity detection method provided by an embodiment of the present invention includes: determining a first sentence set corresponding to a first text and a second sentence set corresponding to a second text; determining a first similarity between the first text and the second text based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set; determining a second similarity between the first text and the second text based on the category comparison results between each sentence in the first sentence set and each sentence in the second sentence set; determining a third similarity between the first text and the second text based on the similarity between each entity corresponding to the first text and each entity corresponding to the second text; determining a first weight based on the number of triples corresponding to sentences in the first sentence set and the second sentence set; determining a second weight based on the number of word codes corresponding to sentences in the first sentence set and the second sentence set; determining a third weight based on the number of entities corresponding to the first text and the second text; and performing weighted summation of the first similarity, the second similarity, and the third similarity based on the first weight, the second weight, and the third weight to obtain the target similarity. The above technical solution can first determine the sentences corresponding to the first text and the sentences corresponding to the second text by extracting sentences from the first text and the second text, construct a first sentence set based on the sentences extracted from the first text, and construct a second sentence set based on the sentences extracted from the second text, thereby realizing the rapid construction of the first sentence set corresponding to the first text and the second sentence set corresponding to the second text. Secondly, the first similarity between the first text and the second text can be determined based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set. The second similarity between the first text and the second text can also be determined based on the category comparison results of each sentence in the first sentence set and each sentence in the second sentence set. The third similarity between the first text and the second text can also be determined based on the entities corresponding to each sentence in the first sentence set and the entities corresponding to each sentence in the second sentence set. Then, the first similarity, the second similarity and the third similarity can be fused to obtain a target similarity, thereby determining the target similarity between the first text and the second text. Moreover, by fusion of the first similarity, the second similarity and the third similarity to obtain the target similarity, the target similarity can be determined, thereby realizing the calculation of the similarity between the texts in combination with the text context, the text semantics and the hierarchical relationship between the entities in the texts, thereby calculating a more accurate similarity between the texts.
[0119] Figure 6 This is a schematic diagram of the structure of a text similarity detection device provided by an embodiment of the present invention. This device can be applied to situations where text similarity detection is required, improving the accuracy of similarity detection. The device can be implemented using software and / or hardware and is generally integrated into an electronic device, such as a computer.
[0120] like Figure 6 As shown, the device includes:
[0121] An execution module 610 is configured to determine a first sentence set corresponding to the first text and a second sentence set corresponding to the second text;
[0122] A first determining module 620, configured to determine a first similarity between the first text and the second text based on triples corresponding to each sentence in the first sentence set and triples corresponding to each sentence in the second sentence set;
[0123] A second determining module 630 is configured to determine a second similarity between the first text and the second text based on a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set;
[0124] A third determining module 640 is configured to determine a third similarity between the first text and the second text based on similarities between the entities corresponding to the first text and the entities corresponding to the second text;
[0125] The similarity determination module 650 is configured to determine a target similarity between the first text and the second text based on the first similarity, the second similarity, and the third similarity between the first text and the second text.
[0126] The text similarity detection device provided in this embodiment determines a first sentence set corresponding to a first text and a second sentence set corresponding to a second text; determines a first similarity between the first text and the second text based on triples corresponding to each sentence in the first sentence set and triples corresponding to each sentence in the second sentence set; determines a second similarity between the first text and the second text based on a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set; determines a third similarity between the first text and the second text based on the similarity between each entity corresponding to the first text and each entity corresponding to the second text; and determines a target similarity between the first text and the second text based on the first similarity, the second similarity, and the third similarity between the first text and the second text. The above technical solution can first determine the sentences corresponding to the first text and the sentences corresponding to the second text by extracting sentences from the first text and the second text, construct a first sentence set based on the sentences extracted from the first text, and construct a second sentence set based on the sentences extracted from the second text, thereby realizing the rapid construction of the first sentence set corresponding to the first text and the second sentence set corresponding to the second text. Secondly, the first similarity between the first text and the second text can be determined based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set. The second similarity between the first text and the second text can also be determined based on the category comparison results of each sentence in the first sentence set and each sentence in the second sentence set. The third similarity between the first text and the second text can also be determined based on the entities corresponding to each sentence in the first sentence set and the entities corresponding to each sentence in the second sentence set. The first similarity, the second similarity and the third similarity can then be integrated to obtain the target similarity, thereby realizing a more accurate target similarity between the first text and the second text.
[0127] Based on the above embodiment, the execution module 610 is specifically configured to:
[0128] By performing sentence extraction on the first text, the first sentence set corresponding to the first text is determined; by performing sentence extraction on the second text, the second sentence set corresponding to the second text is determined.
[0129] Based on the above embodiment, the first determining module 620 is specifically configured to:
[0130] Each of the sentences is input into a pre-trained triple extraction model so that the triple extraction model determines the triple corresponding to each of the sentences; the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set are input into a pre-trained comparison model so that the comparison model determines the first similarity between the first text and the second text by analyzing the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set.
[0131] Based on the above embodiment, the second determining module 630 is specifically configured to:
[0132] Determine the word vector encoding and the character vector encoding of each of the sentences, and fuse the word vector encoding and the character vector encoding to obtain the encoding information; input the encoding information corresponding to each sentence in the first sentence set and the encoding information corresponding to each sentence in the second sentence set into a pre-trained classification model, so that the classification model determines the category labels between each sentence in the first sentence set and each sentence in the second sentence set; determine the second similarity between the first text and the second text according to each of the category labels.
[0133] Based on the above embodiment, the third determining module 640 is specifically configured to:
[0134] By performing entity extraction on the first text and the second text, the entities corresponding to the first text and the entities corresponding to the second text are determined; the similarities between the entities corresponding to the first text and the entities corresponding to the second text are determined based on the depth information of the entities corresponding to the first text in the entity tree and the depth information of the entities corresponding to the second text in the entity tree; and the third similarity between the first text and the second text is determined based on the similarities between the entities corresponding to the first text and the entities corresponding to the second text.
[0135] Based on the above embodiment, the device further includes:
[0136] A weight determination module is used to determine a first weight based on the number of triples corresponding to the sentences in the first sentence set and the second sentence set; determine a second weight based on the number of word codes corresponding to the sentences in the first sentence set and the second sentence set; and determine a third weight based on the number of entities corresponding to the first text and the second text.
[0137] Based on the above embodiment, the similarity determination module 650 is specifically configured to:
[0138] The first similarity, the second similarity, and the third similarity are weightedly summed based on the first weight, the second weight, and the third weight to obtain the target similarity.
[0139] The text similarity detection device provided in the embodiment of the present invention can execute the text similarity detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the text similarity detection method.
[0140] It is worth noting that in the embodiment of the above-mentioned text similarity detection device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the various functional units are only for the convenience of distinguishing each other and are not used to limit the scope of protection of the present invention.
[0141] Figure 7 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. Figure 7 A block diagram of an exemplary electronic device 7 suitable for implementing embodiments of the present invention is shown. Figure 7 The electronic device 7 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0142] like Figure 7 As shown, the electronic device 7 is in the form of a general-purpose computing electronic device. Components of the electronic device 7 may include, but are not limited to, one or more processors or processing units 16, a system memory 28, and a bus 18 connecting various system components (including the system memory 28 and the processing unit 16).
[0143] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0144] The electronic device 7 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 7, including volatile and non-volatile media, removable and non-removable media.
[0145] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 7 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 7 Not shown, often called a "hard drive"). Although Figure 7 Not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.
[0146] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0147] The electronic device 7 may also communicate with one or more external devices 14 (e.g., a keyboard, a pointing device, a display 24, etc.), one or more devices that enable a user to interact with the electronic device 7, and / or any device that enables the electronic device 7 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 7 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. Figure 7 As shown, the network adapter 20 communicates with other modules of the electronic device 7 via the bus 18. Figure 7 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 7, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0148] The processing unit 16 executes various functional applications and page displays by running programs stored in the system memory 28, for example, implementing the text similarity detection method provided in an embodiment of the present invention, which includes:
[0149] Determine a first sentence set corresponding to the first text and a second sentence set corresponding to the second text;
[0150] determining a first similarity between the first text and the second text based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set;
[0151] determining a second similarity between the first text and the second text based on a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set;
[0152] determining a third similarity between the first text and the second text based on similarities between each entity corresponding to the first text and each entity corresponding to the second text;
[0153] A target similarity between the first text and the second text is determined according to the first similarity, the second similarity, and the third similarity between the first text and the second text.
[0154] Of course, those skilled in the art will appreciate that the processor may also implement the technical solution of the text similarity detection method provided by any embodiment of the present invention.
[0155] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method for detecting text similarity provided in an embodiment of the present invention is implemented, for example, and the method includes:
[0156] Determine a first sentence set corresponding to the first text and a second sentence set corresponding to the second text;
[0157] determining a first similarity between the first text and the second text based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set;
[0158] determining a second similarity between the first text and the second text based on a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set;
[0159] determining a third similarity between the first text and the second text based on similarities between each entity corresponding to the first text and each entity corresponding to the second text;
[0160] A target similarity between the first text and the second text is determined according to the first similarity, the second similarity, and the third similarity between the first text and the second text.
[0161] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, 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 above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0162] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0163] Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0164] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0165] Those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using a general-purpose computing device. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computer device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
[0166] In addition, the acquisition, storage, use, and processing of data in the technical solution of the present invention comply with relevant provisions of laws and regulations.
[0167] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will appreciate that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments, and substitutions are possible for those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. A text similarity detection method, characterized in that: include: Determine a first sentence set corresponding to the first text and a second sentence set corresponding to the second text; determining a first similarity between the first text and the second text based on the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set; determining a second similarity between the first text and the second text based on a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set; determining a third similarity between the first text and the second text based on similarities between each entity corresponding to the first text and each entity corresponding to the second text; A target similarity between the first text and the second text is determined according to the first similarity, the second similarity, and the third similarity between the first text and the second text.
2. The text similarity detection method according to claim 1, characterized in that: Determining a first sentence set corresponding to the first text and a second sentence set corresponding to the second text includes: Determining the first sentence set corresponding to the first text by performing sentence extraction on the first text; The second sentence set corresponding to the second text is determined by performing sentence extraction on the second text.
3. The text similarity detection method according to claim 1, characterized in that: Determining a first similarity between the first text and the second text based on triples corresponding to each sentence in the first sentence set and triples corresponding to each sentence in the second sentence set includes: Inputting each of the sentences into a pre-trained triple extraction model so that the triple extraction model determines the triple corresponding to each of the sentences; The triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set are input into a pre-trained comparison model, so that the comparison model determines the first similarity between the first text and the second text by analyzing the triples corresponding to each sentence in the first sentence set and the triples corresponding to each sentence in the second sentence set.
4. The text similarity detection method according to claim 1, characterized in that: Determining a second similarity between the first text and the second text according to a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set includes: Inputting each sentence in the first sentence set and each sentence in the second sentence set into a pre-trained classification model, so that the classification model determines a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set; A second similarity between the first text and the second text is determined according to the category comparison results.
5. The text similarity detection method according to claim 1, characterized in that: Determining a third similarity between the first text and the second text based on similarities between entities corresponding to the first text and entities corresponding to the second text includes: Determine an entity corresponding to the first text and an entity corresponding to the second text by performing entity extraction on the first text and the second text; Determining similarities between the entities corresponding to the first text and the entities corresponding to the second text based on depth information of the entities corresponding to the first text in the entity tree and depth information of the entities corresponding to the second text in the entity tree; A third similarity between the first text and the second text is determined based on similarities between the entities corresponding to the first text and the entities corresponding to the second text.
6. The text similarity detection method according to claim 1, characterized in that: Before determining the target similarity between the first text and the second text according to the first similarity, the second similarity, and the third similarity between the first text and the second text, the method further includes: Determining a first weight according to the number of triples corresponding to sentences in the first sentence set and the second sentence set; Determining a second weight according to the number of word codes corresponding to the sentences in the first sentence set and the second sentence set; A third weight is determined according to the number of entities corresponding to the first text and the second text.
7. The text similarity detection method according to claim 6, characterized in that: Determining a target similarity between the first text and the second text according to the first similarity, the second similarity, and the third similarity between the first text and the second text includes: The first similarity, the second similarity, and the third similarity are weightedly summed based on the first weight, the second weight, and the third weight to obtain the target similarity.
8. A text similarity detection device, characterized in that: include: An execution module, configured to determine a first sentence set corresponding to the first text and a second sentence set corresponding to the second text; a first determining module, configured to determine a first similarity between the first text and the second text based on a triple corresponding to each sentence in the first sentence set and a triple corresponding to each sentence in the second sentence set; a second determining module, configured to determine a second similarity between the first text and the second text based on a category comparison result between each sentence in the first sentence set and each sentence in the second sentence set; a third determining module, configured to determine a third similarity between the first text and the second text based on similarities between each entity corresponding to the first text and each entity corresponding to the second text; The similarity determination module is configured to determine a target similarity between the first text and the second text according to the first similarity, the second similarity, and the third similarity between the first text and the second text.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the text similarity detection method according to any one of claims 1 to 7.
10. A storage medium containing computer-executable instructions, characterized in that: When executed by a computer processor, the computer executable instructions are used to perform the text similarity detection method according to any one of claims 1 to 7.