Document information extraction method and device, electronic equipment and medium
By analyzing the document content and location information, determining the title level, and calling the large language model, the problem of extracting information of missing title identification documents is solved, and efficient document information extraction is achieved.
Patent Information
- Application Number
- CN202510287316.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-04-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art cannot accurately identify and extract document information when processing documents with missing title identification.
By obtaining the pending document, parsing the document to determine the text content and location information of the chapter title, determining the title level, and calling the large language model for information extraction.
The chapter information extraction of documents that do not contain title tags is realized, and the limitations of the prior art in such document scenarios are solved.
Smart Images

Figure CN119783658A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, in particular to technical fields such as natural language processing and deep learning, and specifically to a document information extraction method, device, electronic device, storage medium and computer program product, and a data processing platform. Background Art
[0002] Document information extraction is an important part of the document understanding process. Related technologies usually rely on the hierarchical structure of each level of title in the document to extract relevant chapter information. However, the above solution has certain limitations. When the hierarchical structure of each level of title is missing in the document, it will not be possible to accurately identify and extract document information. Summary of the invention
[0003] The present invention provides a document information extraction method, device, electronic equipment, storage medium and computer program product, and a data processing platform.
[0004] According to one aspect of the present invention, a document information extraction method is provided, comprising: obtaining a document to be processed, the document to be processed being a document that does not contain a title identifier, the title identifier being used to identify the title level of each chapter title in the document to be processed; parsing the document to be processed to determine text content information and text position information corresponding to each of the multiple chapter titles in the document to be processed; determining the title level corresponding to each chapter title based on the text position information corresponding to each of the multiple chapter titles; calling a large language model to extract information on chapter content between the multiple chapter titles in the document to be processed based on the text content information, text position information and title level corresponding to each of the multiple chapter titles, to obtain an information extraction result.
[0005] According to another aspect of the present invention, there is provided a document information extraction device, comprising: an acquisition module, used to acquire a document to be processed, the document to be processed being a document that does not contain a title identifier, the title identifier being used to identify the title level of each chapter title in the document to be processed; a parsing module, used to parse the document to be processed to determine text content information and text position information corresponding to each of the multiple chapter titles in the document to be processed; a determination module, used to determine the title level corresponding to each chapter title based on the text position information corresponding to each of the multiple chapter titles; and an extraction module, used to call a large language model to extract information on the chapter content between the multiple chapter titles in the document to be processed based on the text content information, text position information and title level corresponding to each of the multiple chapter titles, to obtain an information extraction result.
[0006] According to another aspect of the present invention, there is provided a data processing platform, comprising: a data management system for receiving configuration information for a target document, and acquiring the target document based on the configuration information, wherein the target document is a document that does not contain a title identifier, and the title identifier is used to identify the title level of each chapter title in the target document; a data processing system for parsing the target document to determine text content information and text position information corresponding to each of the multiple chapter titles in the target document; determining the title level corresponding to each chapter title based on the text position information corresponding to each of the multiple chapter titles; and calling a large language model to extract information on the chapter content between the multiple chapter titles in the target document based on the text content information, text position information and title level corresponding to each of the multiple chapter titles, to obtain an information extraction result.
[0007] According to another aspect of the present invention, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the document information extraction method as described above.
[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, on which executable instructions are stored. When the instructions are executed by a processor, the processor executes the document information extraction method as described above.
[0009] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, which implements the document information extraction method as described above when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0011] Figure 1 is a flowchart of a method for extracting document information according to an embodiment of the present invention;
[0012] Figure 2 A schematic diagram of a document to be processed according to an embodiment of the present invention;
[0013] Figure 3 is a block diagram of a document information extraction device according to an embodiment of the present invention;
[0014] Figure 4 is a schematic diagram of the structure of a data processing platform according to an embodiment of the present invention;
[0015] Figure 5 is a block diagram of an electronic device suitable for implementing a document information extraction method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0016] The technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention and the drawings in the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.
[0017] It should be noted that the sequence numbers of the operations in the following method are only used as representations of the operations for the purpose of description, and should not be regarded as representing the execution order of the operations. Unless explicitly stated, the method does not need to be executed completely in the order shown.
[0018] In addition, in the description of the present invention, the terms “first”, “second”, etc. (if any) are used only to distinguish the description and cannot be understood as indicating or implying relative importance.
[0019] In the technical solution of the present invention, the collection, storage, use, processing, transmission, provision, disclosure and application of the data involved (for example, including but not limited to user personal information) shall comply with the relevant laws and regulations of relevant countries and regions and shall not violate public order and good morals.
[0020] In the technical solution of the present invention, before obtaining or collecting relevant data, the authorization or consent of the data owner is obtained.
[0021] In order to facilitate understanding of the technical solutions of the embodiments of the present invention and the technical effects produced by them, the terms involved in the embodiments of the present invention are explained below.
[0022] Large Language Model (LLM) is a deep learning model trained with a large amount of text data, including but not limited to language models based on Transformer architecture. Large language models can generate natural language text or understand the meaning of language text. Large language models usually contain a large number of parameters and can capture complex patterns and structures in language, so as to perform well in a variety of natural language processing tasks.
[0023] Figure 1 is a flowchart of a document information extraction method according to an embodiment of the present invention.
[0024] like Figure 1 As shown, the document information extraction method 100 includes operations S110 to S140.
[0025] In operation S110, a document to be processed is obtained. The document to be processed is a document that does not contain a title identifier. The title identifier is used to identify the title level of each chapter title in the document to be processed.
[0026] In operation S120, the document to be processed is parsed to determine text content information and text position information corresponding to each of a plurality of chapter titles in the document to be processed.
[0027] In operation S130, the title level corresponding to each chapter title is determined according to the text position information corresponding to each of the multiple chapter titles.
[0028] In operation S140, the large language model is called to extract information from the chapter contents between the multiple chapter titles in the document to be processed based on the text content information, text position information and title levels corresponding to the multiple chapter titles, and obtain an information extraction result.
[0029] According to an embodiment of the present invention, the document format of the document to be processed may include, but is not limited to, a PDF (Portable Document Format) document, plain text, and rich text. The document to be processed may be a document in any field, or a document in different languages, such as a Chinese document, an English document, etc., which is not limited by the present invention.
[0030] In an embodiment of the present invention, the document to be processed may include multiple chapter titles, but each chapter title does not include a title identifier, wherein the title identifier is used to identify the title level of each chapter title in the document to be processed. The title identifier may be represented, for example, in Chinese characters, numeric characters, Western characters (including letters and words), or other suitable character forms.
[0031] For example, in Figure 2 The multiple chapter titles included in the document to be processed are, for example, "Project Introduction", "Project Purpose", "Main Innovation Points of the Project", "Main Research Content", "Overall Idea", "Implementation Results", etc. Since these chapter titles do not contain title identifiers, it is impossible to determine the title level of each chapter title in the document to be processed based on the title identifier, and thus it is impossible to use related technologies to extract chapter information from the document to be processed. The solution provided by the present invention can be applied to the scenario of extracting chapter information from a document to be processed that does not contain a title identifier, which is introduced below.
[0032] According to an embodiment of the present invention, the above-mentioned document to be processed can be processed by optical character recognition (OCR) technology, so as to extract the text content information and text position information corresponding to each of the multiple chapter titles in the document to be processed. For example, an OCR model can be used to perform recognition processing on the document to be processed, so as to obtain the text content information and text position information corresponding to each chapter title in the document to be processed. OCR models include, for example, but are not limited to MinerU models. The MinerU model can process a variety of document types, and the content types extracted from the document are rich and diverse, covering various key elements in the document, so as to ensure the integrity and high quality of the extraction results.
[0033] According to an embodiment of the present invention, text content information is used to indicate the chapter title name of the corresponding chapter title, and text position information is used to characterize the text position of the corresponding chapter title in the document to be processed. Exemplarily, the text content information includes the text content contained in the text box corresponding to the corresponding chapter title, and the text position information includes the coordinate information of the text box corresponding to the corresponding chapter title and the position information of the text box in the document to be processed. The coordinate information of the text box is used to describe the specific position of the text box on the page. The coordinate information of the text box can be, for example, the coordinate information of the two points of the upper left corner and the lower right corner of the text box relative to the upper left corner of the page. The position information of the text box in the document to be processed is used to describe the relative position of the text box in the entire document to be processed. The position information of the text box in the document to be processed can be, for example, the page number position where the text box appears in the document to be processed. It should be noted that the text position information in the embodiment of the present invention is not limited to the above examples, and can also be expressed in other suitable ways in some embodiments, which is not limited here.
[0034] In the document typesetting process, in order to highlight the hierarchy of each chapter title in the document, chapter titles of different levels usually set corresponding text line heights. For example, the text line height corresponding to a high-level chapter title (such as a first-level title) may be larger, while the text line height corresponding to a low-level chapter title (such as a second-level title, a third-level title, etc.) is relatively small. This difference in text line height helps to visually distinguish the levels of each chapter title, thereby making the document structure clearer. In other words, the text line height of each chapter title in the document can reflect its title level to a certain extent. Since the text position information of each chapter title can be used to determine the text line height of the chapter title. Therefore, the title level of each chapter title can be determined by using the text position information corresponding to each of the multiple chapter titles. This process is described in detail below.
[0035] First, for each chapter title, the text line height corresponding to the chapter title is determined according to the text position information corresponding to the chapter title.
[0036] For example, assuming that the document to be processed includes N chapter titles, the text position information corresponding to the nth chapter title can be expressed as ,in and Respectively represent the coordinate information of the upper left corner and lower right corner of the text box corresponding to the nth chapter title, N is an integer greater than 1, and n is a positive integer less than or equal to N. According to the text position information corresponding to the nth chapter title, the text line height corresponding to the nth chapter title can be determined. For example, the text line height corresponding to the nth chapter title can be expressed as In the above manner, the text line heights corresponding to each of the N chapter titles contained in the document to be processed can be determined.
[0037] Next, the title levels corresponding to the multiple chapter titles are determined according to the text line heights corresponding to the multiple chapter titles.
[0038] According to an embodiment of the present invention, determining the title level corresponding to each of the plurality of chapter titles according to the text line height corresponding to each of the plurality of chapter titles may include the following process.
[0039] First, the text line heights corresponding to the multiple chapter titles may be sorted to determine the maximum text line height and the minimum text line height among the multiple text line heights.
[0040] Next, the title level depth for multiple chapter titles is determined based on the maximum text line height and the minimum text line height. The title level depth refers to the maximum level span from the highest level chapter title to the lowest level chapter title in the document to be processed. For example, if the title level depth is 4 (just an example), it means that the document to be processed contains "Level 1 Title", "Level 2 Title", "Level 3 Title" and "Level 4 Title".
[0041] Exemplarily, the following formula may be used to determine the title level depth.
[0042] group_num=math.ceil((max(height)-min(height)+1) / k)
[0043] In the above formula, group_num represents the title level depth, max(height) represents the maximum text line height among multiple text line heights, and min(height) represents the minimum text line height among multiple text line heights. k is a threshold parameter, which is used to define the maximum allowable range of the difference in text line heights between chapter titles of two different title levels. In an embodiment of the present invention, k can be set according to actual needs. Exemplarily, k=5. math.ceil represents calculation by rounding up to an integer. That is, if (max(height)-min(height)+1) / k is an integer, group_num is equal to (max(height)-min(height)+1) / k, otherwise group_num is equal to (max(height)-min(height)+1) / k+1.
[0044] Next, the multiple chapter titles are divided into title levels according to the title level depth to obtain the title levels corresponding to the multiple chapter titles.
[0045] The following describes the process of dividing multiple chapter titles into heading levels based on the heading hierarchy depth.
[0046] First, the first text line height interval is segmented according to the title level depth to obtain a plurality of second text line height intervals.
[0047] The values of the starting endpoint and the ending endpoint of the first text line height interval are determined according to the minimum text line height and the maximum text line height, respectively. Each second text line height interval corresponds to a title level, and the larger the value of the ending endpoint corresponding to the second text line height interval, the higher the title level corresponding to the second text line height interval. In addition, the title level corresponding to the second text line height interval whose ending endpoint value is the maximum text line height is the highest title level, and the title level corresponding to the second text line height interval whose starting endpoint value is the minimum text line height is the lowest title level. Among them, the title level types from the highest title level to the lowest title level can be determined according to the title level depth. The highest title level can usually be set to a first-level title.
[0048] The example of N chapter titles in the above-mentioned document to be processed is used. The first text line height interval can be expressed as [h0, he], where the values of the starting endpoint h0 and the ending endpoint he are the minimum text line height and the maximum text line height among the N text line heights, respectively. Assume that the title level depth is 3. According to the title level depth, the first text line height interval is divided into equal parts to obtain 3 second text line height intervals: [h0, h1], (h1, h2], (h2, he]. Among them, the values of h0, h1, h2, he are h0, h1, h2, and he, respectively.
[0049] Next, the multiple chapter titles are divided into title levels according to the correspondence between the text line height corresponding to each chapter title and the multiple second text line height intervals, so as to obtain the title level of each chapter title in the multiple chapter titles.
[0050] For example, for any one of the multiple chapter titles, if the text line height corresponding to the chapter title falls into a second text line height interval, the title level corresponding to the second text line height interval is used as the title level of the chapter title. Exemplarily, for any one of the N chapter titles, if the text line height corresponding to the chapter title falls into the second text line height interval [h0, h1], the title level corresponding to the chapter title is, for example, a third-level title; if the text line height corresponding to the chapter title falls into the second text line height interval (h1, h2], the title level corresponding to the chapter title is, for example, a second-level title; if the text line height corresponding to the chapter title falls into the second text line height interval (h2,h3], the title level corresponding to the chapter title is, for example, a first-level title.
[0051] The above describes the process of obtaining the title level of each chapter title in the document to be processed. In this process, the embodiment of the present invention determines the title level of each chapter title through the text position information corresponding to each chapter title in the document to be processed. Since the text position information is directly extracted from the document to be processed, it is closely aligned with the content and structure of the document to be processed and can truly and accurately reflect the structure and logical relationship of the document to be processed. Therefore, the title level of each chapter title is determined by using the text position information corresponding to each chapter title, which can improve the accuracy and acquisition efficiency of the title level of the chapter title.
[0052] After obtaining the title level of each chapter title, the large language model can be called to extract information on the chapter content between multiple chapter titles in the document to be processed based on the text content information, text position information and title level corresponding to each of the multiple chapter titles to obtain the information extraction result.
[0053] In an embodiment of the present invention, a plurality of bigrams are constructed based on the text content information and title levels corresponding to a plurality of chapter titles. Each bigram includes the text content information and title level corresponding to a chapter title, and the association between the text content information and the title level. Afterwards, a large language model is called to extract information on the chapter contents between the plurality of chapter titles in the document to be processed based on the plurality of bigrams and the text position information corresponding to the plurality of chapter titles, and obtain an information extraction result.
[0054] In the above information extraction process, a large language model can be first used to generate a title hierarchy diagram based on multiple bigram information and text position information corresponding to each chapter title. Among them, the text position information corresponding to each chapter title is used to provide the index order of each chapter title in the document to be processed. The title hierarchy diagram is used to represent the hierarchical structure of the chapter titles in the document to be processed. The title hierarchy diagram can be represented by a tree structure, for example. Each node in the title hierarchy diagram represents a chapter title, and the parent-child relationship between the nodes reflects the hierarchical relationship between the chapter titles in the document to be processed. Afterwards, the large language model is used to extract information from the chapter content between multiple chapter titles in the document to be processed based on the title hierarchy diagram to obtain an information extraction result.
[0055] It can be understood that the title hierarchy diagram can represent the hierarchical structure of chapter titles in the document to be processed. In the process of extracting chapter information based on the title hierarchy diagram, this chapter title hierarchy structure can help or guide the large language model to locate the chapter content between the corresponding chapter titles more quickly and accurately, so that the required information can be extracted from the chapter content more quickly and accurately.
[0056] In an embodiment of the present invention, the information extraction result includes, for example, summary information corresponding to each chapter title. The summary information is a descriptive summary of the chapter content under the corresponding chapter title. For example, the summary information corresponding to the chapter title "Project Introduction" is "The project mainly involves xxx". In some embodiments, in addition to the summary information corresponding to each chapter title, the information extraction result may also include, for example, key information corresponding to each chapter title. Key information refers to the key content or key knowledge points in the chapter content under the corresponding chapter title. For example, the key information is "the cultivated land area is xxx acres", "the forest area is xxx acres", and so on.
[0057] According to some embodiments of the present invention, after obtaining the summary information and key information corresponding to each chapter title, the summary information and / or key information of each chapter title can also be stored in the form of text on the node corresponding to the chapter title in the title hierarchy diagram, so as to enrich the document knowledge in the title hierarchy diagram, so that the title hierarchy diagram carrying document information (including the summary information and / or key information of each chapter title) can be used to represent the element information in the document to be processed. In this way, tasks related to the document to be processed can be processed based on the title hierarchy diagram. For example, when performing information retrieval on the document to be processed according to the document retrieval data, the title hierarchy diagram can be used to perform information retrieval on the document to be processed, thereby obtaining the retrieval results corresponding to the document retrieval data. Among them, the document retrieval data is used to retrieve the document information corresponding to the retrieval requirements from the document to be processed. The document retrieval data, for example, includes but is not limited to query keywords and / or query parameters.
[0058] According to the technical solution of the present invention, by parsing the document to be processed, the text content information and text position information corresponding to each of the multiple chapter titles in the document to be processed are obtained, and the title level corresponding to each of the chapter titles is determined according to the text position information corresponding to each of the multiple chapter titles, and then the chapter content between the multiple chapter titles in the document to be processed is extracted based on the text content information, text position information and title level corresponding to each of the multiple chapter titles by calling the large language model. Through the above solution, the relevant chapter information can be extracted from the document to be processed that does not contain the title identifier in a simple and efficient manner, which effectively alleviates the limitations of the relevant technology in dealing with such document scenarios.
[0059] Figure 3 is a block diagram of a document information extraction device according to an embodiment of the present invention.
[0060] like Figure 3 As shown, the document information extraction device 300 includes an acquisition module 310 , a parsing module 320 , a determination module 330 and an extraction module 340 .
[0061] The acquisition module 310 is used to acquire a document to be processed. The document to be processed is a document that does not contain a title identifier. The title identifier is used to identify the title level of each chapter title in the document to be processed.
[0062] The parsing module 320 is used to parse the document to be processed to determine the text content information and text position information corresponding to each of the multiple chapter titles in the document to be processed.
[0063] The determination module 330 is used to determine the title level corresponding to each chapter title according to the text position information corresponding to each of the multiple chapter titles.
[0064] The extraction module 340 is used to call the large language model to extract information from the chapter contents between the multiple chapter titles in the document to be processed based on the text content information, text position information and title level corresponding to each of the multiple chapter titles, and obtain an information extraction result.
[0065] According to an embodiment of the present invention, the determination module 330 includes a first determination submodule and a second determination submodule. The first determination submodule is used to determine the text line height corresponding to each chapter title according to the text position information corresponding to the chapter title; the second determination submodule is used to determine the title level corresponding to each of the multiple chapter titles according to the text line height corresponding to each of the multiple chapter titles.
[0066] According to an embodiment of the present invention, the second determination submodule includes a first determination unit, a second determination unit and a division unit. The first determination unit is used to determine the maximum text line height and the minimum text line height among multiple text line heights; the second determination unit is used to determine the title level depth according to the maximum text line height and the minimum text line height; the division unit is used to divide the multiple chapter titles into title levels according to the title level depth, and obtain the title levels corresponding to the multiple chapter titles.
[0067] According to an embodiment of the present invention, the extraction module 340 includes a construction submodule and an extraction submodule. The construction submodule is used to construct a plurality of bigram information according to the text content information and title levels corresponding to the plurality of chapter titles. The extraction submodule is used to call the large language model to extract information from the chapter contents between the plurality of chapter titles in the to-be-processed document based on the plurality of bigram information and the text position information corresponding to the plurality of chapter titles, and obtain an information extraction result.
[0068] Figure 4 It is a structural schematic diagram of a data processing platform according to an embodiment of the present invention.
[0069] like Figure 4 As shown, the data processing platform 400 includes a data management system 410 and a data processing system 420 .
[0070] The data management system 410 is used to receive configuration information for a target document and obtain the target document based on the configuration information.
[0071] According to an embodiment of the present invention, the document format of the target document may include, but is not limited to, a PDF document, plain text, etc. The target document may be a document in any field, or a document in different languages, such as a Chinese document, an English document, etc. The target document may include at least one chapter title, but each chapter title does not include a title identifier, wherein the title identifier is used to identify the title level of each chapter title in the target document.
[0072] According to an embodiment of the present invention, the configuration information for the target document may be, for example, set by the user through a user interface, or may be configuration information that matches the target document and is selected by the user from a plurality of pre-set configuration information, which is not limited here. The above configuration information may include data source configuration information and data resource configuration information corresponding to the target document. Among them, the data source configuration information indicates the address information of the target database storing the target document, and the data resource configuration information indicates the database table associated with the target document in the target database. The data source configuration information may, for example, include at least some of the following configuration parameters: the way to obtain the target document (such as local upload, server import, web service connection and JDBC connection, etc.), the target data source address storing the target document, the target database name, the target database type and the target data source port identifier, the verification information when the target data source is accessed, etc.
[0073] The data processing system 420 is communicatively connected to the data management system 410, and is used to obtain the target document from the data management system 410 and parse the target document to determine the text content information and text position information corresponding to each of the multiple chapter titles in the target document, determine the title level corresponding to each chapter title according to the text position information corresponding to each of the multiple chapter titles, and call the large language model to extract information on the chapter content between the multiple chapter titles in the target document based on the text content information, text position information and title level corresponding to each of the multiple chapter titles, to obtain an information extraction result.
[0074] According to an embodiment of the present invention, the data management system 410 may further include a creation module and a data acquisition module. The creation module is used to create a target view according to the configuration information, and the target view is used to indicate the data source connection information corresponding to the target document. The data acquisition module is used to obtain the target document from the target data source based on the target view.
[0075] According to an embodiment of the present invention, the data management system 410 may further include a storage module, which is used to create a basic view according to the information extraction result and store the basic view.
[0076] It should be noted that the implementation methods, technical problems solved, functions realized, and technical effects achieved of each system / module / sub-module / unit in the data processing platform and device embodiments are the same or similar to the implementation methods, technical problems solved, functions realized, and technical effects achieved of each corresponding step in the method embodiments, and will not be repeated here.
[0077] Figure 5 A block diagram of an electronic device suitable for implementing a document information extraction method according to an embodiment of the present invention is schematically shown.
[0078] like Figure 5 As shown, the electronic device 500 according to an embodiment of the present invention includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 to a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0079] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present invention by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present invention by executing the program stored in the one or more memories.
[0080] According to an embodiment of the present invention, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the I / O interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage portion 508 as needed.
[0081] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the document information extraction method according to the embodiment of the present invention is implemented.
[0082] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.
[0083] The embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the document information extraction method provided by the embodiment of the present invention.
[0084] The computer program executes the above functions defined in the system / device of the embodiment of the present invention when it is executed by the processor 501. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0085] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 509, and / or installed from the removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0086] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above functions defined in the system of the embodiment of the present invention are performed. According to the embodiment of the present invention, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0087] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, such as Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0088] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0089] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present invention may be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in the various embodiments of the present invention may be combined and / or combined in various ways. All of these combinations and / or combinations fall within the scope of the present invention.
[0090] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination advantageously. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.
Claims
1. A document information extraction method, comprising: Acquire a document to be processed, wherein the document to be processed is a document that does not contain a title identifier, and the title identifier is used to identify the title level of each chapter title in the document to be processed; Parsing the document to be processed to determine text content information and text position information corresponding to each of a plurality of chapter titles in the document to be processed; Determine the title level corresponding to each of the chapter titles according to the text position information corresponding to each of the chapter titles; The large language model is called to extract information on the chapter contents between the multiple chapter titles in the document to be processed based on the text content information, text position information and title level corresponding to each of the multiple chapter titles, so as to obtain an information extraction result.
2. The method according to claim 1, wherein: Determining the title level corresponding to each of the chapter titles according to the text position information corresponding to each of the chapter titles comprises: For each of the chapter titles, determining the text line height corresponding to the chapter title according to the text position information corresponding to the chapter title; According to the text line heights respectively corresponding to the plurality of chapter titles, the title levels respectively corresponding to the plurality of chapter titles are determined.
3. The method according to claim 2, wherein: Determining the title level corresponding to each of the plurality of chapter titles according to the text line heights corresponding to each of the plurality of chapter titles comprises: Determine a maximum text line height and a minimum text line height among the plurality of text line heights; Determine the title level depth according to the maximum text line height and the minimum text line height; The multiple chapter titles are divided into title levels according to the title level depth to obtain the title levels corresponding to the multiple chapter titles.
4. The method according to any one of claims 1 to 3, wherein: The calling of the large language model extracts information of the chapter contents between the multiple chapter titles in the to-be-processed document based on the text content information, text position information and title level corresponding to each of the multiple chapter titles, and obtains the information extraction result including: Constructing a plurality of binary information according to the text content information and the title level corresponding to each of the plurality of chapter titles; The large language model is called to extract information of the chapter contents between the multiple chapter titles in the document to be processed based on the multiple bigram information and the text position information corresponding to each of the multiple chapter titles, so as to obtain the information extraction result.
5. A data processing platform, comprising: A data management system, configured to receive configuration information for a target document, and to obtain the target document based on the configuration information, wherein the target document is a document that does not contain a title tag, and the title tag is used to identify the title level of each chapter title in the target document; The data processing system is used to parse the target document to determine the text content information and text position information corresponding to each of the multiple chapter titles in the target document; determine the title level corresponding to each of the chapter titles based on the text position information corresponding to each of the multiple chapter titles; and call a large language model to extract information on the chapter content between the multiple chapter titles in the target document based on the text content information, text position information and title level corresponding to each of the multiple chapter titles to obtain an information extraction result.
6. The data processing platform according to claim 5, wherein: The data management system comprises: A creation module, used to create a target view according to the configuration information, wherein the target view is used to indicate data source connection information corresponding to the target document; A data acquisition module is used to obtain the target document based on the target view.
7. A document information extraction device, comprising: An acquisition module, used for acquiring a document to be processed, wherein the document to be processed is a document that does not contain a title identifier, and the title identifier is used to identify the title level of each chapter title in the document to be processed; A parsing module, used for parsing the document to be processed to determine the text content information and text position information corresponding to each of the multiple chapter titles in the document to be processed; A determination module, used to determine the title level corresponding to each of the chapter titles according to the text position information corresponding to each of the multiple chapter titles; The extraction module is used to call the large language model to extract information on the chapter content between the multiple chapter titles in the document to be processed based on the text content information, text position information and title level corresponding to each of the multiple chapter titles, and obtain an information extraction result.
8. An electronic device comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the method according to any one of claims 1 to 4.
9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to perform the method according to any one of claims 1 to 4.
10. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Document chapter structure identification method, device, equipment and storage medium
CN110427884A
Power emergency unstructured document directory construction method and device, computer equipment, storage medium and computer program product
CN119066141A
Document segmentation method and device, computer equipment and storage medium
CN119474250A
Cited By
Method, system and equipment for intelligent analysis and information extraction of feasibility research report
CN120373306A
Feasibility study report intelligent analysis and information extraction method, system and equipment
CN120373306B
Long document content extraction method and system based on dynamic segmentation and multi-model optimization
CN121168413A
Multi-modal document information extraction method, system and equipment and storage device
CN121766326A