Method for converting structured data into unstructured text based on AI to realize knowledge base

By acquiring structured data and generating unstructured description sentences, a large model question and answer knowledge base is established, which solves the problem of converting structured data into unstructured data, achieves efficient understanding and real-time updating, enhances the NLP semantic understanding function, and reduces investment costs.

CN118733711AActive Publication Date: 2024-10-01JIANGSU ZHONGWEI TECH SOFTWARE SYST
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411216017.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-10-01
Estimated Expiration
2044-09-02

AI Technical Summary

Technical Problem

The existing technology is difficult to convert structured data into unstructured data, resulting in the inability to understand the correspondence and numerical relationships between data, requiring a large amount of data to retrain the model with poor results.

Method used

By acquiring structured data, preprocessing and generating unstructured description statements, creating unique identifiers, building a large model question and answer knowledge base, converting data into vector format, and updating unstructured text in real time to achieve automatic updating of the knowledge base.

Benefits of technology

It achieves efficient and accurate structured data understanding, detects data changes in real time, quickly adds NLP semantic understanding functions, reduces investment costs, and is in line with the trend of the times.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733711A_ABST
    Figure CN118733711A_ABST
Patent Text Reader

Abstract

The invention discloses an AI-based method for converting structured data into an unstructured text to realize a knowledge base. The method comprises the following steps: acquiring data in a structured format in a production system and preprocessing the data; setting an unstructured description statement according to the mutual relation of the preprocessed data, generating an unstructured description text for each record according to the format of the unstructured description statement, creating a unique identifier for each unstructured description text, and creating an association relation with data in a production system; creating a large model question and answer knowledge base, and inputting large model questions according to the questions and the unstructured text to obtain answers; when recorded data in the structured data in the production system changes, the corresponding non-structured text is updated and reimported into the large model knowledge base to update the currently recorded data, the efficient and accurate data and table content understanding method is innovated, a user can understand the content of the data and the table through simple statement logic setting, and the user experience is improved. And the structured data can be converted into the unstructured text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and specifically to a method for converting structured data into unstructured text to realize a knowledge base based on AI. Background Art

[0002] Existing technologies usually convert unstructured data into structured data, usually to solve the retrieval, transmission and storage problems of unstructured data, but do not solve the problem of converting structured data into unstructured data. For structured data, it is impossible to understand the correspondence and numerical relationship between structured data. It is necessary to analyze and extract structured files, retrain and fine-tune the model, which requires a large amount of data and cannot guarantee the model effect. Summary of the invention

[0003] The purpose of the present invention is to provide a method for converting structured data into unstructured text to realize a knowledge base based on AI, so as to solve the problems raised in the above background technology.

[0004] To achieve the above object, the present invention provides the following technical solution: A method for converting structured data into unstructured text to realize a knowledge base based on AI, comprising the following steps: Step S1: obtaining data in a structured format in a production system and preprocessing it, and further obtaining the header, field, and the relationship between the header, field, and each record information in the structured data; Step S2: according to the relationship between the header, the field and each record information, an unstructured description statement is set, and each record in the structured data is generated into an unstructured description text according to the unstructured description statement; Step S3: Create a unique identifier for each unstructured description text and create an association relationship with the data in the production system; Step S4: Create a large model question-answering knowledge base, process the unstructured description text with the association relationship established in step S3 into the vector format in the knowledge base, process the question asked by the large model into a vector, and calculate it with the text vector in the knowledge base, match the vector to the corresponding unstructured text based on the similarity between the two, and input the question and unstructured text into the large model to obtain the answer; Step S5: If the record data in the structured data in the production system changes, the corresponding unstructured text will be updated and re-imported into the large model knowledge base to update the current record data; if the header or field of the structured data changes, the description text of all records will be constructed and updated to the large model knowledge base; if the statistical data content or statistical values ​​in the system change, all automatically generated statistical data can be synchronized to the AI ​​knowledge base in real time or by setting corresponding rules, and the original text will be overwritten to form a new knowledge base.

[0005] Preferably, the structured data includes tabular data and database tables; when the collected data is a scanned copy, the specific steps for obtaining the tabular data in the scanned copy are: first identify the position of the table line, then extract the position of each cell in the table and identify the text information in each cell, and output it according to the table structure; the relationship between the field and each record information refers to the correspondence between the table header and the field and the data record.

[0006] Preferably, the specific steps of preprocessing the data in the production system in step S1 are as follows: Step S11: respectively obtain the table header and the field information in the database table; Step S12: Arrange the header and field information in the first row, and arrange each data record in rows to generate a unified format; Step S13: Delete the duplicate data in the data table with the unified format generated above, filter the table data with the unified format, obtain the primary key value of each table and sort them according to the primary key.

[0007] Preferably, the specific process of generating unstructured description text according to the description statement format for each record in the structured data in step S2 is as follows: Step S21: combining multiple fields into a descriptive text according to the relationship between the header, the field and each record information; Step S22: using large language model generation technology to process the combined text into natural sentences or paragraphs, and maintaining the field information of the original table; Step S23: extracting information of each column field in the table, and statistically analyzing the data in the column field; Step S24: Process different types of data. If the data is of text type, the number of occurrences of each text is counted after deduplication. If the data is of numerical type, information about the field data is obtained, including the sum, mean, standard deviation, and median of the field data. Step S25: Combine the processed data into descriptive text.

[0008] Preferably, in step S23, the length of each text segment does not exceed a set threshold, and the vector of text content that is less than the set length is filled with the value 0.

[0009] Preferably, the overall descriptive text file of the current table file generated in step S2 is named according to the table name.

[0010] Preferably, the specific steps of processing the unstructured description text into a knowledge base in step S4 are as follows: Step S41: Obtain and read the descriptive text file generated by each table; Step S42: automatically segmenting the file using a text vectorization model, and vectorizing the segmented text; Step S43: Match the text vector generated by each table with the table file name, save them in the vector file library respectively, and generate a knowledge base of the text vector, the corresponding file name, and the content.

[0011] Preferably, the specific steps of processing the questions asked by the large model in step S4 into vectors are as follows: Step S51: obtaining questions about the table content to be understood, generating a question vector of the table, wherein zeros are padded according to a set threshold length; Step S52: Calculate the similarity between the question vector of the table and the knowledge base text vector; Step S53: obtaining the most similar text vector, and obtaining the text content corresponding to the most similar text vector; In step S54: the text content in the above step S53 and the question in step S51 are input into the large language model.

[0012] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention innovates an efficient and accurate method for understanding data and table content. Users can convert structured data into unstructured text through simple statement logic settings; (2) The present invention detects data changes in real time through rules generated by unstructured sentences and converts the changed data into unstructured text, and overwrites the unstructured text before the change, thereby realizing automatic updating of the knowledge base text; (3) The present invention converts databases into unstructured texts and forms into unstructured texts, so that traditional application systems and table files can quickly add NLP semantic understanding functions and realize AI artificial intelligence, so that users' traditional application systems can quickly keep up with the trend, which is both in line with the times and reduces investment. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a flow chart of the present invention; DETAILED DESCRIPTION

[0014] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Example

[0015] Combination Figure 1 As shown, the present invention provides a method for converting structured data into unstructured text to realize a knowledge base based on AI, comprising the following steps: Step S1: obtain the data in the structured format in the production system and preprocess it. The structured data includes table data and database tables. The specific process of preprocessing the data is as follows: Step S11: obtain the table header and the field information in the database table respectively; Step S12: arrange the table header and field information in the first row, and arrange each data record by row to generate a unified format; Step S13: delete the duplicate data in the data table generated in the unified format, filter the table data with a unified format, obtain the primary key value of each table and sort them according to the primary key; after preprocessing the data, further obtain the table header, field, and the relationship between the table header, field and each record information in the structured data, wherein the relationship between the field and each record information refers to the corresponding relationship between the table header and the field. For example: if a column of data in a row of data is a number, if you do not look at the table header or field, you will not know the meaning of the number. If you know that the column of data described in the table header represents salary, then this column of data is salary data; Step S2: According to the relationship between the table header, the field and each record information, an unstructured description statement is set, and each record in the structured data is generated into an unstructured description text according to the unstructured description statement format, wherein the unstructured description statement refers to describing a record in a certain table by using the table header plus text. Specifically, the process of generating an unstructured description text according to the description statement format for each record in the structured data is as follows: S21: According to the relationship between the table header, the field and each record information, multiple fields are combined into a descriptive text; S22: The above combined text is processed into a natural sentence or paragraph using the large language model generation technology, and the original table is maintained. Field information of the grid; S23: extract the information of each column field in the table, statistically analyze the data in the column field, wherein the length of each paragraph of text in step S23 does not exceed the set threshold, and the vector of text content that is less than the set length is filled with the value 0; S24: process different types of data. If the data is of text type, then count the number of occurrences of each text after deduplication. If the data is of numerical type, obtain information about the field data, and the field data information includes the sum, mean, standard deviation, and median of the field data; S25: combine the processed data into a descriptive text, and the overall descriptive text file of the current table file generated at the same time is named according to the table name. For example, if it is a salary table, the header and the text corresponding to the header need to be manually matched, and a text description is used, which is described as the basic salary for month xx is xx yuan, deducting social security and provident fund xx yuan, and deducting tax xx yuan, then the actual salary received is xx yuan; Step S3: Create a unique identifier for each unstructured description text and create an association relationship with the data in the production system; Step S4: Create a large model question-and-answer knowledge base, process the unstructured description text with the association established in step S3 into the vector format in the knowledge base, process the questions asked by the large model into vectors, and calculate them with the text vectors in the knowledge base, match the vector to the corresponding unstructured text according to the similarity between the two, and input the large model questions according to the questions and unstructured text to obtain answers, wherein the specific steps of processing the unstructured description text into the knowledge base are as follows: S41: Obtain and read the descriptive text file generated by each table; S42: Use the text vectorization model to automatically segment the file, and vectorize the segmented text; S43: Match the text vector generated by each table with the table file name, and save them in the vector file library respectively, to generate a knowledge base of the text vector, the corresponding file name, and the content; S5: When the record data in the structured data in the production system changes, the corresponding unstructured text is updated and re-imported into the large model knowledge base to update the current record data, and the corresponding knowledge base is updated; if the header or field of the structured data changes, all the description texts of the records are constructed and updated in the large model knowledge base, and the knowledge base is updated synchronously; if the statistical data content or the statistical value of the system changes, the automatically generated statistical data can be synchronized to the AI ​​knowledge base in real time or by setting corresponding rules, and the original text is overwritten to form a new knowledge base. The specific steps for processing the questions asked by the large model into vectors are as follows: S51: Obtain questions about the table content to be understood, generate a question vector for the table, wherein 0 is padded according to a set threshold length; S52: calculate the similarity between the question vector for the table and the text vector for the knowledge base; S53: obtain the most similar text vector, and obtain the text content corresponding to the most similar text vector; in S54: input the text content in the above step S53 and the question in step S51 into a large language model, so that the database can be converted into unstructured text, and the form can be converted into unstructured text, so that the traditional application system and table file can quickly increase the NLP semantic understanding function, realize AI artificial intelligence, and enable the user's traditional application system to quickly keep up with the trend, which is both in line with the sense of the times and reduces investment.

[0016] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments are to be regarded as exemplary and non-limiting in all respects, and the scope of the invention is to be defined by the appended claims rather than by the foregoing description, and it is intended that all variations falling within the meaning and range of equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be regarded as limiting the claim to which it relates.

Claims

1. A method for converting structured data into unstructured text to realize a knowledge base based on AI, characterized in that: The following steps are involved: Step S1: obtaining data in a structured format in a production system and preprocessing it, and further obtaining the header, field, and the relationship between the header, field, and each record information in the structured data; Step S2: according to the relationship between the header, the field and each record information, an unstructured description statement is set, and each record in the structured data is generated into an unstructured description text according to the unstructured description statement; Step S3: Create a unique identifier for each unstructured description text and create an association relationship with the data in the production system; Step S4: Create a large model question-answering knowledge base, process the unstructured description text with the association relationship established in step S3 into the vector format in the knowledge base, process the question asked by the large model into a vector, and calculate it with the text vector in the knowledge base, match the vector to the corresponding unstructured text based on the similarity between the two, and input the question and unstructured text into the large model to obtain the answer; Step S5: If the record data in the structured data in the production system changes, the corresponding unstructured text is updated and re-imported into the large model knowledge base to update the current record data; If the header or field of structured data changes, all the description texts of the records are constructed and updated in the large model knowledge base; If the content or value of statistical data in the system changes, all automatically generated statistical data can be synchronized to the AI ​​knowledge base in real time or by setting corresponding rules, and the original text can be overwritten to form a new knowledge base.

2. According to claim 1, the method for converting structured data into unstructured text based on AI to realize a knowledge base is characterized by: The structured data includes table data and database tables; when the collected data is a scanned copy, the specific steps for obtaining the table data in the scanned copy are: first identify the position of the table line, then extract the position of each cell in the table and identify the text information in each cell, and output it according to the table structure; the relationship between the field and each record information refers to the correspondence between the table header and the field and the data record.

3. The method for converting structured data into unstructured text to realize a knowledge base based on AI according to claim 1, characterized in that: The specific steps of preprocessing the data in the production system in step S1 are as follows: Step S11: respectively obtain the table header and the field information in the database table; Step S12: Arrange the header and field information in the first row, and arrange each data record in rows to generate a unified format; Step S13: Delete the duplicate data in the data table with the unified format generated above, filter the table data with the unified format, obtain the primary key value of each table and sort them according to the primary key.

4. The method for converting structured data into unstructured text to realize a knowledge base based on AI according to claim 1, characterized in that: The specific process of generating unstructured description text according to the description sentence format for each record in the structured data in step S2 is as follows: Step S21: combining multiple fields into a descriptive text according to the relationship between the header, the field and each record information; Step S22: using large language model generation technology to process the combined text into natural sentences or paragraphs, and maintaining the field information of the original table; Step S23: extracting information of each column field in the table, and statistically analyzing the data in the column field; Step S24: Process different types of data. If the data is of text type, the number of occurrences of each text is counted after deduplication. If the data is of numerical type, information about the field data is obtained, including the sum, mean, standard deviation, and median of the field data. Step S25: Combine the processed data into descriptive text.

5. The method for converting structured data into unstructured text to realize a knowledge base based on AI according to claim 4, characterized in that: In step S23, the length of each text segment does not exceed a set threshold, and the vector of text content that is less than the set length is filled with a value of 0.

6. The method for converting structured data into unstructured text to realize a knowledge base based on AI according to claim 1, characterized in that: The overall descriptive text file of the current table file generated in step S2 is named according to the table name.

7. The method for converting structured data into unstructured text to realize a knowledge base based on AI according to claim 1, characterized in that: The specific steps of processing the unstructured description text into a knowledge base in step S4 are as follows: Step S41: Obtain and read the descriptive text file generated by each table; Step S42: automatically segmenting the file using a text vectorization model, and vectorizing the segmented text; Step S43: Match the text vector generated by each table with the table file name, save them in the vector file library respectively, and generate a knowledge base of the text vector, the corresponding file name, and the content.

8. The method for converting structured data into unstructured text to realize a knowledge base based on AI according to claim 1, characterized in that: The specific steps of processing the questions asked by the large model into vectors in step S5 are as follows: Step S51: obtaining questions about the table content to be understood, generating a question vector of the table, wherein zeros are padded according to a set threshold length; Step S52: Calculate the similarity between the question vector of the table and the knowledge base text vector; Step S53: obtaining the most similar text vector, and obtaining the text content corresponding to the most similar text vector; In step S54: the text content in the above step S53 and the question in step S51 are input into the large language model.

Citation Information

Patent Citations

  • Knowledge question and answer method and device, electronic equipment and storage medium

    CN114116997A

  • Metallurgical knowledge question-answering method and system based on knowledge graph

    CN114238595A

  • Knowledge base automatic rapid construction method, system and device based on large language model technology

    CN118152520A

  • Large language model intelligent question and answer work order processing method and device based on optimized knowledge base

    CN118535702A

  • Question answering method and language model training method, apparatus, device, and storage medium

    US20210191962A1