Method and apparatus for text parsing conforming to retrieval-augmented generation, computer device, and storage medium
By parsing industrial documents into structured knowledge pieces, the method addresses the LLM's industrial performance gap, enhancing RAG systems' accuracy and efficiency.
Patent Information
- Application Number
- PCT/CN2024/089861
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-04-25
- Publication Date
- 2025-10-30
AI Technical Summary
Existing Large Language Models (LLMs) struggle with suboptimal performance in industrial scenarios due to insufficient industrial knowledge in training data, and current Retrieval-Augmented Generation (RAG) systems inadequately parse industrial documents, leading to compromised integrity and accuracy of technical information.
A method for parsing industrial documents into logically structured knowledge pieces by dividing them into chapters and segments based on content and length, preserving formatting and semantic coherence, suitable for RAG systems.
Enhances the effectiveness and efficiency of LLMs in industrial applications by providing accurate, meaningful, and unified knowledge segments for retrieval and generation, improving the performance of RAG systems.
Smart Images

Figure CN2024089861_30102025_PF_FP_ABST
Abstract
Description
METHOD AND APPARATUS FOR TEXT PARSING CONFORMING TO RETRIEVAL-AUGMENTED GENERATION, COMPUTER DEVICE, AND STORAGE MEDIUMTECHNICAL FIELD
[0001] This application relates to the field of large language models, and in particular relates to a method and apparatus for text parsing conforming to retrieval-augmented generation, a computer device, and a storage medium.BACKGROUND
[0002] Large Language Model (LLM) is undoubtedly powerful enough to enhance various applications in different fields, including industrial processes. However, since industrial knowledge only accounts for a small portion of training data of large language models in open domain, its performance in industrial scenarios is not as outstanding as in ordinary scenarios. This fact has prompted researchers to optimize LLM for specific industrial applications.SUMMARY
[0003] The content section of the present disclosure is provided to introduce some selected concepts in a simplified form, which will be further described in the specific embodiments below. The content section of the present disclosure is not intended to identify any key or necessary features of the claimed subject matter, nor is it intended to be used for assisting in determining the scope of the claimed subject matter.
[0004] Based on this, this application discloses a method for text parsing conforming to retrieval-augmented generation, including: receiving text information, where a text includes chapter information; according to the chapter information, dividing the text information into multiple chapters; and performing segmentation on each chapter according to a length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation.
[0005] By using the above method, knowledge pieces conforming to retrieval-augmented generation can be generated and stored in a knowledge base for corpus preparation for later language model output.
[0006] Further, before performing segmentation on each chapter according to the length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation, the method further includes:
[0007] performing sentence boundary detection and repair on each chapter to form a semantically coherent chapter text.
[0008] By using the above method, spaces, non-coherent text paragraphs and the like can be eliminated to make the text within the chapter more complete and semantically coherent, thus preparing for subsequent content segmentation.
[0009] Further, the performing segmentation on each chapter according to a length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation includes:
[0010] performing segmentation on each chapter according to the length and content of the chapter to form knowledge pieces containing a number, a title, a content and an attachment.
[0011] By using the above method, corresponding numbering and naming can be performed to effectively manage knowledge pieces, thus well preparing for subsequent semantic learning in a database and the output of a large language model.
[0012] Further, the performing segmentation on each chapter according to a length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation includes:
[0013] in a case that the length of the chapter is less than a preset length threshold, using the chapter as a full-chapter piece; and
[0014] in a case that the length of the chapter is greater than the preset length threshold, segmenting the chapter into textual chapter segment pieces or tabular chapter segment pieces.
[0015] By using the above method, chapters can be accurately segmented to obtain knowledge pieces conforming to retrieval-augmented generation, thus preparing for the subsequent corpus output and learning of the large language model.
[0016] Further, this application discloses an apparatus for text parsing conforming to retrieval-augmented generation, including:
[0017] a text receiving device configured to receive text information, where a text includes chapter information;
[0018] a chapter dividing device configured to, according to the chapter information, divide the text information into multiple chapters; and
[0019] a content segmentation device configured to perform segmentation on each chapter according to a length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation.
[0020] This application further provides a computer device, including a memory and a processor, the memory storing a computer program, where executing the computer program, the processor implements the method.
[0021] This application further provides a computer-readable storage medium, storing a computer program, where the computer program, when executed by a processor, implements the method.
[0022] This application further provides a computer program product, tangibly stored on a computer-readable medium and including computer-executable instructions, the computer-executable instructions, when executed, causing at least one processor to execute the method.BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The implementations of the present disclosure are illustrated in the form of examples rather than limitations in the drawings, and similar reference signs represent identical or similar components.
[0024] FIG. 1 is schematic diagram of a process of a method for text parsing conforming to retrieval-augmented generation according to an embodiment of this application.
[0025] FIG. 2 is a schematic diagram of an apparatus for text parsing conforming to retrieval-augmented generation according to an embodiment of this application.
[0026] FIG. 3 is a schematic diagram of a computer device for text parsing conforming to retrieval-augmented generation according to an embodiment of this application.
[0027] FIG. 4 is schematic diagram of a system model conforming to retrieval-augmented generation according to an embodiment of this application.
[0028] FIG. 5 is a schematic diagram of technical standards and product user manuals according to an embodiment of this application.
[0029] FIG. 6 is schematic diagram of a process of a method for text parsing conforming to retrieval-augmented generation according to an embodiment of this application.
[0030] FIG. 7 is a schematic diagram of chapter dividing performed on text information according to an embodiment of this application.
[0031] Reference signs are as follows:
[0032] S101-S103: steps
[0033] 200: apparatus
[0034] 201: module
[0035] 202: module
[0036] 203: module
[0037] 300: computer device
[0038] 302: processor
[0039] 304: memoryDETAILED DESCRIPTION
[0040] Numerous specific details are set forth in the description below for the purpose of explanation. However, it is to be understood that the implementations of the present disclosure may be implemented without these specific details. In some examples, well-known circuits, structures and technologies are not disclosed in detail, to avoid influencing the understanding on the description.
[0041] The expressions "an implementation" , "implementation" , "exemplary implementation" , "some implementations" , "various implementations" and the like throughout the description indicate that the described implementations of the present disclosure may include specific features, structures, or characteristics. However, it does not necessarily mean that each implementation must include these specific features, structures, or characteristics. In addition, some implementations may have some or all of features described in other implementations, or may not have features described in other implementations.
[0042] Generally speaking, there are two technological approaches to achieve LLM for industry: (1) massive industrial data continue to be used for pre-training, and LLM is turned into an industrial encyclopedia; (2) taking selected industrial knowledge as a reference, Retrieval-Augmented Generation (RAG) is applied. Considering the operational difficulty and data security risks of collecting LLM scale training data, most industrial enterprises clearly prefer to use the second method, i.e., RAG.
[0043] The performance of RAG systems is largely influenced by the quality of "retrieved" knowledge. Frequently occurring industrial documents, such as product manuals or technical standards, such as ISO, IEC and GB / T, undoubtedly involve high-quality technical information. However, due to the limitation of the total number of input tokens in most LLMs, the whole document must be segmented into a bunch of content blocks. Unfortunately, inappropriate segmentation may seriously compromise the integrity or accuracy of the technical information, thus having a negative influence on the effectiveness of LLM-based RAG systems.
[0044] In some embodiments, the term RAG was first proposed by researchers from Meta (then Facebook) in 2020. However, after the emergence of chatGPT of OpenAI in 2022, this concept has been widely applied in various products. The most famous RAG public framework is called LangChain. A corresponding system has also been proposed in this application, called Q-R-A, whose full name is An Effective Method for Utilizing Generative Large Language Model with Strict Data Privacy Requirement.
[0045] However, such a universal framework does not specify how documents should be parsed. For example, LangChain will recklessly convert documents to plain text format, ignore all possible formatting information, such as tabular blocks, and then simply chunk the converted text stream based on the length, such as a default threshold of 512 tokens. This direct method demonstrates great universality, but sacrifices accuracy as a cost.
[0046] At the same time, there are also different attempts to optimize the accuracy of chunking operations, including but not limited to: (1) detecting punctuations to ensure that there is no splitting between clauses or sentences; (2) overlapping a certain number of tokens on nearby content blocks to protect contextual information; (3) rewriting table content into plain text through manually created rules. These methods are all valuable, but they are still not precise enough to meet the requirements of industrial applications.
[0047] To address this pain point, this application proposes a practical implementation scenario, which involves parsing commonly used industrial documents into logical knowledge pieces, or logical knowledge blocks. Then, they are organized into a highly compatible knowledge base for further application of LLM services (usually RAG systems) . Further specifically, an article is firstly divided into chapters, and then each chapter is divided according to the content and preset length in the chapter, so that knowledge pieces conforming to retrieval-augmented generation can be obtained. These knowledge pieces of the unified mode are input into the knowledge base. On the one hand, effective and unified corpus can be added to the knowledge base, and on the other hand, a perfect preparation can be made for the output of the large language model.
[0048] Firstly, the problem is defined:
[0049] In the context of the application of the Large Language Model (LLM) , a typical RAG system may be shown in FIG. 4. The end-to-end Q / Aor Seq2Seq problem is decomposed into 3 subtasks:
[0050] 1. A knowledge base containing textual content is created.
[0051] 2. Certain knowledge segments related to the semantics of an original input query text are retrieved.
[0052] 3. The original query text and the retrieved relevant knowledge segments are combined together by appropriate prompt words as input to the LLM, and then an output answer text is obtained by running the LLM.
[0053] In this application, only the first task is technically focused on, that is, better knowledge pieces are created by logically parsing commonly used industrial documents, thus further improving the effectiveness and efficiency of retrieval and generation of subtasks. This application does not currently involve how to retrieve and parse knowledge segments, and detailed techniques for obtaining or optimizing LLM.
[0054] Additional prerequisites are as follows:
[0055] The input industrial document should also meet the following additional prerequisites, otherwise it cannot be processed through the suggested parsing mechanism:
[0056] - The document contains recognizable text content, which may be either selectable and replicable, or a scanned copy that can be processed by OCR.
[0057] - The document has a chapter -sub-chapter system with clear chapter numbers, and the content is logically organized in a tree structure. However, an independent directory, index, or content table is not necessary.
[0058] As shown in FIG. 5, many commonly used documents in industrial scenarios, such as technical standards or product user manuals, meet the above prerequisites. 5 (a) is an example of IEC Standard 62271-209, and 5 (b) is an example of S7-200 SMART System Manual.
[0059] Specifically, this application discloses a method for text parsing conforming to retrieval-augmented generation, which includes the following:
[0060] In S101, text information is received. A text includes chapter information.
[0061] Specifically, the text information may be a text containing content chapters. Further, it can be achieved through any optical character recognition tool or editable text conversion tool, or may be manually copied and pasted. This application does not standardize the method of obtaining "plain text" , but defines the final output in a textual manner to retain the following information and maintain its original order:
[0062] · Chapter name; and chapter number (if exists) ;
[0063] · Normal text content: it may be saved as sentences, paragraphs, or even physical lines in the original document layout (without semantic meaning) ;
[0064] · Table: any recognizable table structure should be retained and distinguished from normal text, for example, surrounded by tags such as TABLE-CONTENT , and the actual table content should also retain its format, with line breaks ( '\n' ) and tab characters ( '\t' ) ;
[0065] · Image: images in the original document should be saved separately, but URLs should be inserted at their positions and enclosed with tags such as IMAGE_URL .
[0066] In S102, according to the chapter information, the text information is divided into multiple chapters.
[0067] The embodiment in FIG. 7 shows the working principle of "Chapter" in the document, and this application only takes "Chapter 1" as an example. In order to achieve textual alignment, "Chapter name" is attached to the rectangular box with "Chapter" in FIG. 7, while the other three types of information, namely normal text content, tables, and images, are all attached to the circle of "text of chapter" .
[0068] In fact, in such a tree system, there are only three types of chapters, regardless of their hierarchy:
[0069] 1. Leaf chapter: it refers a chapter that only contains main text and does not contain sub-chapters, such as Chapter 1.2, Chapter 1.1.1, and Chapter 1.1.2 in FIG. 7.
[0070] 2. Bag chapter: it refers a chapter that only contains sub-chapters and does not contain any directly attached text, such as Chapter 1.1 in FIG. 6.
[0071] 3. Complex chapter: it refers a chapter that contains both main text and sub-chapters, such as Chapter 1 in FIG. 6.
[0072] Please note that according to the suggestions in this application, only leaf chapters and complex chapters will be parsed into distinguishing pieces that can be further processed (for example, "Chapter" output on the right side of FIG. 6) , and each chapter will take its directly attached text as the content and is accompanied by a chapter name. For example, as shown in FIG. 7, Chapter 1, Chapter 1.2, Chapter 1.1.1, and Chapter 1.1.2 will ultimately be parsed into four separate chapters.
[0073] In S103, segmentation is performed on each chapter according to a length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation.
[0074] The knowledge pieces are parsed from industrial documents and may specifically include the following four components:
[0075] - ID: it is unique in the knowledge base and has no specific formatting requirements.
[0076] - Title: it is a concise summary of a knowledge segment. This application suggests using the extended name of the chapter extracted from the knowledge segment.
[0077] - Content: it is the textual content of the knowledge point, which may be sentences, paragraphs, key points, numbered lists, table data, etc.
[0078] - Attachment: it mainly refers to the image embedded into the document.
[0079] Except for the number, all other components mentioned above need to be parsed from the input document.
[0080] Specifically, in this step, as shown in FIG. 6, all chapters inputted to Content Parsing will firstly confirm their own chapter names using a combination of document title, all superior chapter names, and their own numbers and names. For example, in FIG. 5 (a) , the chapter name of the leaf chapter 4.2 under this mechanism is named "IEC Standard 62271-209 [SEP] 4.2 [SEP] Power Limitation [SEP] Overvoltage Protection" , where the separator (SEP) between different parts may be freely defined.
[0081] Next, in the normal text content of a chapter, it will be processed through a sentence boundary detection process to repair unexpected line breaks without semantics caused by the original document layout. In this process, the punctuation at the end of the text span and the bullet point at the beginning of the text span may be fully utilized as "no connection" markers. Semantic analysis tools may also be used to analyze other situations. For example, sentence boundary detection and other multi-label classification schemes are used for processing.
[0082] Then, each chapter will be evaluated according to its length. In a case that the total length is less than a predefined threshold, such as less than 512 tokens, the entire chapter will be regarded as a "full-chapter piece" (as shown on the left side of FIG. 6) . Otherwise, the chapter will be further segmented because excessively long knowledge segments will have a negative influence on the retrieval and generation processes of most currently used LLM RAG systems. The segmentation process should follow the following rules:
[0083] - The table content labeled within the label, such as , should be regarded as an independent knowledge segment and combined with adjacent potential table descriptions to form an in-chapter piece (table) , as shown on the left side of FIG. 6.
[0084] - The beginning, parsed table, and end of the chapter will clearly divide the remaining plain text stream into several segments. In a case that the length of a segment is less than the threshold, it is regarded as an "in-chapter piece (text) " .
[0085] In a case that the length of a segment is greater than the threshold, it will be further divided into several in-chapter pieces (text) . Once the cumulative length is greater than the threshold, the dividing operation is performed, but with the following limitations:
[0086] ο After the SBD process, segmentation is not performed within a continuous text span.
[0087] ο No segmentation is performed before a text span with a bullet point as a beginning.
[0088] ο No segmentation is performed before the URL of an image.
[0089] ο In a case that the remaining length of an unprocessed segment is less than 1 / 4 of the threshold, no segmentation is performed.
[0090] All final knowledge segments obtained from the same chapter will share the same chapter name, and all knowledge segments belonging to the same document can now be saved to the knowledge base for potential retrieval operations in any RAG system.
[0091] By using the above method, knowledge pieces conforming to retrieval-augmented generation can be generated and stored in a knowledge base for corpus preparation for later language model output.
[0092] Further, before performing segmentation on each chapter according to the length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation, the method further includes the following:
[0093] Sentence boundary detection and repair is performed on each chapter to form a semantically coherent chapter text.
[0094] By using the above method, spaces, non-coherent text paragraphs and the like can be eliminated to make the text within the chapter more complete and semantically coherent, thus preparing for subsequent content segmentation.
[0095] Further, the performing segmentation on each chapter according to a length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation includes the following:
[0096] Segmentation is performed on each chapter according to the length and content of the chapter to form knowledge pieces containing a number, a title, a content and an attachment.
[0097] By using the above method, corresponding numbering and naming can be performed to effectively manage knowledge pieces, thus well preparing for subsequent semantic learning in a database and the output of a large language model.
[0098] Further, the performing segmentation on each chapter according to a length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation includes the following:
[0099] In a case that the length of the chapter is less than a preset length threshold, the chapter is used as a full-chapter piece; and
[0100] in a case that the length of the chapter is greater than the preset length threshold, the chapter is segmented into textual chapter segment pieces or tabular chapter segment pieces.
[0101] By using the above method, chapters can be accurately segmented to obtain knowledge pieces conforming to retrieval-augmented generation, thus preparing for the subsequent corpus output and learning of the large language model.
[0102] In summary, as shown in FIG. 6, the general process of the detailed parsing mechanism for input document is composed of three main technical steps: textualization, chapter parsing, and content parsing. Finally, a set of saved images and a bunch of logically segmented knowledge segments are output. These segments may have links that need to be aligned.
[0103] The document parsing mechanism disclosed in this application is highly compatible with industrial scenarios and covers most commonly used document types in industrial business. Compared with some technologies, it has the following advantages: (1) capability: the knowledge segments obtained through the suggested method are more meaningful, especially suitable for LLM activities; (2) universality: it can be applied to various industrial documents; (3) interpretability: its working principle can be interpreted very well; (4) feasibility: The suggested mechanism is easy to apply, so operators only need to undergo short-term training to start working.
[0104] In some embodiments, the method for detecting this application has been used to examine whether the knowledge base structure of the suspicious system has the following characteristics: clear and independent expression components, or use of chapters instead of pages as boundary of knowledge segments, and naming format of knowledge segments.
[0105] It is to be understood that, although each step of the flowcharts in FIG. 1 is displayed sequentially according to arrows, the steps are not necessarily performed according to an order indicated by arrows. Unless otherwise explicitly specified in this application, execution of the steps is not strictly limited, and the steps may be performed in other sequences. Moreover, at least part of the steps in FIG. 1 may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but may be executed at different times. The order of execution of these steps or stages is not necessarily performed sequentially, but may be performed in turn or alternately with other steps or at least a part of steps or stages of other steps.
[0106] FIG. 2 provides an apparatus 200 for text parsing conforming to retrieval-augmented generation. The apparatus 200 includes:
[0107] a text receiving device 201 configured to receive text information, where a text includes chapter information;
[0108] a chapter dividing device 202 configured to, according to the chapter information, divide the text information into multiple chapters; and
[0109] a content segmentation device 203 configured to perform segmentation on each chapter according to a length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation.
[0110] Further, the apparatus further includes: a semantic repair device 204 configured to perform sentence boundary detection and repair on each chapter to form a semantically coherent chapter text.
[0111] Further, the content segmentation device 203 is configured to perform segmentation on each chapter according to the length and content of the chapter to form knowledge pieces containing a number, a title, a content and an attachment.
[0112] Further, the content segmentation device 203 is further configured to: in a case that the length of the chapter is less than a preset length threshold, use the chapter as a full-chapter piece; and in a case that the length of the chapter is greater than the preset length threshold, segment the chapter into textual chapter segment pieces or tabular chapter segment pieces.
[0113] It should be noted that the apparatus may include more or fewer modules to achieve the described functions. For example, at least one module in FIG. 2 may be further divided into several different sub-modules, each of which is configured to perform at least a portion of the operation described herein in conjunction with the corresponding module. In addition, in some examples, the apparatus 200 may further include additional modules configured to perform other operations already described in the description. In addition, those skilled in the art can understand that the exemplary apparatus 200 may be implemented using software, hardware, firmware, or any combination thereof.
[0114] FIG. 3 provides a computer device. According to an embodiment, the computer device 300 may include a processor 302. The processor 302 executes a computer program stored in a memory 304. The computer program, when executed by the processor, implements the method described above.
[0115] Those skilled in the art may understand that the structure shown in FIG. 3 is only a block diagram of a partial structure related to a solution in this application, and does not constitute a limitation to the computer device to which the solution in this application is applied. Specifically, the computer device may include more or fewer components than those shown therein, or some components may be combined, or a different component deployment may be used.
[0116] A person of ordinary skill in the art may understand that all or some of the processes of the method in the foregoing embodiments may be implemented by a computer program instructing relevant hardware. The computer program may be stored in a non-volatile computer-readable storage medium. When the computer program is executed, the processes of the foregoing method embodiments may be implemented. Any reference to the memory, the storage, the database, or other medium used in the embodiments provided in this application may include at least one of non-volatile and volatile memories. The non-volatile memories may include Read Only Memories (ROMs) , magnetic tapes, floppy disks, flash memories, or optical memories. The volatile memories may include Random Access Memories (RAMs) or external cache memories. As an explanation rather than limitation, RAMs can be in various forms, such as Static Random Access Memories (SRAMs) or Dynamic Random Access Memories (DRAMs) .
[0117] This application further provides a computer-readable storage medium, storing a computer program. The computer program, when executed by a processor, implements the steps described.
[0118] This application further provides a computer program product. The computer program product is tangibly stored on a computer-readable medium and includes computer-executable instructions. The computer-executable instructions, when executed, causes at least one processor to execute the method described above.
[0119] Further, the computer program may be stored and run in the cloud for the execution of the method. Further, the components of the program may be laid out on multiple devices or clouds. For example, the corresponding steps may be laid out and run on local or onsite computers, or run on different cloud devices to transmit signals through communication connections, or may also be laid out and run on local or onsite computers. The approach or method described is not limited in this application. Corresponding technologies may be flexibly laid out and deployed. Devices and technologies such as cloud, big data, and supercomputing capabilities may be fully utilized for the execution and completion of the method.
[0120] Some implementations of the present disclosure may include artifacts. The artifacts may include storage media for storage logics. Examples of the storage media may include one or more types of computer-readable storage media capable of storing electronic data, including a volatile memory or non-volatile memory, removable or non-removable memories, erasable or non-erasable memories, writable or rewritable memories, and so on. Examples of the logics may include various software units, such as software components, programs, applications, computer programs, application programs, system programs, machine programs, operating system software, middleware, firmware, software modules, routines, subroutines, functions, methods, processes, software interfaces, Application Programming Interfaces (APIs) , instruction sets, computational codes, computer codes, code segments, computer code segments, words, values, symbols, or any combination thereof. In some implementations, for example, the artifacts can store executable computer program instructions which, when executed by a processor, cause the processor to execute the methods and / or operations described herein. The executable computer program instructions may include any suitable type of codes, such as source codes, compiled codes, interpreted codes, executable codes, static codes, dynamic codes, and so on. The executable computer program instructions may be implemented according to predefined computer languages, methods, or syntax used to instruct a computer to execute specific functions. The instructions may be implemented using any appropriate high-level, low-level, object-oriented, visual, compiled, and / or interpreted programming language.
[0121] The examples including the publicly available architecture have already been described above. Of course, it is not possible to describe every conceivable combination of components and / or methods, but those skilled in the art can understand that many other combinations and arrangements are also feasible. Therefore, the novel architecture is intended to cover all such replacements, modifications, and variations that fall within the spirit and scope of the attached claims.
Claims
1.A method for text parsing conforming to retrieval-augmented generation, comprising:receiving text information, wherein a text comprises chapter information;according to the chapter information, dividing the text information into a plurality of chapters; andperforming segmentation on each chapter according to a length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation.2.The method according to claim 1, wherein before performing segmentation on each chapter according to the length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation, the method further comprises:performing sentence boundary detection and repair on each chapter to form a semantically coherent chapter text.3.The method according to claim 1, wherein the performing segmentation on each chapter according to a length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation comprises:performing segmentation on each chapter according to the length and content of the chapter to form knowledge pieces containing a number, a title, a content and an attachment.4.The method according to claim 1, wherein the performing segmentation on each chapter according to a length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation comprises:in a case that the length of the chapter is less than a preset length threshold, using the chapter as a full-chapter piece; andin a case that the length of the chapter is greater than the preset length threshold, segmenting the chapter into textual chapter segment pieces or tabular chapter segment pieces.5.An apparatus (200) for text parsing conforming to retrieval-augmented generation, comprising:a text receiving device (201) configured to receive text information, wherein a text comprises chapter information;a chapter dividing device (202) configured to, according to the chapter information, divide the text information into a plurality of chapters; anda content segmentation device (203) configured to perform segmentation on each chapter according to a length and content of the chapter to form knowledge pieces conforming to retrieval-augmented generation.6.The apparatus (200) according to claim 5, further comprising:a semantic repair device (204) configured to perform sentence boundary detection and repair on each chapter to form a semantically coherent chapter text.7.The apparatus (200) according to claim 5, whereinthe content segmentation device (203) is configured to perform segmentation on each chapter according to the length and content of the chapter to form knowledge pieces containing a number, a title, a content and an attachment.8.The apparatus (200) according to claim 5, wherein the content segmentation device (203) is further configured to:in a case that the length of the chapter is less than a preset length threshold, use the chapter as a full-chapter piece; andin a case that the length of the chapter is greater than the preset length threshold, segment the chapter into textual chapter segment pieces or tabular chapter segment pieces.9.A computer device, comprising a memory and a processor, the memory storing a computer program, wherein when executing the computer program, the processor implements steps of the method according to any one of claims 1-4.10.A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements steps of the method according to any one of claims 1-4.11.A computer program product, tangibly stored on a computer-readable medium and comprising computer-executable instructions, the computer-executable instructions, when executed, causing at least one processor to execute the method according to any one of claims 1-4.
Citation Information
Patent Citations
Electronic book section processing method, device and system
CN101996162A
Document chapter segmentation method and device and storage medium
CN112329548A
Document processing method and device, storage medium and computer equipment
CN113204951A
Knowledge base construction method and question and answer dialogue method and system based on generative large language model
CN117056471A
Document segmentation, interpretation, and re-organization
US20180225259A1