Transformer standard differentiation comparison method, system, equipment and medium
Through the unsupervised comparison learning model, the transformer supervision troubles caused by the difference in standards in the power industry are solved, and high-precision differentiated comparison of standard documents is achieved, which improves the discrimination and application effect of standard documents.
Patent Information
- Application Number
- CN202510426195.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-07-18
AI Technical Summary
Due to the differences in the description methods, research objects and subject titles of the power industry standards, there are great differences in the business execution of transformer standard documents in different years, domestic and foreign standards, equipment manufacturers and provincial companies, which brings troubles to the technical supervision of the entire process of transformer and the execution of grassroots business, affecting the effectiveness of the digital application of standards.
The unsupervised comparative learning model is used to process the standard text of the transformer, and the similarity matrix is constructed through dropout encoder and mask operations, the similarity points and differences points of the standard text are judged, and the cosine similarity calculation and semantic level loss function are used to improve the discriminantity of the standard file.
It realizes high-precision and high-quality semantic representation of transformer standard documents, reduces noise interference, strengthens the discriminant characteristics between standard texts, and improves the differentiated comparison capabilities of standard documents.
Smart Images

Figure CN120336875A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data processing, and relates to a method, system, device and medium for comparing the differences of transformer standards. Background Art
[0002] The power industry standards are comprehensive industry standards that span multiple disciplines, departments and languages. In the process of promoting the digitization of power industry standards, due to differences in description methods, research objects, disciplinary titles, and scope of application, there are cases of entity misalignment of one-to-many and many-to-one in the semantic mapping of relevant standard clauses, resulting in machine semantic understanding deviation, which seriously affects the practical application value of standard digitization construction.
[0003] At present, the State Grid Corporation has issued a large number of technical standards and technical documents in various links such as the operation and maintenance, repair and disposal of transformers. However, the standards in each link have different focuses, and the standards in each link are under different centralized management and have strong subjectivity in writing, resulting in large differences between the standard clauses in each link, which brings troubles to the whole-process technical supervision of transformers and the implementation of standards by grass-roots business personnel. In view of the problems existing in transformer standards, such as differences in standards of different years, differences between domestic and foreign standards, differences among equipment manufacturers, and differences in the implementation of business by provincial companies, it is urgent to standardize and sort out the extraction strategies of key entity elements, co-refer and disambiguate the key entities of a large number of standard clauses, and quantitatively analyze the semantic similarity of clauses, so as to further improve the digitization and intelligence level of standard application, support the safe, economic and low-carbon operation of the power grid, and ensure the effective implementation of the digital transformation of the power industry. Summary of the Invention
[0004] The purpose of the present invention is to overcome the above-mentioned disadvantages of the prior art, and provides a method, system, device and medium for comparing the differences of transformer standards, which can realize the differential comparison of transformer standard documents.
[0005] To achieve the above object, the present invention discloses a method for comparing the differences of transformer standards, including:
[0006] Obtaining each execution standard text of the transformer;
[0007] Inputting each execution standard text of the transformer into a trained unsupervised contrastive learning model to obtain a similarity matrix between each execution standard text;
[0008] Determining execution standard text pairs with a similarity exceeding a similarity threshold according to the similarity matrix between each execution standard text;
[0009] Judging the similarities and differences between the two execution standard texts in the determined execution standard text pairs.
[0010] A further improvement of the transformer standard differentiation comparison method described in the present invention lies in:
[0011] Furthermore, the unsupervised contrastive learning model includes an encoding layer and an output layer. The encoding layer processes the execution standard text through two different dropout encoders to obtain positive and negative discrimination pairs h i and and operates on the execution standard text through two masks with different ratios to form a triple (s i , s i ', s i "); The output layer constructs a similarity matrix between the respective execution standard texts according to the positive and negative discrimination pairs h i and and the triple (s i , s i ', s i ").
[0012] Furthermore, the loss function L during the training process of the unsupervised contrastive learning model is:
[0013] L = αL sen + βL tri
[0014] where L tri represents the semantic level loss function, L sen represents the sentence level loss function, and α and β are the weights of L sen and L tri respectively.
[0015] Furthermore, the sentence level loss function L sen is expressed as:
[0016]
[0017] where the angle i between h j and h ε is a hyperparameter, is the included angle between h i and .
[0018] Furthermore, the semantic level loss function L tri is expressed as:
[0019] L tri = max(0, sim(s i , s i ") - sim(s i , s i '))
[0020] Among them, sim(·,·) is a cosine similarity calculation function.
[0021] The present invention discloses a transformer standard differential comparison system, including:
[0022] An acquisition module, configured to acquire each execution standard text of the transformer;
[0023] A calculation module, configured to input each execution standard text of the transformer into a trained unsupervised contrast learning model to obtain a similarity matrix between the execution standard texts;
[0024] A determination module, configured to determine, according to the similarity matrix between the execution standard texts, execution standard text pairs whose similarity exceeds a similarity threshold;
[0025] A judgment module, configured to judge the similarities and differences between the two execution standard texts in the determined execution standard text pairs.
[0026] A further improvement of the transformer standard differential comparison system according to the present invention lies in:
[0027] Further, the unsupervised contrast learning model includes an encoding layer and an output layer. The encoding layer processes the execution standard text through two different dropout encoders to obtain positive and negative discrimination pairs h i and and operates on the execution standard text through two masks with different ratios to form a triple (s i , s i ', s i ”) with an inclusion relationship; the output layer constructs the similarity matrix between the execution standard texts according to the positive and negative discrimination pairs h i and and the triple (s i , s i ', s i ”).
[0028] Further, the loss function of the unsupervised contrast learning model during the training process is:
[0029] L = αL sen + βL tri
[0030] Among them, L tri represents a semantic-level loss function, L sen represents a sentence-level loss function, and α and β are the weights of L sen and L tri respectively.
[0031] Further, the sentence-level loss function Lsen Expressed as:
[0032]
[0033] Where h i and h j The angle between ε is a hyperparameter, is the included angle between h i and The included angle between.
[0034] Furthermore, the loss function L at the semantic level tri Expressed as:
[0035] L tri = max(0, sim(s i , s i ") - sim(s i , s i '))
[0036] Where sim(·,·) is the cosine similarity calculation function.
[0037] The present invention discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the transformer standard differential comparison method are implemented.
[0038] The present invention discloses a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the transformer standard differential comparison method are implemented.
[0039] The present invention has the following beneficial effects:
[0040] When the transformer standard differential comparison method, system, device and medium of the present invention are specifically operated, the respective execution standard texts of the transformer are input into the trained unsupervised contrast learning model to obtain a similarity matrix between the respective execution standard texts, so as to improve the high-precision and high-quality semantic representation of the standard file, strengthen the discriminative features between the standard texts, reduce the noise interference during discrimination, and then determine the similarity points and difference points between the two execution standard texts in the obtained execution standard text pair, realizing the differential comparison of the transformer standard file. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The specification drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention. In the drawings:
[0042] Figure 1 is the method flowchart of the present invention;
[0043] Figure 2 is the structural diagram of the unsupervised contrastive learning model in the present invention;
[0044] Figure 3 is the system structural diagram of the present invention. Detailed implementation manners
[0045] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0046] In the description of the present invention, it should be understood that the terms "include" and "comprise" indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.
[0047] It should also be understood that the terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.
[0048] It should also be further understood that the term " / and" used in the specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in the present invention generally represents an "or" relationship between the preceding and following related objects.
[0049] It should be understood that although the terms first, second, third, etc. may be used in the embodiments of the present invention to describe preset ranges, etc., these preset ranges should not be limited to these terms. These terms are only used to distinguish the preset ranges from each other. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0050] Depending on the context, as used herein, the term "if" can be interpreted as "when" or "while" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if determined" or "if detecting (stated condition or event)" can be interpreted as "when determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)".
[0051] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. Generally, the components described and shown in the accompanying drawings herein can be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.
[0052] Schematic diagrams of various structures according to the disclosed embodiments of the present invention are shown in the drawings. These figures are not drawn to scale, where for the purpose of clear illustration, some details are enlarged and some details may be omitted. The shapes of various regions and layers shown in the figures and their relative sizes and positional relationships are merely exemplary, and may actually deviate due to manufacturing tolerances or technical limitations, and those skilled in the art can additionally design regions / layers with different shapes, sizes and relative positions according to actual requirements.
[0053] Embodiment 1
[0054] Refer to Figure 1 , the transformer standard differentiation comparison method of the present invention includes the following steps:
[0055] 1) Extract standard key elements;
[0056] For text data such as the implementation standards of transformers, the implementation standard text is parsed and annotated to complete the extraction of key elements in each implementation standard text.
[0057] According to the structural characteristics of the implementation standards of the transformer, the standard text is parsed and classified into three categories: "structured - single value", "structured - list", and "unstructured". Among them, the "structured - single value" type contains data information where one type of label corresponds to one content; the "structured - list" type contains data information where one type of label corresponds to multiple contents; the "unstructured" type contains data information where the labels and contents are not fixed. After parsing and annotation, a standard text pair is formed < l a b e l ,content> , where content is the text content and label is the corresponding text label
[0058] 2) Construct features
[0059] Based on the text content and key entity elements obtained in step 1), feature representations at the sentence level and semantic level are constructed respectively
[0060] The specific operation of step 2) is as follows
[0061] 21) Construct positive and negative discrimination pairs at the sentence level
[0062] For any text content content i , two different dropout encoders are used to construct positive and negative discrimination pairs h i and
[0063] The loss function at the sentence level is calculated as
[0064]
[0065] where sim(·,·) is the cosine similarity calculation function, ε is a hyperparameter, and n is the number of all sentences in the training set
[0066] In addition, the cosine similarity method is converted to an angular space metric method. Specifically, let h i and h j The angle between Then the loss function at the sentence level is modified to
[0067]
[0068] 22) Construct semantic triples at the semantic level
[0069] For any text content content i , through two masking operations with different ratios, a set of triples with an inclusion relationship (s i , s i ', s i”), where the masking operation deletes the attributive and other content in the sentence and only retains the core content of the sentence. Generally, s i ' has a higher semantic similarity with s i than s i ” and s i .
[0070] The loss function for calculating the semantic level is as follows:
[0071] L tri = max(0, sim(s i , s i ”) - sim(s i , s i '))
[0072] where sim(·,·) is the cosine similarity calculation function.
[0073] 23) Calculation of the loss function.
[0074] The final loss function is jointly determined by the loss functions of two levels, that is:
[0075] L = αL sen + βL tri
[0076] where α and β are the weights of L sen and L tri respectively.
[0077] 3) Unsupervised contrastive learning;
[0078] Refer to Figure 2 , by minimizing the final loss function, reducing the distance from the positive samples and increasing the distance from the negative samples, to learn an encoder that can encode similar data for the same class and as different as possible for different data. The unsupervised contrastive learning model includes an input layer, an enhancement layer, an encoding layer, a loss layer, and an output layer.
[0079] Input layer: Use each standard text pair <label, content> in step 1) as the model input.
[0080] Enhancement layer: Divide the model input into the sentence level and the semantic level according to steps 21) and 22), and perform data enhancement operations respectively to improve the robustness and generalization of the model.
[0081] Encoding layer: Encode the enhanced data according to the operations in steps 21) and 22) respectively. At the sentence level, construct positive and negative discriminant pairs h i and At the semantic level, construct a triple (s i,s i ',s i ”)。
[0082] Loss layer: Calculate the loss functions at the sentence level and semantic level respectively, and feedback the parameters to the model by minimizing the loss functions for iterative training.
[0083] Output layer: Calculate the similarity between the positive and negative discrimination pairs h corresponding to each standard text pair i and and calculate the similarity between the triples (s i ,s i ',s i ”) corresponding to each standard text. Construct a similarity matrix based on the similarity between the positive and negative discrimination pairs h i and corresponding to each standard text pair and the similarity of the corresponding triples (s i ,s i ',s i ”), and output it.
[0084] 4) The transformer performs standard differential comparison;
[0085] Based on the text similarity matrix output by the unsupervised contrast model, judge the similarity degree between the input texts, set the similarity threshold to 0.8, that is, regard the texts with similarity exceeding 0.8 as combinations with smaller differences, and further judge the similarity points and difference points. Among them, use the bidirectional maximum matching method to segment keywords, mark the different keywords with different colors, and use the marked sentences as the output to display the differential comparison results of the standard texts.
[0086] Embodiment 2
[0087] The specific process of this embodiment is as follows:
[0088] 1) Extraction of standard key elements;
[0089] For text data such as transformer execution standards, perform text parsing and annotation to complete the extraction of key elements in the execution standards.
[0090] Combined with the structural characteristics of the transformer execution standard, the standard text is parsed and classified and labeled according to three types of content: "structured - single value", "structured - list", and "unstructured". Among them, the "structured - single value" type contains data information where one label corresponds to one content, such as standard cover information, standard scope, etc.; the "structured - list" type contains data information where one label corresponds to multiple contents, such as standard normative reference documents, terms and definitions, references, etc.; the "unstructured" type contains data information where the labels and contents are not fixed, such as standard forewords, standard contents, etc. After parsing and labeling, the standard text pairs <label, content> are obtained, where content is the text content and label is the corresponding text label.
[0091] Text labels include but are not limited to "standard number", "standard name", "release time", "foreword", "drafting unit", "drafter", "entitled unit", "scope", "normative reference documents", "terms and definitions", "abbreviations", "standard text", etc. The text content is the extracted string, with a maximum length of no more than 512 characters.
[0092] 2) Feature construction: Based on the text content and key entity elements obtained in step 1), feature representations at the sentence level and semantic level are constructed respectively.
[0093] The process of step 2) is as follows:
[0094] 21) Construct positive and negative discrimination pairs at the sentence level.
[0095] For any text content content i , through two different dropout encoders, positive and negative discrimination pairs h i and
[0096] Calculate the loss function at the sentence level as:
[0097]
[0098] Among them, sim(·,·) is the cosine similarity calculation function, ε is a hyperparameter, and n is the number of all sentences in the training set.
[0099] In addition, convert the cosine similarity method to an angular space measurement method. Specifically, let the angle i between h j and h Then the loss function at the sentence level can be modified to:
[0100]
[0101] 22) Construct semantic triples at the semantic level.
[0102] For any text content content i , through two masking operations with different ratios, a set of triples with an inclusion relationship is formed (s i , s i ', s i ”). For example, if the original sentence is “When combining the major overhaul of the transformer, the calibration work of the pressure relief valve should be done well”, the sentence with a 20% mask may be “The transformer should have the calibration work of the pressure relief valve done well”, and the sentence with a 50% mask may be “The transformer should have the calibration work done well”. Generally, the masking operation deletes the attributive and other contents in the sentence and only retains the core content of the sentence. Generally speaking, the semantic similarity between s i ' and s i is higher than the semantic similarity between s i ” and s i .
[0103] The loss function for calculating the semantic level is as follows:
[0104] L tri = max(0, sim(s i , s i ”)-sim(s i , s i '))
[0105] Among them, sim(·,·) is the cosine similarity calculation function.
[0106] 23) Calculation of the loss function;
[0107] The final loss function is jointly determined by the loss functions of two levels, that is:
[0108] L = αL sen + βL tri
[0109] Among them, α and β are the weights of L sen and L tri respectively.
[0110] 3) Unsupervised contrastive learning;
[0111] By minimizing the final loss function, the distance between the input text and the positive samples is reduced, and the distance between the input text and the negative samples is increased, so as to learn an encoder that can encode similar data of the same type and encode different data as differently as possible. The unsupervised contrastive learning model includes an input layer, an enhancement layer, an encoding layer, a loss layer, and an output layer.
[0112] Input layer: Each standard text pair <label, content> in step 1) is used as the input of the unsupervised contrastive learning model.
[0113] Enhanced layer: The input of the unsupervised contrastive learning model is divided into the sentence level and the semantic level according to steps 21) and 22), and data enhancement operations are performed respectively to improve the robustness and generalization of the model.
[0114] Encoding layer: The enhanced data is encoded according to the operations in steps 21) and 22) respectively. At the sentence level, positive and negative discrimination pairs h are constructed through the encoder. i and At the semantic level, triples (s i , s i ', s i ”) are constructed through the masking operation.
[0115] Loss layer: Calculate the loss functions at the sentence level and the semantic level respectively, and feedback the parameters to the model by minimizing the loss functions for iterative training.
[0116] Output layer: Calculate the similarity between the positive and negative discrimination pairs h corresponding to each standard text pair i and , calculate the similarity between the triples (s i , s i ', s i ”) corresponding to each standard text. According to the similarity between the positive and negative discrimination pairs h i and and the similarity between the corresponding triples (s i , s i ', s i ”), construct a similarity matrix and output it.
[0117] 4) The transformer performs standard differential comparison;
[0118] Based on the text similarity matrix output by the unsupervised contrast model, judge the similarity degree between the input texts, set the similarity threshold to 0.8, that is, regard the texts with similarity exceeding 0.8 as combinations with smaller differences, and further judge the similarity points and difference points. Among them, the bidirectional maximum matching method is used to segment keywords, and the different keywords are marked with different colors, and the marked sentences are used as the output to display the differential comparison results of the standard texts.
[0119] Example 3
[0120] Refer to Figure 3 , the transformer standard differential comparison system described in the present invention includes:
[0121] An acquisition module for acquiring each execution standard text of the transformer;
[0122] A calculation module, configured to input each execution standard text of the transformer into a trained unsupervised contrastive learning model to obtain a similarity matrix between each execution standard text;
[0123] A determination module, configured to determine execution standard text pairs with a similarity exceeding a similarity threshold according to the similarity matrix between each execution standard text;
[0124] A judgment module, configured to judge the similarity points and difference points between the two execution standard texts in the determined execution standard text pairs.
[0125] In this embodiment, the unsupervised contrastive learning model includes an encoding layer and an output layer. The encoding layer processes the execution standard text through two different dropout encoders to obtain positive and negative discrimination pairs h i and h i * , and operates on the execution standard text through two masks with different ratios to form a triple (s i , s i ', s i ”) with an inclusion relationship; the output layer constructs the similarity matrix between each execution standard text according to the positive and negative discrimination pairs h i and h i * and the triple (s i , s i ', s i ”).
[0126] In this embodiment, the loss function of the unsupervised contrastive learning model during training is:
[0127] L = αL sen + βL tri
[0128] where L tri represents the semantic-level loss function, L sen represents the sentence-level loss function, and α and β are the weights of L sen and L tri respectively.
[0129] In this embodiment, the sentence-level loss function L sen is expressed as:
[0130]
[0131] where the angle i between h j and h ε is a hyperparameter, is h i and The included angle between.
[0132] In this embodiment, the loss function L of the semantic level tri is expressed as:
[0133] L tri = max(0, sim(s i , s i ”) - sim(s i , s i '))
[0134] where sim(·,·) is the cosine similarity calculation function.
[0135] The division of modules in the embodiments of the present application is illustrative, merely a logical function division. In actual implementation, there may be other division methods. In addition, in each embodiment of the present application, each functional module can be integrated in a processor, can also exist physically alone, or two or more modules can be integrated in one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
[0136] Embodiment 4
[0137] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the transformer standard differential comparison method. For example, it includes: obtaining each execution standard text of the transformer; inputting each execution standard text of the transformer into the trained unsupervised contrast learning model to obtain a similarity matrix between the execution standard texts; determining execution standard text pairs with a similarity exceeding a similarity threshold according to the similarity matrix between the execution standard texts; and judging the similarity points and difference points between the two execution standard texts in the determined execution standard text pairs. Among them, the memory may include memory, such as high-speed random access memory, and may also include non-volatile memory, such as at least one disk memory, etc.; the processor, network interface, and memory are interconnected through an internal bus, and this internal bus can be an Industry Standard Architecture bus, a Peripheral Component Interconnect standard bus, an Extended Industry Standard Architecture bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory is used to store programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory can include memory and non-volatile memory and provide instructions and data to the processor.
[0138] Embodiment 5
[0139] A computer-readable storage medium stores a computer program which, when executed by a processor, implements the steps of the transformer standard differential comparison method. For example, it includes: obtaining the execution standard texts of the transformer; inputting the execution standard texts of the transformer into a trained unsupervised contrastive learning model to obtain a similarity matrix between the execution standard texts; determining, according to the similarity matrix between the execution standard texts, pairs of execution standard texts whose similarity exceeds a similarity threshold; and judging the similarity points and difference points between the two execution standard texts in the determined pairs of execution standard texts. Specifically, the computer-readable storage medium includes but is not limited to, for example, volatile memory and / or non-volatile memory. The volatile memory may include random access memory (RAM) and / or cache memory, etc. The non-volatile memory may include read-only memory (ROM), hard disk, flash memory, optical disc, magnetic disk, etc.
[0140] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
[0141] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one or more flows Figure 1 or multiple flows and / or blocks
[0142] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the functions specified in Figure 1 one or more flows Figure 1 or multiple flows and / or blocks
[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable apparatus to generate a computer-implemented process, thereby providing instructions for implementing the functions specified in one process or multiple processes and / or blocks Figure 1 one process or multiple processes and / or blocks Figure 1 steps for implementing the functions specified in one block or multiple blocks.
[0144] After considering the specification and the disclosure of the invention, those skilled in the art will readily conceive of other embodiments of the invention. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include known common knowledge or conventional technical means in the technical field not disclosed by the invention. The specification and examples are only illustrative, and the true scope and spirit of the invention are pointed out by the following claims.
[0145] It should be understood that the present invention is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only limited by the appended claims.
[0146] The above are only the preferred embodiments of the present invention, and do not limit the present invention in any way. Any simple modifications, changes, and equivalent structural changes made to the above embodiments according to the technical essence of the present invention still fall within the protection scope of the technical solution of the present invention.
Claims
1. A method for comparing the differences in transformer standards, characterized in that, Including: Obtain the execution standard texts of the transformer; Input the execution standard texts of the transformer into the trained unsupervised contrastive learning model to obtain a similarity matrix between the execution standard texts; Determine the pairs of execution standard texts whose similarity exceeds the similarity threshold according to the similarity matrix between the execution standard texts; Judge the similarities and differences between the two execution standard texts in the determined pairs of execution standard texts.
2. The transformer standard differential comparison method according to claim 1, wherein The unsupervised contrastive learning model includes an encoding layer and an output layer. The encoding layer processes the execution standard text through two different dropout encoders to obtain positive and negative discrimination pairs h i and and operates on the execution standard text through two masks with different ratios to form a triple (s i , s i ', s i ”). The output layer constructs a similarity matrix between the execution standard texts according to the positive and negative discrimination pairs h i and and the triple (s i , s i ', s i ”).
3. The transformer standard differential comparison method according to claim 2, characterized in that, The loss function L in the training process of the unsupervised contrastive learning model is: L = αL sen + βL tri Among them, L tri represents the semantic-level loss function, and L sen represents the sentence-level loss function. α and β are the weights of L sen and L tri respectively.
4. The transformer standard differential comparison method according to claim 3, wherein The sentence-level loss function L sen is expressed as: where h i and h j the angle between ε is a hyperparameter, is the included angle between h i and 5. The transformer standard differential comparison method according to claim 3, wherein The loss function L of the semantic hierarchy tri is expressed as: L tri = max(0, sim(s i , s i ”)-sim(s i , s i ')) where sim(·,·) is the cosine similarity calculation function.
6. A transformer standard differential comparison system, characterized in that, Including: An acquisition module for obtaining the execution standard texts of the transformer; A calculation module for inputting the execution standard texts of the transformer into the trained unsupervised contrastive learning model to obtain a similarity matrix between the execution standard texts; A determination module for determining the pairs of execution standard texts whose similarity exceeds the similarity threshold according to the similarity matrix between the execution standard texts; A judgment module for judging the similarities and differences between the two execution standard texts in the determined pairs of execution standard texts.
7. The transformer standard differential comparison system according to claim 6, characterized in that, The unsupervised contrastive learning model includes an encoding layer and an output layer. The encoding layer processes the execution standard text through two different dropout encoders to obtain positive and negative discrimination pairs h i and and operates on the execution standard text through two masks with different ratios to form a triple (s i , s i ', s i ”) that contains a relationship; the output layer constructs a similarity matrix between the execution standard texts according to the positive and negative discrimination pairs h i and and the triple (s i , s i ', s i ”).
8. The transformer standard differential comparison system according to claim 7, wherein The loss function in the training process of the unsupervised contrastive learning model is: L = αL sen + βL tri Among them, L tri represents the semantic-level loss function, and L sen represents the sentence-level loss function. α and β are the weights of L sen and L tri respectively.
9. The transformer standard differential comparison system according to claim 8, wherein The sentence-level loss function L sen is expressed as: where h i and h j The angle between ε is a hyperparameter, is the included angle between h i and The included angle between 10. The transformer standard differential comparison system according to claim 8, characterized in that The loss function L of the semantic level tri is expressed as: L tri = max(0, sim(s i , s i ”), s i , s i ')) where sim(·,·) is the cosine similarity calculation function.
11. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the transformer standard differentiation comparison method according to any one of claims 1-5.
12. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the transformer standard differentiation comparison method according to any one of claims 1-5.