Message difference risk identification method and device, equipment and storage medium
The graph encoder constructed by the graph neural network model performs document differences analysis, which solves the insufficient identification of differences in format changes and paragraph reorganization of traditional document comparison methods, and achieves a more accurate risk assessment.
Patent Information
- Application Number
- CN202510692811.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-08-26
AI Technical Summary
Traditional document comparison methods cannot identify all differences when dealing with format changes and paragraph reorganization, affecting the accuracy of risk analysis.
The graph neural network model is used to construct a graph encoder through graph convolution operations, perform document differences analysis, identify semantic and structural differences, and risk assessment is carried out based on the results of the difference analysis.
It realizes detailed analysis of differences between documents, provides more accurate risk assessment, identify literal and deep semantic and structural differences, and improves the accuracy of risk analysis.
Smart Images

Figure CN120542409A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of risk identification technology, and in particular to a message difference risk identification method, apparatus, device and storage medium. Background Art
[0002] In the financial industry, message standards and interaction specifications are crucial for ensuring the accuracy and consistency of data exchanged between different systems. These standards and specifications are often highly specialized and complex, resulting in lengthy documents. In practice, it is often necessary to conduct comparative analysis of differences between different versions of the same standard, between different versions, and between similar specifications in similar fields. This comparative analysis is crucial for ensuring accuracy, compliance, and risk management in data exchange.
[0003] However, traditional document comparison methods are mainly based on line-by-line comparison of text, which can only identify literal differences, but may not be effective when dealing with formatting changes and paragraph reorganization. This will result in the inability to identify all differences and affect the final risk analysis.
[0004] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of this application is to provide a message difference risk identification method, device, equipment and storage medium, aiming to solve the technical problem that the accuracy of risk analysis is affected by the traditional document comparison method.
[0006] To achieve the above objectives, the present application proposes a method for identifying message difference risks, which includes:
[0007] Acquire a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed;
[0008] Based on a graph neural network model, performing a difference analysis on the first document to be analyzed and the second document to be analyzed to obtain a difference analysis result, wherein the graph neural network includes a graph encoder constructed based on a graph convolution operation;
[0009] Based on the difference analysis result, a risk analysis is performed on the target document pair to be analyzed to obtain a risk analysis result.
[0010] In one embodiment, the step of obtaining a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed, includes:
[0011] Obtaining a first initial document to be analyzed and a second initial document to be analyzed;
[0012] The first initial document to be analyzed and the second initial document to be analyzed are preprocessed to obtain a first document to be analyzed and a second document to be analyzed, wherein the preprocessing includes at least one of format unification, text cleaning, and sentence segmentation.
[0013] In one embodiment, the step of performing difference analysis on the first document to be analyzed and the second document to be analyzed based on the graph neural network model to obtain a difference analysis result includes:
[0014] Determining a similarity score between the first document to be analyzed and the second document to be analyzed;
[0015] Determining whether the similarity score is greater than a preset threshold;
[0016] When it is determined that the similarity score is greater than the preset threshold, performing a difference analysis on the first document to be analyzed and the second document to be analyzed based on a graph neural network model to obtain a difference analysis result;
[0017] When it is determined that the similarity score is not greater than the preset threshold, the target document pair to be analyzed is summarized and analyzed by a topic checker and a document summarizer to obtain the latest dynamic information for the target document pair to be analyzed.
[0018] In one embodiment, the step of determining the similarity score between the first document to be analyzed and the second document to be analyzed includes:
[0019] extracting a first high-dimensional vector representation of the first document to be analyzed, and extracting a second high-dimensional vector representation of the second document to be analyzed;
[0020] determining a first modulus according to the first high-dimensional vector representation, and determining a second modulus according to the second high-dimensional vector representation;
[0021] Performing a dot product operation on the first high-dimensional vector representation and the second high-dimensional vector representation to obtain a target operation result;
[0022] A similarity score is determined based on the first modulus, the second modulus, and the target operation result.
[0023] In one embodiment, the steps of extracting a first high-dimensional vector representation of the first document to be analyzed and extracting a second high-dimensional vector representation of the second document to be analyzed include:
[0024] Initialize the word segmenter and extraction model through the pre-trained language processing model;
[0025] Converting the first document to be analyzed and the second document to be analyzed into first tag information and second tag information by the word segmenter;
[0026] Adding word-level position codes to the first tag information and the second tag information;
[0027] Establishing a document tree structure mapping according to the word-level position encoding;
[0028] Based on the document tree structure mapping, inputting the first tag information and the second tag information into the extraction model to determine the last hidden state of the extraction model;
[0029] Extracting a first word-level vector and a second word-level vector from the last hidden state layer;
[0030] Mean pooling is performed on the first word-level vector and the second word-level vector respectively to obtain a first high-dimensional vector representation and a second high-dimensional vector representation.
[0031] In one embodiment, the step of performing difference analysis on the first document to be analyzed and the second document to be analyzed based on the graph neural network model to obtain a difference analysis result includes:
[0032] Determining semantic feature differences between the first document to be analyzed and the second document to be analyzed;
[0033] Constructing a first document structure tree according to the first structural element of the first document to be analyzed, and generating a first graph object according to the first document structure tree;
[0034] Constructing a second document structure tree according to the second structural element of the second document to be analyzed, and generating a second graph object according to the second document structure tree;
[0035] Inputting the first graph object and the second graph object into the graph neural network model respectively, and outputting a first graph representation vector and a second graph representation vector through the graph encoder;
[0036] Structural feature differences are determined according to the first image representation vector and the second image representation vector, and difference analysis results are determined according to the structural feature differences and the semantic feature differences.
[0037] In one embodiment, the step of performing risk analysis on the target document pair to be analyzed based on the difference analysis result to obtain the risk analysis result includes:
[0038] Based on the difference analysis result, determining a first difference context of the first document to be analyzed, and determining a second difference context of the second document to be analyzed;
[0039] Determining semantic coherence risk, stylistic consistency risk, and intention deviation risk based on the first difference context and the second difference context;
[0040] determining a risk value of a target difference point based on the semantic coherence risk, the style consistency risk, and the intention deviation risk;
[0041] The risk analysis result is determined based on the risk value and weight value of each difference point in the difference analysis result.
[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a message difference risk identification device, which includes:
[0043] An acquisition module, configured to acquire a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed;
[0044] an analysis module, configured to perform a difference analysis on the first document to be analyzed and the second document to be analyzed based on a graph neural network model to obtain a difference analysis result, wherein the graph neural network includes a graph encoder constructed based on a graph convolution operation;
[0045] The analysis module is further configured to perform risk analysis on the target document pair to be analyzed based on the difference analysis result to obtain a risk analysis result.
[0046] In addition, to achieve the above-mentioned purpose, the present application also proposes a message difference risk identification device, which includes: a memory, a processor, and a computer program stored on the memory and runnable on the processor, and the computer program is configured to implement the steps of the message difference risk identification method as described above.
[0047] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the message difference risk identification method as described above are implemented.
[0048] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of the message difference risk identification method as described above.
[0049] One or more technical solutions proposed in this application have at least the following technical effects:
[0050] The message difference risk identification method, apparatus, device and storage medium proposed in the present application obtains a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed; based on a graph neural network model, performs a difference analysis on the first document to be analyzed and the second document to be analyzed to obtain a difference analysis result, wherein the graph neural network includes a graph encoder constructed based on a graph convolution operation; based on the difference analysis result, performs a risk analysis on the target document pair to be analyzed to obtain a risk analysis result. This solves the technical problem that the accuracy of risk analysis is affected by the traditional document comparison method. Compared with the existing technology, the present application can not only identify the literal differences between documents, but also deeply analyze and understand the semantic differences and structural differences of documents through a graph neural network model, thereby providing more detailed difference analysis results, and thus achieving more accurate risk assessment. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0053] Figure 1 A flowchart of the first embodiment of the method for identifying message difference risks in this application is provided;
[0054] Figure 2 A schematic diagram of a simplified flow chart of the message difference risk identification method provided in Example 1 of the present application;
[0055] Figure 3 A flowchart of the second embodiment of the method for identifying message difference risks in this application is provided;
[0056] Figure 4 A document comparison diagram provided for Example 2 of the method for identifying message differences and risks in this application;
[0057] Figure 5 This is a schematic diagram of the module structure of the message difference risk identification device according to an embodiment of the present application;
[0058] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the message difference risk identification method in the embodiment of the present application.
[0059] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0060] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.
[0061] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0062] The main solution of the embodiment of the present application is: obtaining a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed; based on a graph neural network model, performing a difference analysis on the first document to be analyzed and the second document to be analyzed to obtain a difference analysis result, wherein the graph neural network includes a graph encoder constructed based on a graph convolution operation; based on the difference analysis result, performing a risk analysis on the target document pair to be analyzed to obtain a risk analysis result.
[0063] As can be seen from the above embodiments, the present application obtains a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed; based on a graph neural network model, performs a difference analysis on the first document to be analyzed and the second document to be analyzed to obtain a difference analysis result, wherein the graph neural network includes a graph encoder constructed based on a graph convolution operation; based on the difference analysis result, performs a risk analysis on the target document pair to be analyzed to obtain a risk analysis result. This solves the technical problem that the accuracy of risk analysis is affected by the traditional document comparison method. Compared with the existing technology, the present application can not only identify the literal differences between documents, but also deeply analyze and understand the semantic differences and structural differences of documents through a graph neural network model, thereby providing more detailed difference analysis results, and thus achieving more accurate risk assessment.
[0064] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device capable of performing the above functions, a message difference risk identification device, etc. The following uses the message difference risk identification device as an example to illustrate this embodiment and the following embodiments.
[0065] Based on this, the embodiment of the present application provides a method for identifying message difference risks, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the message difference risk identification method of this application.
[0066] In this embodiment, the message difference risk identification method includes steps S10 to S40:
[0067] Step S10: obtaining a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed;
[0068] It should be noted that the "target document pair to be analyzed" refers to a pair of specific documents, which are selected as objects to be analyzed and compared to identify differences; the "first document to be analyzed" and the "second document to be analyzed" may be different versions of documents (referring to different versions of the same document updated over time, and the differences between them need to be compared to understand the changes), the same standard documents of different docking parties (even the same standards may have subtle differences between multiple organizations or systems. These documents need to be compared to ensure compatibility and consistency), or similar specification documents in similar fields (there may be similar specifications or standards in different fields. These documents may overlap in structure and content, but there may also be key differences that require comparative analysis).
[0069] In a feasible implementation manner, the step of obtaining a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed, includes: obtaining a first initial document to be analyzed and a second initial document to be analyzed; preprocessing the first initial document to be analyzed and the second initial document to be analyzed to obtain the first document to be analyzed and the second document to be analyzed, wherein the preprocessing includes at least one of format unification, text cleaning, and sentence segmentation.
[0070] It should be noted that the format of the document pairs to be analyzed is unified, and documents of different formats (PDF, Word, TXT) can be converted into plain text (i.e., formatted document pairs). Specifically, if the document type of the document pair to be analyzed is PDF format, the Python library PyPDF2 is introduced, the PdfReader method is called to obtain the file, and then each page of the input PDF is traversed, the extract_text method is called to convert each page of PDF into TXT format. If the input document type is DOC format, the Python library python-docx is introduced, the Document class is used to load the file to obtain all sections (Sections), the nodes are traversed to extract the text, and converted to TXT format. If it is a header and footer (header, footer), it is skipped. If the input is a scanned file (such as JPG, PNG or image-type PDF), the image is converted to TXT format through Tesseract OCR+Python. First, install the Tesseract software, then reference the Python library pytesseract, pillow library, use the image class of the pillow library to read the image, and then use pytesseract.image_to_string to convert the image into txt format.
[0071] It should be noted that the formatted target document to be analyzed is subjected to text cleaning. The large model Prompt project is used, and the Qianwen model is selected. The characters are unified into uppercase, full-width characters are converted to half-width characters to unify the character width, garbled emoticons are filtered, extra spaces, tabs and line breaks are removed, and continuous spaces are merged into a single space to complete the text cleaning task.
[0072] It should be noted that the Python library spacy can be introduced to load the zh_core_web_sm Chinese language model, and the target document to be analyzed after text cleaning can be divided into independent sentences according to semantic and grammatical rules to facilitate subsequent analysis.
[0073] Step S20: performing a difference analysis on the first document to be analyzed and the second document to be analyzed based on a graph neural network model to obtain a difference analysis result, wherein the graph neural network includes a graph encoder constructed based on a graph convolution operation;
[0074] It should be noted that the construction and application of graph neural network models can be achieved with the help of the PyTorch framework; the GCNConv method (i.e., graph convolution operation method) in the torch_geometric.nn library can also be used to construct the graph encoder of the graph neural network model. The function of the graph encoder is to encode the information of nodes and edges in the graph object into vector form, thereby extracting the feature representation of the document structure.
[0075] In a feasible embodiment, the graph neural network model is based on which a difference analysis is performed on the first document to be analyzed and the second document to be analyzed, and the steps of obtaining the difference analysis results include: determining the semantic feature difference points between the document to be analyzed and the second document to be analyzed; constructing a first document structure tree according to the first structural element of the document to be analyzed, and generating a first graph object according to the first document structure tree; constructing a second document structure tree according to the second structural element of the second document to be analyzed, and generating a second graph object according to the second document structure tree; inputting the first graph object and the second graph object into the graph neural network model respectively, and outputting a first graph representation vector and a second graph representation vector through the graph encoder; determining the structural feature difference points according to the first graph representation vector and the second graph representation vector, and determining the difference analysis results according to the structural feature difference points and the semantic feature difference points.
[0076] In the specific implementation, for the semantic feature difference points, the cosine similarity between the sentence blocks corresponding to the first document to be analyzed and the second document to be analyzed can be calculated through the Python library numpy, and a dynamic threshold (in the range of 0.85-0.93) can be set to mark the differences for the text blocks below the threshold (the sentence blocks below the threshold can be marked as semantic feature marking points).
[0077] In a specific implementation, analyzing differences in the structural features of documents requires constructing separate structure trees for the two documents. Specifically, a first document structure tree is constructed based on the first structural element of the first document to be analyzed, and a first graph object is generated from this structure tree. Similarly, a second document structure tree is constructed based on the second structural element of the second document to be analyzed, and a second graph object is generated. The document structure tree can represent the hierarchical structure of a document in a tree-like structure, such as the nested relationships between elements such as chapters, paragraphs, and tables. The graph object converts this structural relationship into a graph form, making it easier for the graph neural network model to process it. The PyTorch framework can be used to build and apply the graph neural network model. By importing the Python torch library and using the torch_geometric.data method to construct a graph object for the document structure tree, the document's structural information can be represented as a graph. Then, the GCNConv method in the torch_geometric.nn library is used to construct the graph encoder for the graph neural network model. The graph encoder encodes the node and edge information in the graph object into a vector form, thereby extracting the feature representation of the document structure. Finally, the first and second graph objects are input into the graph neural network model, respectively, to obtain the first and second graph representation vectors. By calculating the difference between the vectors represented by these two graphs, changes in the document structure can be accurately located, such as the addition or deletion of chapters, modification of table rows and columns, and other structural changes.
[0078] In this embodiment, the difference analysis results are ultimately determined by combining semantic feature differences with structural feature differences. This method not only identifies semantic changes in document content but also accurately captures adjustments to the document structure, providing a comprehensive and efficient solution for document difference analysis.
[0079] Step S30: Based on the difference analysis result, risk analysis is performed on the target document pair to be analyzed to obtain a risk analysis result.
[0080] In specific implementation, you can use the large model prompt project, equipped with the deepSeek-R1 model, to input the context of the current difference, determine whether the semantics are coherent, whether the overall style is consistent, detect whether the intention is deviated, and analyze whether there are risks in the difference.
[0081] In the specific implementation, such as Figure 2 As shown, this application requires the input of a first document to be analyzed and a second document to be analyzed. Both documents are then preprocessed, including formatting standardization, text cleaning, and sentence / word segmentation to facilitate subsequent feature extraction. Next, through the feature extraction and representation steps, the text is converted into feature vectors, and information such as keywords is extracted. Cosine similarity is then used to evaluate the similarity between the two documents. Whether the similarity falls below a preset threshold determines whether to proceed to the difference analysis phase. If the similarity exceeds the threshold, the system performs semantic difference analysis, including difference location, context understanding, difference tagging, risk analysis, and difference intent identification. The analysis results are visualized, while a topic checker and document summarizer are used to check thematic consistency and summarize the document content. The final output includes summaries of Document A and Document B, their latest updates, and differences between the documents, along with difference analysis and a risk assessment of the difference intent. This process not only provides a systematic approach for document content comparison but can also be widely applied to various scenarios requiring text comparison, such as academic papers, legal documents, and technical documentation, helping users quickly identify and understand differences between documents and their potential risks.
[0082] In a feasible implementation, the step of performing risk analysis on the target document pair to be analyzed based on the difference analysis result and obtaining the risk analysis result includes: determining the first difference context of the document to be analyzed and the second difference context of the second document to be analyzed based on the difference analysis result; determining the semantic coherence risk, style consistency risk and intention deviation risk based on the first difference context and the second difference context; determining the risk value of the target difference point based on the semantic coherence risk, the style consistency risk and the intention deviation risk; and determining the risk analysis result according to the risk value and weight value of each difference point in the difference analysis result.
[0083] It should be noted that the difference analysis results include the semantic feature differences and structural feature differences between documents; the context of the difference refers to the context of the sentence or paragraph where the difference point is located. The context information is crucial for understanding the semantic background and contextual relationship of the difference point. By extracting the context of the difference point, we can more comprehensively evaluate the impact of the difference point on the overall semantics, style and intention of the document.
[0084] As you can understand, semantic coherence risk refers to assessing whether differences affect the logic and coherence of the document's content. Stylistic consistency risk refers to examining whether differences lead to inconsistencies in the document's style, such as language style and terminology. Intent deviation risk refers to analyzing whether differences alter the original intent or purpose of the document, potentially affecting the reader's understanding of the document.
[0085] In a specific implementation, the risk value of a difference point can be assessed based on semantic coherence risk, style consistency risk, and intent deviation risk. For example, the semantic coherence risk, style consistency risk, and intent deviation risk can be input into a risk assessment model to assess the risk value of a difference point. This value quantifies the degree of risk each difference point may pose. Since there are multiple differences in the document to be analyzed, the importance of each difference point can be determined based on its position and type (for example, differences in key parts such as titles and conclusions may have a higher weight, and modifications to key data in the difference point type require a higher weight than modifications to general text). A weight value is then determined based on the importance of each difference point. The overall risk value of the document to be analyzed is then determined based on the risk value and weight of each difference point in the document to be analyzed. Finally, the corresponding risk analysis results are output based on the different overall risk values (the larger the overall risk value, the higher the risk level).
[0086] It should be noted that in order to improve the accuracy and reliability of risk assessment, a machine learning model can also be used to dynamically adjust the weight values of the difference points. By training the model to learn the actual impact of different difference points on document risks, the weight distribution can be automatically optimized. After the risk assessment is completed, a detailed risk assessment report can be generated, listing the risk value, weight value and contribution to the overall risk value of each difference point, to help users quickly identify and understand the key risk points in the document. At the same time, the risk level of the document can be divided into different levels (such as low risk, medium risk, and high risk) based on the size of the overall risk value, so that users can take appropriate measures based on the risk level. This risk assessment method based on quantitative indicators not only improves the efficiency and effectiveness of document risk management, but also provides strong support for document version control, content review, and quality assurance.
[0087] This application obtains a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed; based on a graph neural network model, performs a difference analysis on the first document to be analyzed and the second document to be analyzed to obtain a difference analysis result, wherein the graph neural network includes a graph encoder constructed based on a graph convolution operation; based on the difference analysis result, performs a risk analysis on the target document pair to be analyzed to obtain a risk analysis result. This solves the technical problem that the accuracy of risk analysis is affected by the traditional document comparison method. Compared with the existing technology, this application can not only identify the literal differences between documents, but also deeply analyze and understand the semantic differences and structural differences of documents through a graph neural network model, thereby providing more detailed difference analysis results, and thus achieving more accurate risk assessment.
[0088] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction and will not be described in detail later. Figure 3 , step S20 further includes steps S201 to S204:
[0089] Step S201, determining a similarity score between the first document to be analyzed and the second document to be analyzed;
[0090] In a specific implementation, the similarity score between the first document to be analyzed and the second document to be analyzed can be calculated based on the text content, and the similarity score between the first document to be analyzed and the second document to be analyzed can also be calculated based on the semantic similarity. Specifically, for the calculation method of text content, cosine similarity, Jaccard similarity, edit distance, Euclidean distance, Manhattan distance, and Hamming distance can be used for calculation; for the calculation method of semantic similarity, it can be calculated based on Word Embedding + Cosine Similarity. For example, Word Embedding technology (such as Word2Vec, GloVe, etc.) can be used to convert words in the text into vectors. These word vectors can better capture the semantic information of the words. Then, the semantic similarity of the text is measured by calculating the cosine similarity of the word vectors. For example, for two documents, the average value of their word vectors can be calculated respectively, and then the cosine similarity of these two average vectors can be calculated. The similarity can also be calculated in combination with semantic role labeling. First, the text is semantically labeled and the semantic role information such as agent, patient, and instrument in the text is extracted. Then, the similarity of the documents is calculated by comparing the similarity of the semantic roles in the two documents (such as the lexical similarity of the semantic roles, the similarity of the semantic role structures, etc.). This method pays more attention to the similarity of the semantic structure and semantic components of the text.
[0091] In a feasible implementation, the step of determining the similarity score between the first document to be analyzed and the second document to be analyzed includes: extracting a first high-dimensional vector representation of the first document to be analyzed, and extracting a second high-dimensional vector representation of the second document to be analyzed; determining a first modulus based on the first high-dimensional vector representation, and determining a second modulus based on the second high-dimensional vector representation; performing a dot product operation on the first high-dimensional vector representation and the second high-dimensional vector representation to obtain a target operation result; and determining a similarity score based on the first modulus, the second modulus, and the target operation result.
[0092] In the specific implementation, the calculation formula of the modulus (i.e. the Euclidean norm of the vector) is as follows:
[0093]
[0094] In the formula, A represents the first high-dimensional vector representation, B represents the second high-dimensional vector representation, and a i represents the i-th dimension component of the first high-dimensional vector, b i Represents the i-th dimension component represented by the second high-dimensional vector.
[0095] In the specific implementation, the calculation formula of the dot product operation (the product of the components of each dimension of two vectors) is as follows:
[0096]
[0097] In the formula, A represents the first high-dimensional vector representation, B represents the second high-dimensional vector representation, and a i represents the i-th dimension component of the first high-dimensional vector, b i Represents the i-th dimension component represented by the second high-dimensional vector.
[0098] In the specific implementation, the similarity score is calculated as follows:
[0099]
[0100] In practice, we can import the Python library numpy and perform a dot product operation (numpy.dot(document 1 vector, document 2 vector)) on the first and second high-dimensional vector representations. Next, we calculate the modulus of document 1 (i.e., the first high-dimensional vector representation) and document 2 (i.e., the second high-dimensional vector representation) (numpy.linalg.norm(document vector)). Finally, we calculate the similarity score by the ratio of the dot product to the product of the modulus lengths. A similarity score ≥ 0.85 indicates highly similar documents, while a score ≤ 0.3 indicates significantly different documents. Semantic difference analysis is required for highly similar documents, but not required for significantly different documents.
[0101] In a feasible embodiment, the steps of extracting a first high-dimensional vector representation of the first document to be analyzed and extracting a second high-dimensional vector representation of the second document to be analyzed include: initializing a word segmenter and an extraction model through a pre-trained language processing model; converting the document to be analyzed and the second document to be analyzed into first tag information and second tag information through the word segmenter; adding word-level position codes to the first tag information and the second tag information; establishing a document tree structure mapping according to the word-level position codes; based on the document tree structure mapping, inputting the first tag information and the second tag information into the extraction model to determine the last hidden state of the extraction model; extracting a first word-level vector and a second word-level vector from the last hidden state; and performing mean pooling on the first word-level vector and the second word-level vector respectively to obtain a first high-dimensional vector representation and a second high-dimensional vector representation.
[0102] It should be noted that a pre-trained language processing model is used to initialize the tokenizer and extraction model. The tokenizer is responsible for segmenting the text (i.e., the document to be analyzed) into tokens that the model can understand, while the extraction model is used to extract features from the text. The tokenizer converts two documents to be analyzed (the first document to be analyzed and the second document to be analyzed) into token information. For each document, this process produces a set of token information (the first token information and the second token information). Word-level position encodings are added to the token information of each document. Word-level position encodings help the model understand the position of each token in the document, which is crucial for understanding the context of the text. A tree-like structure mapping of the document is constructed based on the word-level position encodings. This step involves constructing a tree-like model representing the document structure, allowing the model to better understand the document's hierarchical structure. The token information and position encodings are input to the extraction model. The model processes these inputs and determines the hidden state of the final layer. Word-level vectors are then extracted from the model's final hidden state. These vectors represent the model's encoding of each token and contain rich contextual features. Mean Pooling is performed on the extracted word-level vectors. This step takes the average value of all word-level vectors as the representation of the entire document, thereby obtaining a high-dimensional vector representation of the document.
[0103] Step S202, determining whether the similarity score is greater than a preset threshold;
[0104] It should be noted that if Figure 4 As shown, when the similarity between the first document to be analyzed and the second document to be analyzed is too large, it means that the difference between the two documents is very small (that is, highly similar documents, which may be different counterpart versions of the same standard, different versions, and similar specifications in similar fields), and further difference analysis is needed; when the similarity between the first document to be analyzed and the second document to be analyzed is too small, it means that the difference between the two documents is too large (that is, significantly different documents), and there is no need to continue in-depth comparison at the semantic level and the structural level, because they may involve completely different topics or content areas, and further analysis may not provide valuable comparison results.
[0105] Step S203: When it is determined that the similarity score is greater than the preset threshold, performing a difference analysis on the first document to be analyzed and the second document to be analyzed based on a graph neural network model to obtain a difference analysis result;
[0106] It should be noted that when the similarity score between the first document to be analyzed and the second document to be analyzed is large, it means that the two documents have a high similarity in content and may have partial or major semantic overlap. At this time, the purpose of performing difference analysis is to further identify and locate the subtle differences between them. These differences may be reflected in word choice, sentence structure, expression or description of specific details. Through this analysis, we can more accurately understand the uniqueness of the two documents in the context of similar content, thereby providing more comprehensive information support for subsequent processing or decision-making, such as distinguishing the contribution points of different documents in academic research, or identifying possible rewritten or adapted content in text comparison. Difference analysis can include semantic difference analysis and structural difference analysis.
[0107] Step S204: When it is determined that the similarity score is not greater than the preset threshold, the document pair to be analyzed is summarized and analyzed by a topic checker and a document summarizer to obtain the latest dynamic information for the document pair to be analyzed.
[0108] It should be noted that when the similarity between the first document to be analyzed and the second document to be analyzed is too small, it means that the difference between the two documents is too large (i.e., documents with significant differences). There is no need to continue in-depth comparison at the semantic and structural levels, because they may involve completely different topics or content areas, and further analysis may not provide valuable comparative results. At this time, the topic checker (for example, using the Qianwen model to summarize the document topics) can quickly identify the core topics of the two documents; at the same time, the document summarizer can extract the key information and main points of each document and generate concise summary content. In this way, users can quickly understand the main content differences between the two documents, and thus determine whether there are risks or whether further attention is needed. This method saves computing resources and improves analysis efficiency. It is especially suitable for scenarios that require rapid screening and identification of document differences.
[0109] This embodiment determines the similarity score between the first document to be analyzed and the second document to be analyzed; determines whether the similarity score is greater than a preset threshold; when it is determined that the similarity score is greater than the preset threshold, based on the graph neural network model, performs a difference analysis on the first document to be analyzed and the second document to be analyzed to obtain a difference analysis result; when it is determined that the similarity score is not greater than the preset threshold, summarizes and analyzes the target document pair to be analyzed through a topic checker and a document summarizer to obtain the latest dynamic information for the target document pair to be analyzed. This application can quickly determine whether the two documents have a high degree of similarity by calculating the similarity score between the first document to be analyzed and the second document to be analyzed and comparing it with a preset threshold. For document pairs with low similarity, there is no need to perform complex difference analysis, and the summary analysis link can be directly entered, which saves a lot of time and avoids unnecessary in-depth processing of irrelevant or large-difference documents, thereby significantly improving the overall efficiency of document analysis.
[0110] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the message difference risk identification method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0111] This application also provides a message difference risk identification device, please refer to Figure 5 , the message difference risk identification device includes:
[0112] An acquisition module 10 is configured to acquire a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed;
[0113] The analysis module 20 is used to perform a difference analysis on the first document to be analyzed and the second document to be analyzed based on a graph neural network model to obtain a difference analysis result, wherein the graph neural network includes a graph encoder constructed based on a graph convolution operation.
[0114] The analysis module 20 is further configured to perform risk analysis on the target document pair to be analyzed based on the difference analysis result to obtain a risk analysis result.
[0115] The message difference risk identification device provided in this application, employing the message difference risk identification method described in the aforementioned embodiment, can address the technical issue of using traditional document comparison methods to mitigate the impact of risk analysis accuracy. Compared to the prior art, the message difference risk identification device provided in this application achieves the same beneficial effects as the message difference risk identification method described in the aforementioned embodiment. Other technical features of the message difference risk identification device are the same as those disclosed in the aforementioned embodiment and are not further elaborated here.
[0116] The present application provides a message difference risk identification device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the message difference risk identification method in the above-mentioned embodiment one.
[0117] Reference below Figure 6 , which shows a schematic diagram of the structure of a message difference risk identification device suitable for implementing the embodiments of the present application. The message difference risk identification device in the embodiments of the present application can include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The message difference risk identification device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0118] like Figure 6 As shown, the message difference risk identification device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory 1002 or programs loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the message difference risk identification device. The processing device 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: an input device 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the message difference risk identification device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a message difference risk identification device with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented or have alternatively.
[0119] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are performed.
[0120] The message difference risk identification device provided in this application, employing the message difference risk identification method described in the aforementioned embodiment, can address the technical issue of using traditional document comparison methods to mitigate the impact of risk analysis accuracy. Compared to the prior art, the message difference risk identification device provided in this application achieves the same beneficial effects as the message difference risk identification method described in the aforementioned embodiment. Other technical features of this message difference risk identification device are the same as those disclosed in the aforementioned embodiment and are not further elaborated here.
[0121] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0122] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0123] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, a computer program) stored thereon, and the computer-readable program instructions are used to execute the message difference risk identification method in the above embodiment.
[0124] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: 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 thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0125] The computer-readable storage medium may be included in the message difference risk identification device; or may exist independently without being assembled into the message difference risk identification device.
[0126] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the message difference risk identification device, the message difference risk identification device: obtains a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed; based on a graph neural network model, performs a difference analysis on the first document to be analyzed and the second document to be analyzed to obtain a difference analysis result, wherein the graph neural network includes a graph encoder constructed based on a graph convolution operation; based on the difference analysis result, performs a risk analysis on the target document pair to be analyzed to obtain a risk analysis result.
[0127] Computer program code for performing the operations of the present application 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., via the Internet using an Internet service provider).
[0128] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0129] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0130] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the above-described message difference risk identification method. This computer-readable storage medium can address the technical issue of using traditional document comparison methods to affect the accuracy of risk analysis. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the message difference risk identification method provided in the above-described embodiment, and are not further elaborated here.
[0131] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned message difference risk identification method.
[0132] The computer program product provided in this application can address the technical issues that affect the accuracy of risk analysis using traditional document comparison methods. Compared to the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the message difference risk identification method provided in the above-mentioned embodiment, and will not be elaborated here.
[0133] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for identifying message difference risks, characterized in that: The message difference risk identification method includes: Acquire a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed; Based on a graph neural network model, performing a difference analysis on the first document to be analyzed and the second document to be analyzed to obtain a difference analysis result, wherein the graph neural network includes a graph encoder constructed based on a graph convolution operation; Based on the difference analysis result, a risk analysis is performed on the target document pair to be analyzed to obtain a risk analysis result.
2. The message difference risk identification method according to claim 1, characterized in that: The step of obtaining a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed, comprises: Obtaining a first initial document to be analyzed and a second initial document to be analyzed; The first initial document to be analyzed and the second initial document to be analyzed are preprocessed to obtain a first document to be analyzed and a second document to be analyzed, wherein the preprocessing includes at least one of format unification, text cleaning, and sentence segmentation.
3. The message difference risk identification method according to claim 1, characterized in that: The step of performing difference analysis on the first document to be analyzed and the second document to be analyzed based on the graph neural network model to obtain a difference analysis result includes: Determining a similarity score between the first document to be analyzed and the second document to be analyzed; Determining whether the similarity score is greater than a preset threshold; When it is determined that the similarity score is greater than the preset threshold, performing a difference analysis on the first document to be analyzed and the second document to be analyzed based on a graph neural network model to obtain a difference analysis result; When it is determined that the similarity score is not greater than the preset threshold, the target document pair to be analyzed is summarized and analyzed by a topic checker and a document summarizer to obtain the latest dynamic information for the target document pair to be analyzed.
4. The message difference risk identification method according to claim 3, characterized in that: The step of determining the similarity score between the first document to be analyzed and the second document to be analyzed includes: extracting a first high-dimensional vector representation of the first document to be analyzed, and extracting a second high-dimensional vector representation of the second document to be analyzed; determining a first modulus according to the first high-dimensional vector representation, and determining a second modulus according to the second high-dimensional vector representation; Performing a dot product operation on the first high-dimensional vector representation and the second high-dimensional vector representation to obtain a target operation result; A similarity score is determined based on the first modulus, the second modulus, and the target operation result.
5. The message difference risk identification method according to claim 4, characterized in that: The steps of extracting a first high-dimensional vector representation of the first document to be analyzed and extracting a second high-dimensional vector representation of the second document to be analyzed include: Initialize the word segmenter and extraction model through the pre-trained language processing model; Converting the first document to be analyzed and the second document to be analyzed into first tag information and second tag information by the word segmenter; Adding word-level position codes to the first tag information and the second tag information; Establishing a document tree structure mapping according to the word-level position encoding; Based on the document tree structure mapping, inputting the first tag information and the second tag information into the extraction model to determine the last hidden state of the extraction model; Extracting a first word-level vector and a second word-level vector from the last hidden state layer; Mean pooling is performed on the first word-level vector and the second word-level vector respectively to obtain a first high-dimensional vector representation and a second high-dimensional vector representation.
6. The message difference risk identification method according to claim 1, characterized in that: The step of performing difference analysis on the first document to be analyzed and the second document to be analyzed based on the graph neural network model to obtain a difference analysis result includes: Determining semantic feature differences between the first document to be analyzed and the second document to be analyzed; Constructing a first document structure tree according to the first structural element of the first document to be analyzed, and generating a first graph object according to the first document structure tree; Constructing a second document structure tree according to the second structural element of the second document to be analyzed, and generating a second graph object according to the second document structure tree; Inputting the first graph object and the second graph object into the graph neural network model respectively, and outputting a first graph representation vector and a second graph representation vector through the graph encoder; Structural feature differences are determined according to the first image representation vector and the second image representation vector, and difference analysis results are determined according to the structural feature differences and the semantic feature differences.
7. The message difference risk identification method according to any one of claims 1 to 6, characterized in that: The step of performing risk analysis on the target document pair to be analyzed based on the difference analysis result to obtain the risk analysis result includes: Based on the difference analysis result, determining a first difference context of the first document to be analyzed, and determining a second difference context of the second document to be analyzed; Determining semantic coherence risk, stylistic consistency risk, and intention deviation risk based on the first difference context and the second difference context; determining a risk value of a target difference point based on the semantic coherence risk, the style consistency risk, and the intention deviation risk; The risk analysis result is determined based on the risk value and weight value of each difference point in the difference analysis result.
8. A message difference risk identification device, characterized in that: The message difference risk identification device includes: An acquisition module, configured to acquire a target document pair to be analyzed, wherein the target document pair to be analyzed includes a first document to be analyzed and a second document to be analyzed; an analysis module, configured to perform a difference analysis on the first document to be analyzed and the second document to be analyzed based on a graph neural network model to obtain a difference analysis result, wherein the graph neural network includes a graph encoder constructed based on a graph convolution operation; The analysis module is further configured to perform risk analysis on the target document pair to be analyzed based on the difference analysis result to obtain a risk analysis result.
9. A message difference risk identification device, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the message difference risk identification method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the message difference risk identification method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Asset warehousing method, device and equipment, readable storage medium and program product
CN121658548A