Text information extraction method and device, electronic equipment and storage medium
By introducing rich text parsing and classification modules to parse and classify text documents, the problems of time-consuming and labor-intensive training and difficult iterative optimization in existing technologies are solved, achieving high accuracy and rapid iteration of text information extraction.
Patent Information
- Application Number
- CN202310032264.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-10
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-01-10
AI Technical Summary
Existing information extraction methods suffer from time-consuming and labor-intensive model training and difficulties in iterative optimization.
By introducing a rich text parsing module to perform text parsing and rich text parsing on the text document to be extracted, and using the first rich text classification module to extract text information, including OCR and YOLOv5 methods for text parsing, and combining version information, AND-OR logic and sequential logic matching rules for classification.
It improves the accuracy of text information extraction, solves the problem of not being able to achieve iterative optimization in the short term, and adapts to the classification needs of more complex scenarios.
Smart Images

Figure CN115982362B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of information processing, and in particular to a text information extraction method and device, equipment and a storage medium. BACKGROUND
[0002] With the development of science and technology, information extraction technologies are emerging in an endless stream. Information extraction technology can convert a document into structured data that can be statistically analyzed and then classified through an algorithm model, so that practitioners can quickly and accurately obtain meaningful and valuable text information from it.
[0003] Currently, technical personnel usually use traditional machine learning methods or end-to-end training deep learning methods when performing information extraction. The traditional machine learning method mainly uses feature engineering and a classifier. The main techniques of feature engineering include various word segmentation methods, and the commonly used classifiers include Naive Bayes, KNN (k-Nearest Neighbors), and decision trees. The deep learning method mainly includes text classification algorithms and target detection algorithms.
[0004] The inventors found that the existing information extraction method has problems such as long training time and high training cost of the information extraction model, and difficulty in iterative optimization. SUMMARY
[0005] Embodiments of the present application provide a text information extraction method, device, equipment and storage medium, which can improve the accuracy of text information extraction.
[0006] According to an aspect of the present application, a text information extraction method is provided, comprising:
[0007] obtaining a text document to be extracted;
[0008] performing text analysis and rich text analysis on the text document to be extracted by a first text analysis module to obtain document rich text analysis data;
[0009] extracting text information from the document rich text analysis data by a first rich text classification module.
[0010] According to another aspect of the present application, a text information extraction device is provided, comprising:
[0011] a text document to be extracted obtaining module for obtaining a text document to be extracted;
[0012] a first text analysis module for performing text analysis and rich text analysis on the text document to be extracted to obtain document rich text analysis data;
[0013] a first rich text classification module for extracting text information from the document rich text analysis data.
[0014] According to another aspect of the present application, there is provided an electronic device, comprising:
[0015] at least one processor; and
[0016] a memory connected with the at least one processor in communication; wherein,
[0017] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the text information extraction method according to any one of the embodiments of the present application.
[0018] According to another aspect of the present application, there is provided a computer readable storage medium storing computer instructions for enabling a processor to implement the text information extraction method according to any one of the embodiments of the present application when executed by the processor.
[0019] The technical solution of the embodiments of the present application firstly acquires a text document to be extracted, then performs text analysis and rich text analysis on the text document to be extracted by a first text analysis module to obtain document rich text analysis data, and finally extracts text information from the document rich text analysis data by a first rich text classification module. By introducing rich text information, the problem that iteration optimization cannot be achieved in a short period of time in the text information classification process is solved, and the accuracy of text information extraction is improved.
[0020] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0022] Figure 1 is a flowchart of a text information extraction method provided by the first embodiment of the present application;
[0023] Figure 2 is a flowchart of another text information extraction method provided by the second embodiment of the present application;
[0024] Figure 3 is a flowchart of an information extraction method provided by the second embodiment of the present application;
[0025] Figure 4 is a structural schematic diagram of a text information extraction device provided by Embodiment Three of the present application.
[0026] Figure 5 is a structural schematic diagram of an electronic device provided by Embodiment Four of the present application. DETAILED DESCRIPTION
[0027] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should fall within the protection scope of the present application.
[0028] It should be noted that the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0029] Embodiment One
[0030] Figure 1 is a flowchart of a text information extraction method provided by Embodiment One of the present application. The present embodiment can be applicable to the case of text information extraction using sample data including rich text information. The method can be executed by a text information extraction device, which can be realized by software and / or hardware, and can generally be integrated in an electronic device, which can be a terminal device or a server device. The present embodiment of the present application does not limit the specific device type of the electronic device. Correspondingly, as shown in Figure 1 , the method includes the following operations:
[0031] S110, obtaining a text document to be extracted.
[0032] The text document to be extracted can be data that needs to be extracted.
[0033] In the present embodiment, a word document of a certain format contract uploaded by a user, a picture document of an ID card or a train ticket, and a pdf document of a certain format flow sheet can all be used as the text document to be extracted. As long as the text information extraction requirement is met, the present embodiment does not limit the document type of the text document to be extracted.
[0034] S120, performing text analysis and rich text analysis on the to-be-extracted text document by the first text analysis module to obtain document rich text analysis data.
[0035] The first text analysis module can be a functional module of a text classification model for performing text analysis and rich text analysis on the to-be-extracted text document. The document rich text analysis data can be data including rich text information of the document.
[0036] In the embodiment of the application, the to-be-extracted text document is taken as input data of the first text analysis module in the text classification model and is sent to the first text analysis module for text analysis and rich text analysis. Specifically, the to-be-extracted text document can be analyzed by an OCR (Optical Character Recognition) method, or can be analyzed by a yolov5 (You Only Look Once) method, to finally obtain the document rich text analysis data.
[0037] S130, extracting text information from the document rich text analysis data by the first rich text classification module.
[0038] The first rich text classification module can be a functional module of a text classification model for extracting text information from the document rich text analysis data. The text information can be text data extracted by the first rich text classification module.
[0039] In the embodiment of the application, the first rich text classification module is used to extract the document rich text analysis data to obtain the text information.
[0040] In a specific example, it is assumed that the to-be-extracted text document is a contract in a certain format. The to-be-extracted text document is taken as input data of the first text analysis module and is sent to the first text analysis module for text analysis and rich text analysis to obtain the document rich text analysis data. Then, the document rich text analysis data is taken as input data of the first rich text classification module and is sent to the first rich text classification module to extract text information about the contract in the certain format.
[0041] First, the document rich text analysis data containing the text of A and the text of C is classified and matched based on the rich text classification rule, wherein A appears after C. It can be easily obtained that the rich text classification rule of B matches the document rich text analysis data containing the text of A and the text of C. Then, the to-be-extracted text document is extracted according to the rich text classification rule of B to obtain the text information.
[0042] The technical scheme of the embodiment of the present application firstly acquires a text document to be extracted, then performs text analysis and rich text analysis on the text document to be extracted through a first text analysis module to obtain document rich text analysis data, and finally extracts text information from the document rich text analysis data through a first rich text classification module. By introducing rich text information, the problem that iteration optimization cannot be realized in a short period of time in the text information classification process is solved, and the accuracy of text information extraction is improved.
[0043] Embodiment two
[0044] Figure 2 is a flowchart of another text information extraction method provided by the second embodiment of the present application. The present embodiment is based on the above-mentioned embodiment and is embodied. In the present embodiment, various specific optional implementation manners of performing text analysis and rich text analysis on the text document to be extracted through the first text analysis module to obtain document rich text analysis data and extracting text information from the document rich text analysis data through the first rich text classification module are given. Correspondingly, as shown in Figure 2 , the method of the present embodiment can include:
[0045] S210, determining the text type of the text document to be extracted.
[0046] S220, determining the first rich text classification module from each alternative rich text classification module according to the text type of the text document to be extracted.
[0047] The text type can be a document type, including but not limited to an ID card type, a train ticket type, a certain format contract, and a certain format flow, etc. The alternative rich text classification module can be an information matching module, which can include at least one of a version information matching module, an and / or logical matching module, and a sequential logical matching module.
[0048] In the embodiment of the present application, the version information matching module can be a function module for matching based on the basic text classification matching and introducing layout matching dimension. For example, assuming that an "A_title" is defined, then only the OCR result classified as a title can be matched with the A text field, and the OCR result classified as a body cannot be matched with the A text field. The and / or logic matching module can be a function module for matching through designing and / or logic operation. For example, assuming that an and / or logic operation can be "(A|B)&C", then the and / or operation in the parentheses is calculated first to view the matching result, and then the whole parentheses and C are calculated to view the matching result. The sequential logic matching module can be a function module for matching based on the and / or logic matching and introducing sequential logic. For example, assuming that a sequential logic is "(A|B)&C+sequence", then on the basis of the and / or logic matching, it is also required to satisfy that "A|B is in front of C" in the document, so as to complete the matching.
[0049] In the embodiment of the present application, first, the text type of the text document to be extracted is determined according to the text document to be extracted, and then the first rich text classification module is determined from each candidate rich text classification module according to the text type of the text document to be extracted.
[0050] S230, obtaining the text document to be extracted.
[0051] S240, performing text analysis and rich text analysis on the text document to be extracted by using the first text analysis module to obtain document rich text analysis data.
[0052] In the embodiment of the present application, the document rich text analysis data includes text analysis data and rich text analysis data; the text analysis and the rich text analysis on the text document to be extracted by using the first text analysis module to obtain the document rich text analysis data include: performing text analysis on the text document to be extracted by using a character recognition method of the first text analysis module to obtain the text analysis data; and performing text analysis on the text document to be extracted by using an object detection method of the first text analysis module to obtain the rich text analysis data; wherein the rich text analysis data includes layout information of the text document to be extracted, and the layout information of the text document to be extracted includes at least one of a header, a footer, a title, a paragraph and a table.
[0053] The text document to be extracted can include but is not limited to a bill document, a certificate document and a contract document. The text analysis data can be data obtained by processing the text document to be extracted by using a character recognition method. The layout information can be all information in a page of the text document to be extracted.
[0054] In the embodiment of the present application, the text analysis method is first used to analyze the text of the text document to be extracted to obtain text analysis data, and the object detection method is also used to analyze the text of the text document to be extracted to obtain rich text analysis data.
[0055] In a specific embodiment, the text document to be extracted can be a contract document in a certain format. First, the OCR method can be selected to analyze the text of the text document to be extracted to obtain text analysis data, and then the yolov5 method can be selected to analyze the text of the text document to be extracted to obtain rich text analysis data with header, footer, title, paragraph, table, etc. For example, the text document to be extracted is analyzed by the yolov5 method to obtain a triple list, i.e. (A, [100, 100, 300, 120], title). Wherein, A is the text content; (100, 100) are the left upper corner coordinate values of the text box; (300, 120) are the right lower corner coordinate values of the text box.
[0056] S250, determining a rich text classification rule by the first rich text classification module; wherein the rich text classification rule is composed of target matching text and / or logical operators according to the text matching principle.
[0057] The rich text classification rule can be a rule for classifying the text document to be extracted. The target matching text can be a text field selected by self-definition. The target matching text can be the same type of text data matched with the text document to be extracted.
[0058] In a specific example, the rich text classification rule of the target matching text A can be (A_text | B_text) & C_text; the rich text classification rule of the target matching text B can be (A_text | B_text) | C_text; and the rich text classification rule of the target matching text C can be (A_text & B_text) & C_text.
[0059] S260, classifying and matching the document rich text analysis data based on the rich text classification rule.
[0060] S270, obtaining the text information according to the classification and matching result of the document rich text analysis data.
[0061] In the embodiment of the present application, the document rich text analysis data is first classified and matched by the rich text classification rule, and then the text document to be extracted is extracted to obtain the text information according to the classification and matching result of the document rich text analysis data.
[0062] In an optional embodiment of the present application, the rich text classification rule can comprise a version information matching rule; and the classification matching of the document rich text parsing data based on the rich text classification rule can comprise: determining to-be-matched version information according to the version information matching rule; determining a version information matching position of the document rich text parsing data according to the to-be-matched version information; and matching the to-be-matched version information based on the version information matching position of the document rich text parsing data.
[0063] In a specific example, it is assumed that the rich text classification rule of the target matching text A can be (A_body|B_body)&C_body; the rich text classification rule of the target matching text B can be (A_body|B_body)|C_body; and the rich text classification rule of the target matching text C can be (A_body&B_body)&C_body. First, the classification matching of the document rich text parsing data containing C_body is performed based on the rich text classification rule, and it can be easily obtained that the document rich text parsing data containing C_body is matched with the rich text classification rule of B. Then, the text information can be obtained by extracting the to-be-extracted text document according to the rich text classification rule of B.
[0064] In an optional embodiment of the present application, the rich text classification rule can comprise a logical matching rule; and the classification matching of the document rich text parsing data based on the rich text classification rule can comprise: determining to-be-matched text content and a logical matching order of the to-be-matched text content according to a rule expression of the logical matching rule; and matching the to-be-matched version information according to the to-be-matched text content and the logical matching order of the to-be-matched text content.
[0065] In a specific example, it is assumed that the rich text classification rule of the target matching text A can be (A_body|B_body)&C_body; the rich text classification rule of the target matching text B can be (A_body|B_body)&C_body; and the rich text classification rule of the target matching text C can be (A_body|B_title)&C_body. First, the classification matching of the document rich text parsing data containing C_body and containing B_title is performed based on the rich text classification rule, and it can be easily obtained that the document rich text parsing data containing C_body and containing B_title is matched with the rich text classification rule of C. Then, the text information can be obtained by extracting the to-be-extracted text document according to the rich text classification rule of C.
[0066] In an optional embodiment of the present application, the rich text classification rule can comprise a sequential logic matching rule; and the classification matching of the document rich text parsing data based on the rich text classification rule can comprise: determining the to-be-matched text content and the sequential matching order of the to-be-matched text content according to the rule expression of the sequential logic matching rule; and matching the document rich text parsing data according to the to-be-matched text content and the sequential matching order of the to-be-matched text content.
[0067] In a specific example, it is assumed that the rich text classification rule of the target matching text A can be (A_body|B_title) & C_title; the rich text classification rule of the target matching text B can be (A_body|B_title) & C_body; and the rich text classification rule of the target matching text C can be (A_body|B_title) & C_body+sequence. First, the document rich text parsing data containing the body of A and the body of C is classified and matched based on the rich text classification rule, wherein A appears after C. It can be easily obtained that the rich text classification rule of B is matched with the document rich text parsing data containing the body of A and the body of C D. Then, the text document to be extracted is extracted according to the rich text classification rule of B, and thus the text information can be obtained.
[0068] Figure 3 is a flowchart of information extraction provided by the second embodiment of the present application, as shown in Figure 3 First, the text document to be extracted is subjected to OCR text parsing to obtain text parsing data, and then the rich text parsing data is obtained through no-text parsing. Then, the matching is performed according to the layout rule or the and rule or the sequence rule. The text information is extracted according to the matching result. After the information extraction post-processing is completed, the structured information is obtained.
[0069] The technical solution of the embodiment of the present application first determines the text type of the text document to be extracted, determines the first rich text classification module from each alternative rich text classification module according to the text type of the text document to be extracted, acquires the text document to be extracted, performs text parsing and rich text parsing on the text document to be extracted through the first text parsing module to obtain document rich text parsing data, determines the rich text classification rule through the first rich text classification module, and finally, performs classification matching on the document rich text parsing data based on the rich text classification rule, and obtains the text information according to the classification matching result of the document rich text parsing data. By introducing the rich text information, more complex scene classification can be adapted on the basis of retaining the advantage of convenient rule classification expansion, the problem that iteration optimization cannot be realized in a short period of time in the text information classification process is solved, and the accuracy of text information extraction is improved.
[0070] Embodiment three
[0071] Figure 4is a structural schematic diagram of a text information extraction device provided by Embodiment Three of the present application, as shown in the figure, the device comprises: a text document to be extracted acquisition module 310, a first text analysis module 320 and a first rich text classification module 330, wherein: Figure 4
[0072] The text document to be extracted acquisition module 310 is used for acquiring a text document to be extracted.
[0073] The first text analysis module 320 is used for performing text analysis and rich text analysis on the text document to be extracted to obtain document rich text analysis data.
[0074] The first rich text classification module 330 is used for extracting text information from the document rich text analysis data.
[0075] The technical solution of the embodiment of the present application firstly acquires a text document to be extracted, then performs text analysis and rich text analysis on the text document to be extracted through the first text analysis module to obtain document rich text analysis data, and finally extracts text information from the document rich text analysis data through the first rich text classification module. By introducing rich text information, the problem that iteration optimization cannot be realized in a short period of time in the text information classification process is solved, and the accuracy of text information extraction is improved.
[0076] Optionally, the document rich text analysis data comprises text analysis data and rich text analysis data; the first text analysis module 320 is specifically used for: performing text analysis on the text document to be extracted through the first text analysis module by using a character recognition method to obtain the text analysis data; and performing text analysis on the text document to be extracted through the first text analysis module by using an object detection method to obtain the rich text analysis data; wherein the rich text analysis data comprises layout information of the text document to be extracted, and the layout information of the text document to be extracted comprises at least one of a header, a footer, a title, a paragraph and a table.
[0077] Optionally, the text information extraction device further comprises a first rich text classification determination module, which is specifically used for: determining a text type of the text document to be extracted; and determining the first rich text classification module from each alternative rich text classification module according to the text type of the text document to be extracted; wherein the alternative rich text classification module comprises at least one of a version information matching module, an and / or logical matching module and a sequential logical matching module.
[0078] Optionally, the first rich text classification module 330 is specifically configured to: determine a rich text classification rule through the first rich text classification module; wherein the rich text classification rule is composed of target matching text and / or a logical operator according to a text matching principle; perform classification matching on the document rich text analysis data based on the rich text classification rule; and obtain the text information according to a classification matching result of the document rich text analysis data.
[0079] Optionally, the rich text classification rule includes a version information matching rule, and the first rich text classification module 330 is specifically further configured to: determine to-be-matched version information according to the version information matching rule; determine a version information matching position of the document rich text analysis data according to the to-be-matched version information; and perform matching on the to-be-matched version information based on the version information matching position of the document rich text analysis data.
[0080] Optionally, the rich text classification rule includes a version information matching rule, and the first rich text classification module 330 is specifically further configured to: determine to-be-matched text content and a logical matching order of the to-be-matched text content according to a rule expression of the and / or logical matching rule; and perform matching on the to-be-matched version information according to the to-be-matched text content and the logical matching order of the to-be-matched text content.
[0081] Optionally, the rich text classification rule includes a version information matching rule, and the first rich text classification module 330 is specifically further configured to: determine to-be-matched text content and a first / next matching order of the to-be-matched text content according to a rule expression of the sequential logical matching rule; and perform matching on the document rich text analysis data according to the to-be-matched text content and the first / next matching order of the to-be-matched text content.
[0082] The above text information extraction device can perform the text information extraction method provided by any embodiment of the application, has the corresponding function modules and beneficial effects of performing the method. Technical details not described in detail in the embodiment can be referred to the text information extraction method provided by any embodiment of the application.
[0083] Embodiment Four
[0084] Figure 5A structural diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application described and / or claimed in this document.
[0085] As shown, Figure 5 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., connected in communication with the at least one processor 11, where the memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 12 or loaded into the random access memory (RAM) 13 from the storage unit 18. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0086] Various components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, a speaker, etc., a storage unit 18, such as a magnetic disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0087] The processor 11 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the text information extraction method.
[0088] In some embodiments, the text information extraction method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as storage unit 18. In some embodiments, parts or all of the computer program can be loaded and / or installed onto electronic device 10 via, for example, ROM 12 and / or communication unit 19. When the computer program is loaded onto RAM 13 and executed by processor 11, one or more steps of the text information extraction method or the classification model training method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the text information extraction method by any other suitable means, such as by way of firmware.
[0089] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, specially designed application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0090] Computer programs used to implement the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed by the processor of the machine, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine and partially on a remote machine or entirely on a remote machine or server.
[0091] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0092] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0093] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0094] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
Claims
1. A method of text information extraction, characterized by, The application is applied to a text classification model, comprising: acquiring a text document to be extracted; performing text analysis and rich text analysis on the text document to be extracted by a first text analysis module to obtain document rich text analysis data; extracting text information from the document rich text analysis data by a first rich text classification module; wherein the extraction of the text information from the document rich text analysis data by the first rich text classification module comprises: determining a rich text classification rule by the first rich text classification module; wherein the rich text classification rule is composed of target matching text and / or logical operators according to a text matching principle, and the rich text classification rule is a rule for classifying the text document to be extracted; the rich text classification rule comprises at least one of a version information matching rule, an and / or logical matching rule and a sequential logical matching rule; performing classification matching on the document rich text analysis data based on the rich text classification rule; obtaining the text information according to the classification matching result of the document rich text analysis data.
2. The method of claim 1, wherein, The document rich text analysis data comprises text analysis data and rich text analysis data; the text analysis and the rich text analysis on the text document to be extracted by the first text analysis module to obtain the document rich text analysis data comprises: performing text analysis on the text document to be extracted by the first text analysis module using a character recognition method to obtain the text analysis data; performing text analysis on the text document to be extracted by the first text analysis module using an object detection method to obtain the rich text analysis data; wherein the rich text analysis data comprises layout information of the text document to be extracted, and the layout information of the text document to be extracted comprises at least one of a header, a footer, a title, a paragraph and a table.
3. The method of claim 1, wherein, Before the acquisition of the text document to be extracted, further comprising: determining a text type of the text document to be extracted; determining the first rich text classification module from each alternative rich text classification module according to the text type of the text document to be extracted.
4. The method of claim 1, wherein, The classification matching on the document rich text analysis data based on the rich text classification rule comprises: determining to-be-matched version information according to the version information matching rule; determining a version information matching position of the document rich text analysis data according to the to-be-matched version information; matching the to-be-matched version information based on the version information matching position of the document rich text analysis data.
5. The method of claim 1, wherein, The classification matching on the document rich text analysis data based on the rich text classification rule comprises: determining to-be-matched text content and a logical matching order of the to-be-matched text content according to a rule expression of the and / or logical matching rule; matching the document rich text analysis data according to the to-be-matched text content and the logical matching order of the to-be-matched text content.
6. The method of claim 1, wherein, The classification matching on the document rich text analysis data based on the rich text classification rule comprises: determining to-be-matched text content and a matching order of the to-be-matched text content according to a rule expression of the sequential logical matching rule; The document rich text parsing data is matched according to the to-be-matched text content and the matching sequence of the to-be-matched text content.
7. A text information extraction apparatus characterized by comprising: The text classification model comprises: a to-be-extracted text document acquisition module configured to acquire a to-be-extracted text document; a first text parsing module configured to perform text parsing and rich text parsing on the to-be-extracted text document to obtain document rich text parsing data; a first rich text classification module configured to extract text information from the document rich text parsing data; The first rich text classification module is specifically configured to determine a rich text classification rule, wherein the rich text classification rule is composed of target matching text and / or logical operators according to a text matching principle, and the rich text classification rule is a rule for classifying the to-be-extracted text document; the rich text classification rule comprises at least one of a version information matching rule, an and / or logical matching rule, and a sequence logical matching rule; The document rich text parsing data is classified and matched based on the rich text classification rule; The text information is obtained according to a classification matching result of the document rich text parsing data.
8. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the text information extraction method in any one of claims 1-6.
9. A computer storage medium, characterized in that The computer readable storage medium stores computer instructions for enabling the processor to implement the text information extraction method in any one of claims 1-6 when executed.
Citation Information
Patent Citations
Image recognition and information extraction method and device for standardized document
CN111353492A
Information extraction method and device, equipment and storage medium
CN114444465A