Document comparison system

The document comparison system addresses the challenge of identifying substantive changes in hierarchical documents by correlating headings and combining texts, enabling clear distinction between formal and substantive document modifications.

JP7868511B2Active Publication Date: 2026-06-02TOYOTA JIDOSHA KK

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
TOYOTA JIDOSHA KK
Filing Date
2023-01-10
Publication Date
2026-06-02

Smart Images

  • Figure 0007868511000001
    Figure 0007868511000001
  • Figure 0007868511000002
    Figure 0007868511000002
  • Figure 0007868511000003
    Figure 0007868511000003
Patent Text Reader

Abstract

To provide a document comparison system that extracts a substantial change in a document as a difference.SOLUTION: A document comparison system 10, which compares documents with a plurality of headings to extract a difference between the two documents, includes a server device 20 as a processing circuit. The server 20 performs a step of finding a corresponding relationship between respective headings of the two documents to be compared, and performs, when a heading of one document corresponds to a plurality of headings of the other document, a step of comparing combined respective texts of the plurality of headings with a text with one of the headings to extract the differences therebetween.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a document comparison system.

Background Art

[0002] As disclosed in Patent Document 1, a document comparison system that compares documents with each other and displays their differences is known.

Prior Art Documents

Patent Documents

[0003]

Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0004] There are hierarchical structured documents with headings such as chapters, sections, and clauses, like legal documents. In such hierarchical structured documents, depending on revisions of laws and regulations, multiple headings may be consolidated into one, or one heading may be divided into multiple ones. In conventional document comparison systems, all parts corresponding to the headings increased or decreased by consolidation or division are detected as differences in the documents, so it may be difficult to understand the substantial differences in the documents.

Means for Solving the Problems

[0005] A document comparison system for solving the above problems is a document comparison system that compares documents with multiple headings and extracts differences between the two documents, and includes a processing circuit. When two documents to be compared are the first document and the second document, the processing circuit obtains the correspondence relationship of each heading of the first document and the second document, and when one heading of the first document corresponds to multiple headings of the second document, combines the texts of each of the multiple headings and compares them with the text of the one heading to extract their differences.

[0006] In some cases, the second document may be created by splitting one of the headings in the first document into multiple headings. Conversely, the first document may be created by merging multiple headings in the second document into a single heading. In these cases, one heading in the first document corresponds to multiple headings in the second document. In such cases, the processing circuit of the document comparison system combines the body text of the multiple headings in the second document that correspond to one heading in the first document. Then, it compares this combined text with the body text of the single heading in the first document that corresponds to the combined headings, and extracts the differences. Therefore, the document comparison system has the effect of being able to extract as differences the substantive changes in the document, rather than just formal changes caused by the merging or splitting of headings. [Brief explanation of the drawing]

[0007] [Figure 1] This diagram schematically shows the configuration of one embodiment of a document comparison system. [Figure 2] This is a flowchart of the document comparison process performed in the document comparison system. [Figure 3] This figure shows an example of an embodiment of the heading mapping in the document comparison process described above. [Figure 4] This figure shows an example of an embodiment of difference extraction in the document comparison process described above. [Figure 5] This figure shows an example of a comparison screen generated by the document comparison process described above. [Modes for carrying out the invention]

[0008] Below, one embodiment of the document comparison system will be described in detail with reference to Figures 1 to 5. <Document Comparison System Configuration> First, the configuration of the document comparison system 10 of this embodiment will be described with reference to Figure 1. The document comparison system 10 of this embodiment includes a server device 20 as a processing circuit. The server device 20 can be configured with a general-purpose computer. In this case, the server device 20 has a processor 21 such as a CPU or GPU, a main memory 22 such as RAM or ROM, and an auxiliary storage device 23 such as an EPROM or hard disk drive. A control program is stored in the auxiliary storage device 23. The processor 21 loads the control program stored in the auxiliary storage device 23 into the main memory 22 and executes it. As a result, the document comparison system 10 performs the document comparison process described later. A display device 24 and an input device 25 are connected to the server device 20 as a user interface. The display device 24 is a device for displaying information, such as a display. The input device 25 is a device for user operation, such as a keyboard and mouse.

[0009] <Structure of the document being compared> Next, the structure of the documents to be compared by the document comparison system 10 will be explained. The documents to be compared have a hierarchical structure with headings such as chapters, sections, and subsections. An example of a document with such a hierarchical structure is a legal document. Such documents have headings for each level. In this embodiment, the heading of the first level, which is the highest level, is "Chapter," the heading of the second level, which is one level below the first level, is "Section," and the heading of the third level, which is one level below the second level, is "Subsection." Each heading is assigned a heading number corresponding to the level. The heading number includes a number indicating the order of the heading. In the following explanation, the headings of each level in the comparison documents will be written in the following format: The heading of the first level will be written in the format "(Chapter Number)." The heading of the second level will be written in the format "(Chapter Number).(Section Number)." The heading of the third level will be written in the format "(Chapter Number).(Section Number).(Subsection Number)."

[0010] <Document Comparison Processing> Next, with reference to Figure 2, the document comparison process performed in the document comparison system 10 will be described. The document comparison process shown in Figure 2 starts when the user selects the data of two documents to be compared using the input device 25, and the server device 20 reads the data of the two selected documents. The server device 20 terminates this process after the processing in step S170 in Figure 2.

[0011] When the document comparison process begins, the server device 20 first divides the two documents to be compared into blocks based on their headings (S100). Next, the server device 20 compares the body text of each block and performs heading correspondence (S110). The body text is the portion of each divided block excluding the headings. Heading correspondence refers to extracting combinations of headings in the two documents whose body text matches or is similar. Through this heading correspondence, the server device 20 determines the correspondence between each heading in the documents being compared.

[0012] The mapping of headings is performed, for example, using the technology described in Japanese Patent Publication No. 2022-0166486. In the technology described in that publication, the similarity between each block of one document to be compared and each block of the other document is calculated. Then, under various constraints, the block with the highest similarity is selected as the corresponding block. In such cases, a heading in one document may be mapped to a heading in the other document.

[0013] Next, the server device 20 extracts differences for each of the associated heading combinations. When extracting differences, the server device 20 first determines whether the heading combination being processed is a one-to-one heading combination (S120). That is, it determines whether only one heading in one document is associated with one heading in the other document. If it is a one-to-one combination (YES), the server device 20 compares the body texts of both documents with the corresponding headings and extracts the differences between their body texts (S130). On the other hand, there are cases where the heading combination being processed is a one-to-many combination (S120:NO). That is, there are cases where one heading in one document is associated with multiple headings in the other document. In such cases, the server device 20 combines the body texts of the multiple headings (S140). Then, the server device 20 compares the combined body text with the body text of the other heading and extracts the differences between them (S150).

[0014] Once the server device 20 has finished extracting the differences for all the associated heading combinations (S160: YES), it proceeds to step S170. In step S170, the server device 20 generates a comparison screen showing the document comparison results and outputs it to the display device 24. The comparison screen displays the two documents being compared side by side, distinguishing the extracted differences by text color, font, etc. As described above, there are cases where one heading in one document corresponds to multiple headings in the other document. In such cases, the server device 20 generates the comparison screen so that one heading and its body text in one document correspond to multiple headings and their body texts in the other document.

[0015] <Effects and Effects of the Embodiment> The operation of this embodiment will be explained using the example of comparing document X and document Y, which have the structure shown in Figure 3. Note that the sentences (a) to (h) shown in Figure 3 and the subsequent figures each consist of one or more sentences.

[0016] The differences between Document X and Document Y are as follows. In Document Y, the content of Section "1.2." of Document X is described by being divided into three headings. More specifically, the body text of Section "1.2." of Document X is composed of three paragraphs (c) to (e). In Document Y, the body text of Section "1.2." of Document X is divided and described as Section "1.2." with paragraph (c) as the body text, Subsection "1.2.1" with paragraph (d) as the body text, and Subsection "1.2.2." that includes paragraph (e) as the body text. Furthermore, in the body text of Subsection "1.2.2." of Document Y, a new paragraph (f) is added in addition to paragraph (e).

[0017] As described above, in the document comparison process, the server device 20 determines the correspondence relationship of each heading between the documents to be compared. In the case of this embodiment, the headings are associated based on the similarity of the body text. In the case of Documents X and Y in FIG. 3, the headings with matching body text are associated with each other. Also, Section "1.2.", Subsection "1.2.1.", and Subsection "1.2.2." of Document Y are the headings of Document X that have the highest similarity in body text with Section "1.2." of Document X where a part of the body text is common. Therefore, Section "1.2.", Subsection "1.2.1.", and Subsection "1.2.2." of Document Y are associated with Section "1.2." of Document X.

[0018] Subsequently, the server device 20 compares the body texts of the associated headings and extracts the differences therebetween. When the correspondence of the headings is in a one-to-multiple relationship, the server device 20 combines the body texts of the multiple headings corresponding to a common single heading. Then, the server device 20 compares the combined text with the body text of the corresponding single heading and extracts the differences therebetween.

[0019] FIG. 4 shows an extraction mode of differences between documents X and Y. In the case of FIG. 4, the server device 20 combines the main texts of the "1.2." section, the "1.2.1." item, and the "1.2.2." item of document Y corresponding to the "1.2." section of document X, respectively. That is, the server device 20 combines the sentences (c), the sentences (d) constituting the main text of the "1.2.1." item, and the sentences (e), (f) constituting the main text of the "1.2.2." item of document Y. Then, the server device 20 compares the combined sentences (c) to (f) with the main text of the "1.2." section of document X and extracts the differences therebetween. The main text of the "1.2." section of document X is composed of the sentences (c) to (e). Therefore, in this case, the sentence (f) constituting a part of the main text of the "1.2.2." item of document Y is extracted as a difference.

[0020] After that, based on the extraction result of the differences, the server device 20 generates a comparison screen and outputs it to the display device 24. As a result, on the display device 24, a comparison screen is displayed in which the two documents to be compared are arranged side by side in a manner that distinguishes the extracted difference portions.

[0021] FIG. 5 shows an example of the display of the comparison screen in the case of documents X and Y. In the case of FIG. 5, the extracted difference portions are displayed underlined. In the comparison screen in this case, the heading numbers and the main texts of the corresponding headings of documents X and Y are displayed side by side horizontally. In the case of FIG. 5, the presence or absence of differences is displayed in the portion between the heading numbers and the main texts of both documents X and Y on the display screen. And horizontally beside the heading number and the displayed portion of the main text of the "1.2." section of document X in the comparison screen of FIG. 5, the heading numbers and their main texts of the "1.2." section, the "1.2.1." item, and the "1.2.2." item of document Y are displayed. Further, in the comparison screen of FIG. 5, the sentence (f) constituting a part of the main text of the "1.2.2." item of document Y is displayed as the difference portion from document X.

[0022] According to the document comparison system 10 of the above-described embodiment, the following effects can be achieved. (1) The document comparison system 10 refers to two documents that it compares in the document comparison process as the first document and the second document. In this case, if one heading in the first document corresponds to multiple headings in the second document, the server device 20 of the document comparison system 10 compares the combined body text of each of the multiple headings with the body text of the single heading and extracts the differences between them. Therefore, it is possible to extract as differences the parts of the document that are substantive changes, not just formal changes caused by the merging or splitting of headings.

[0023] (2) The server device 20 generates a comparison screen that displays the first document and the second document side by side, distinguishing the extracted differences, and outputs it to the display device 24. Furthermore, if one heading in the first document corresponds to multiple headings in the second document, the server device 20 generates a comparison screen that displays the single heading and its body text side by side with the multiple headings and their respective bodies. This makes it possible to clearly present to the user the substantial changes in the text.

[0024] <Other Embodiments> This embodiment can be implemented with the following modifications. This embodiment and the following modifications can be combined with each other to the extent that they do not contradict each other technically.

[0025] • In the comparison screen, the differences from the other parts may be distinguished and displayed using methods other than underlining, such as changing the text color or font. • In the comparison screen, the headings and their corresponding body texts may be displayed vertically instead of horizontally.

[0026] The documents used for comparison may not be legal documents, but any document with a hierarchical structure and multiple headings. Examples of such other documents include product instruction manuals and specifications, legal documents, and academic papers.

[0027] The configuration of the document comparison system can be modified as appropriate, as long as the system is equipped with a processing circuit that performs document comparison processing. For example, the document comparison system may be configured with a server device and client terminals connected to the server device via a communication line. In this case, the server device may perform part of the document comparison processing, and the client terminals may perform the remaining part. For example, the server device may perform the processing up to difference extraction in the document comparison processing in Figure 2 (S100~S160) and send the information of the difference extraction results to the client terminal. The client terminal may then generate a comparison screen based on the information received from the server device and output it to a display device.

[0028] The number of levels and format of headings may be changed as desired. The display device 24 is not limited to a display. For example, a printer that prints and displays comparison screens on paper or the like may also be considered the display device 24.

[0029] The results of the document comparison process, specifically the extraction of differences, may be used for purposes other than generating the comparison screen. The processing circuit is not limited to one that includes a CPU and ROM and executes software processing. That is, the processing circuit may have any of the following configurations: (a) The processing circuit includes one or more processors that execute various processes according to a computer program. The processor includes a CPU and memory such as RAM and ROM. The memory stores program code or instructions configured to cause the CPU to execute the processing. The memory, i.e., computer-readable medium, includes any available medium that can be accessed by a general-purpose or dedicated computer. (b) The processing circuit includes one or more dedicated hardware circuits that execute various processes. Examples of dedicated hardware circuits include application-specific integrated circuits, i.e., ASICs or FPGAs. ASIC is an abbreviation for "Application Specific Integrated Circuit," and FPGA is an abbreviation for "Field Programmable Gate Array." (c) The processing circuit includes a processor that executes a part of the various processes according to a computer program, and a dedicated hardware circuit that executes the remaining part of the various processes. [Explanation of symbols]

[0030] 10...Document comparison system, 20...Server device, 21...Processor, 22...Main memory, 23...Secondary memory, 24...Display device, 25...Input device.

Claims

1. A document comparison system that compares documents with multiple headings and extracts the differences between the two documents, It is equipped with a processing circuit, When the two documents to be compared are designated as Document 1 and Document 2, Document 1 and Document 2 have a hierarchical structure, and the headings are assigned to each level. The aforementioned processing circuit is To determine the correspondence between the headings of the first and second documents, If one heading in the first document corresponds to multiple headings in the second document, the text of each of the multiple headings, combined in the order of the multiple headings, is compared with the text of the single heading, and the differences between them are extracted. A document comparison system that performs this task.

2. The document comparison system generates and outputs a comparison screen that displays the first document and the second document side by side, distinguishing the extracted differences. If one heading in the first document corresponds to one of several headings in the second document, the comparison screen is generated to display the one heading and its body text alongside the several headings and their respective body texts. The document comparison system according to claim 1.

3. The document comparison system according to claim 1, wherein the documents to be compared by the document comparison system are legal documents.