Document dividing device, document dividing method, and program

The document splitting device uses an independence score to recursively divide software documentation into functional units, addressing the challenges of conventional methods by ensuring context and relevance, thereby improving generative AI accuracy in software development.

WO2026234799A1PCT designated stage Publication Date: 2026-11-12NT T INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2025/017039
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2026-11-12

AI Technical Summary

Technical Problem

Conventional methods for document splitting in software development, such as character-based or semantic-based approaches, fail to accurately divide software documentation into functional units due to dependencies between documents and varying levels of appropriate division within a single document, leading to fragmented information and loss of context.

Method used

A document splitting device that calculates an independence score based on the likelihood of a text describing a single item, recursively dividing documents until the score meets a threshold, using an affinity vector and natural language similarity methods to ensure each divided text is unique, thereby maintaining context and accuracy.

Benefits of technology

Enables precise division of documents into functional units, enhancing the accuracy of generative AI by maintaining context and relevance, suitable for software development tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2025017039_12112026_PF_FP_ABST
    Figure JP2025017039_12112026_PF_FP_ABST
Patent Text Reader

Abstract

This document dividing device includes a calculating unit configured to calculate, for a text included in a document, an independence score indicating the likelihood that the text contains a description of only one matter among a plurality of matters described by the document, and a dividing unit configured to divide a text representing all or part of the content of the document on the basis of the content of the document, wherein the dividing unit is configured to recursively repeat the text division until the independence score calculated by the calculating unit for the text before division is smaller than the average of the independence scores calculated by the calculating unit for each of the plurality of texts after division of the text, thereby supporting division of the document into desired units.
Need to check novelty before this filing date? Find Prior Art

Description

Document splitting device, document splitting method, and program

[0001] This invention relates to a document splitting device, a document splitting method, and a program.

[0002] In recent years, efforts to improve the efficiency of software development have progressed, and the need for software development support technology using generative AI has increased. In order to utilize generative AI in software development, it is necessary to provide the generative AI with information about the software currently under development. Specifically, it is necessary to provide a set of documents (project information) that contain project knowledge, such as requirements specifications and design specifications. However, project information is enormous, and it is not practical to provide it all at once.

[0003] Therefore, one possible approach is to narrow down the information related to the task to be performed and provide it to the generative AI. However, these tasks require a great deal of effort and specialized knowledge, which is a factor hindering the introduction of generative AI into software development.

[0004] To address these challenges, a method called RAG (Retrieval Augmented Generation) exists. RAG is a method that searches for relevant information within a large volume of documents, and a generating AI provides answers based on the search results. In typical RAG, documents are divided into chunks based on character count, etc., and these chunks are used as the search target.

[0005] Traditionally, in addition to the number of characters, there are also techniques for dividing documents based on their semantic units. For example, the Hearth method (Non-Patent Literature 1) divides documents based on the frequency of word occurrences.

[0006] Furthermore, there are methods for splitting text using learning models (Non-Patent Document 2).

[0007] Marti A. Hearst, "TextTiling: Segmenting Text into Multi-Paragraph Subtopic Passages," Comput. Linguist. 23, 1 (March 1997), 33-64. G. Glavas' (s' is Harchek (Caron)) and S. Somasundaran, "Two-Level Transformer and Auxiliary Coherence Modeling for Improved Text Segmentation," CoRR, vol. abs / 2001.00891, 2020. [online]. Available: http: / / arxiv.org / abs / 2001.00891

[0008] However, there are several challenges in dividing documentation in software development, making it difficult to apply conventional methods directly. For example, requirements specifications and design documents are not independent sections, but often have dependencies between multiple documents. Therefore, if documents are simply divided by the number of characters, related information will be fragmented, making it difficult to search while maintaining the appropriate context. In addition, technical documents such as code and API specifications have meaning in structural units such as functions and classes, so mechanical division may lead to a loss of information consistency.

[0009] Furthermore, while the method described in Non-Patent Document 1 is effective for dividing text where the topic clearly changes, it is difficult to divide software documentation by function because similar words appear even for different functions.

[0010] For example, consider dividing a software document like the one in Figure 1 into functional units. The heading structure in Figure 1 (a Markdown structure separated by #) is as shown in Figure 2. From Figure 2, it can be seen that the system targeted by the software document has both a login function and a logout function.

[0011] In dividing documents into functional units like this, semantic-based division is not always effective. In the example in Figure 1, when dividing the login function and logout function, both functions share words such as "system," "member," and "login." Therefore, because the words appearing in the document are similar, it is highly likely that the method described in Non-Patent Document 1 will not be able to divide them accurately.

[0012] Furthermore, the method described in Non-Patent Document 2 has the drawback that its accuracy depends on the type of training data, making stable partitioning impossible. In particular, in software development, the partitioning accuracy varies greatly depending on the type of software.

[0013] As shown in Figure 2, the descriptions of each function are distinguished at the second level (two # symbols). Therefore, it is reasonable to divide the software documentation at the second level headings. However, the appropriate level of division depends on how the documentation is written. In another document, the third level might be more appropriate. Furthermore, even within a single document, the appropriate division level may differ from chapter to chapter. Therefore, it is necessary to understand the content of the document and divide it appropriately.

[0014] For these reasons, RAG for software development requires that text be divided into independent units, taking into account the structure and meaning of the document, rather than simply by the number of characters.

[0015] The present invention has been made in view of the above points, and aims to support the division of documents into desired units.

[0016] To solve the above problem, the document splitting device includes a calculation unit configured to calculate an independence score for the text contained in a document, indicating the likelihood that it contains only a description of one of several matters described by the document; and a splitting unit configured to split text representing all or part of the content of the document based on the content of the document. The splitting unit is configured to recursively repeat the text splitting until the independence score calculated by the calculation unit for the text before splitting becomes smaller than the average of the independence scores calculated by the calculation unit for each of the multiple texts after the text has been split.

[0017] It can assist in splitting documents into desired units.

[0018] This figure shows an example of software documentation. This figure shows the structure of the headings in software documentation. This figure shows an example of the hardware configuration of the document splitting device 10 in an embodiment of the present invention. This figure shows an example of the functional configuration of the document splitting device 10 in an embodiment of the present invention. This is a flowchart illustrating an example of the processing procedure performed by the document splitting device 10. This is a flowchart illustrating an example of the processing procedure of a recursive splitting function. This figure illustrates an example of document splitting realized by this embodiment.

[0019] In this embodiment, a document containing multiple items is recursively divided from a coarse division to a progressively finer division. The division stops for parts where the independence of the content (text) of that part has increased, while the recursive division is repeated for the remaining parts. Because the number of divisions is flexibly adjusted according to the document's content, division with stable accuracy becomes possible. "Items" refer to, for example, the functions of software if the document to be divided is related to software development. Furthermore, the independence of the content (text) of a part refers to the likelihood that the item in that part is unique, or the likelihood that the item in that part is different from the items in other parts.

[0020] The "level of independence" of a particular part of a text is quantitatively evaluated using an independence score. The independence score of a text is calculated based on an affinity vector, where the degree of affinity between the text and each of several items is the value of each dimension. The degree of affinity between a text and an item can be calculated using any natural language similarity calculation method. For example, the degree of affinity can be evaluated by the similarity between the text and a string related to the item (the name of the item or text describing the item). Methods for evaluating the similarity between texts include methods that examine the frequency of word occurrences and methods that use machine learning models. In addition, the similarity between two texts can be evaluated by generating feature vectors for each text using an embedding model such as BERT and calculating the cosine similarity between the two feature vectors.

[0021] The independence score, calculated based on this degree of relevance, increases when only one item has a high degree of relevance. In other words, the independence score increases the more "only one item is described," and by dividing the document so that each divided text has a high independence score, it becomes possible to divide it at the item level. The independence score is formulated by the following formula.

[0022]

[0023] This formula is s 1 ~s n We will show that the maximum value among the n-1 calculation results when i is set sequentially is the independent score. That is, s 1 ~s n The independent score is the result of the calculation in parentheses when the maximum value among them is i.

[0024] Furthermore, other formulas may be used if it is possible to calculate a score where the value increases the more "only one function is listed".

[0025] The following explanation describes an example where the document to be divided is a software development document, and the multiple items described in the document represent multiple functions of the software.

[0026] Embodiments of the present invention will be described below with reference to the drawings.

[0027] Figure 3 shows an example of the hardware configuration of a document splitting device 10 in an embodiment of the present invention. The document splitting device 10 in Figure 3 includes a drive device 100, an auxiliary storage device 102, a memory device 103, a processor 104, and an interface device 105, etc., which are all interconnected by bus B.

[0028] The program that enables processing in the document splitting device 10 is provided on a recording medium 101 such as a CD-ROM. When the recording medium 101 containing the program is set in the drive device 100, the program is installed from the recording medium 101 to the auxiliary storage device 102 via the drive device 100. However, the program does not necessarily have to be installed from the recording medium 101; it may also be downloaded from another computer via a network. The auxiliary storage device 102 stores the installed program as well as necessary files and data.

[0029] The memory device 103 reads a program from the auxiliary storage device 102 and stores the program when receiving a program activation instruction. The processor 104 is a CPU or a GPU (Graphics Processing Unit), or a CPU and a GPU, and executes the functions related to the document division device 10 in accordance with the program stored in the memory device 103. The interface device 105 is used as an interface for connecting to a network.

[0030] FIG. 4 is a diagram showing an example of a functional configuration of the document division device 10 according to the embodiment of the present invention. In FIG. 4, the document division device 10 includes a calculation unit 11, a division unit 12, and an output unit 13. Each of these units is implemented by processing that causes the processor 104 to execute one or more programs installed in the document division device 10.

[0031] The calculation unit 11 calculates, for text included in a document, an independence score indicating the likelihood that the text includes only the description of one of a plurality of items described by the document. As shown in Equation 1, the calculation unit 11 calculates the degree of association between the text and each item, and calculates the independence score such that the greater the difference between the degree of association with one item and the degree of association with another item, the higher the aforementioned likelihood.

[0032] The division unit 12 divides text representing all or part of the content of a document based on the content of the document. The content of the document refers to the structure of the document, for example, a hierarchical structure based on headings. At this time, the division unit 12 recursively repeats the division of the text until the independence score calculated by the calculation unit 11 for the text before division becomes smaller than the average of the independence scores calculated by the calculation unit 11 for each of the plurality of texts obtained after dividing the text.

[0033] The output unit 13 outputs the document division result obtained by the division unit 12.

[0034] The following describes the processing procedure performed by the document splitting device 10. Figure 5 is a flowchart illustrating an example of the processing procedure performed by the document splitting device 10. In the following description, the text representing the entire document to be split is referred to as the "input text." A list of strings relating to multiple functions described by the input text (for example, text containing function names and function summaries) is called a function list and is assumed to be given. For example, a function list can be obtained from a function design document, etc. Figure 5 shows the processing procedure performed when it is desired to split the input text by function.

[0035] In step S101, the calculation unit 11 initializes the relevance dictionary to an empty state. The relevance dictionary is a key-value type variable whose key is the function string and whose value is the degree of relevance between the input text and the function string.

[0036] Next, the calculation unit 11 executes a loop process including steps S102 and S103 for each function related to the function list. The function being processed in this loop process is called the "target function".

[0037] In step S102, the calculation unit 11 calculates the degree of relevance between the input text and the string of the target function. Subsequently, the calculation unit 11 assigns the calculated degree of relevance to the degree of relevance dictionary and associates it with the target function (S103). The degree of relevance can be calculated by the method described above.

[0038] Once the loop processing is complete for all functions, the calculation unit 11 calculates the independence score of the input text by substituting the relevance vector based on the relevance dictionary into the formula shown in Equation 1 (S104). The relevance vector based on the relevance dictionary is a vector in which the relevance assigned to each function in the relevance dictionary is the value of the dimension corresponding to each function.

[0039] Next, the splitting unit 12 initializes a list-format variable called texts, which stores the results of splitting the input text, to an empty state (S105).

[0040] Next, the splitting unit 12 calls the recursive splitting function and assigns its return value to texts (S106). At this time, the first to fourth arguments of the recursive splitting function are specified in order as 1, function list, input text, and the independence score calculated in step S104. The first argument of the recursive splitting function is a number indicating at which level in the hierarchy of the headings of the text to be split will the split. The second argument is a list of strings indicating the splitting unit, which in this embodiment is the function list. The third argument is the text to be split. The fourth argument is the independence score of the text to be split. The return value of the recursive splitting function is a list of texts split according to the function related to the function list, obtained by recursively splitting the text to be split (the third argument) while deepening the hierarchy from the level specified in the first argument.

[0041] Next, the output unit 13 outputs the contents of texts (the result of splitting the input text) (S107).

[0042] Next, we will explain the details of the recursive partition function. Figure 6 is a flowchart illustrating an example of the processing procedure of the recursive partition function. In Figure 6, the first to fourth arguments of the recursive partition function are described in order as N, function list, text X, and independent score X.

[0043] In step S201, the splitting unit 12 splits text X at the Nth level heading and stores each of the split texts (hereinafter referred to as "split texts") in the split text list tL in the order in which they appear in text X (S201). The split text list tL is a list-type variable whose elements are the split texts.

[0044] Next, the calculation unit 11 initializes the independent score list to an empty state (S202). The independent score list is a list-type variable for storing the independent score for each segmented text.

[0045] Next, a loop process including steps S203 to S207 is executed for each segmented text contained in the segmented text tL. The segmented text that is processed in this loop process is called the "target segmented text".

[0046] In step S203, the calculation unit 11 initializes the relevance dictionary for the target segmented text to an empty state. This relevance dictionary is a variable having the same structure as the relevance dictionary used in Figure 5.

[0047] Next, the calculation unit 11 executes a loop process including steps S204 and S205 for each function in the function list. The function being processed in this loop process is called the "target function".

[0048] In step S204, the calculation unit 11 calculates the degree of association between the target segmented text and the string of the target function. Subsequently, the calculation unit 11 associates the calculated degree of association with the target function and assigns it to the degree of association dictionary of the target segmented text (S205).

[0049] Once steps S204 and S205 are completed for all functions, the calculation unit 11 calculates the independence score of the target segmented text by substituting the relevance vector based on the relevance dictionary of the target segmented text into the formula shown in Equation 1 (S206).

[0050] Next, the calculation unit 11 adds the independent score of the target segmented text to the independent score list (S207).

[0051] Once steps S203 to S207 have been executed for all the divided texts included in the divided text list tL, the independent score list will contain the independent score for each divided text.

[0052] Next, the calculation unit 11 calculates the average value of all independent scores in the independent score list (hereinafter referred to as the "average partitioned independent score") (S208).

[0053] Next, the splitting unit 12 determines whether the average split independence score is less than the independence score X (i.e., the independence score of the text X before splitting) (S209). If the average split independence score is less than the independence score X (Yes in S209), the splitting unit 12 returns the text X before splitting as the return value because the independence has decreased due to the splitting (S210).

[0054] On the other hand, if the average partitioning independence score is greater than or equal to the independence score X (No in S209), the partitioning unit 12 initializes the list-format variable texts, which stores the results of partitioning text X, to an empty state (S211).

[0055] Next, the splitting unit 12 executes step S212 for each split text contained in the split text tL. The split text that is to be processed in step S212 is called the "target split text".

[0056] In step S212, the splitting unit 12 recursively splits the target split text by recursively calling the recursive splitting function (N+1, function list, target split text, independent score of target split text), and adds the return value to texts.

[0057] Once step S212 has been performed for all the split texts, the splitting unit 12 returns texts as the return value (S213).

[0058] As described above, for split texts whose independent score is equal to or greater than the original text X, a recursive splitting attempt is made. Split texts whose average independent score becomes small as a result of the splitting are not split.

[0059] Next, we will explain the above processing procedure with a specific example.

[0060] Figure 7 illustrates an example of document segmentation achieved by this embodiment. In Figure 7, the text t1 of a document containing descriptions of three functions, A, B, and C, is the target of segmentation. The relevance vector s of text t1 t1 Let's assume that the independent scores for text t1 are (0.9, 0.86, 0.88). Therefore, the independent score I of text t1 is t1 = ((0.9 - 0.86) + (0.9 - 0.88)) ÷ 2 = 0.03. Note that the dimensions of the correlation vector are, in order, the correlation with function A, the correlation with function B, and the correlation with function C.

[0061] As a result of dividing text t1 by the first-level headings, texts t2 and t3 are generated. Text t2 includes descriptions of function A and function B, and text t3 includes a description of only function C. Relevance vector s of text t2 t2 is (0.9, 0.86, 0.1), and independence score I t2 = ((0.9-0.86)+(0.9-0.1))÷2=0.42. Relevance vector s of text t3 t3 is (0.12, 0.22, 0.88), and independence score I t3 = ((0.88-0.12)+(0.88-0.22))÷2=0.71.

[0062] I t2 and I t3 is equal to or greater than I t1 , both texts t2 and t3 are divided by the second-level headings. As a result, text t2 is divided into texts t4 and t5, and text t3 is divided into texts t6 and t7.

[0063] Text t4 includes a description of only function A, and text t5 includes a description of only function B. Relevance vector s of text t4 t4 is (0.9, 0.26, 0.1), and independence score I t4 is 0.72. Relevance vector s of text t5 t5 is (0.3, 0.86, 0.1), and independence score I t4 is 0.66.

[0064] In addition, texts t6 and t7 each include a divided portion of the description of function C. Relevance vector s of text t6 t6 is (0.1, 0.12, 0.4), and the independence score is 0.29. Relevance vector s of text t7 t7 is (0.06, 0.21, 0.3), and the independence score is 0.16.

[0065] I t4 and I t5 is equal to or greater than I t2 , text t t4 and t t5Each of these is further divided, but the mean of the independent scores after division of text t4 is I t4 It is less than I, and the mean of the independent scores after splitting text t5 is I t5 Assume it is less than

[0066] On the other hand, I t6 and I t7 The average is I t3 It is less than.

[0067] Based on the above, texts t4, t5, and t3 represent the final division results of text t1.

[0068] As described above, this embodiment increases the likelihood of dividing documents into functional units or other items. Therefore, it can support the division of documents into desired units.

[0069] For software documentation, it is possible to divide the document into functional units and, by combining this with information retrieval technology, improve the inference accuracy of generative AI.

[0070] The functions of the elements disclosed herein may be implemented using circuits or processing circuitry that include general-purpose processors, special-purpose processors, integrated circuits, ASICs (Application Specific Integrated Circuits), FPGAs (Field Programmable Gate Arrays), conventional circuits, and / or combinations thereof that are programmed using one or more programs stored in one or more memories, or otherwise configured to perform the disclosed functions. A processor is considered processing circuitry or circuitry because it includes transistors and other circuits. A processor may be a programmed processor that executes programs stored in memory. In this disclosure, a circuit, unit, or means is hardware that performs the enumerated functions, or hardware programmed to perform the enumerated functions. Hardware may be any hardware disclosed herein that is programmed or configured to perform the enumerated functions.

[0071] There is a memory for storing a computer program that includes computer instructions. These computer instructions provide logic and routines that enable hardware (e.g., processing circuitry or circuitry) to perform the methods disclosed herein. This computer program can be implemented in commonly known forms, such as computer-readable storage media, computer program products, memory devices, recording media such as CD-ROMs and DVDs, and / or memory in FPGAs and ASICs.

[0072] Although embodiments of the present invention have been described in detail above, the present invention is not limited to these specific embodiments, and various modifications and changes are possible within the scope of the gist of the present invention as described in the claims.

[0073] 10 Document splitting device 11 Calculation unit 12 Splitting unit 13 Output unit 100 Drive device 101 Recording medium 102 Auxiliary storage device 103 Memory device 104 Processor 105 Interface device B Bus

Claims

1. A document splitting device comprising: a calculation unit configured to calculate an independence score indicating the likelihood that the text contained in a document contains only a description of one of several matters described in the document; and a splitting unit configured to split text representing all or part of the content of the document based on the content of the document, wherein the splitting unit is configured to recursively repeat the splitting of text until the independence score calculated by the calculation unit for the text before splitting becomes smaller than the average of the independence scores calculated by the calculation unit for each of the multiple texts after the text has been split.

2. The document splitting device according to claim 1, wherein the calculation unit is configured to calculate the degree of relevance between the text and each of the items, and to calculate the independence score such that the greater the difference between the degree of relevance with one item and the degree of relevance with another item, the higher the probability of the event.

3. A document splitting method characterized by a computer performing the following steps: a calculation step for calculating an independent score indicating the likelihood that the text contained in the document contains only a description of one of several matters described in the document; and a splitting step for splitting text that represents all or part of the content of the document based on the content of the document, wherein the splitting step recursively repeats the text splitting until the independent score calculated by the calculation step for the text before splitting becomes smaller than the average of the independent scores calculated by the calculation step for each of the multiple texts after the text has been split.

4. A program characterized by causing a computer to perform the following steps: a calculation procedure for calculating an independent score indicating the likelihood that the text contained in a document contains only a description of one of several matters described in the document; and a splitting procedure for splitting text that represents all or part of the content of the document based on the content of the document, wherein the splitting procedure recursively repeats the splitting of text until the independent score calculated by the calculation procedure for the text before splitting is less than the average of the independent scores calculated by the calculation procedure for each of the multiple texts after the text has been split.