Industrial data-oriented large model corpus construction method
Through data integration and structured extraction and graph retrieval of LLM large language model, combined with vector processing and hybrid search algorithm, the problem of insufficient data correlation and context understanding ability in the construction of industrial large model corpus is solved, and high accuracy is achieved. Corpus generation reduces operating costs.
Patent Information
- Application Number
- CN202411487291.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2024-11-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
It is difficult for the prior art to effectively build an industrial large model corpus, especially when processing multi-source heterogeneous industrial data, it is difficult to reveal the deep relationship between the data and have poor ability to understand complex contexts, resulting in low accuracy and high cost in Q&A results.
Through data integration, LLM large language model structured extraction entities, graph search and vector processing, a vector library is constructed, and corpus generation is optimized using mixed search algorithms and contrast loss functions, and combined with local corpus to enhance template generation, ensuring professionalism and accuracy of corpus Spend.
It significantly improves data relevance discovery, enhances the understanding of complex contexts in the industrial field, improves the professionalism and accuracy of corpus generation, and reduces operating costs.
Smart Images

Figure CN119005160A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a method for constructing a large model corpus for industrial data. Background Art
[0002] In the industrial field, since the data sources include OT (operational technology) data (including sensor data, real-time monitoring data, equipment status information, production process control data, analog signals, timing signals, etc.), IT (information technology) data (including enterprise resource planning (ERP) system data, database records, business process information, production management system data, digital logs, etc.), ET (engineering technology) data (including engineering design data, modeling data, process design drawings, equipment specifications and calibration data, test results, etc.) and NT (non-traditional) data (including Internet open data, social media data, user-generated content, online comments and market research data, etc.), it is difficult for existing technologies to effectively convert these multi-source heterogeneous industrial data into industrial large model corpus. The following is the basic method for building an industrial large model corpus:
[0003] 1) Use the pipeline pipeline to merge unit and word layout, and generate text as corpus through templates. 2) Use deep learning end-to-end encoding and decoding to output text corpus. 3) Use pre-trained models to learn massive text in advance and generate more fluent and natural corpus.
[0004] For example, the patent document with patent number 202111030767.5 discloses a method for building a question-and-answer system based on Pipeline processing and ES storage, which collects and cleans industry data question and answer pairs, and constructs multi-dimensional semantic feature labels for the questions in the question and answer pairs; the questions in the question and answer pairs and the corresponding multi-dimensional semantic feature labels and answers are stored in the ES database in batches.
[0005] The defects of the above methods are: 1) It is difficult to reveal the deep relationship between data. Due to the multi-source heterogeneity of industrial data, the ability to mine potential connections between data is limited; 2) Poor understanding ability. It cannot handle complex contexts, especially when it involves industrial expertise; 3) Low accuracy. Due to the loss or distortion of information transmission in each processing stage, the final output question and answer results are biased, reducing the overall accuracy of the answer; 4) High cost. In order to adapt to specific scenarios, the model needs to be fine-tuned, resulting in increased operating costs for enterprises.
[0006] Therefore, it is necessary to improve the above-mentioned prior art to overcome the above-mentioned defects. Summary of the invention
[0007] The purpose of the present invention is to provide a method for constructing a large model corpus for industrial data to solve the problems existing in the prior art.
[0008] The above object of the present invention is achieved through the following technical solutions:
[0009] A method for constructing a large model corpus for industrial data includes the following steps:
[0010] 1) Integrate industrial data by searching local knowledge bases, databases and graphs, find data related to industrial data, and obtain integrated industrial data;
[0011] 2) Use the LLM large language model to perform structured extraction of industrial data, perform graph retrieval on the extracted entities, sort the retrieval results according to the relevance between the entities and industrial data, and obtain the industrial mechanism context;
[0012] 3) Construct the local relevant corpus into a vector library; after vectorizing the industrial data, search for similar vectors in the vector library; re-sort the retrieved relevant texts according to their relevance and output them as sample templates for generating corpus;
[0013] 4) Using the above sample templates and combining them with the industrial mechanism context, the integrated industrial data is converted into corpus through the LLM large language model.
[0014] Furthermore, the specific method of step 1) is as follows:
[0015] 1.1) Industrial data integration: List the industrial data sources that need to be integrated, create configuration files for the industrial data sources, automatically extract the metadata of the data sources based on the configuration files, and store them in the metadata database;
[0016] 1.2) Metadata vectorization retrieval: Clean the metadata, remove invalid and duplicate information, convert the metadata into vectors, and store the vectorized metadata in the vector database; according to the vector of the input data source, retrieve the relevant industrial data in the vector database;
[0017] 1.3) Metadata integration: Read relevant data sources, set and adjust thresholds according to specific application scenarios, use the LLM large language model to determine the correlation between data sources to obtain relevant data sources; calculate the correlation between any two data sources; based on valid correlation results, complete the relevant information of industrial data by horizontally merging tables.
[0018] Furthermore, the metadata cleaning adopts a contrast loss function, as shown in formula (1):
[0019] (1)
[0020] in, is the value of the contrast loss function; is the number of metadata sample pairs of industrial data corpus; It is The labels of similar sample pairs of industrial data corpora, where =1 means the sample pairs are similar. =0 means the sample pairs are not similar; It is The distance between pairs of samples; It is the preset distance threshold between pairs of industrial data corpus samples, which is used to determine whether the sample pairs are similar;
[0021] when =1, that is, when the metadata samples of the industrial data corpus are similar, the first term of the contrast loss function Penalizes pairs of samples whose distance is greater than the threshold similar sample pairs; if Less than or equal to , then the loss is 0; if Greater than , then the loss is and difference;
[0022] when = 0, that is, when the metadata samples of the industrial data corpus are not similar, the second term of the contrast loss function Penalizes pairs of samples whose distance is less than the threshold Dissimilar sample pairs.
[0023] Furthermore, the reading of the relevant data source adopts the following method:
[0024] 1) Dynamically select the optimal data source based on the weight of metadata features;
[0025] 2) Integrate multiple metadata reading methods and adjust according to real-time needs;
[0026] 3) Feature importance score: For each metadata feature , predict its importance score through the random forest model , the calculation method is shown in formula (2);
[0027] (2)
[0028] in, Representation characteristics Importance rating; Represents the number of trees in the random forest model; Representation characteristics In the The average mean square error of the split nodes in the tree; Representation characteristics In the The average mean square error of the nodes used as splits in the tree.
[0029] 4) Calculate the weight of each metadata feature according to formula (3) ,according to Determine priorities for metadata processing;
[0030] (3)
[0031] Representation characteristics The weight of Representation characteristics Importance rating; Indicates the total number of features; Representation characteristics importance rating.
[0032] Furthermore, the confirmation of the effective association adopts formula (4):
[0033] (4)
[0034] in, Represents the data source and data sources Is there a valid relationship between
[0035] The value is greater than or equal to ,but is set to true, indicating that there is a relationship between the two data sources; otherwise, Is set to false, indicating that there is no association between the two data sources.
[0036] Further, the specific method of step 2) is as follows:
[0037] 2.1) Use the LLM large language model to extract structured entities from industrial data;
[0038] 2.2) Based on the knowledge in the industrial field, construct a structured entity industrial knowledge graph;
[0039] 2.3) Retrieve entities in the industrial knowledge graph based on the hybrid retrieval algorithm;
[0040] 2.4) Re-rank the entities according to their relevance to provide industrial mechanism context for corpus generation.
[0041] Furthermore, the hybrid retrieval algorithm is implemented using formula (5):
[0042] (5)
[0043] in, is the final score of the vector retrieval of data item d for query q; is a weight parameter whose value is between [0, 1], indicating the weight of the score based on the vector and the keyword; represents the vector-based retrieval score; Indicates the search score based on keywords; Represents the search score based on the graph.
[0044] The entities are reordered according to the relevance of the retrieved entities using formula (6):
[0045] (6)
[0046] in, represents the relevance score between the i-th entity and the query;
[0047] is the similarity score between the ith entity and the query; is the relevance score between the ith entity and the query; Considers the semantic association between the entity and the query and the importance of the entity; relevance scoring The value range is [0, 1], and the closer the value is to 1, the more relevant the entity is to the query.
[0048] Furthermore, the corpus vectorization includes: 1) calculating the word vector of each word in the corpus; 2) converting the word vector into a sentence vector; which is implemented by formulas (7) and (8) respectively:
[0049] (7)
[0050] in, represents the word embedding function; is the first words;
[0051] yes The corresponding word vector;
[0052] (8)
[0053] in, It is a sentence The number of words in the sentence; Expressive words The corresponding sentence vector, It is The vector of the word;
[0054] The vector library construction includes: 1) calculating the storage vector; 2) constructing the index of the storage vector; which is respectively implemented by formula (9) and (10):
[0055] ) (9)
[0056] in, Indicates storage operation; Represents industrial corpus text; It is an industrial corpus text The vector representation of Represents the storage vector after the industrial corpus text is vectorized;
[0057] (10)
[0058] It is the query vector after the industrial data is vectorized when generating the corpus; It is the first vectors; Represents the index of the stored vector that is closest to the query vector.
[0059] Further, the specific method of step 3) is as follows:
[0060] 3.1) Build a local corpus vector library: organize existing text resources as corpus templates, convert text resources into vector representations, and store them in the local corpus vector library;
[0061] 3.2) Generate industrial corpus template: Convert industrial data into vectors, search for vectors similar to industrial data in the local corpus vector library, and use the corpus corresponding to the retrieved similar vectors as templates.
[0062] Use the LLM large language model to reorder the templates and select the best template.
[0063] Further, the specific method of step 4) is as follows:
[0064] 4.1) Input data preparation: Integrate the integrated industrial data, industrial mechanism context and reference corpus templates as context information related to the original data;
[0065] 4.2) Corpus generation: Input context information into the LLM large language model, set prompt words according to the reference template, and generate the final industrial corpus;
[0066] 4.3) Corpus review and optimization: Review, modify and optimize the generated industrial corpus.
[0067] In summary, the present invention has the following beneficial effects:
[0068] 1) Use data integration strategies to discover potential correlations in industrial data and effectively enrich the dimensions of industrial data, thereby eliminating data silos and improving data quality.
[0069] 2) In-depth exploration of industrial mechanisms, through entity recognition and graph retrieval technology, significantly enhances the model's ability to understand complex contexts in the industrial field.
[0070] 3) Innovative use of local corpus RAG retrieval enhancement and sample template enhancement optimizes the corpus generation process and ensures the professionalism and accuracy of text generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 It is a flow chart of the method for constructing a large model corpus for industrial data described in the present invention.
[0072] Figure 2 This is a schematic diagram of industrial data integration described in the present invention.
[0073] Figure 3 It is a schematic diagram of the industrial mechanism retrieval described in the present invention.
[0074] Figure 4 This is a schematic diagram of the enhanced local knowledge base retrieval described in the present invention.
[0075] Figure 5 It is a schematic diagram of the original industrial data described in the present invention.
[0076] Figure 6 It is a schematic diagram of the preprocessed industrial data described in the present invention.
[0077] Figure 7 It is a schematic diagram of the generated corpus described in the present invention. DETAILED DESCRIPTION
[0078] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further described below in conjunction with illustrations and specific embodiments.
[0079] like Figure 1 and Figure 4 As shown, the method for constructing a large model corpus for industrial data proposed in the present invention includes the following steps:
[0080] , Industrial Data Integration
[0081] Step 1: Ingest multi-source heterogeneous industrial data through metadata
[0082] 1. Determine data sources: List the industrial data sources that need to be integrated, including databases, file systems, sensors, etc.
[0083] 2. Fill in data source information: Create a configuration file for each data source, including data source type, connection information, data format, etc.
[0084] 3. Metadata extraction: According to the ME algorithm, the configuration file automatically extracts the metadata of the data source. The ME algorithm consists of two steps: 1) Extraction of metadata information; 2) Converting the extracted metadata information into the iDS3 default data format. The core idea of the ME algorithm is mainly reflected in the algorithm paradigms (1) and (2).
[0085] (1)
[0086] in, Represents the extracted metadata; It is a metadata extraction algorithm; Indicates a data source consisting of a certain type of industrial data (the source of data for generating corpus); Is the function that parses the configuration file, Represents a configuration file.
[0087] ) (2)
[0088] in, Represents the transformed metadata; Represents the metadata format conversion function, Represents the extracted metadata.
[0089] 4. Metadata import: Metadata import algorithm MI is used to implement metadata import and store it in the metadata database in the iDS3 system. The proposed MI algorithm consists of two steps: 1) metadata import into the iDS3 platform; 2) metadata database construction. The core idea of the MI algorithm is mainly reflected in algorithmic paradigms (3) and (4).
[0090] ) (3)
[0091] in, Indicates the status or result of an import operation. Represents the function of importing metadata into the iDS3 system; Indicates metadata after format conversion.
[0092] (4)
[0093] in, Indicates the completed metadata database. Represents the function of establishing a metadata database. Indicates metadata after format conversion.
[0094] Step 2: Metadata Vectorization Retrieval
[0095] 1. Metadata preprocessing: Clean metadata and remove invalid and duplicate information.
[0096] A deep learning model is used to identify and remove duplicate information that is semantically similar but superficially different. The present invention uses a contrastive learning model (ConLearning) to identify the similarity between different metadata entries. According to the principle that the loss is proportional to the distance between sample pairs, a contrastive loss function (ContrastiveLoss) is designed to train the contrastive learning model, aiming to improve the ability of metadata to distinguish similarities. The contrastive loss function is shown in formula (5).
[0097] (5)
[0098] in, is the value of the contrastive loss function. is the number of metadata sample pairs of industrial data corpus.
[0099] It is The labels of similar sample pairs of industrial data corpora, where =1 means the sample pairs are similar. = 0 means the sample pair is not similar. It is The distance between pairs of samples. It is the preset distance threshold between pairs of industrial data corpus samples, which is used to determine whether the sample pairs are similar.
[0100] 1) When =1, that is, when the metadata samples of the industrial data corpus are similar, the first term of the contrast loss function Penalizes pairs of samples whose distance is greater than the threshold If Less than or equal to , then the loss is 0; if Greater than , then the loss is and difference.
[0101] 2) When = 0, that is, when the metadata samples of the industrial data corpus are not similar, the second term of the contrast loss function Penalizes pairs of samples whose distance is less than the threshold Dissimilar sample pairs.
[0102] 2. Vectorization processing: Use text vectorization technology (such as Word2Vec, BERT, etc.) to convert metadata into vectors.
[0103] 3. Build a vector database: store the vectorized metadata in the vector database.
[0104] 4. Retrieve relevant data: Based on the vector of the input data source, retrieve the related industrial data in the vector database.
[0105] Step 3: Metadata Integration
[0106] Adaptive reading of related data sources: Adopt the adaptive reading algorithm AdaRead to realize the reading of metadata of related data sources. The steps of the proposed adaptive reading algorithm AdaRead are as follows:
[0107] 1) Dynamically select the optimal data source based on the weight of metadata features;
[0108] 2) Integrate multiple metadata reading methods (such as API, database query, file parsing) and adjust according to real-time needs;
[0109] 3) Feature importance score. For each metadata feature , predict its importance score through the random forest model , the calculation method is shown in formula (6).
[0110] 4) Calculate the weight of each metadata feature according to formula (7) ,according to Prioritize metadata processing.
[0111] (6)
[0112] (7)
[0113] in, Representation characteristics Importance rating; Represents the number of trees in the random forest model; Representation characteristics In the The average mean square error of the split nodes in the tree; Representation characteristics In the The average mean square error of the split nodes in the tree; Representation characteristics Importance rating; Indicates the total number of features; Representation characteristics importance rating.
[0114] Association analysis: According to the specific application scenario, the threshold τ is set or adaptively adjusted, and the association of the data source is determined through the LLM large language model to obtain relevant data sources.
[0115] Determine valid associations: For any two data sources and , calculate the correlation between them according to formula (8). If their similarity If it is greater than or equal to the threshold τ, it is considered that there is a valid association between them.
[0116] (Formula 8)
[0117] in, Represents the data source and data sources Is there a valid relationship between The value is greater than or equal to ,but is set to True, indicating that there is a relationship between the two data sources; otherwise, Is set to False, indicating that there is no association between the two data sources.
[0118] Data expansion and supplementation: Based on the effective association results, the original industrial data related information is supplemented by horizontally merging tables.
[0119] II. Generating Industrial Mechanism Context
[0120] Step 1: Structured Entity Recognition
[0121] 1. Use the LLM large language model to extract structured entities from industrial data.
[0122] Step 2: Graph-based entity retrieval and ranking
[0123] 2. Build a graph: Build an entity relationship graph based on industrial knowledge.
[0124] 3. Hybrid retrieval: Use the hybrid retrieval algorithm HyRetrieval to retrieve entities in the industrial knowledge graph constructed in step 2. The proposed hybrid retrieval algorithm HyRetrieval combines graph retrieval, keyword retrieval, and vector retrieval in a weighted manner, and improves the accuracy of entity retrieval through weighted fusion sorting. The core idea of the hybrid retrieval algorithm HyRetrieval is reflected in formula (9).
[0125] (9)
[0126] in, is the final score of the vector retrieval of data item d for query q; is a weight parameter, whose value is between [0,1], indicating the weight of the score based on the vector and the keyword; represents the vector-based retrieval score; Indicates the search score based on keywords; Represents the search score based on the graph.
[0127] 4. Result sorting: Re-sort the entities according to their relevance to provide context for corpus generation. Formula (10) reflects the idea of re-sorting entities.
[0128] (10)
[0129] in, represents the relevance score between the i-th entity and the query; is the similarity score between the ith entity and the query. is the relevance score between the ith entity and the query. Factors such as the semantic relevance of the entity to the query and the importance of the entity are taken into account. The value range is between [0,1], and the closer the value is to 1, the more relevant the entity is to the query.
[0130] III. Industrial Corpus Template Generation
[0131] Step 1: Build a local corpus vector library
[0132] Collect historical corpus: organize existing historical texts that can be used as corpus templates.
[0133] Corpus vectorization: CorpusVector is used to convert text corpus into vectors. The CorpusVector algorithm consists of two steps: 1) calculating the word vector of each word in the text corpus; 2) converting the word vector into a sentence vector. Formulas (11) and (12) reflect the core idea of the CorpusVector algorithm.
[0134] (11)
[0135] in, represents the word embedding function; is the first word; yes The corresponding word vector.
[0136] (12)
[0137] in, It is a sentence The number of words in the sentence; Expressive words The corresponding sentence vector, It is The vector of the word.
[0138] Constructing a vector library: Use the vector library construction algorithm VectorCon to store the vectorized corpus in the local corpus vector library. The algorithm VectorCon consists of two steps: 1) calculating the storage vector; 2) constructing the index of the storage vector. Formulas (13) and (14) reflect the core idea of the algorithm VectorCon.
[0139] ) (13)
[0140] in, Indicates storage operation; Represents industrial corpus text; It is an industrial corpus text The vector representation of Represents the storage vector after the industrial corpus text is vectorized.
[0141] (14)
[0142] in, It is the query vector after the industrial data is vectorized when generating the corpus; It is the first vectors; Represents the index of the stored vector that is closest to the query vector.
[0143] Step 2: Generate industrial corpus template
[0144] 1. Industrial data vectorization: convert industrial data into vectors.
[0145] 2. Retrieve similar vectors: Retrieve vectors similar to industrial data in the local corpus vector library.
[0146] 3. Convert to corpus template: Use the corpus corresponding to the retrieved similar vector as a template.
[0147] 4. Template sorting: Use the LLM large language model to reorder the templates and select the best template.
[0148] IV. Industrial Corpus Generation
[0149] Step 1: Input data preparation: Integrate the integrated industrial data, industrial mechanism context and reference corpus templates as context information related to the original data .
[0150] Step 2: Corpus generation: The CorpusGen algorithm is used to generate industrial corpus from input data. The context information is input into the large language model, and the prompt words are set according to the reference template to generate the final industrial corpus. The core idea of the proposed algorithm CorpusGen is reflected in the algorithm paradigm (15).
[0151] (15)
[0152] in, represents the final generated industrial data corpus, represents a large language model with inference capabilities, Represents raw industrial data, Represents the context information obtained when the industrial corpus is generated.
[0153] Step 3: Corpus review and optimization: Review, modify and optimize the generated industrial corpus to ensure quality.
[0154] Example
[0155] After ETL preprocessing, industrial data is integrated to discover relevant data (existing in local knowledge bases, other databases or graphs) and expand into integrated industrial data. Utilize industrial mechanism retrieval and enrich context to retrieve industry-related mechanism information from existing knowledge bases and graphs, and enrich the context of this information as input to the LLM large language model. Search for suitable template examples in the local corpus, and finally, input the results generated by these steps into the LLM large language model to generate corpus suitable for the industrial vertical large language model.
[0156] Industrial data, including OT, IT and ET data (ET data needs to be recognized by OCR), is first integrated by searching local knowledge bases, databases and graphs, from which relevant data is extracted to expand the data dimension. Preprocessing is then performed, including outlier processing, deduplication and data cleaning.
[0157] like Figure 5 The original industrial data shown in the figure is supplemented with fault log data, maintenance record data, and equipment manuals through data integration. The integrated OT data is as follows: Figure 6 shown.
[0158] For industrial mechanism retrieval, we first use the LLM large language model to extract industrial data in a structured manner, and then perform graph recognition on the extracted entities. The graph retrieval uses a hybrid search: graph search, keyword search, and vector search, and the retrieved entities are then sorted according to their relevance to the industrial data.
[0159] The entities extracted by LLM institutionalization are as follows:
[0160] Reactor, temperature, pH value, dissolved oxygen, fault code, operation log, operation manual.
[0161] The entity-related information identified by the search graph is:
[0162] The normal temperature range of the reactor is 14~18℃, the pH value range is 3~4, and the dissolved oxygen content range is 10~15.
[0163] The fault code E1 in the operation manual indicates that the temperature is too high and the device needs to be restarted.
[0164] First, the local relevant corpus (such as operation logs, document materials, etc.) is constructed as a vector library. After the industrial data is vectorized, similar vectors are retrieved in the vector library. The retrieved relevant texts are reordered according to relevance and output as sample templates for generating corpus.
[0165] The sample template after the local knowledge base retrieval is enhanced is as follows:
[0166] At 00:00:00 on January 1, 2024, the temperature of device E12345 is 25.6 degrees Celsius, the pressure is 15.3 PSI, and the flow rate is 120.5 L / min.
[0167] At 10:30:00 on July 15, 2024, device E12345 had an overtemperature alarm and was manually restarted. The device overheated under high load.
[0168] At 00:00:00 on January 1, 2024, the current temperature of Device 2 is 15.1°C, the pH value is 3.6, the dissolved oxygen content is 10.8, and the device is in good operating condition.
[0169] At 00:00:00 on March 12, 2024, the failure rate of Device 1 was 50%, the failure rate of Device 2 was 0, and the overall failure rate of the equipment was 25%. The equipment repair rate was 100%, and there were 1 types of failures. Equipment failure, parts damage, have been recorded and repaired. No other abnormalities were found.
[0170] Using the above corpus as a template and entity information as context, the integrated OT data is converted into corpus through the LLM large language model. The final generated corpus text is shown in Figure 7 .
[0171] In this document, the directions or positional relationships indicated by terms such as "up", "down", "front", "back", "left", "right", "top", "bottom", "inside", "outside", "vertical", and "horizontal" are based on the directions or positional relationships shown in the accompanying drawings and are only for the clarity of expressing the technical solutions and the convenience of description, and therefore should not be understood as limitations of the present invention.
[0172] In this document, the terms "comprises," "comprising," or any other variations thereof, are intended to cover a non-exclusive inclusion of elements other than those listed and may also include additional elements not expressly listed.
[0173] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for constructing a large model corpus for industrial data, characterized in that: The steps include: 1) Integrate industrial data by searching local knowledge bases, databases and graphs, find data related to industrial data, and obtain integrated industrial data; 2) Use the LLM large language model to perform structured extraction of industrial data, perform graph retrieval on the extracted entities, sort the retrieval results according to the relevance between the entities and industrial data, and obtain the industrial mechanism context; 3) Construct the local relevant corpus into a vector library; after vectorizing the industrial data, search for similar vectors in the vector library; re-sort the retrieved relevant texts according to their relevance and output them as sample templates for generating corpus; 4) Using the above sample templates and combining them with the industrial mechanism context, the integrated industrial data is converted into corpus through the LLM large language model.
2. The method for constructing a large model corpus for industrial data according to claim 1, characterized in that: The method of step 1) is as follows: 1.1) Industrial data integration: List the industrial data sources that need to be integrated, create configuration files for the industrial data sources, automatically extract the metadata of the data sources based on the configuration files, and store them in the metadata database; 1.2) Metadata vectorization retrieval: Clean the metadata, remove invalid and duplicate information, convert the metadata into vectors, and store the vectorized metadata in the vector database; according to the vector of the input data source, retrieve the relevant industrial data in the vector database; 1.3) Metadata integration: Read relevant data sources, set and adjust thresholds according to specific application scenarios, use the LLM large language model to determine the correlation between data sources to obtain relevant data sources; calculate the correlation between any two data sources; based on valid correlation results, complete the relevant information of industrial data by horizontally merging tables.
3. The method for constructing a large model corpus for industrial data according to claim 2, characterized in that: The metadata cleaning adopts the contrast loss function Contrastive Loss, as shown in formula (1): (1) in, is the value of the contrast loss function; is the number of metadata sample pairs in the industrial data corpus; It is The labels of similar sample pairs of industrial data corpora, where =1 means the sample pairs are similar. =0 means the sample pairs are not similar; It is The distance between pairs of samples; It is the preset distance threshold between pairs of industrial data corpus samples, which is used to determine whether the sample pairs are similar; when =1, that is, when the metadata samples of the industrial data corpus are similar, the first term of the contrast loss function Penalizes pairs of samples whose distance is greater than the threshold similar sample pairs; if Less than or equal to , then the loss is 0; if Greater than , then the loss is and difference; when = 0, that is, when the metadata samples of the industrial data corpus are not similar, the second term of the contrast loss function Penalizes pairs of samples whose distance is less than the threshold Dissimilar sample pairs.
4. The method for constructing a large model corpus for industrial data according to claim 2, characterized in that: The method for reading the relevant data source is as follows: 1) Dynamically select the optimal data source based on the weight of metadata features; 2) Integrate multiple metadata reading methods and adjust according to real-time needs; 3) Feature importance score: For each metadata feature , predict its importance score through the random forest model , the calculation method is shown in formula (2); (2) in, Representation characteristics Importance rating; Represents the number of trees in the random forest model; Representation characteristics In the The average mean square error of the split nodes in the tree; Representation characteristics In the The average mean square error of the split nodes in the tree; 4) Calculate the weight of each metadata feature according to formula (3) ,according to Determine priorities for metadata processing; (3) Representation characteristics The weight of Representation characteristics Importance rating; Indicates the total number of features; Representation characteristics Importance rating.
5. The method for constructing a large model corpus for industrial data according to claim 2, characterized in that: The confirmation of the effective association adopts formula (4): (4) in, Represents the data source and data sources Is there a valid relationship between The value is greater than or equal to ,but is set to true, indicating that there is a relationship between the two data sources; otherwise, Is set to false, indicating that there is no association between the two data sources.
6. The method for constructing a large model corpus for industrial data according to claim 2, characterized in that: The specific method of step 2) is as follows: 2.1) Use the LLM large language model to extract structured entities from industrial data; 2.2) Based on the knowledge in the industrial field, construct a structured entity industrial knowledge graph; 2.3) Retrieve entities in the industrial knowledge graph based on the hybrid retrieval algorithm; 2.4) Re-rank the entities according to their relevance to provide industrial mechanism context for corpus generation.
7. The method for constructing a large model corpus for industrial data according to claim 6, characterized in that: The hybrid retrieval algorithm is implemented using formula (5): (5) in, is the final score of the vector retrieval of data item d for query q; is a weight parameter whose value is between [0, 1], indicating the weight of the score based on the vector and the keyword; represents the vector-based retrieval score; Indicates the search score based on keywords; Represents the search score based on the graph; The entities are reordered according to the relevance of the retrieved entities using formula (6): (6) in, represents the relevance score between the i-th entity and the query; is the similarity score between the ith entity and the query; is the relevance score between the ith entity and the query; Considers the semantic association between the entity and the query and the importance of the entity; relevance scoring The value range is [0, 1], and the closer the value is to 1, the more relevant the entity is to the query.
8. The method for constructing a large model corpus for industrial data according to claim 6, characterized in that: The corpus vectorization includes: 1) calculating the word vector of each word in the corpus; 2) converting the word vector into a sentence vector; which is implemented by formulas (7) and (8) respectively: (7) in, represents the word embedding function; is the first words; yes The corresponding word vector; (8) in, It is a sentence The number of words in the sentence; Expressive words The corresponding sentence vector, It is The vector of each word; The vector library construction includes: 1) calculating the storage vector; 2) constructing the index of the storage vector; which is respectively implemented by formula (9) and (10): ) (9) in, Represents a storage operation; Represents industrial corpus text; It is an industrial corpus text The vector representation of Represents the storage vector after the industrial corpus text is vectorized; (10) It is the query vector after the industrial data is vectorized when generating the corpus; It is the first vectors; Represents the index of the stored vector that is closest to the query vector.
9. The method for constructing a large model corpus for industrial data according to claim 6, characterized in that: The specific method of step 3) is as follows: 3.1) Build a local corpus vector library: organize existing text resources as corpus templates, convert text resources into vector representations, and store them in the local corpus vector library; 3.2) Generate industrial corpus template: Convert industrial data into vectors, search for vectors similar to industrial data in the local corpus vector library, and use the corpus corresponding to the retrieved similar vectors as templates. Use the LLM large language model to reorder the templates and select the best template.
10. The method for constructing a large model corpus for industrial data according to claim 7, characterized in that: The specific method of step 4) is as follows: 4.1) Input data preparation: Integrate the integrated industrial data, industrial mechanism context and reference corpus templates as context information related to the original data; 4.2) Corpus generation: Input context information into the LLM large language model, set prompt words according to the reference template, and generate the final industrial corpus; 4.3) Corpus review and optimization: Review, modify and optimize the generated industrial corpus.
Citation Information
Patent Citations
Cross-border ethnic text sorting method and device fusing document theme features
CN115114400A
Agricultural disease knowledge question and answer retrieval method and system based on heterogeneous knowledge fusion
CN118550991A
Knowledge retrieval enhancement-based characteristic agricultural product standardized file content generation method
CN118779407A
Feedback data graph generation method and refrigerator
WO2023246849A1
