Document content recognition method and device
The document content recognition method is used to process the nuclear power plant documents, judge and match the encoding, and efficient automatic encoding recognition and extraction is realized, solving the problem of time-consuming and low accuracy in encoding search and extraction in the document.
Patent Information
- Application Number
- CN202110951502.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-19
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2041-08-19
AI Technical Summary
The search and extraction of equipment encodings in nuclear power plant documents requires a lot of time and effort, and the encoding library lags behind document updates, resulting in unupdated encodings being easily missed.
A document content recognition method is designed to determine whether there is a preset encoding in the text content through document type conversion and text content extraction, and match the semantic conditions and position information, generate a set of encoding results and label the relevant documents.
It realizes rapid traversal of document content, filters out preset encodings that meet expectations with high recall and high accuracy, solving the problem of automatic identification and extraction of key encodings in nuclear power plant documents.
Smart Images

Figure CN113988011B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of nuclear power technology, and in particular relates to a document content recognition method and device. Background Art
[0002] With the rapid growth of the number of nuclear power plant documents, the need to extract useful information from a document is becoming more and more urgent. Among them, the large number of equipment codes appearing in the document can reflect which equipment the document is associated with, which is one of the key information that nuclear power plant staff need to master. However, relying on manual query to find these codes often takes a lot of time and effort, and the code library is huge and lags behind the document update. It is easy to miss the code that has not been updated to the code library. Summary of the invention
[0003] In order to overcome the problems existing in the related art, a document content recognition method and device are provided.
[0004] According to one aspect of an embodiment of the present disclosure, a document content recognition method is provided, the method comprising:
[0005] Perform document type conversion and text content extraction on multiple documents to be processed to obtain the text content corresponding to each document;
[0006] For each text content, determine whether the text content has a preset code;
[0007] In the case where it is determined that the text content has a preset code, determining that the text content records the code;
[0008] In the case where it is determined that the text content does not have a preset code, if the text content has a suspected code, determining whether the semantics of the text content meets the preset semantic condition corresponding to the position information of the text content;
[0009] In the case where it is determined that the semantics of the text content meets the preset semantic condition corresponding to the position information of the text content, determining that the text content records the code;
[0010] Generate a set of encoding results according to the text content determined to record the codes, the set of encoding results at least including the recorded codes and the positions of the recorded codes in each document;
[0011] According to the encoding result set, the codes in the relevant documents are marked to generate a visual document.
[0012] In a possible implementation, determining whether the semantics of the text content meets the preset semantic condition corresponding to the position information of the text content includes:
[0013] Determine whether the paragraph where the text content is located is in the table;
[0014] In the case where it is determined that the paragraph where the text content is located is located in a table, a first position coefficient is determined according to a result of a determination whether a paragraph keyword exists in the body of the text content, a second position coefficient is determined according to a result of a determination whether a table keyword exists in the header of the text content, a similarity coefficient is determined according to an edit distance between the suspected code of the text content and each preset code, and a similarity is determined according to the first position coefficient, the second position coefficient and the similarity coefficient;
[0015] In the case where it is determined that the paragraph where the text content is located is not located in the table, a first position coefficient is determined according to a result of determining whether there is a paragraph keyword in the body of the text content, a similarity coefficient is determined according to an edit distance between the suspected code of the text content and each preset code, and a similarity is determined according to the first position coefficient and the similarity coefficient;
[0016] In the case where the determined similarity meets the similarity judgment condition, it is judged that the semantics of the text content meets the preset semantic condition corresponding to the position information of the text content.
[0017] In a possible implementation, each preset code includes a unit code, a system code, and a device code;
[0018] Determine whether the text content has a preset code, including:
[0019] Determine the suspected encoding of the text content;
[0020] In the case where the system code of the preset code matches a portion of the characters of the suspected code, determining whether the unit code of the preset code matches the characters preceding the portion of the characters;
[0021] In the case where it is determined that the unit code of the preset code matches the characters before the part of characters, it is determined whether the device code of the preset code matches the characters after the part of characters;
[0022] When it is determined that the device code of the preset code matches the characters after the part of characters, it is determined that the text content has the preset code.
[0023] In a possible implementation, the encoding result set further includes: the frequency of occurrence of the recorded encoding and / or the similarity between the recorded encoding and the preset encoding.
[0024] According to another aspect of an embodiment of the present disclosure, a document content recognition device is provided, the device comprising:
[0025] The conversion and extraction module is used to convert the document types and extract the text content of multiple documents to be processed to obtain the text content corresponding to each document;
[0026] The first judgment module is used to judge whether there is a preset code for each text content;
[0027] A first determination module is used to determine that the text content records the code when it is determined that the text content has a preset code;
[0028] A second judgment module is used to judge whether the semantics of the text content meets the preset semantic conditions corresponding to the position information of the text content if the text content has suspected encoding when judging that the text content does not have the preset encoding;
[0029] A second determination module is used to determine that the text content records a code when it is determined that the semantics of the text content meets the preset semantic condition corresponding to the position information of the text content;
[0030] A first generating module, configured to generate a set of encoding results according to the text content determined to record the codes, wherein the set of encoding results at least includes the recorded codes and the positions of the recorded codes in each document;
[0031] The second generating module is used to mark the codes in the relevant documents according to the encoding result set to generate a visual document.
[0032] In a possible implementation, the second determination module includes:
[0033] The first judgment submodule is used to judge whether the paragraph where the text content is located is in a table;
[0034] A first similarity determination submodule is used to, when it is determined that the paragraph where the text content is located is located in a table, determine a first position coefficient according to a determination result of whether a paragraph keyword exists in the body of the text content, determine a second position coefficient according to a determination result of whether a table keyword exists in the header of the text content, determine a similarity coefficient according to an edit distance between a suspected code of the text content and each preset code, and determine a similarity according to the first position coefficient, the second position coefficient and the similarity coefficient;
[0035] A second similarity determination submodule is used to determine a first position coefficient according to a result of determining whether there is a paragraph keyword in the body of the text content when it is determined that the paragraph where the text content is located is not located in the table, determine a similarity coefficient according to an edit distance between the suspected code of the text content and each preset code, and determine a similarity according to the first position coefficient and the similarity coefficient;
[0036] The second judgment submodule is used to judge whether the semantics of the text content meets the preset semantic conditions corresponding to the position information of the text content when the determined similarity meets the similarity judgment condition.
[0037] In a possible implementation, each preset code includes a unit code, a system code, and a device code;
[0038] The first judgment module includes:
[0039] A first determination submodule, used to determine the suspected encoding of the text content;
[0040] A third judgment submodule is used to judge whether the unit code of the preset code matches the characters before the part of characters when the system code of the preset code matches the part of characters of the suspected code;
[0041] A fourth determination submodule is used to determine whether the device code of the preset code matches the characters after the part of characters when it is determined that the unit code of the preset code matches the characters before the part of characters;
[0042] The fifth determination submodule is used to determine whether the text content has a preset code when it is determined that the device code of the preset code matches the characters after the part of characters.
[0043] In a possible implementation, the encoding result set further includes: the frequency of occurrence of the recorded encoding and / or the similarity between the recorded encoding and the preset encoding.
[0044] According to another aspect of an embodiment of the present disclosure, a document content recognition device is provided, the device comprising:
[0045] processor;
[0046] a memory for storing processor-executable instructions;
[0047] Wherein, the processor is configured to execute the above method.
[0048] According to another aspect of an embodiment of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor.
[0049] The beneficial effect of the present disclosure is that: according to the coding characteristics of nuclear power plants, the present disclosure designs a method for searching preset codes based on regular matching. This method can quickly traverse the text content of a document and find all preset codes in the document. The present disclosure designs a similarity matching method based on a code library and a code position coefficient. By calculating the code position coefficient, the preset code is matched with the code library in the code library for similarity, and the preset code that meets the expectation can be screened out with high accuracy on the basis of a high recall rate. The problem of automatic recognition and extraction of key codes with high accuracy in different types of documents of nuclear power plants is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 The figure is a flow chart of a document content recognition method according to an exemplary embodiment.
[0051] Figure 2 The figure is a flow chart of a document content recognition method according to an exemplary embodiment.
[0052] Figure 3 The present invention is a block diagram of a document content recognition device according to an exemplary embodiment.
[0053] Figure 4 The present invention is a block diagram of a document content recognition device according to an exemplary embodiment.
[0054] Figure 5 The present invention is a block diagram of a document content recognition device according to an exemplary embodiment. DETAILED DESCRIPTION
[0055] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0056] Figure 1 and Figure 2 The flowchart of a document content recognition method according to an exemplary embodiment is shown. The method can be executed by a terminal device, for example, the terminal device can be a server, a desktop computer, a laptop computer, a tablet computer, etc. The terminal device can also be a user device, a vehicle-mounted device or a wearable device, etc. The embodiment of the present disclosure does not limit the type of terminal device. Figure 1 and Figure 2 As shown, the method may include the following steps:
[0057] Step 100, performing document type conversion and text content extraction on a plurality of documents to be processed, and obtaining text content corresponding to each document to be processed;
[0058] In the present disclosure, the types of documents to be processed may include any types. For example, the types of documents to be processed may include common document types such as DOC (Document), PDF (Portable Document Format), etc. The present disclosure does not limit the types of documents to be processed.
[0059] For example, in step 100, first, an open source document extraction tool (such as Apache POI) may be used to read the document converted into a specific type to obtain text content corresponding to the document.
[0060] Next, the types of multiple documents to be processed can be converted into specific types. For example, the document types of the documents to be processed can be uniformly converted into PDF. Since documents of types such as DOC and DOCX have the characteristics of rendering and loading, it is difficult to locate the page number of the code in these types of documents, while it is easy to locate the page number where the code is located in PDF documents. Therefore, documents of various formats can be converted into PDF documents, which is conducive to smoothly reading the text content under the current page number. In addition, due to the existence of multiple historical versions of Microsoft Office Word, the existing open source processing tools cannot perform character-level operations on documents in DOC format, which will make it impossible to accurately mark the code in the DOC document. Therefore, documents of various formats can be converted into PDF documents, which is conducive to accurately marking the code in the document.
[0061] Step 101: for each text content, determine whether the text content has a preset code.
[0062] As an example of this embodiment, each preset code may include a unit code, a system code, and a device code, and step 101 may include:
[0063] Step 1010, determine the suspected encoding of the text content. For example, if a group of strings contains consecutive numbers, letters or symbols, and the length of the string is greater than or equal to a preset length (the preset length can be determined based on the minimum character length of the preset encoding), then the group of strings can be determined as suspected encoding.
[0064] Step 1011, when the system code of the preset code matches some of the characters of the suspected code, it is determined whether the unit code of the preset code matches the characters before the part of the characters. The system code of each preset code can be compared with the suspected code. If there is a system code of a preset code that matches some of the continuous characters of the suspected code, it can be determined whether the unit code of the preset code matches the characters before the part of the characters.
[0065] Step 1012, when it is determined that the unit code of the preset code matches the characters before the part of characters, it is determined whether the device code of the preset code matches the characters after the part of characters;
[0066] Step 1013: When it is determined that the device code of the preset code matches the characters after the part of characters, it is determined that the text content has the preset code.
[0067] In this way, the present disclosure realizes fast fuzzy query and positioning of codes according to the coding characteristics of nuclear power plant documents.
[0068] Step 102: when it is determined that the text content has a preset code, determine that the text content has a code recorded therein.
[0069] Step 103, when it is determined that the text content does not have a preset code, if the text content has a suspected code, it is determined whether the semantics of the text content meets the preset semantic condition corresponding to the position information of the text content.
[0070] In the present disclosure, when it is determined that there is no preset code in the text content, if there is a suspected code in the text content, the suspected code recorded in the text content may be a code that does not exist in the code database. This part of the code may be similar to a certain type of code in the code database because the device is relatively new and has not been updated to the code database. In this case, abruptly discarding this type of suspected code will most likely result in the omission of the code. Therefore, the semantics of the text content can be used to assist in determining whether the suspected code is indeed a code.
[0071] For example, it can be determined whether the paragraph where the text content is located is located in a table (an example of text content location information). When it is determined that the paragraph where the text content is located is located in a table, the semantics of the main body of the text content and the semantics of the header of the text content can be determined. The terminal device can pre-store multiple paragraph keywords, and the paragraph keywords can include, for example, "encoded as", "this device", "this unit", etc. It can also pre-store multiple table keywords, and the table keywords can include, for example, "device number", "device code", etc. The semantics of the multiple paragraph keywords and table keywords are strongly related to the encoding. If the main body of the text content contains any one or more of the multiple paragraph keywords, and the header of the text content contains any one or more of the multiple table keywords, it means that the text content containing suspected encoding records the encoding, thereby effectively avoiding the omission of encoding.
[0072] For example, step 103 may also include:
[0073] Step 1030, determining whether the paragraph where the text content is located is in a table;
[0074] Step 1031, when it is determined that the paragraph where the text content is located is in a table, a first position coefficient is determined according to a result of determining whether a paragraph keyword exists in the body of the text content, a second position coefficient is determined according to a result of determining whether a table keyword exists in the header of the text content, a similarity coefficient is determined according to an edit distance between a suspected code of the text content and each preset code, and a similarity is determined according to the first position coefficient, the second position coefficient and the similarity coefficient;
[0075] Step 1032, when it is determined that the paragraph where the text content is located is not located in the table, a first position coefficient is determined according to a result of determining whether there is a paragraph keyword in the body of the text content, a similarity coefficient is determined according to an edit distance between the suspected code of the text content and each preset code, and a similarity is determined according to the first position coefficient and the similarity coefficient;
[0076] Step 1033: When the determined similarity meets the similarity judgment condition, it is judged that the semantics of the text content meets the preset semantic condition corresponding to the position information of the text content.
[0077] For example, when it is determined that the text content does not have a preset code, if the text content has a suspected code, it can be determined whether the paragraph where the text content is located is in a table. In the case where it is determined that the paragraph where the text content is located is located in a table, it can be determined whether the body of the text content contains paragraph keywords, and whether the header of the text content contains table keywords. When it is determined that the body of the text content contains paragraph keywords, the first position coefficient can be determined to be a high confidence value (for example, 10). When it is determined that the body of the text content does not contain paragraph keywords, the first position coefficient can be determined to be a low confidence value (for example, 0.1). When it is determined that the header of the text content contains table keywords, the second position coefficient can be determined to be a high confidence value (for example, 10). When it is determined that the header of the text content does not contain table keywords, the second position coefficient can be determined to be a low confidence value (for example, 0.1). The edit distance between the suspected code of the text content and each preset code is also determined (wherein the edit distance can be expressed as the minimum number of single-character edit operations required to convert a string into another string), and the similarity coefficient can be determined based on the determined multiple edit distances (for example, the similarity coefficient can be the average, maximum or minimum value of multiple edit distances). Finally, the similarity can be determined based on the first position coefficient, the second position coefficient and the similarity coefficient. For example, the similarity can be determined according to the following formula:
[0078] s=α·β·sl
[0079] Among them, s is the similarity, sl is the edit distance, α is the first position coefficient, and β is the second position coefficient.
[0080] A similarity threshold Th can be preset. If the similarity is greater than Th (an example that meets the similarity judgment condition), the semantics of the text content is judged to meet the preset semantic conditions corresponding to the position information of the text content, and the text content is judged to record the code. If the similarity is less than or equal to Th, the text content and the code are discarded. In this way, the suspected code can be judged more accurately through the quantitative judgment of the position coefficient and the similarity.
[0081] Step 104, when it is determined that the semantics of the text content meets the preset semantic condition corresponding to the position information of the text content, determining that the text content records a code;
[0082] Step 105: Generate a set of encoding results based on the text content determined to record the codes, wherein the set of encoding results at least includes the recorded codes and the positions of the recorded codes in each document.
[0083] Among them, step 105 realizes the function of sorting the coding result set. For example, the interface of ApachePOI can be used to output it into a document according to the preset format: code, code frequency, code page number, code similarity with the preset code, to form a coding database, and the result set is more intuitively presented in the form of statistical information. At the same time, the data is persisted and saved in the database for subsequent visual statistics, so that the staff can more intuitively and quickly grasp the association between key coding document types in the document.
[0084] Step 106: annotate the codes in the relevant documents according to the coding result set to generate a visual document.
[0085] For PDF document annotation: You can use the Spire.PDF tool to traverse the encoding result set and annotate the PDF document page by page.
[0086] For word document editing: other formats of word documents (doc, dot, etc.) can be converted to docx format. During the annotation process, the code to be annotated is not in the minimum unit text object of the same docx document, so this minimum unit text object (not a single character) needs to be cut and reassembled. Finally, the annotated result document is output and saved to the result database.
[0087] According to the coding characteristics of nuclear power plants, the present invention designs a method for searching preset codes based on regular matching. This method can quickly traverse the text content of a document and find all preset codes in the document. The present invention designs a similarity matching method based on a code library and a code position coefficient. By calculating the code position coefficient, the preset code is matched with the code library in the code library for similarity. On the basis of a high recall rate, the preset code that meets the expectations can be screened out with high accuracy. The problem of high-accuracy automatic identification and extraction of key codes in different types of documents in nuclear power plants is solved.
[0088] Figure 3 FIG. 1 is a block diagram of a document content recognition device according to an exemplary embodiment. Figure 3 As shown, the device comprises:
[0089] The conversion and extraction module is used to convert the document types and extract the text content of multiple documents to be processed to obtain the text content corresponding to each document;
[0090] The first judgment module is used to judge whether there is a preset code for each text content;
[0091] A first determination module is used to determine that the text content records the code when it is determined that the text content has a preset code;
[0092] A second judgment module is used to judge whether the semantics of the text content meets the preset semantic conditions corresponding to the position information of the text content if the text content has suspected encoding when judging that the text content does not have the preset encoding;
[0093] A second determination module is used to determine that the text content records a code when it is determined that the semantics of the text content meets the preset semantic condition corresponding to the position information of the text content;
[0094] A first generating module, configured to generate a set of encoding results according to the text content determined to record the codes, wherein the set of encoding results at least includes the recorded codes and the positions of the recorded codes in each document;
[0095] The second generating module is used to mark the codes in the relevant documents according to the encoding result set to generate a visual document.
[0096] In a possible implementation, the second determination module includes:
[0097] The first judgment submodule is used to judge whether the paragraph where the text content is located is in a table;
[0098] A first similarity determination submodule is used to, when it is determined that the paragraph where the text content is located is located in a table, determine a first position coefficient according to a determination result of whether a paragraph keyword exists in the body of the text content, determine a second position coefficient according to a determination result of whether a table keyword exists in the header of the text content, determine a similarity coefficient according to an edit distance between a suspected code of the text content and each preset code, and determine a similarity according to the first position coefficient, the second position coefficient and the similarity coefficient;
[0099] A second similarity determination submodule is used to determine a first position coefficient according to a result of determining whether there is a paragraph keyword in the body of the text content when it is determined that the paragraph where the text content is located is not located in the table, determine a similarity coefficient according to an edit distance between the suspected code of the text content and each preset code, and determine a similarity according to the first position coefficient and the similarity coefficient;
[0100] The second judgment submodule is used to judge whether the semantics of the text content meets the preset semantic conditions corresponding to the position information of the text content when the determined similarity meets the similarity judgment condition.
[0101] In a possible implementation, each preset code includes a unit code, a system code, and a device code;
[0102] The first judgment module includes:
[0103] A first determination submodule, used to determine the suspected encoding of the text content;
[0104] A third judgment submodule is used to judge whether the unit code of the preset code matches the characters before the part of characters when the system code of the preset code matches the part of characters of the suspected code;
[0105] A fourth determination submodule is used to determine whether the device code of the preset code matches the characters after the part of characters when it is determined that the unit code of the preset code matches the characters before the part of characters;
[0106] The fifth determination submodule is used to determine whether the text content has a preset code when it is determined that the device code of the preset code matches the characters after the part of characters.
[0107] In a possible implementation, the encoding result set further includes: the frequency of occurrence of the recorded encoding and / or the similarity between the recorded encoding and the preset encoding.
[0108] The description of the above-mentioned device has been explained in detail in the description of the above-mentioned method, and will not be repeated here.
[0109] Figure 4 800 is a block diagram of a document content recognition device according to an exemplary embodiment. For example, the device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0110] Reference Figure 4 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0111] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned device. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0112] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or device operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0113] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0114] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0115] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0116] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0117] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800 and the temperature change of the device 800. The sensor assembly 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0118] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0119] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0120] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 804 including computer program instructions, which can be executed by the processor 820 of the device 800 to perform the above method.
[0121] Figure 5 1900 is a block diagram of a document content recognition device according to an exemplary embodiment. For example, the device 1900 may be provided as a server. Figure 5 , the apparatus 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as an application, that can be executed by the processing component 1922. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0122] The device 1900 may also include a power supply component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input / output (I / O) interface 1958. The device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, MacOS X™, Unix™, Linux™, FreeBSD™, or the like.
[0123] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the device 1900 to perform the above method.
[0124] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0125] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: 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 static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0126] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0127] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0128] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0129] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0130] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0131] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0132] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A document content recognition method, characterized in that: The method comprises: Perform document type conversion and text content extraction on multiple documents to be processed to obtain the text content corresponding to each document; For each text content, determine whether the text content has a preset code; In the case where it is determined that the text content has a preset code, determining that the text content records the code; In the case where it is determined that the text content does not have a preset code, if the text content has a suspected code, determining whether the semantics of the text content meets the preset semantic condition corresponding to the position information of the text content; In the case where it is determined that the semantics of the text content meets the preset semantic condition corresponding to the position information of the text content, determining that the text content records the code; Generate a set of encoding results according to the text content determined to record the codes, the set of encoding results at least including the recorded codes and the positions of the recorded codes in each document; According to the encoding result set, the codes in the relevant documents are marked to generate a visual document; Determining whether the semantics of the text content meets the preset semantic conditions corresponding to the position information of the text content includes: Determine whether the paragraph where the text content is located is in the table; In the case where it is determined that the paragraph where the text content is located is located in a table, a first position coefficient is determined according to a result of a determination whether a paragraph keyword exists in the body of the text content, a second position coefficient is determined according to a result of a determination whether a table keyword exists in the header of the text content, a similarity coefficient is determined according to an edit distance between the suspected code of the text content and each preset code, and a similarity is determined according to the first position coefficient, the second position coefficient and the similarity coefficient; In the case where it is determined that the paragraph where the text content is located is not located in the table, a first position coefficient is determined according to a result of determining whether there is a paragraph keyword in the body of the text content, a similarity coefficient is determined according to an edit distance between the suspected code of the text content and each preset code, and a similarity is determined according to the first position coefficient and the similarity coefficient; In the case where the determined similarity meets the similarity judgment condition, it is judged that the semantics of the text content meets the preset semantic condition corresponding to the position information of the text content.
2. The method according to claim 1, characterized in that Each preset code includes unit code, system code and equipment code; Determine whether the text content has a preset code, including: Determine the suspected encoding of the text content; In the case where the system code of the preset code matches a portion of the characters of the suspected code, determining whether the unit code of the preset code matches the characters preceding the portion of the characters; In the case where it is determined that the unit code of the preset code matches the characters before the part of characters, it is determined whether the device code of the preset code matches the characters after the part of characters; When it is determined that the device code of the preset code matches the characters after the part of characters, it is determined that the text content has the preset code.
3. The method according to claim 1, characterized in that The encoding result set also includes: the frequency of occurrence of the recorded encoding and / or the similarity between the recorded encoding and the preset encoding.
4. A document content recognition device, characterized in that: The device comprises: The conversion and extraction module is used to convert the document types and extract the text content of multiple documents to be processed to obtain the text content corresponding to each document; The first judgment module is used to judge whether there is a preset code for each text content; A first determination module, configured to determine that the text content records the code when it is determined that the text content has a preset code; A second judgment module is used to judge whether the semantics of the text content meets the preset semantic conditions corresponding to the position information of the text content if the text content has suspected encoding when judging that the text content does not have the preset encoding; A second determination module is used to determine that the text content records a code when it is determined that the semantics of the text content meets the preset semantic condition corresponding to the position information of the text content; A first generating module, configured to generate a set of encoding results according to the text content determined to record the codes, wherein the set of encoding results at least includes the recorded codes and the positions of the recorded codes in each document; A second generating module is used to mark the codes in the relevant documents according to the encoding result set to generate a visual document; The second judgment module includes: The first judgment submodule is used to judge whether the paragraph where the text content is located is in the table; A first similarity determination submodule is used to, when it is determined that the paragraph where the text content is located is located in a table, determine a first position coefficient according to a determination result of whether a paragraph keyword exists in the body of the text content, determine a second position coefficient according to a determination result of whether a table keyword exists in the header of the text content, determine a similarity coefficient according to an edit distance between a suspected code of the text content and each preset code, and determine a similarity according to the first position coefficient, the second position coefficient and the similarity coefficient; A second similarity determination submodule is used to determine a first position coefficient according to a result of determining whether there is a paragraph keyword in the body of the text content when it is determined that the paragraph where the text content is located is not located in the table, determine a similarity coefficient according to an edit distance between the suspected code of the text content and each preset code, and determine a similarity according to the first position coefficient and the similarity coefficient; The second judgment submodule is used to judge whether the semantics of the text content meets the preset semantic conditions corresponding to the position information of the text content when the determined similarity meets the similarity judgment condition.
5. The device according to claim 4, characterized in that Each preset code includes unit code, system code and equipment code; The first judgment module includes: A first determination submodule, used to determine the suspected encoding of the text content; A third judgment submodule is used to judge whether the unit code of the preset code matches the characters before the part of characters when the system code of the preset code matches the part of characters of the suspected code; A fourth determination submodule is used to determine whether the device code of the preset code matches the characters after the part of characters when it is determined that the unit code of the preset code matches the characters before the part of characters; The fifth determination submodule is used to determine whether the text content has a preset code when it is determined that the device code of the preset code matches the characters after the part of characters.
6. The device according to claim 4, characterized in that The encoding result set also includes: the frequency of occurrence of the recorded encoding and / or the similarity between the recorded encoding and the preset encoding.
7. A document content recognition device, characterized in that: The device comprises: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method according to any one of claims 1 to 3.
8. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Method for obtaining financial data, terminal device and medium
CN109062874A
Text matching method and device, computer equipment and storage medium
CN110276071A