Document comparison auditing method and related device
By splitting documents and fusing models, small models are used to quickly filter differences, and large models are combined for review. This solves the problem of low efficiency in document comparison and review, and achieves efficient and accurate document comparison and review.
Patent Information
- Application Number
- CN202511276640.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-08
- Publication Date
- 2025-12-23
AI Technical Summary
Existing document comparison and review methods are inefficient, unable to effectively handle documents with many differences, and unable to detect cases where words are different but the meaning is the same.
By breaking down documents to be reviewed into fragments, using small models to quickly filter out discrepancies, mapping these fragments to baseline document fragments, and then using large models for further review, the scope of review is narrowed and the accuracy of review is improved by combining the advantages of small and large models.
Without affecting the review risk recall rate, the accuracy of the review is significantly improved, the probability of false reviews and redundant content is reduced, and the review efficiency is increased.
Smart Images

Figure CN121189302A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence, and in particular to a document comparison auditing method and related device. BACKGROUND
[0002] Document comparison auditing refers to comparing the differences between two documents (a document to be audited and a benchmark document) through technical means to identify inconsistencies in content.
[0003] Currently, the main methods for document comparison auditing include word-by-word comparison after optical character recognition, natural language processing, and large model direct recognition. However, the above auditing methods are low in efficiency. SUMMARY
[0004] Embodiments of the present application provide a document comparison auditing method and related device to improve the efficiency of document auditing.
[0005] In a first aspect, embodiments of the present application provide a document comparison auditing method, comprising:
[0006] splitting a first document into a plurality of document segments to obtain a first document segment set; the first document being a document to be audited;
[0007] obtaining a second document segment set with the highest similarity to the first document segment set; the second document segment set being a document segment set determined from a benchmark document segment set;
[0008] extracting first difference content of the first document segment set and the second document segment set using a first model;
[0009] based on the first difference content, further auditing the first document segment set using a second model to determine second difference content of the first document segment set relative to the second document segment set; the complexity of the second model being higher than that of the first model;
[0010] generating an audit report based on the second difference content.
[0011] In some embodiments, the obtaining of the second document segment set with the highest similarity to the first document segment set comprises:
[0012] for each first segment in the first document segment set, constructing a first prompt word based on the first segment and a target string; the target string being obtained by concatenating each segment in the benchmark document segment set;
[0013] based on the first prompt word, determining a plurality of second segments similar to the first segment from the target string using the second model;
[0014] obtaining the second document segment set based on a plurality of second segments corresponding to each of the first segments.
[0015] In some embodiments, the obtaining the second document segment set based on a plurality of second segments corresponding to each of the first segments in the first document segment set comprises:
[0016] determining a source document corresponding to each of the second segments respectively;
[0017] taking a document with the largest number in the source documents as a target document;
[0018] taking a second segment corresponding to the target document as a target second segment most similar to the first segment;
[0019] obtaining the second document segment set based on the target second segment.
[0020] In some embodiments, the method further comprises:
[0021] obtaining a cosine similarity between the first segment and the target second segment;
[0022] if the cosine similarity is less than a preset value, marking the first segment, the marking being used to indicate that the first segment does not exist a similar segment.
[0023] In some embodiments, the extracting the first difference content of the first document segment set and the second document segment set by using a first model comprises:
[0024] extracting content difference of the target second segment corresponding to the first segment by using the first model in sequence to obtain the first difference content;
[0025] wherein, the first difference content comprises a first segment original text, a second segment original text and a natural paragraph serial number.
[0026] In some embodiments, the method further comprises:
[0027] if the first segment exists the marking, not extracting content difference of the first segment.
[0028] In some embodiments, the further auditing the first document segment set by using a second model based on the first difference content to determine a second difference content of the first document segment set relative to the second document segment set comprises:
[0029] constructing a second prompt word based on the first difference content, the first document segment set and the second document segment set;
[0030] based on the second prompt word, further auditing the first segment by using the second model to determine second difference content of the first segment relative to a corresponding second target segment.
[0031] In some embodiments, the method further comprises:
[0032] obtaining a modification suggestion for the second difference content by using the second model.
[0033] In some embodiments, the generating an audit report based on the second difference content comprises:
[0034] filling the second difference content and the modification suggestion into corresponding positions of an audit report template to obtain the audit report.
[0035] In a second aspect, the embodiments of the present application provide a document comparison and auditing apparatus, comprising:
[0036] a splitting module configured to split a first document into a plurality of document segments to obtain a first document segment set; the first document being a document to be audited;
[0037] an obtaining module configured to obtain a second document segment set with the highest similarity to the first document segment set; the second document segment set being determined from a document segment set of a benchmark document segment set;
[0038] a first auditing module configured to extract first difference content of the first document segment set and the second document segment set by using a first model;
[0039] a second auditing module configured to further audit the first document segment set by using a second model based on the first difference content to determine second difference content of the first document segment set relative to the second document segment set; the second model having a higher complexity than the first model;
[0040] a generating module configured to generate an audit report based on the second difference content.
[0041] In a third aspect, the present application provides an electronic device, comprising: a transceiver, a memory and a processor;
[0042] the memory is configured to store computer instructions; the transceiver is configured to communicate with external devices; and the processor is configured to run the computer instructions stored in the memory to implement the method of any one of the first aspect.
[0043] In a fourth aspect, the present application provides a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method of any one of the first aspect.
[0044] In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the method of any one of the first aspect.
[0045] The document comparison auditing method and related device provided by the embodiments of the present application find a reference document segment with semantic similarity for each split segment of the to-be-audited document, find the differences of the small model to the reference document segment, and then input the to-be-audited segment, the reference document segment having a mapping relationship, and the difference result found by the small model into the large model to infer the final auditing result. In the document comparison auditing process, the large model and the small model are fused, which can reduce the auditing range, improve the auditing efficiency, reduce the false auditing probability and redundant auditing content, and finally greatly improve the auditing accuracy rate under the premise of not affecting the auditing risk recall rate, thereby finally improving the auditing accuracy rate. BRIEF DESCRIPTION OF DRAWINGS
[0046] Figure 1 A scene schematic diagram is provided for the embodiments of the present application.
[0047] Figure 2 A flowchart of a document comparison auditing method provided by the embodiments of the present application Figure 1 ;
[0048] Figure 3 A flowchart of a document comparison auditing method provided by the embodiments of the present application Figure 2 ;
[0049] Figure 4 A structural schematic diagram of a document comparison auditing method provided by the embodiments of the present application;
[0050] Figure 5 A structural schematic diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION
[0051] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in detail with reference to the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0052] In the embodiments of the present application, the terms such as "first", "second", and the like are used to distinguish the same or similar items or components with substantially the same function and role, and do not limit the order. Those skilled in the art can understand that the terms such as "first", "second", and the like do not limit the number and execution order, and the terms such as "first", "second", and the like do not necessarily mean different.
[0053] It should be noted that in the embodiments of the present application, the words "exemplary" or "for example" are used to represent examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words "exemplary" or "for example" are used to present the relevant concepts in a specific manner.
[0054] As before, the main methods used in document comparison auditing include optical character recognition (OCR) followed by word-by-word comparison, natural language processing, and large model direct recognition.
[0055] The OCR recognition followed by word-by-word comparison method is suitable for detecting a small amount of tampering in contracts, detecting differences in handwritten content, etc. The disadvantage is that it is not suitable for detecting a large number of differences, and it cannot detect cases where words are different but the semantics are the same. The natural language processing method is suitable for scenarios where the board is the same and meets the board covered by the pre-training model. Once it deviates from the predetermined board, the auditing accuracy may decrease significantly. The advantage of the large model direct recognition is that it can handle cases where words are different but the semantics are the same, and it does not need to consider the differences in the board. However, the disadvantage is that the inference speed is slower than other methods, and it may produce more redundant output results, reducing the readability of the auditing results.
[0056] Therefore, the embodiments of the present application provide a document comparison auditing method and related device, by constructing the mapping between the document to be audited and the reference document, and using small models and large models to audit in turn, using small models to quickly filter out different content, reducing the processing range of large models, and then using large models to check and supplement the results of small models, improving the auditing accuracy, reducing the probability of false auditing and redundant auditing content, ultimately improving the auditing accuracy without affecting the auditing risk recall rate, and ultimately improving the auditing accuracy.
[0057] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail in the specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0058] Figure 1 A scenario diagram provided by an embodiment of the present application is shown in Figure 1 , which includes a client 1 and a server 2.
[0059] The client 1 is configured to provide a document to be audited to the server 2, and the server 2 is configured to perform an audit on the document to be audited based on a benchmark document and output an audit result to the client 1. The audit result is used to indicate the difference between the document to be audited and the benchmark document.
[0060] In some embodiments, the benchmark document can be pre-stored in the server 2, or provided to the server 2 when the client 1 provides the document to be audited, which is not limited in the embodiments of the present application.
[0061] It should be understood that the server 2 can be a server deployed locally, or a server deployed in the cloud, and can be a standalone server or a server cluster, which is not limited in the embodiments of the present application.
[0062] Based on the above-mentioned embodiments, the document comparison and audit method provided by the embodiments of the present application will be described in detail below taking the server shown in Figure 1 as an example.
[0063] Figure 2 The flowchart of the document comparison and audit method provided by an embodiment of the present application is shown in Figure 1 , which includes the following steps. Figure 2
[0064] S201, split a first document into a plurality of document segments to obtain a first document segment set.
[0065] In some embodiments, the first document is a document to be audited. For example, a legal contract, a business agreement, a compliance file of a bank or a securities institution, etc.
[0066] In some embodiments, the first document can be split according to the number of words, for example, the first document is split into a plurality of document segments with a limit of 10,000 words.
[0067] For example, the first document segment set can be represented as A={a1, a2, …, an}, where ai (i=1, 2, …, n) is any one of the document segments. n i
[0068] Optionally, in order to improve the integrity of the splitting, when splitting based on the number of words, the integrity of the sentence and the paragraph needs to be considered. For example, when splitting, when the number of words reaches 10,000 words, a sentence or a paragraph has not ended, then splitting can be performed at the boundary of the end of the sentence or the paragraph. Or, when the number of words in the segment does not meet 10,000 words, a sentence or a paragraph has ended, then splitting is performed at the end.
[0069] In some embodiments, the first document can be subjected to layout recognition, and if the first document is a high-frequency layout, the first document can be split by a preset splitting method. For example, a regular method can be used to determine whether the document repeatedly appears the mark information of chapter bar and table of contents outline, such as: Chapter 1, First Chapter, 1.1.1, etc. If it appears, the document is split into several chapter bar content segments with obvious boundaries.
[0070] S202, obtaining a second document segment set with the highest similarity to the first document segment set; the second document segment set is determined from the document segment set in the reference document segment set.
[0071] In some embodiments, the reference document segment set can be represented as C={c1,c2,…,c j}。
[0072] In some embodiments, each segment in the first document segment set A={a1,a2,…,a n} can be compared with each segment in the reference document segment set one by one to determine the most similar segment c i in the reference document segment set C. i Each c i is arranged in the order of the segments in the first document to obtain a second document segment set, denoted as B={b1,b2,…,b n}.
[0073] For example, the cosine similarity, Jaccard similarity coefficient, etc. of each a i and each segment in the reference document segment set C can be calculated to determine the most similar segment c i in the reference document segment set C. i
[0074] For example, an artificial intelligence model (large model) can be used to infer the first document segment set and the reference document segment set to determine the second document segment set from the reference document segment set.
[0075] S203, extracting the first difference content of the first document segment set and the second document segment set using the first model.
[0076] In some embodiments, the first model can be a small model with low complexity and high processing speed compared to the large model.
[0077] In some embodiments, the first model can be a small model based on encapsulating a dynamic programming algorithm. For example, the dynamic programming algorithm can be a Smith-Waterman dynamic programming algorithm, a Needleman-Wunsch algorithm, a multiple sequence alignment (MSA) algorithm, etc.
[0078] In some embodiments, each segment in the first document set and its corresponding segment in the second document set can be sequentially output to the first model to obtain the first model output
[0079] For example, segment a1 and the corresponding segment b1 are input into the first model to obtain the difference between segments a1 and b1 output by the first model. Then segment a2 and the corresponding segment b2 are input into the first model to obtain the difference between segments a2 and b2 output by the first model. Repeat the above process until the difference between each segment in the first document set and its corresponding segment in the second document set is obtained. Merge each of the differences obtained above to obtain the first difference content.
[0080] For example, the segment set {a1, b1}, {a2, b2} … {a n 、b n} can also be input into the first model at the same time to obtain the difference between each segment in each segment set output by the first model, and the first difference content based on the output difference.
[0081] S204, based on the first difference content, further review the first document segment set using the second model to determine the second difference content of the first document segment set relative to the second document segment set.
[0082] In some embodiments, the complexity of the second model is higher than that of the first model. For example, the second model can be an open source artificial intelligence model (large model).
[0083] In some embodiments, the first document segment set, the second document segment set can be input into the second model, and the first difference content can be input into the second model, and a prompt word (also known as a guide word) can be generated based on the first difference to make the second model further review the first document segment set to determine the second difference content of the first document segment set relative to the second document segment set.
[0084] For example, the first document fragment set, the second document fragment set and the first difference content are input into the second model, and the prompt word is "the above-mentioned first difference content is the difference content screened preliminarily, please refer to the content and take the second document fragment set as the correct standard to identify which content in the first document fragment set has difference with the second document fragment set".
[0085] S205, generating an audit report based on the second difference content.
[0086] In some embodiments, when the second difference content is obtained, the second difference content can be filled into the corresponding position of the audit report template to generate the audit report.
[0087] The document comparison and audit method provided by the embodiments of the present application can find a benchmark document fragment with semantic similarity for each split fragment of the document to be audited, find the difference of the small model to the benchmark document fragment, and then input the document to be audited, the benchmark document fragment having a mapping relationship with the document to be audited and the difference found by the small model into the large model to infer the final audit result. In the document comparison and audit process, the small model and the large model are fused, which can reduce the audit range, improve the audit efficiency, reduce the false audit probability and redundant audit content, and finally greatly improve the audit accuracy rate without affecting the audit risk recall rate, thereby improving the audit accuracy.
[0088] On the basis of the above-mentioned embodiments, the document comparison and audit method provided by the embodiments of the present application will be further described.
[0089] Figure 3 The flowchart of the document comparison and audit method of the embodiments of the present application Figure 1 As shown in Figure 3 , it includes:
[0090] S301, splitting the first document into a plurality of document fragments to obtain a first document fragment set.
[0091] The specific implementation mode shown in S301 in the embodiments of the present application is similar to the specific implementation mode shown in S201 in the embodiments shown in Figure 2 , which will not be described here.
[0092] S302, constructing a first prompt word based on the first fragment and a target string.
[0093] In some embodiments, the first fragment can refer to any fragment in the first document fragment set. The target string is obtained by splicing each fragment in the benchmark document fragment set.
[0094] For example, the benchmark document fragment set can be represented as C={c1, c2, …, c jThe segments in the set C can be spliced into a complete long string (target string) SB with the newline character "\n" as a delimiter.
[0095] For each first segment a i combined with the long string SB into a first prompt word, which is used to indicate that the first segment a i is the most similar to a second segment in the set of reference document segments.
[0096] For example, the first prompt word is as follows:
[0097] The to-be-audited document segments are as follows: \n${a1}\n\n\n, and the reference document segments are displayed in a list format as follows: \n${SB}\n\n\n. Please indicate which segments in the set of reference document segments are the most similar to the to-be-audited document segments.
[0098] Optionally, to reduce the interference of redundant segments, the number of segments in the first prompt word can be limited to 3, 2, or the like.
[0099] S303, based on the first prompt word, determining a plurality of second segments similar to the first segment from the target string by using a second model.
[0100] The content corresponding to the first segment and the content corresponding to the long string SB are filled into the position corresponding to the first prompt word, and the first prompt word after filling the content is input into the second model to obtain a plurality of second segments similar to the first segment output by the second model.
[0101] The content of each segment in the first segment set is sequentially filled into the first prompt word to obtain a plurality of second segments corresponding to each segment in the first segment set in the second segment set.
[0102] S304, obtaining a second document segment set based on the plurality of second segments corresponding to each first segment.
[0103] In some embodiments, after determining the plurality of second segments corresponding to each first segment, a most matched target second segment can be determined from the plurality of second segments based on the source document corresponding to each second segment. Based on the target second segment corresponding to each first segment, a second document segment set is obtained.
[0104] For example, the source document corresponding to each second segment is determined; the document with the largest number in the source document is taken as a target document; the second segment corresponding to the target document is taken as the target second segment most similar to the first segment; and based on the target second segment, a second document segment set is obtained.
[0105] For example, for the segment a1, the similar second segments include c1, c9, c 55 ;
[0106] For the segment a2, the similar second segments include c7, c 20 , c 105 ;
[0107] For the segment a3, the similar second segments include c 74 , c 92 , c 108 ;
[0108] ……..
[0109] wherein c1, c 20 , c 92 correspond to the source document A, c9, c7 correspond to the source document B, c 105 correspond to the source document C, c 92 , c 108 correspond to the source document D, and c 55 correspond to the source document E.
[0110] In the above source documents, the source document A appears the most, and thus the second segment corresponding to the source document A is taken as the corresponding target second segment.
[0111] That is, for the segment a1, the target second segment is c1;
[0112] For the segment a2, the target second segment is c 20 ;
[0113] For the segment a3, the target second segment is c 92 .
[0114] In some embodiments, to improve the inference efficiency of the large model, the “which several segments are most similar to the
to-be-audited document segment
to-be-audited document segment
[0115] In some embodiments, since a1 can have no semantic similarity or low similarity with any element in C, but the running result of the large model will inevitably output one or several c i , the cosine similarity between the first segment and the target second segment can be obtained; if the cosine similarity is less than a preset value, the first segment is marked, and the mark is used to indicate that the first segment has no similar segment.
[0116] For example, the cosine similarity between each first segment a i and the corresponding target second segment c icosine similarity between the first segment a i and the corresponding target second segment c i is less than a preset value (e.g., 0.2), the first segment a
[0117] For example, for the first segment a1, the target second segment is c1, which can be replaced by:
[0118] For the first segment a1, the target second segment is c error .
[0119] Based on the above method, the corresponding target second segment of each first segment in the first document set can be determined, and the mapping relationship can be denoted as f: a i → c i / c error .
[0120] In some embodiments, the corresponding target second segment of each first segment can be collected in the order of each segment in the first document set to obtain a second document set. That is, the first document set A = {a1, a2, …, a n}, the second document set B = {b1, b2, …, b n}, wherein a1 and b1 are similar document segments, a2 and b2 are similar document segments, a n and b n are similar document segments.
[0121] S305, using the first model to sequentially extract the content difference of the target second segment corresponding to the first segment to obtain the first difference content.
[0122] In some embodiments, after determining the corresponding target second segment of each first segment, the corresponding target second segment of each first segment can be sequentially input into the first model to obtain the difference points between the target second segments output by the first model corresponding to each first segment. The plurality of difference points are combined to obtain the first difference content.
[0123] The first difference content includes the first segment original text, the second segment original text, and the paragraph number.
[0124] It should be understood that the first segment having a difference point with the target second segment can be one or several segments in the first segment set, that is, not every first segment has a difference point with the corresponding target second segment.
[0125] For example, a certain first segment is as follows:
[0126] Lease Agreement\nLocation: Room 1001, Block A, Sunshine Apartment, No. 123, C Street, XY District, AA City\nLease Term: From November 1, 2023 to October 31, 2024\nRent: The monthly rent is RMB 6,000.00 (¥6,000.00), payable in advance with a deposit of one month's rent and three months' rent paid upfront. The lessee shall pay the rent for the next quarter before the first day of the first month of each quarter.\nDuring the lease term, the property management fee shall be borne by the lessor, while the lessee shall bear the costs of water, electricity, gas, heating, internet, etc.\nIf the lessee fails to pay the rent on time, the lessee shall pay the lessor a penalty of 0.3% of the monthly rent per day.\nIf either party needs to terminate the contract in advance, it must give the other party written notice sixty days in advance.
[0127] The corresponding second segment of the target is shown below:
[0128] Lease Agreement\nLocation: Room 1001, Block A, Sunshine Apartment, No. 123, C Street, XY District, AA City\nLease Term: From November 1, 2023 to October 31, 2024\nRent: The monthly rent is RMB 6,500.00 (¥6,500.00), payable in advance with a deposit of one month's rent and three months' rent paid upfront. The lessee shall pay the rent for the next quarter before the fifth day of the first month of each quarter.\nDuring the lease term, the property management fee shall be borne by the lessor, while the lessee shall bear the costs of water, electricity, gas, heating, internet, etc.\nIf the lessee fails to pay the rent on time, the lessee shall pay the lessor a penalty of 0.5% of the monthly rent per day.\nIf either party needs to terminate the contract in advance, it must give the other party written notice sixty days in advance.
[0129] The difference content (diff_content) extracted by the small model is as follows: [
[0131] {
[0132] "merge_str1":"Rental terms: The monthly rent is RMB 6,000.00 (¥6,000.00), payable in installments of one month's deposit and three months' rent in advance. The lessee shall pay the rent for the next quarter before the first day of the first month of each quarter."
[0133] "merge_str2":"Rental terms: The monthly rent is RMB 6,500.00 (¥6,500.00), payable in installments of one month's deposit and three months' rent in advance. The lessee shall pay the rent for the next quarter before the fifth day of the first month of each quarter."
[0134] "segment_no":69
[0135] },
[0136] {
[0137] "merge_str1":"If Party B fails to pay the rent on time, Party B shall pay Party A a penalty of 0.3% of the monthly rent per day."
[0138] "merge_str2":"Party B shall pay Party A a default interest of 0.005% of the monthly rent per day for overdue rent payment",
[0139] "segment_no":71
[0140] } ]
[0142] Wherein merge_str1 represents the original text of the difference content in the first segment, merge_str2 represents the original text of the difference content in the target second segment, and segment_no represents the natural segment number of the difference content in the original text.
[0143] S306, constructing a second prompt word based on the first difference content, the first document segment set, and the second document segment set.
[0144] In some embodiments, a second prompt word for auditing each first segment can be constructed based on the first difference content, each first segment in the first document segment set, and the corresponding second target segment of the first segment in the second document segment set.
[0145] For example, for the first segment a1, the second prompt word is as follows:
[0146]
First segment to be audited
Second document segment
First difference content
First difference content
First segment to be audited
Second document segment
[0147] In some embodiments, to further improve the auditing efficiency, the modification suggestions for the difference points can also be output by the large model.
[0148] For example, the second prompt word outputting the modification suggestions is as follows:
[0149]
First segment to be audited
Second document segment
First difference content
First difference content
First segment to be audited
Second document segment
Benchmark document segment
[0150] In some embodiments, limitations can also be added to the second prompt word to make the results output by the large model more in line with actual needs and convenient to use.
[0151] For example, the defined second prompt word is as follows:
[0152] The first document segment to be audited is as follows: \n${a1}\n\n\n, the second document segment is as follows: \n${b1}\n\n\n, and the first difference content is as follows: \n${diff_content}\n\n\n. Please refer to the first difference content and point out the differences between the first document segment to be audited and the second document segment, taking the first document segment as the correct standard, and give modification suggestions. Note: 1. Output in the following list[json] format: [{\"difference point 1\": \"First, output the inconsistent type, such as the following three types: \"add\", \"delete\", \"modify\"; then list the inconsistent content in the first document segment to be audited and the second document segment, which must show the modified content in the first document segment to be audited, in the format of heading + modification point\", \"suggestion for modification method\": please write the modification suggestion according to the difference point}, {\"difference point 2\": xxx, \"suggestion for modification method\": xxx}] The elements in the list must be output in the order of the text of the first document segment to be audited, and the order must not be changed. 2. Pay special attention to the content that is not in the second document segment but is added in the first document segment to be audited; 3. If the first document segment to be audited and the second document segment involve classification discussion, the differences in each category must be pointed out separately, and cannot be mixed in one difference point.
[0153] S307, based on the second prompt word, using the second model to further audit the first segment to determine the second difference content of the first segment relative to the corresponding second target segment.
[0154] Fill the content of the first segment, the content of the corresponding second segment, and the first difference content into the second prompt word corresponding position, and input the filled second prompt word into the second model to obtain the audit result (second difference point) output by the second model.
[0155] Fill the content of each segment in the first segment set and its corresponding second segment content and first difference content into the above-mentioned second prompt word in turn to obtain the second difference point corresponding to each first segment output by the large model. Combine each second difference point to obtain the second difference content. It should be understood that not every first segment has a second difference point corresponding to the second segment.
[0156] In some embodiments, if the prompt word includes a modification suggestion, the large model output result includes the difference point and the modification suggestion.
[0157] Exemplary, the large model output result is as follows: [
[0159] {
[0160] "Difference points": "Modification: Rent form: monthly rent of RMB 6,000.00 (¥6,000.00), payment method is one-third deposit, and party B shall pay the next quarter rent before the first day of each quarter",
[0161] "Modification method": "Modify to: Rent form: monthly rent of RMB 6,500.00 (¥6,500.00), payment method is one-third deposit, and party B shall pay the next quarter rent before the fifth day of each quarter", to match the correct rent "RMB 6,500.00 (¥6,500.00)" and the correct rent payment deadline "before the fifth day of each quarter" in the benchmark document, to ensure the accuracy of the lease agreement."
[0162] }
[0163] ]。
[0164] S308, generating an audit report based on the second difference content.
[0165] In some embodiments, after obtaining the large model output second difference content and modification suggestions, the second difference content and modification suggestions can be filled into the corresponding positions of the audit report template to obtain the audit report.
[0166] Exemplary, the audit report is as follows:
[0167] The risk content of this audit is as follows:
[0168] I. Lease agreement information risk
[0169] 1. Difference between rent and rent payment deadline
[0170] Original content of the document to be audited:
[0171] Rent form: monthly rent of RMB 6,000.00 (¥6,000.00), payment method is one-third deposit, and party B shall pay the next quarter rent before the first day of each quarter;
[0172] Suggested modification method:
[0173] Rent form: monthly rent of RMB 6,500.00 (¥6,500.00), payment method is one-third deposit, and party B shall pay the next quarter rent before the fifth day of each quarter;
[0174] Modification reason:
[0175] To match the correct rent and rent payment deadline in the reference document, ensure the accuracy of the lease agreement.
[0176] II. ……
[0177] III. ……
[0178] In summary, the document comparison auditing method provided by the embodiments of the present application first splits a to-be-audited document and its corresponding reference document into an optimal fragment set, facilitating subsequent comparison and auditing in the same dimension. Then, for each split fragment of the to-be-audited document, a reference document fragment with semantic similarity is found to participate in subsequent auditing; if the semantic similarity is low, it is marked as "no similar fragment", i.e. the fragment no longer participates in subsequent auditing. Secondly, the to-be-audited fragment and the reference document fragment having a mapping relationship are used to find their differences by a small model, and then the to-be-audited fragment, the reference document fragment having a mapping relationship, and the difference found by the small model are input into a large model to infer the final auditing result. Finally, the auditing result is parsed and placed in the relevant position of the auditing report template to form an actual auditing report that meets the business expectations. By using the fusion of large and small models, the auditing time can be shortened, the auditing range can be reduced, the auditing efficiency can be improved, the probability of false auditing and redundant auditing content can be reduced, and ultimately the auditing accuracy rate can be greatly improved without affecting the auditing risk recall rate, thereby improving the auditing accuracy rate.
[0179] On the basis of the above-mentioned embodiments, the embodiments of the present application also provide a document comparison auditing device.
[0180] Figure 4 The structure diagram of the document comparison auditing device provided by the embodiments of the present application is shown in Figure 4 as shown, comprising:
[0181] The splitting module 401 is configured to split the first document into a plurality of document fragments to obtain a first document fragment set; the first document is a to-be-audited document.
[0182] The acquisition module 402 is configured to acquire a second document fragment set with the highest similarity to the first document fragment set; the second document fragment set is determined from a document fragment set in the reference document fragment set.
[0183] The first auditing module 403 is configured to extract a first difference content of the first document fragment set and the second document fragment set by using a first model.
[0184] The second auditing module 404 is configured to further audit the first document fragment set based on the first difference content by using a second model to determine a second difference content of the first document fragment set relative to the second document fragment set; the complexity of the second model is higher than that of the first model.
[0185] Module 405 is used to generate an audit report based on the second difference content.
[0186] In some embodiments, the acquisition module 402 is configured to construct a first prompt word for each first fragment in the first document fragment set based on the first fragment and a target string; the target string is obtained by concatenating the fragments in the baseline document fragment set; based on the first prompt word, a second model is used to determine a plurality of second fragments similar to the first fragment from the target string; and based on the plurality of second fragments corresponding to each first fragment, a second document fragment set is obtained.
[0187] In some embodiments, the acquisition module 402 is used to determine the source documents corresponding to each second segment; take the document with the most occurrences among the source documents as the target document; take the second segment corresponding to the target document as the target second segment most similar to the first segment; and obtain a set of second document segments based on the target second segments.
[0188] In some embodiments, the acquisition module 402 is used to acquire the cosine similarity between the first segment and the target second segment; if the cosine similarity is less than a preset value, the first segment is marked, and the mark is used to indicate that there are no similar segments for the first segment.
[0189] In some embodiments, the first review module 403 is used to extract content differences from the target second segment corresponding to the first segment using a first model to obtain the first difference content; wherein, the first difference content includes the original text of the first segment with differences, the original text of the second segment, and the natural paragraph number.
[0190] In some embodiments, the first review module 403 is configured to not extract content differences from the first segment if the first segment is marked.
[0191] In some embodiments, the second review module 404 is used to construct a second prompt word based on the first difference content, the first document fragment set, and the second document fragment set; based on the second prompt word, the first fragment is further reviewed using a second model to determine the second difference content of the first fragment relative to the corresponding second target fragment.
[0192] In some embodiments, the second review module 404 is used to obtain modification suggestions for the second difference content using the second model.
[0193] In some embodiments, the generation module 405 is used to fill in the second difference content and modification suggestions into the corresponding positions of the audit report template to obtain an audit report.
[0194] The document comparison and review device provided in this application embodiment can execute the document comparison and review method shown in any of the above embodiments. Its principle and technical effect are similar, and will not be described again here.
[0195] The embodiments of the present application further provide an electronic device.
[0196] Figure 5 A structural schematic diagram of the electronic device 50 provided by the embodiments of the present application is shown in FIG. 5. The electronic device can include a transceiver 501, a processor 502, and a memory 503. The electronic device can be a server in any of the above embodiments. Figure 5
[0197] The processor 502 executes computer-executed instructions stored in the memory, so that the processor 502 executes the schemes in the above embodiments. The processor 502 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; and can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0198] The memory 503 is connected with the processor 502 through a system bus and completes mutual communication. The memory 503 is used for storing computer program instructions.
[0199] The transceiver 501 can execute receiving and sending data and instructions.
[0200] Optionally, the electronic device 50 can further include a communication interface 504, so that the communication interface 503 can communicate with external or internal devices, for example, a client (for example, a mobile phone, a tablet). In a specific implementation, if the communication interface 504, the memory 503 and the processor 502 are independently implemented, the communication interface 504, the memory 503 and the processor 502 can be connected with each other through a bus and complete mutual communication.
[0201] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, only one thick line is shown in the figure, but it does not mean that there is only one bus or only one type of bus. The transceiver is used to realize communication between the database access device and other computers (for example, a client, a read-write library and a read-only library). The memory can include a random access memory (RAM), and can also include a non-volatile memory.
[0202] Optionally, in a specific implementation, if the communication interface 504, the memory 503 and the processor 502 are integrated on a chip, the communication interface 504, the memory 503 and the processor 502 can complete communication through an internal interface.
[0203] The embodiment of the application further provides a chip for running an instruction, which is used for executing the technical solution of the monitoring method in the above embodiment.
[0204] The embodiment of the application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the technical solution of the above method embodiment, and the implementation principle and technical effects are similar, and details are not repeated here.
[0205] In a possible implementation, the computer readable medium can include a random access memory (RAM), a read-only memory (ROM), a compact disc read-only memory (CD-ROM) or other optical memory, a magnetic disk storage or other magnetic storage device, or any other medium that is targeted to carrying or storing desired program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is properly referred to as a computer readable medium. For example, if software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave) is included in the definition of medium. As used herein, a disk and a disc include a compact disc, a laser disc, an optical disc, a digital versatile disc (DVD), a floppy disk and a Blu-ray disc, in which a disk usually magnetically reproduces data, and a disc optically reproduces data with a laser. Combinations of the above should also be included in the scope of computer readable medium.
[0206] The embodiment of the application further provides a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the technical solution of the above method embodiment, and the implementation principle and technical effects are similar, and details are not repeated here.
[0207] In the specific implementation of the terminal device or the server, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.
[0208] Those skilled in the art can understand that all or part of the steps of any of the method embodiments described above can be completed by hardware related to program instructions. The foregoing program can be stored in a computer readable storage medium, and when the program is executed, all or part of the steps of the method embodiments described above are executed.
[0209] When the technical solutions of the present application are realized in the form of software and sold or used as products, they can be stored in a computer readable storage medium. Based on this understanding, all or part of the technical solutions of the present application can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a computer program or a number of instructions. The computer software product makes a computer device (which can be a personal computer, a server, a network device or similar electronic equipment) execute all or part of the steps of the method embodiments of the present application.
[0210] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all expressed as a combination of a series of actions, but those skilled in the art should know that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0211] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0212] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0213] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0214] When integrated units / modules are implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, the storage unit can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc.
[0215] If the integrated units / modules are implemented in the form of software program modules and sold or used as independent products, they can be stored in a computer readable memory. Based on this understanding, the technical solutions of the present application or the entire or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a memory and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the embodiments of the present application. The aforementioned memory includes: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0216] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0217] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that: they can still modify the technical solutions recorded in the above embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A document comparison and review method, characterized in that, include: The first document is split into multiple document fragments to obtain a set of first document fragments; the first document is the document to be reviewed. Obtain the second set of document fragments that has the highest similarity to the first set of document fragments; the second set of document fragments is the set of document fragments determined from the baseline set of document fragments; The first difference content between the first set of document fragments and the second set of document fragments is extracted using the first model; Based on the first difference, the first document fragment set is further reviewed using the second model to determine the second difference between the first document fragment set and the second document fragment set; the complexity of the second model is higher than that of the first model. An audit report is generated based on the second difference.
2. The method according to claim 1, characterized in that, The step of obtaining the second set of document fragments with the highest similarity to the first set of document fragments includes: For each first segment in the first document segment set, a first prompt word is constructed based on the first segment and the target string; the target string is obtained by concatenating the segments in the baseline document segment set. Based on the first prompt word, the second model is used to determine multiple second segments similar to the first segment from the target string; Based on the multiple second segments corresponding to each of the first segments, the second document segment set is obtained.
3. The method according to claim 2, characterized in that, The process of obtaining the second document fragment set based on multiple second fragments corresponding to each of the first fragments in the first document fragment set includes: Identify the source documents corresponding to each of the second segments; The document with the largest number of occurrences in the source documents is selected as the target document; The second segment corresponding to the target document is taken as the target second segment that is most similar to the first segment. Based on the target second segment, the second document segment set is obtained.
4. The method according to claim 3, characterized in that, The method further includes: Obtain the cosine similarity between the first segment and the target second segment; If the cosine similarity is less than a preset value, the first segment is marked, and the mark is used to indicate that there are no similar segments to the first segment.
5. The method according to claim 3, characterized in that, The step of extracting the first difference content between the first document fragment set and the second document fragment set using the first model includes: The first model is used to extract the content differences of the target second segment corresponding to the first segment in turn to obtain the first difference content. The first difference includes the original text of the first segment with the difference, the original text of the second segment, and the natural paragraph number.
6. The method according to claim 4, characterized in that, The method further includes: If the first segment is marked, then no content difference extraction is performed on the first segment.
7. The method according to any one of claims 1-5, characterized in that, The step of further reviewing the first document fragment set based on the first difference content using a second model to determine the second difference content between the first document fragment set and the second document fragment set includes: A second prompt word is constructed based on the first difference content, the first set of document fragments, and the second set of document fragments; Based on the second prompt word, the second model is used to further review the first segment and determine the second difference content between the first segment and the corresponding second target segment.
8. The method according to claim 7, characterized in that, The method further includes: Use the second model to obtain modification suggestions for the second difference content.
9. The method according to claim 8, characterized in that, The process of generating an audit report based on the second difference includes: Enter the second difference content and the modification suggestions into the corresponding positions in the audit report template to obtain the audit report.
10. A document comparison and review device, characterized in that, include: The splitting module is used to split the first document into multiple document fragments to obtain a set of first document fragments; the first document is the document to be reviewed. The acquisition module is used to acquire a second set of document fragments that has the highest similarity to the first set of document fragments; the second set of document fragments is a set of document fragments determined from the baseline set of document fragments. The first review module is used to extract the first difference content between the first document fragment set and the second document fragment set using the first model; The second review module is used to further review the first document fragment set based on the first difference content using a second model, and determine the second difference content between the first document fragment set and the second document fragment set; the complexity of the second model is higher than that of the first model. The generation module is used to generate an audit report based on the second difference content.
11. An electronic device, characterized in that, include: The processor, transceiver, and memory are provided; the processor is communicatively connected to both the transceiver and the memory. The memory is used to store computer programs; The transceiver is used for communication and interaction with external devices; The processor is configured to execute the computer program to implement the method of any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, It stores a computer program thereon, which is executed by a processor to implement the method of any one of claims 1-9.
13. A computer program product, characterized in that, Includes a computer program that, when executed by a controller, implements the method of any one of claims 1-9.
Citation Information
Cited By
File auditing method and equipment
CN121581017A