Information processing method and device, electronic equipment and storage medium

By extracting table content from the pending documents and building a table knowledge base, and directly converting it into a target type table, the problem of requiring a large number of annotated samples for model training in the existing technology is solved, and efficient table data processing and management is achieved.

CN119597804APending Publication Date: 2025-03-11CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411640282.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

Existing table recognition technology requires a large number of labeled samples for model training, resulting in high labor and time costs.

Method used

By extracting the table content from the to-process document, determining the two-dimensional matrix, and determining the table structure information based on the cell's data type, building a table knowledge base, and directly converting it into a table of target type, the steps of model training are avoided.

Benefits of technology

It reduces computing costs, improves data processing efficiency, simplifies the management and application of tabular data, and realizes fast response and efficient query.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597804A_ABST
    Figure CN119597804A_ABST
Patent Text Reader

Abstract

The invention provides an information processing method and device, electronic equipment and a storage medium, and relates to the technical field of big data. The method comprises the steps that table content is extracted from a document to be processed, and a two-dimensional matrix is determined; the two-dimensional matrix comprises a plurality of rows, and each row comprises a plurality of cells; determining table structure information of the two-dimensional matrix according to the data types of the plurality of cells; determining the type of the two-dimensional matrix according to the table structure information of the two-dimensional matrix, converting the two-dimensional matrix into a to-be-stored table with a target type, and constructing a table knowledge base; and determining the answer content from the table knowledge base according to the query question. The method does not need to use a labeled sample to pre-train a model, the table is processed through the heuristic rule, the operation cost can be greatly reduced, the data processing efficiency is improved, the table to be stored is unified into the standard format with the target type, and the table data governance capability is effectively improved through the constructed table knowledge base.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Tables are used to store and display structured / semi-structured data and are widely found in technical documents, industry reports, scientific literature and other document materials. With the explosive growth in the number of document materials, the traditional manual method of processing documents into tables requires a lot of manpower and time costs, which seriously limits the management and application of table data. Table recognition technology has emerged, and its goal is to automatically extract table information from massive long documents and convert table information from unstructured document formats to structured storage formats, which helps to fully explore and utilize the high-quality information carried in table data, and has become an important research issue in the field of big data applications.

[0003] Existing table recognition technology uses a deep model training and then predictive classification to complete table recognition and extraction. It requires the collection of a large number of historical long documents and corresponding target table annotation samples as model training data, and is also limited by labor costs and time costs.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The present disclosure provides an information processing method, device, electronic device and storage medium, which at least to some extent overcome the problem of high labor and time costs caused by the need to use labeled samples for training recognition tables in advance using models.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to one aspect of the present disclosure, there is provided an information processing method, comprising:

[0008] Extract table content from the document to be processed to determine a two-dimensional matrix; the two-dimensional matrix includes multiple rows, and each row includes multiple cells;

[0009] Determining table structure information of the two-dimensional matrix according to the data types of the plurality of cells;

[0010] According to the table structure information of the two-dimensional matrix, determine the type of the two-dimensional matrix and convert the two-dimensional matrix into a table to be stored with a target type, and build a table knowledge base;

[0011] The answer content is determined from the table knowledge base according to the query question.

[0012] In some embodiments, extracting table content from a document to be processed and determining a two-dimensional matrix includes:

[0013] Get the documents to be processed;

[0014] Unifying the formats of the documents to be processed into a target format;

[0015] Using a software library to read the document to be processed in the target format, traverse the table in the document to be processed and extract cells from the table; wherein, if the extracted cell is a merged cell, split the merged cell into cells with the same content;

[0016] The cells are arranged according to the maximum number of rows in the table in the document to be processed to determine a two-dimensional matrix.

[0017] In some embodiments, determining the table structure information of the two-dimensional matrix according to the data types of the plurality of cells includes:

[0018] Obtaining data types of the multiple cells;

[0019] If the data types of the plurality of cells are two or more, the distribution positions of the table header and the table body in the two-dimensional matrix are determined, and the table structure information of the two-dimensional matrix is ​​determined.

[0020] In some embodiments, if the data types of the plurality of cells are two or more, determining the distribution positions of the table header and the table body in the two-dimensional matrix, and determining the table structure information of the two-dimensional matrix includes:

[0021] If the data types of the plurality of cells are two or more, identifying the data types of the cells in each row from bottom to top of the two-dimensional matrix;

[0022] If the data types of cells in each row of the two-dimensional matrix from bottom to top are consistent when compared between rows, then the number of rows with consistent statistical data types is counted;

[0023] If the number of rows with consistent data types is between the total number of rows in the two-dimensional matrix and zero, the table structure information of the two-dimensional matrix is ​​determined to be a vertical table, and the distribution positions of the table header and the table body in the two-dimensional matrix are determined based on the number of rows with consistent types.

[0024] In some embodiments, if the data types of the plurality of cells are two or more, determining the distribution positions of the table header and the table body in the two-dimensional matrix, and determining the table structure information of the two-dimensional matrix includes:

[0025] If the data types of cells in each column of the two-dimensional matrix from right to left are consistent when comparing between columns, then the number of columns with consistent statistical data types is counted;

[0026] If the number of columns with consistent data types is between the total number of columns of the two-dimensional matrix and zero, the table structure information of the two-dimensional matrix is ​​determined to be a horizontal table, and the distribution positions of the table header and the table body in the two-dimensional matrix are determined based on the number of columns with consistent types.

[0027] In some embodiments, according to the table structure information of the two-dimensional matrix, determining the type of the two-dimensional matrix and converting the two-dimensional matrix into a table to be stored with a target type, and constructing a table knowledge base includes:

[0028] According to the number of rows or columns of the header of the two-dimensional matrix, determining whether the type of the two-dimensional matrix is ​​a simple table or a composite table; wherein the number of rows or columns of the header of the simple table is 1, and the number of rows or columns of the header of the composite table is an integer greater than 1;

[0029] According to the table structure information of the two-dimensional matrix, the two-dimensional matrix whose table structure information is a horizontal table is converted into a vertical table by performing a transposition operation as a matrix, and determining the transposed two-dimensional matrix;

[0030] The two-dimensional matrix whose table structure information is a vertical table and the transposed two-dimensional matrix are used as an updated two-dimensional matrix, and cells whose adjacent cells in the header of the updated two-dimensional matrix have the same content are identified;

[0031] Merge cells whose adjacent cells in the header of the updated two-dimensional matrix have the same contents to determine a restored table;

[0032] If the restored table is determined to be a composite table according to the number of rows of the header of the restored table, the header of the composite table is vertically merged and compressed into a single-row header to determine the table to be stored; the target type of the table to be stored is a simple table and a vertical table;

[0033] A table knowledge base is constructed according to the table to be stored.

[0034] In some embodiments, constructing a table knowledge base according to the table to be stored includes:

[0035] Taking each row content of the table to be stored as a key-value pair, a key-value pair list is constructed; the key in the key-value pair corresponds to the field of the table header, and the value in the key-value pair corresponds to the cell content;

[0036] A single table to be stored is taken as a knowledge slice, and a trained model is used to convert the key-value pair list in the knowledge slice into a vector, and a mapping relationship between the table to be stored and the vector is established to construct a table knowledge base.

[0037] In some embodiments, determining the answer content from the table knowledge base according to the query question includes:

[0038] Converting the query question into a query vector using the trained model;

[0039] Using the query vector to query the table knowledge base for vectors that meet a similarity threshold, and determining a corresponding table to be stored as enhanced knowledge through the mapping relationship;

[0040] Prompt engineering is used to construct a big model prompt for the query question and the enhanced knowledge, and the big model prompt is input into the big model to generate answer content.

[0041] According to another aspect of the present disclosure, there is also provided an information processing device, including:

[0042] A two-dimensional matrix determination module is used to extract table content from the document to be processed and determine a two-dimensional matrix; the two-dimensional matrix includes multiple rows, and each row includes multiple cells;

[0043] A table structure information determination module, used to determine the table structure information of the two-dimensional matrix according to the data types of the multiple cells;

[0044] A table knowledge base construction module, used to determine the type of the two-dimensional matrix according to the table structure information of the two-dimensional matrix and convert the two-dimensional matrix into a table to be stored with a target type, so as to construct a table knowledge base;

[0045] The answer content determination module is used to determine the answer content from the table knowledge base according to the query question.

[0046] According to another aspect of the present disclosure, an electronic device is also provided, which includes: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned information processing methods by executing the executable instructions.

[0047] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the information processing method described in any one of the above is implemented.

[0048] According to another aspect of the present disclosure, a computer program product is provided, including: a computer program or instructions, wherein when the computer program or instructions are executed by a processor, any one of the above-mentioned information processing methods is implemented.

[0049] The information processing method, device, electronic device and storage medium provided in the embodiments of the present disclosure include: extracting table content from the document to be processed, determining a two-dimensional matrix; the two-dimensional matrix includes multiple rows, each row includes multiple cells; according to the data types of the multiple cells, determining the table structure information of the two-dimensional matrix; according to the table structure information of the two-dimensional matrix, determining the type of the two-dimensional matrix and converting the two-dimensional matrix into a table to be stored with a target type, and constructing a table knowledge base; determining the answer content from the table knowledge base according to the query question. The embodiment of the present disclosure extracts table content from the document to be processed, and the two-dimensional matrix is ​​composed of multiple cells, and the data types of the multiple cells are judged to obtain the table structure information, and the heuristic rules are formed based on the data type, and the model does not need to be pre-trained with labeled samples. The table can be processed by the heuristic rules to greatly reduce the operation cost and improve the data processing efficiency, and the two-dimensional matrix is ​​uniformly converted into a table to be stored with a target type according to the table structure information, and a table database is constructed. By unifying the table to be stored into a standard format with a target type, the constructed table knowledge base effectively improves the table data management capability, and obtains the corresponding answer content from the table knowledge base when receiving the query question, so as to achieve a rapid response to the query question and improve the efficiency of query feedback.

[0050] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0052] Figure 1 A schematic diagram showing the system structure of an information processing method in an embodiment of the present disclosure.

[0053] Figure 2 A schematic diagram of an information processing method in an embodiment of the present disclosure is shown.

[0054] Figure 3 A schematic diagram of a two-dimensional matrix determination process of an information processing method in an embodiment of the present disclosure is shown.

[0055] Figure 4 A schematic diagram of a process of determining table structure information of a two-dimensional matrix in an information processing method in an embodiment of the present disclosure is shown.

[0056] Figure 5 A schematic diagram of a process of determining that table structure information of a two-dimensional matrix is ​​a vertical table in an information processing method according to an embodiment of the present disclosure is shown.

[0057] Figure 6 A schematic diagram of a process of determining that table structure information of a two-dimensional matrix is ​​a horizontal table in an information processing method according to an embodiment of the present disclosure is shown.

[0058] Figure 7 A schematic diagram showing the process of converting a table to be stored and constructing a table knowledge base in an information processing method in an embodiment of the present disclosure is shown.

[0059] Figure 8 A schematic diagram of a process of constructing a table knowledge base in an information processing method in an embodiment of the present disclosure is shown.

[0060] Fig. 9 A schematic diagram of a process of determining answer content in an information processing method in an embodiment of the present disclosure is shown.

[0061] Fig.10 A flow chart of an information processing method in an embodiment of the present disclosure is shown.

[0062] Fig.11 A schematic diagram of an information processing device in an embodiment of the present disclosure is shown.

[0063] Fig.12 A schematic diagram of a computer-readable storage medium showing an information processing method in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0064] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0065] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0066] For ease of understanding, before introducing the embodiments of the present disclosure, several terms involved in the embodiments of the present disclosure are first explained as follows:

[0067] Heuristic rules are an empirical method used to solve problems or make decisions. They are usually based on intuition, common sense or past experience, rather than strict mathematical or logical proofs. Heuristic rules are widely used in many fields, especially in scenarios such as big data, artificial intelligence, search algorithms, and decision support systems; heuristic rules can help find effective solutions to complex problems and improve the performance and efficiency of the system. Its characteristics include: Approximation: Heuristic rules usually provide approximate solutions rather than optimal solutions. But in many cases, approximate solutions are good enough and have lower computational costs. Flexibility: Heuristic rules can be adjusted according to specific circumstances and have high flexibility. Efficiency: Compared with complex algorithms, heuristic rules are usually simpler and faster.

[0068] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.

[0069] Figure 1 FIG. 1 shows an exemplary application system architecture diagram to which the information processing method in the embodiment of the present disclosure can be applied. Figure 1 As shown, the system architecture may include a terminal device 101 , a network 102 and a server 103 .

[0070] The network 102 is a medium for providing a communication link between the terminal device 101 and the server 103, and can be a wired network or a wireless network.

[0071] Optionally, the wireless network or wired network described above uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a dedicated network or any combination of a virtual private network). In some embodiments, the data exchanged through the network is represented by technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPSec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.

[0072] The terminal device 101 can be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, smart speakers, smart watches, wearable devices, augmented reality devices, virtual reality devices, etc.

[0073] Optionally, the client of the application installed in different terminal devices 101 is the same, or the client of the same type of application based on different operating systems. Based on the different terminal platforms, the specific form of the client of the application can also be different, for example, the application client can be a mobile client, a PC client, etc.

[0074] The server 103 may be a server that provides various services, such as a background management server that provides support for the device operated by the user using the terminal device 101. The background management server may analyze and process the received request and other data, and feed back the processing results to the terminal device.

[0075] Optionally, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.

[0076] Those skilled in the art will know that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration, and any number of terminal devices, networks and servers may be provided according to actual needs, and the embodiments of the present disclosure do not limit this.

[0077] Under the above system architecture, an information processing method is provided in an embodiment of the present disclosure. The method can be executed by any electronic device with computing and processing capabilities.

[0078] In some embodiments, the information processing method provided in the embodiments of the present disclosure may be executed by a terminal device of the above-mentioned system architecture; in other embodiments, the information processing method provided in the embodiments of the present disclosure may be executed by a server in the above-mentioned system architecture; in other embodiments, the information processing method provided in the embodiments of the present disclosure may be implemented by a terminal device and a server in the above-mentioned system architecture through interaction.

[0079] Documents (such as Word files) are widely used in the field of big data as an unstructured data storage format. To process the documents, it is necessary to convert the documents from unstructured storage formats to structured storage formats (such as Excel tables, MySQL database tables, etc.). By processing the structured tables, it is helpful to fully explore and utilize the high-quality information carried in the table data. The traditional manual method of converting documents into tables requires a lot of manpower and time costs, which seriously limits the management and application of table data.

[0080] Table recognition technology can automatically extract table content from documents. Table recognition technology mainly includes two parts: table content recognition and table structure recognition (also known as table structure reconstruction). Among them, table content recognition refers to automatically extracting table content entities from data source documents (such as PDF, pictures, Word files, etc.), that is, the text or data contained in the cells of the table. The main goal of table structure recognition technology is to identify / restore the structural information of the original table and identify the layout structure and hierarchical structure of the table. Table structure recognition often includes table semantic parsing, automatically identifying the type of cells stored in the table, and thus determining the regional location of the header / body. In order to meet the needs of the table application step, the extracted table also needs to be represented in a unified format. Common representation methods include text sequence format, markdown format, excel format, html format, and mysql format.

[0081] One type of table recognition technology is to identify and extract tables in image documents, which specifically includes five steps: document preprocessing, table detection, table content recognition, table data classification, and table data storage. Among them, the table detection model is TableNet, the content recognition adopts the OCR model, and the data classification uses the NLP model to classify the text content in the table. Another type of table recognition technology is to obtain the target table corresponding to the document by inputting the long document rich text information obtained by preprocessing into the pre-trained table classification model; then the feature vector extracted from the target table is input into the cell classification model to obtain the information extraction result of the table. The above two types of table recognition technologies both use the method of predictive classification after deep model training to complete table recognition and extraction. It is necessary to collect a large number of historical long documents and corresponding target table annotation samples as model training data before the training stage. The processing efficiency of this method will also be limited by labor costs and time costs. There is also a table recognition technology that pre-trains after vectorizing the table content, which is called a table language model. The model architecture of the combination of encoder and decoder is often used, such as a language model based on transformer. In the table query stage, the user query question and the query table are encoded and decoded, and finally a table cell predicted by the model to be most relevant to the query question is output as the answer. This table recognition technology is good at accurately locating the original content in the table, but it is not applicable to more complex user queries that require analyzing the entire table content to combine the correct answer.

[0082] Figure 2 A schematic diagram of an information processing method in an embodiment of the present disclosure is shown. Figure 2 As shown, the information processing method provided in the embodiment of the present disclosure includes the following steps:

[0083] Step S202: extracting table content from the document to be processed and determining a two-dimensional matrix; the two-dimensional matrix includes a plurality of rows, and each row includes a plurality of cells;

[0084] Step S204: determining the table structure information of the two-dimensional matrix according to the data types of the multiple cells;

[0085] Step S206: according to the table structure information of the two-dimensional matrix, determine the type of the two-dimensional matrix and convert the two-dimensional matrix into a table to be stored with a target type, and construct a table knowledge base;

[0086] Step S208: Determine the answer content from the table knowledge base according to the query question.

[0087] This embodiment extracts table content from the document to be processed, forms a two-dimensional matrix with multiple cells, and determines the data types of the multiple cells to obtain table structure information, and forms heuristic rules based on the data types. There is no need to use labeled samples to pre-train the model. Processing tables through heuristic rules can greatly reduce computing costs and improve data processing efficiency. The two-dimensional matrix is ​​uniformly converted into a table to be stored with a target type according to the table structure information, and a table database is constructed. By unifying the tables to be stored into a standard format with a target type, the constructed table knowledge base effectively improves the table data management capability, and obtains the corresponding answer content from the table knowledge base when a query question is received, thereby achieving rapid response to the query question and improving the efficiency of query feedback.

[0088] Figure 3 A schematic diagram of a process of determining a two-dimensional matrix in an information processing method according to an embodiment of the present disclosure is shown. Figure 3 As shown, in the embodiment, extracting table content from the document to be processed and determining a two-dimensional matrix includes:

[0089] Step S302: Obtain the document to be processed;

[0090] Step S304: uniformly processing the formats of the documents to be processed into a target format;

[0091] Step S306: using the software library to read the document to be processed in the target format, traversing the table in the document to be processed and extracting cells from the table; wherein, if the extracted cell is a merged cell, splitting the merged cell into cells with the same content;

[0092] Step S308: Arrange the cells according to the maximum number of rows in the table in the document to be processed to determine a two-dimensional matrix.

[0093] The document to be processed can be a long document in Word format, which contains a large amount of text, tables, pictures and other contents, and the tables need to be extracted. The documents to be processed are stored in a long document database, and multiple documents to be processed are obtained from the long document database. The formats of the documents to be processed include .doc and .docx. In order to achieve efficient processing, the .docx format is used as the target format, and the .doc format of the documents to be processed is uniformly converted to .docx format. In the Windows system + Office software environment, the win32com module in Python is used to uniformly convert the documents to be processed into .docx format for processing.

[0094] After the format of the document to be processed is unified into the .docx format, the software library "python-docx library" is used to read the document to be processed in the .docx format, and the tables in the document to be processed in the .docx format are traversed, wherein Table 1 shows the tables in the document to be processed.

[0095]

[0096] Table 1

[0097] Extract table contents from the table as cells. If the extracted cell is a merged cell, split the merged cell into cells with the same content. For example, if "Title 2" in Table 1 is a merged cell, then you need to split the merged cell "Title 2" to get two separate cells, and the cell content is also "Title 2". If the extracted cell is a single cell, keep the content of the extracted single cell unchanged. For example, "Content 2" in Table 1 is a single cell, and it remains a single cell after extraction, and the content remains unchanged.

[0098] Since there are merged cells in the table in the document to be processed, it is necessary to identify the maximum number of rows in the table, so that the table obtained when the merged cells are split will not produce additional overflow, and the split table is kept as a rectangular table. The extracted cells and the split cells are arranged according to the maximum number of rows to construct a two-dimensional matrix; wherein Table 2 is the two-dimensional matrix obtained by processing Table 1. In a two-dimensional matrix, the number of rows is the number of rows in the table, and each cell in each row stores the content of the corresponding position in the table.

[0099] Title 1 Title 2 Title 2 Title 1 Subheading 1 Subheading 2 Content 1 Content 2 Content 3 Content 4 Content 5 Content 6

[0100] Table 2

[0101] Figure 4 A schematic diagram of the process of determining the table structure information of a two-dimensional matrix in an information processing method according to an embodiment of the present disclosure is shown. Figure 4As shown, in the embodiment, determining the table structure information of the two-dimensional matrix according to the data types of multiple cells includes:

[0102] Step S402: obtaining data types of multiple cells;

[0103] Step S404: If the data types of the plurality of cells are two or more, the distribution positions of the table header and the table body in the two-dimensional matrix are determined, and the table structure information of the two-dimensional matrix is ​​determined.

[0104] After extracting the table content from the document to be processed to obtain a two-dimensional matrix, in order to form a heuristic rule, it is necessary to determine the table structure information of the two-dimensional matrix. The specific process includes: obtaining the data type of each of the multiple cells in the two-dimensional matrix. The cell data type can include: character type, numeric type, date / time type and other uncommon types; analyzing and judging how many types of data types there are in the multiple cells of the two-dimensional matrix. If the data types of multiple cells are the same, then the two-dimensional matrix is ​​most likely a special type of table that conforms to the common format. Therefore, in this case, there is no need to form a heuristic rule to identify the structural information of the table. For example, if a table is full of numbers, then there is only a table body but no table header. This table format does not require structural analysis, and the numbers in the table can be directly processed as a matrix. Therefore, when the data types of multiple cells are the same, there is no need to identify the table structure, and the table content can be directly output or processed manually.

[0105] If the data types of the multiple cells are two or more, the table header and the table body can be determined from the multiple cells, and the distribution positions of the table header and the table body in the two-dimensional matrix can be identified, thereby determining the table structure information of the two-dimensional matrix.

[0106] After identifying the data type of each cell in the two-dimensional matrix shown in Table 2 above, Table 3 is obtained, and each cell in Table 3 shows its data type;

[0107] Title 1 (characters) Title 2 (characters) Title 2 (characters) Title 1 (characters) Subtitle 1 (value) Subheading 2 (value) Content 1 (value) Content 2 (value) Content 3 (characters) Content 4 (value) Content 5 (value) Content 6 (characters)

[0108] Table 3

[0109] It can be seen from Table 3 above that the data types of Title 1 and Title 2 are character types, and the data types of Subtitle 1, Subtitle 2 and Content 1-Content 6 are numeric types. Then Table 3 includes two data types, so the table header and table body can be determined from multiple cells of Table 3, and the distribution positions of the table header and table body in the two-dimensional matrix can be identified, thereby determining the table structure information of the two-dimensional matrix.

[0110] Figure 5Schematic diagram of the process of determining the tabular structure information of a two-dimensional matrix as a vertical table in an information processing method according to an embodiment of the present disclosure, as follows Figure 5 In the embodiment, if the data types of multiple cells are two or more, determine the distribution positions of the table header and the table body in the two-dimensional matrix, and determine the tabular structure information of the two-dimensional matrix, including:

[0111] Step S502: When the data types of multiple cells are two or more, identify the data types of the cells in each row of the two-dimensional matrix from bottom to top;

[0112] Step S504: If the data types of the cells in each row of the two-dimensional matrix from bottom to top are the same when compared row by row, count the number of rows with the same data type;

[0113] Step S506: If the number of rows with the same data type is between the total number of rows of the two-dimensional matrix and zero, determine the tabular structure information of the two-dimensional matrix as a vertical table, and determine the distribution positions of the table header and the table body in the two-dimensional matrix according to the number of rows with the same type.

[0114] In the embodiment, when it is analyzed and determined that the data types of multiple cells are two or more, identify the data types of the cells in each row of the two-dimensional matrix from bottom to top;

[0115] Based on the data types of multiple cells, establish a heuristic rule for the consistency of the data types of the table content; wherein, the heuristic rule for the consistency of the data types of the table content is that the data types of the content of the table body cells corresponding to the same table header title in the table should be the same.

[0116] When identifying, it is from bottom to top. Then each row of cells is used as a comparison object. When comparing row by row, based on the heuristic rule for the consistency of the data types of the table content, count the number N of rows with the same data type among the cells in the rows of the two-dimensional matrix from bottom to top. If the number N satisfies 0 < N < L (L is the total number of rows), then the tabular structure information of the two-dimensional matrix is a vertical table. Further, according to the number N of rows with the same type, determine the table header and the table body, and determine the distribution positions of the table header and the table body in the two-dimensional matrix. Among them, the L - N rows are the table header, and the N rows to the last row are the table body. Based on the above position relationship of dividing the two-dimensional matrix by N rows for the table header and the table body, determine the distribution positions of the table header and the table body in the two-dimensional matrix.

[0117] Taking the above Table 3 as an example, compare the data types row by row from bottom to top. The data types of the last row are {numeric, numeric, character}, the data types of the second last row are {numeric, numeric, character}, and the data types of the third last row are {character, numeric, numeric}. Therefore, the data types of the last row and the second last row are the same, and the third last row is inconsistent with the second last row and the last row. That is, in Table 3, N = 2, and the data types of each cell in the last 2 rows are the same. Therefore, it can be determined that Table 3 is a vertical table. Among them, L - N = 4 - 2 = 2, that is, the first 2 rows are the table headers, and the last N = 2 rows are the table body. In a vertical table, the distribution position of the table header is the first 2 rows, and the distribution position of the table body is the last 2 rows.

[0118] Figure 6 Schematic diagram of the process of determining the table structure information of a two-dimensional matrix as a horizontal table in an information processing method according to an embodiment of the present disclosure, as Figure 6 shown. In the embodiment, if the data types of multiple cells are two or more, determine the distribution positions of the table header and the table body in the two-dimensional matrix, and determine the table structure information of the two-dimensional matrix, including:

[0119] Step S602: If the data types of the cells in each column of the two-dimensional matrix from right to left are the same when comparing between columns, count the number of columns with the same data type.

[0120] Step S604: If the number of columns with the same data type is between the total number of columns of the two-dimensional matrix and zero, determine that the table structure information of the two-dimensional matrix is a horizontal table, and determine the distribution positions of the table header and the table body in the two-dimensional matrix according to the number of columns with the same type.

[0121] If it is determined that the two-dimensional matrix is not a vertical table, then the comparison direction needs to be changed from row by row to column by column. When determining that the two-dimensional matrix is not a vertical table, one way is that the number of rows with the same data type is zero, or the number of rows with the same data type is the same as the total number of rows. When comparing the two-dimensional matrix from right to left, each column of cells is used as a comparison object. When comparing between columns, based on the heuristic rule of data type consistency of table content data, count the number M of columns with the same data type in the columns of the two-dimensional matrix from right to left; if the number M satisfies 0 < M < K (K is the total number of columns), then the table structure information of the two-dimensional matrix is a horizontal table. Further, according to the number M of columns with the same type, determine the table header and the table body, and determine the distribution positions of the table header and the table body in the two-dimensional matrix. Among them, K - M columns are the table header, and the M columns to the last column are the table body. Based on the above position relationship of dividing the two-dimensional matrix by M columns for the table header and the table body, determine the distribution positions of the table header and the table body in the two-dimensional matrix.

[0122] This embodiment uses heuristic rules based on the consistency of data types in table content to process tables. There is no need to pre-train the model using labeled samples, which greatly reduces computing costs and improves data processing efficiency.

[0123] Figure 7 A schematic diagram showing the process of converting a table to be stored and building a table knowledge base in an information processing method according to an embodiment of the present disclosure is shown. Figure 7 As shown, in the embodiment, according to the table structure information of the two-dimensional matrix, the type of the two-dimensional matrix is ​​determined and the two-dimensional matrix is ​​converted into a table to be stored with a target type, and a table knowledge base is constructed, including:

[0124] Step S702: Determine whether the type of the two-dimensional matrix is ​​a simple table or a composite table according to the number of rows or columns of the header of the two-dimensional matrix; wherein the number of rows or columns of the header of a simple table is 1, and the number of rows or columns of the header of a composite table is an integer greater than 1;

[0125] Step S704: according to the table structure information of the two-dimensional matrix, the two-dimensional matrix whose table structure information is a horizontal table is converted into a vertical table by performing a transposition operation as a matrix, and determining a transposed two-dimensional matrix;

[0126] Step S706: using the two-dimensional matrix whose table structure information is a vertical table and the transposed two-dimensional matrix as an updated two-dimensional matrix, and identifying cells whose adjacent cells in the header of the updated two-dimensional matrix have the same content;

[0127] Step S708: merging cells whose adjacent cells in the header of the updated two-dimensional matrix have the same contents to determine the restored table;

[0128] Step S7010: if the restored table is determined to be a composite table according to the number of rows of the header of the restored table, the header of the composite table is vertically merged and compressed into a single-row header to determine the table to be stored; the target type of the table to be stored is a simple table and a vertical table;

[0129] Step S7012: construct a table knowledge base based on the table to be stored.

[0130] Based on the table header and table body of the two-dimensional matrix determined above, the number of rows or columns of the table header of the two-dimensional matrix is ​​obtained. If the number of rows or columns of the table header is 1, that is, the table header is one row or one column, then the type of the two-dimensional matrix is ​​a simple table; if the number of rows or columns of the table header is an integer greater than 1, then the type of the two-dimensional matrix is ​​a composite table. The above Table 3 is a vertical table and a composite table, and the number of rows of its table header is 2.

[0131] The two-dimensional matrix includes both vertical tables and horizontal tables. If it is a horizontal table, the content of each cell in the two-dimensional matrix is ​​converted into a vertical table by transposition operation as a matrix to obtain a transposed two-dimensional matrix; at this time, the original table structure information is a two-dimensional matrix of a vertical table, and the two-dimensional matrix after transposition is combined as an updated two-dimensional matrix. All the updated two-dimensional matrices are vertical tables. Identify the cells with the same adjacent cell content in the header of the updated two-dimensional matrix. For example, in Table 3 above, the cells with the same adjacent cell content are "Title 1 (character)" and "Title 2 (character)", where "Title 1 (character)" is adjacent to the top and bottom, and "Title 2 (character)" is adjacent to the left and right. Perform a cell merge operation on the cells with the same adjacent cell content in the header of the updated two-dimensional matrix to determine the restored table; taking Table 3 as an example, perform a cell merge operation on "Title 1 (character)" and a cell merge operation on "Title 2 (character)" to obtain a restored table, as shown in Table 4.

[0132]

[0133] Table 4

[0134] The structure of the above Table 4 is the same as that of Table 1. The content of the cells in Table 4 includes the content of the cells in Table 1, but Table 4 also adds the corresponding data type in each cell.

[0135] In Table 4, the number of rows in the header is 2, so Table 4 is a composite table. Based on the fact that Table 4 is a vertical table, the headers of Table 4 are vertically merged and compressed into a single-row header, that is, the original 2-row headers are compressed into 1-row header, becoming a simple table and a vertical table as the table to be stored; wherein, Figure 5 The table to be stored is obtained by vertically merging and compressing the headers of Table 4 into a single-row header.

[0136] Title 1 Heading 2 - Subheading 1 Heading 2 - Subheading 2 Content 1 Content 2 Content 3 Content 4 Content 5 Content 6

[0137] Table 5

[0138] After obtaining the table to be stored in a unified format of a simple table and a vertical table, a table knowledge base is constructed. In the process of table storage, this embodiment adjusts the table to a unified and standardized format, which can be stored in the database for management query, effectively improving the table data management capability.

[0139] Figure 8 A schematic diagram of the process of constructing a table knowledge base in an information processing method according to an embodiment of the present disclosure is shown. Figure 8 As shown, in the embodiment, a table knowledge base is constructed according to the table to be stored, including:

[0140] Step S802: taking each row of the table to be stored as a key-value pair, constructing a key-value pair list; the key in the key-value pair corresponds to the field in the table header, and the value in the key-value pair corresponds to the cell content;

[0141] Step S804: Take a single table to be stored as a knowledge slice, use the trained model to convert the key-value pair list in the knowledge slice into a vector, establish a mapping relationship between the table to be stored and the vector to construct a table knowledge base.

[0142] In the embodiment, the table to be stored is a vertical table and a simple table, consisting of multiple rows, each row has multiple cells, and each cell stores specific table content. Based on the above structure, the content of each row of the table to be stored is used as a key-value pair, wherein the header field is used as the key of the key-value pair, and the cell content is used as the value of the key-value pair. The table to be stored has multiple rows, thus forming multiple key-value pairs, and constructing a key-value pair list.

[0143] Taking Table 5 above as an example, the constructed key-value pair list is as follows:

[0144] {{Title 1: Content 1, Title 2-Subtitle 1: Content 2, Title 2-Subtitle 2: Content 3},

[0145] {Title 1: Content 4, Title 2-Subtitle 1: Content 5, Title 2-Subtitle 2: Content 6}};

[0146] When there are multiple tables to be stored obtained from the documents to be processed, each of the multiple tables to be stored is used as a knowledge slice, and the key-value pair list in the knowledge slice is converted into a vector using a trained model, wherein the trained model is used to convert the key-value pair into a vector, that is, the vectorization of the key-value pair is realized, and multiple vectors are obtained. A mapping relationship is established between the table to be stored and the corresponding multiple vectors obtained by the conversion, and the tables are stored in the Elasticsearch database to build a table knowledge base. Elasticsearch is a distributed, RESTful-style search and analysis engine that is widely used for full-text search, real-time analysis, and large-scale data storage. It is built on Apache Lucene and provides powerful search functions and flexible data management capabilities. Elasticsearch can easily expand to hundreds of servers and process PB-level data. The trained model can be a pre-trained bert-base-chinese model, which can vectorize the input key-value pairs and output the corresponding vectors.

[0147] Fig. 9 A schematic diagram of a process of determining answer content in an information processing method according to an embodiment of the present disclosure is shown. Fig. 9As shown, in the embodiment, the answer content is determined from the table knowledge base according to the query question, including:

[0148] Step S902: using the trained model to convert the query question into a query vector;

[0149] Step S904: using the query vector to search for vectors that meet the similarity threshold in the table knowledge base, and determining the corresponding table to be stored as enhanced knowledge through the mapping relationship;

[0150] Step S906: Use prompt engineering to construct big model prompts for query questions and enhanced knowledge, and input the big model prompts into the big model to generate answer content.

[0151] When a user enters a query, the enhanced retrieval of the table knowledge base and the table query capabilities of the open source general large model can be used to generate answers corresponding to the user's query and feed them back to the user.

[0152] Since the table knowledge base stores vectors and the mapping relationship between vectors and the table to be stored, when querying the table knowledge base, it is also necessary to use the vector query method, and then use the trained model that converts the key-value pair list into a vector to convert the query question into a query vector. The trained model can be a pre-trained bert-base-chinese model.

[0153] The query vector is input into the table knowledge base, and the vector similarity is calculated with each vector in the table knowledge base. For example, the cosine similarity between the query vector and the vector in the table knowledge base can be calculated by using the cosine similarity method, and the vectors that meet the similarity threshold are screened out, and the table to be stored corresponding to the screened vectors is used as enhanced knowledge through a mapping relationship. For example, the similarity threshold is set to 95%, and 4 tables to be stored are obtained after similarity comparison, and these 4 tables to be stored are used as enhanced knowledge. In another embodiment, the similarity threshold can be set to a specific value, for example, the similarity threshold is set to 3, that is, the tables to be stored corresponding to the 3 most similar vectors are screened out as enhanced knowledge.

[0154] Use prompt engineering to construct big model prompts for query questions and enhanced knowledge, input the big model prompts into open source general big models, such as ChatGLM, Chinese-Vicuna, Qwen, etc., and the general big model generates answer content, which is then fed back to the user.

[0155] During the table storage process, the table is adjusted to a unified and standardized format and can be stored in the database for management queries. The large model query method enhanced by table knowledge base retrieval can better handle complex user queries, and after an overall analysis of the table content, the correct query answer is combined and fed back to the user.

[0156] Fig.10 A flowchart of an information processing method in an embodiment of the present disclosure is shown. Fig.10 As shown, in the embodiment, the process of the information processing method includes:

[0157] Step 1: For a long document database consisting of a large number of Word documents, read the document content to extract the table content, specifically:

[0158] Step 1.1: Convert all doc format documents in the long document database to docx format documents for subsequent steps. This step requires converting the format of Word documents. In fact, the win32com module in Python is used to process Word documents in the Windows system + Office software environment.

[0159] Step 1.2: For all documents in the long document database that have been unified in format, call the python-docx library to read the docx document content and extract the content of all tables from it. The extraction result is a two-dimensional matrix after all merged cells in the table are split. The number of rows is the number of rows in the table. Each cell in each row stores the content of the corresponding position in the table. For example, the result obtained after the sample table shown in Table 1 is extracted is shown in Table 2.

[0160] Step 2: In order to obtain the structural information of the table, the data type of the table content extracted in step 1 is determined. According to the consistency principle of the data type of the table content, the location of the table header and the table body (i.e., the cells storing the content information) is identified. Specifically:

[0161] Step 2.1: For the two-dimensional matrix table obtained in step 1, determine the data type of each cell content, including the following: character type, numeric type, date / time type and other (uncommon type). If there are two or more data types in the cell content of a table, execute step 2.2 to identify the table structure; otherwise, that is, the table contains only one data type (usually character type), skip the following steps and execute step 2.3. For example, identify the data type of each cell content in Table 2 obtained through step 1. Assume that the identification result is shown in Table 3, where the bracket content in each cell indicates the data type of the cell content, that is, the data type of title 1 is character type, the data type of content 1 is numeric type, and so on; since the table contains both character type and numeric type cell content, step 2.2 should be executed according to the rules.

[0162] Step 2.2: Based on the data type of the table content obtained in Step 2.2, according to the principle of data type consistency of the table content, that is, the data types of the content in the table cells corresponding to the same table header title in the table should be the same, determine the positions of the table header and the table body. The specific method is as follows: First, identify the number of rows N where the data types of the content in each cell of each row of the table are the same from bottom to top. If 0 < N < L (L is the total number of rows), then the table is a vertical table, and the first L - N rows are the table header, and the last N rows are the table body; otherwise, identify the number of columns N where the data types of the content in each cell of each column of the table are the same from right to left. If 0 < N < L (L is the total number of columns), then the table is a horizontal table, and the first L - N columns are the table header, and the last N columns are the table body; if neither is satisfied, then perform Step 2.3. In the example shown in Table 3, first judge the data types of the content in each cell of each row of the table from bottom to top. For example, the last row is (numerical value, numerical value, character), the second last row is also (numerical value, numerical value, character), and the third last row is (character, numerical value, numerical value), which is different from the first two rows. That is, the data types of the content in each cell of the last N = 2 rows of the table are the same, so it can be judged that the table is a vertical table, and its first L - N = 4 - 2 = 2 rows (the total number of rows L = 4) are the table header, and the last N = 2 rows are the table body, and there is no need to further judge whether the table is a horizontal table.

[0163] Step 2.3: Since the target table may be a special type of table that does not conform to the common format and the structural information of the table cannot be automatically recognized according to the above heuristic rules, it is possible to choose to abandon the recognition of the table or feedback it for manual recognition.

[0164] Step 3: Based on the structural information of the table recognized in Step 2.2, judge the type of the table (i.e., vertical / horizontal table and simple / composite table), and convert it into a unified storage format. Specifically:

[0165] Step 3.1: According to the distribution position relationship between the table header and the table body recognized in Step 2.2, it can be known that the table is a vertical table / horizontal table; then, according to the number of rows / columns (L - N) of the table header recognized in Step 2.2, judge whether the table is a simple table or a composite table. The specific method is as follows: If L - N = 1, it is called a simple table, otherwise L - N > 1, it is called a composite table; the example shown in Table 3 is a vertical and composite table, and the number of rows of its table header is L - N = 2 > 1;

[0166] Step 3.2: If the table is a horizontal table, regard the table content as a matrix and perform a transpose operation on it to convert it into a vertical table;

[0167] Step 3.3: Merge the parts of the adjacent cells in the table header area where the content is exactly the same. For example, the example table shown in Table 3 is merged to obtain Table 4, which completely restores the structure and content information of the original Table 1;

[0168] Step 3.4: If the table is a composite table, vertically merge and compress its multi-row header contents into a single-row header to convert it into a simple table; the example shown in Table 4 is a composite table, and after vertically compressing its header, the example shown in Table 5 is obtained.

[0169] At this point, the method automatically extracts the complete table structure and content information from the long document and converts it into a unified vertical, simple type table that can be stored in the database for use in subsequent steps.

[0170] Step 4: Store the table contents in the Elasticsearch database to build a table knowledge base for subsequent large model query steps. Specifically:

[0171] Step 4.1: Store the contents of each row in the table as a list of key-value pairs, where the key is the corresponding header field and the value is the cell content. For example, the stored contents of Table 5 are:

[0172] {{Title 1: Content 1, Title 2-Subtitle 1: Content 2, Title 2-Subtitle 2: Content 3},

[0173] {Title 1: Content 4, Title 2-Subtitle 1: Content 5, Title 2-Subtitle 2: Content 6}};

[0174] Step 4.2: Take a table as a knowledge slice, use the pre-trained bert-base-chinese model to convert the key-value pair lists of all tables into vectors, and store them in the Elasticsearch database to build a table knowledge base;

[0175] Step 5: When the user enters a query question, the table knowledge base is used to enhance the retrieval and table query capabilities of the open source general large model to generate the answer content of the user's query question and feedback it to the user, specifically:

[0176] Step 5.1: For the query question input by the user, the BERT-base-Chinese model is also used to vectorize it and search for the k tables (k=3) with the highest vector similarity in the table knowledge base as enhanced knowledge;

[0177] Step 5.2: Use prompt engineering to construct a large model prompt based on the user's question and the table obtained in step 5.1, input it into an open source general large model (such as ChatGLM, Chinese-Vicuna, Qwen, etc.) to generate the answer content of the user's query question, and feedback it to the user.

[0178] At this point, through steps 1 to 5, a method for extracting, storing and querying table information in a long document is completed.

[0179] The above information processing process is aimed at a long document database consisting of a large number of Word documents, and the document content is read to extract all the table contents. In order to obtain the structural information of the table, the data type of the extracted table content is judged, and the location of the table header and table body (i.e., the cell storing the content information) is identified according to the consistency principle of the table content data type. Based on the table structure information, the type of the table (i.e., vertical / horizontal table and simple / compound table) is judged, and it is converted into a unified vertical, simple type table to be stored in the database for subsequent steps. Then, each row of the table is stored as a list of key-value pairs, where the key is the corresponding header field and the value is the cell content. With one table as a block, the vectors of all table contents are stored in the Elasticsearch database as a table knowledge base. Finally, when the user enters a query question, the table knowledge base is used to enhance the table query capabilities of the retrieval and open source general large model, generate the answer content of the user's query question, and feedback it to the user.

[0180] Compared with the existing methods of extracting and storing table information in documents, this process does not require the use of labeled samples to pre-train the model. It uses heuristic rules such as the consistency principle of table content data type to process tables, which can greatly reduce computing costs and improve data processing efficiency. In addition, this process uses a large model query method enhanced by table knowledge base retrieval, which can better handle complex user queries, and after an overall analysis of the table content, it combines the correct query answers and feeds them back to the user. It can meet all needs of table data extraction, storage, and management based on long documents. The system of this proposal has high universality; it solves China Telecom's massive long document table data query problem and improves the degree of automation of data analysis; through this solution, the table data management capabilities can be effectively improved, while saving a lot of manpower maintenance costs, achieving the effect of reducing costs and increasing efficiency. Compared with the existing methods of extracting and storing table information in documents, this paper processes tables through heuristic rules, which does not require the use of labeled samples to pre-train the model. It uses heuristic rules such as the principle of consistency of table content data type to process tables, which can greatly reduce computing costs and improve data processing efficiency. In the process of table storage, the table is adjusted to a unified and standardized format and can be stored in the database for management and query, which effectively improves the table data governance capabilities. The large model query method enhanced by table knowledge base retrieval can better handle complex user queries, and after an overall analysis of the table content, the correct query answer is combined and fed back to the user.

[0181] It should be noted that the acquisition, storage, use, and processing of data in the technical solution disclosed in this disclosure are in compliance with the relevant provisions of national laws and regulations, and various types of data such as personal identity data, operation data, behavioral data, etc. related to individuals, customers, and groups obtained in the embodiments of this disclosure have all been authorized.

[0182] Based on the same inventive concept, the present disclosure also provides an information processing device in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.

[0183] Fig.11 A schematic diagram of an information processing device in an embodiment of the present disclosure is shown. Fig.11 As shown, the device comprises:

[0184] The two-dimensional matrix determination module 1101 is used to extract table content from the document to be processed and determine a two-dimensional matrix; the two-dimensional matrix includes multiple rows, and each row includes multiple cells;

[0185] The table structure information determination module 1102 is used to determine the table structure information of the two-dimensional matrix according to the data types of the multiple cells;

[0186] The table knowledge base construction module 1103 is used to determine the type of the two-dimensional matrix according to the table structure information of the two-dimensional matrix and convert the two-dimensional matrix into a table to be stored with a target type, so as to construct a table knowledge base;

[0187] The answer content determination module 1104 is used to determine the answer content from the table knowledge base according to the query question.

[0188] It should be noted that the examples and application scenarios implemented by the modules in the above-mentioned device embodiment are the same as those of the corresponding steps in the method embodiment, but are not limited to the contents disclosed in the above-mentioned method embodiment. It should be noted that the above-mentioned modules as part of the device can be executed in a computer system such as a set of computer executable instructions.

[0189] Those skilled in the art will appreciate that various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation that combines hardware and software aspects, which may be collectively referred to herein as a "circuit," "module," or "system."

[0190] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present disclosure, the electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above information processing methods by executing the executable instructions. Since the principle of solving the problem in the electronic device embodiment is similar to that in the above method embodiment, the implementation of the electronic device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.

[0191] Refer to the following Fig.121200 according to this embodiment of the present disclosure is described. Fig.12 The electronic device 1200 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0192] like Fig.12 As shown, the electronic device 1200 is in the form of a general computing device. The components of the electronic device 1200 may include but are not limited to: at least one processing unit 1210, at least one storage unit 1220, and a bus 1230 connecting different system components (including the storage unit 1220 and the processing unit 1210).

[0193] The storage unit stores a program code, and the program code can be executed by the processing unit 1210, so that the processing unit 1210 executes the steps described in the above "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 1210 can execute the following steps of the above method embodiment: extracting table content from the document to be processed and determining a two-dimensional matrix; the two-dimensional matrix includes multiple rows, and each row includes multiple cells; according to the data types of the multiple cells, determining the table structure information of the two-dimensional matrix; according to the table structure information of the two-dimensional matrix, determining the type of the two-dimensional matrix and converting the two-dimensional matrix into a table to be stored with a target type, and constructing a table knowledge base; determining the answer content from the table knowledge base according to the query question.

[0194] The storage unit 1220 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 12201 and / or a cache storage unit 12202 , and may further include a read-only storage unit (ROM) 12203 .

[0195] The storage unit 1220 may also include a program / utility 12204 having a set (at least one) of program modules 12205, such program modules 12205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0196] Bus 1230 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0197] The electronic device 1200 may also communicate with one or more external devices 1240 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1200, and / or communicate with any device that enables the electronic device 1200 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1250. Furthermore, the electronic device 1200 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1260. As shown, the network adapter 1260 communicates with other modules of the electronic device 1200 via a bus 1230. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0198] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0199] Based on the same inventive concept, the embodiment of the present disclosure also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, any of the above-mentioned information processing methods is implemented. Since the principle of solving the problem in the embodiment of the computer-readable storage medium is similar to that in the above-mentioned method embodiment, the implementation of the embodiment of the computer-readable storage medium can refer to the implementation of the above-mentioned method embodiment, and the repeated parts will not be repeated.

[0200] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, 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), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0201] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0202] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0203] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0204] Based on the same inventive concept, a computer program product is also provided in the embodiments of the present disclosure, including a computer program product, including: a computer program or an instruction, wherein when the computer program or the instruction is executed by a processor, the information processing method of any one of the above method embodiments is implemented. Since the principle of solving the problem in the computer program product embodiment is similar to that in the above method embodiment, the implementation of the computer program product embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.

[0205] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0206] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0207] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0208] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

Claims

1. An information processing method, characterized in that: include: Extract table content from the document to be processed to determine a two-dimensional matrix; the two-dimensional matrix includes multiple rows, and each row includes multiple cells; Determining table structure information of the two-dimensional matrix according to the data types of the plurality of cells; According to the table structure information of the two-dimensional matrix, determine the type of the two-dimensional matrix and convert the two-dimensional matrix into a table to be stored with a target type, and build a table knowledge base; The answer content is determined from the table knowledge base according to the query question.

2. The information processing method according to claim 1, characterized in that: Extract table contents from the document to be processed and determine a two-dimensional matrix, including: Get the documents to be processed; Unifying the formats of the documents to be processed into a target format; Using a software library to read the document to be processed in the target format, traverse the table in the document to be processed and extract cells from the table; wherein, if the extracted cell is a merged cell, split the merged cell into cells with the same content; The cells are arranged according to the maximum number of rows in the table in the document to be processed to determine a two-dimensional matrix.

3. The information processing method according to claim 1, characterized in that: Determining table structure information of the two-dimensional matrix according to the data types of the plurality of cells includes: Obtaining data types of the multiple cells; If the data types of the plurality of cells are two or more, the distribution positions of the table header and the table body in the two-dimensional matrix are determined, and the table structure information of the two-dimensional matrix is ​​determined.

4. The information processing method according to claim 3, characterized in that: If the data types of the multiple cells are two or more, determining the distribution positions of the table header and the table body in the two-dimensional matrix, and determining the table structure information of the two-dimensional matrix includes: If the data types of the plurality of cells are two or more, identifying the data types of the cells in each row from bottom to top of the two-dimensional matrix; If the data types of cells in each row of the two-dimensional matrix from bottom to top are consistent when compared between rows, then the number of rows with consistent statistical data types is counted; If the number of rows with consistent data types is between the total number of rows in the two-dimensional matrix and zero, the table structure information of the two-dimensional matrix is ​​determined to be a vertical table, and the distribution positions of the table header and the table body in the two-dimensional matrix are determined based on the number of rows with consistent types.

5. The information processing method according to claim 4, characterized in that: If the data types of the multiple cells are two or more, determining the distribution positions of the table header and the table body in the two-dimensional matrix, and determining the table structure information of the two-dimensional matrix includes: If the data types of cells in each column of the two-dimensional matrix from right to left are consistent when comparing between columns, then the number of columns with consistent statistical data types is counted; If the number of columns with consistent data types is between the total number of columns of the two-dimensional matrix and zero, the table structure information of the two-dimensional matrix is ​​determined to be a horizontal table, and the distribution positions of the table header and the table body in the two-dimensional matrix are determined based on the number of columns with consistent types.

6. The information processing method according to claim 4, characterized in that: According to the table structure information of the two-dimensional matrix, determining the type of the two-dimensional matrix and converting the two-dimensional matrix into a table to be stored with a target type, and constructing a table knowledge base, including: According to the number of rows or columns of the header of the two-dimensional matrix, determining whether the type of the two-dimensional matrix is ​​a simple table or a composite table; wherein the number of rows or columns of the header of the simple table is 1, and the number of rows or columns of the header of the composite table is an integer greater than 1; According to the table structure information of the two-dimensional matrix, the two-dimensional matrix whose table structure information is a horizontal table is converted into a vertical table by performing a transposition operation as a matrix, and determining the transposed two-dimensional matrix; The two-dimensional matrix whose table structure information is a vertical table and the transposed two-dimensional matrix are used as an updated two-dimensional matrix, and cells whose adjacent cells in the header of the updated two-dimensional matrix have the same content are identified; Merge cells whose adjacent cells in the header of the updated two-dimensional matrix have the same contents to determine a restored table; If the restored table is determined to be a composite table according to the number of rows of the header of the restored table, the header of the composite table is vertically merged and compressed into a single-row header to determine the table to be stored; the target type of the table to be stored is a simple table and a vertical table; A table knowledge base is constructed according to the table to be stored.

7. The information processing method according to claim 6, characterized in that: According to the table to be stored, a table knowledge base is constructed, including: Taking each row content of the table to be stored as a key-value pair, a key-value pair list is constructed; the key in the key-value pair corresponds to the field of the table header, and the value in the key-value pair corresponds to the cell content; A single table to be stored is taken as a knowledge slice, and a trained model is used to convert the key-value pair list in the knowledge slice into a vector, and a mapping relationship between the table to be stored and the vector is established to construct a table knowledge base.

8. The information processing method according to claim 7, characterized in that: Determining answer content from the table knowledge base according to the query question includes: Converting the query question into a query vector using the trained model; Using the query vector to query the table knowledge base for vectors that meet a similarity threshold, and determining a corresponding table to be stored as enhanced knowledge through the mapping relationship; Prompt engineering is used to construct a big model prompt for the query question and the enhanced knowledge, and the big model prompt is input into the big model to generate answer content.

9. An information processing device, characterized in that: include: A two-dimensional matrix determination module is used to extract table content from the document to be processed and determine a two-dimensional matrix; The two-dimensional matrix includes a plurality of rows, and each row includes a plurality of cells; A table structure information determination module, used to determine the table structure information of the two-dimensional matrix according to the data types of the multiple cells; A table knowledge base construction module, used to determine the type of the two-dimensional matrix according to the table structure information of the two-dimensional matrix and convert the two-dimensional matrix into a table to be stored with a target type, so as to construct a table knowledge base; The answer content determination module is used to determine the answer content from the table knowledge base according to the query question.

10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the information processing method according to any one of claims 1 to 8 by executing the executable instructions.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the information processing method according to any one of claims 1 to 8 is implemented.

12. A computer program product comprising: A computer program or instruction, characterized in that when the computer program or instruction is executed by a processor, it implements the information processing method described in any one of claims 1 to 8.