A large model-based industry-specific customized model generation method

By constructing a knowledge graph for the target industry and using supervised fine-tuning and reinforcement learning algorithms to optimize the large language model, the problem of insufficient accuracy and relevance of large language models in professional domain question answering was solved, achieving more accurate and relevant question answering capabilities.

CN120542597BActive Publication Date: 2026-07-24CHENGDU MINGTU TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDU MINGTU TECH CO LTD
Filing Date
2025-05-13
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing large language models struggle to provide accurate industry knowledge in highly specialized fields such as medicine, law, and finance, resulting in low accuracy and relevance in question answering.

Method used

By constructing a knowledge graph for the target industry, deep learning technology is used for knowledge representation, extraction, and fusion. Supervised fine-tuning and reinforcement learning algorithms are combined to optimize the question-answering ability of the large language model, inject target industry domain knowledge, and optimize the model's answer through knowledge graph retrieval enhancement technology.

Benefits of technology

It significantly improves the accuracy and relevance of large language models in question answering within target industry domains, generates answers that better align with user preferences and industry standards, and enhances the model's application value in professional fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120542597B_ABST
    Figure CN120542597B_ABST
Patent Text Reader

Abstract

The application discloses an industry-specific customized model generation method based on a large model, which comprises the following key steps: first, collecting structured and semi-structured multi-modal data containing key entities, concepts and relationships in the target industry; then, constructing a knowledge graph through a deep learning method; in the model construction stage, pre-training of a large language model is selected, and feature engineering and personalized adjustment of the model architecture are carried out according to the characteristics of the industry; on the basis of the constructed knowledge graph, the retrieval enhancement technology based on the knowledge graph is adopted to optimize the answer content of the large language model and inject the knowledge of the target industry field; finally, the reinforcement learning algorithm is used to optimize the model output by training the reward model. The application realizes the professional customization of the industry-specific model, significantly improves the question and answer ability of the large language model in the target industry field, and ensures the high accuracy and high relevance of the model when answering the problems related to the target industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of industry-specific large-scale models and natural language processing technology, specifically to a method for generating industry-specific customized models based on large-scale models. The method involves constructing a knowledge graph of the target industry domain, supervising and fine-tuning the customized large-scale language model, injecting the knowledge graph into the customized large-scale language model using knowledge graph retrieval enhancement technology, and optimizing the output of the customized model using reinforcement learning algorithms. Background Technology

[0002] Against the backdrop of the rapid development of artificial intelligence technology, large language models, as a key technology in the field of natural language processing, are already capable of accurately providing answers to questions. However, their training mode based on general datasets has revealed significant limitations, especially in highly specialized industries such as medicine, law, and finance. General-purpose models often struggle to provide precise industry knowledge, resulting in lower accuracy and relevance of answers in these applications. Ensuring that the model outputs highly relevant answers to the target industry during the question-and-answer content generation process is a pressing issue that needs to be addressed. Summary of the Invention

[0003] The purpose of this invention is to propose a method for generating industry-specific customized models based on a large model. This method collects and integrates multimodal datasets of the target industry, constructs a knowledge graph using deep learning technology, and includes three steps: knowledge representation, extraction, and fusion. A supervised fine-tuning algorithm is used on a pre-trained large language model to construct a customized model. A knowledge graph-based retrieval enhancement technique is used to optimize the model's answers. Finally, a reinforcement learning algorithm is used to optimize the model output, thereby improving the relevance and accuracy of the question-and-answer format for the target industry.

[0004] The objective of this invention is achieved through the following technical solution:

[0005] A method for generating industry-specific customized models based on large models includes the following steps:

[0006] Step S1: Collect structured and semi-structured multimodal data, such as documents and reports, containing key entities, concepts, and relationships within the target industry;

[0007] Step S2: Construct a knowledge graph using deep learning methods, including three steps: knowledge representation, knowledge extraction, and knowledge fusion.

[0008] Step S3: In the model building stage, select a pre-trained large language model, perform feature engineering and personalized adjustments to the model architecture according to industry characteristics, and design a customized model that meets the characteristics of the target industry through fine parameter tuning and strict training process monitoring.

[0009] Step S4: Based on the constructed knowledge graph, use knowledge graph-based retrieval enhancement technology to optimize the answer content of the large language model and inject target industry domain knowledge;

[0010] Step S5: Utilize reinforcement learning algorithms to optimize model output by training a reward model and provide feedback on the best question-and-answer results.

[0011] Furthermore, step S1 specifically includes:

[0012] Step S101: Obtain reports and publicly available datasets published by the target industry analysis agency, construct a structured relational database for the target industry, select a suitable dataset, and transform the structured data in the dataset into entities and relationships between entities in a knowledge graph;

[0013] Step S102: Obtain semi-structured data and unstructured text corpus data of the target industry from web pages, online encyclopedia Wikipedia, online books and documents. The specific process is as follows: Obtain the website links of the target industry and collect them into a list. Obtain unstructured text corpus data for each link in turn until the list is empty. After filtering, deduplication and summarizing the data, finally store it in the database.

[0014] Furthermore, step S2 specifically includes:

[0015] Step S201: Use deep learning methods to represent the multimodal data of the target industry obtained in S1. Deep learning algorithms can effectively integrate multimodal information, enhance the complementarity of multi-source heterogeneous information and the effectiveness of knowledge representation. Use a Transformer-based bidirectional encoder to pre-train the target industry dataset and generate word embeddings.

[0016] Step S202: Use the word embedding vectors generated by the Transformer-based bidirectional encoder as input to the bidirectional long short-term memory conditional random field model for entity recognition. The specific steps are as follows:

[0017] (1) Use the word vectors output by the bidirectional encoder model of Transformer as the input of the bidirectional long short-term memory network at each time step;

[0018] (2) At each time step t, the forward long short-term memory network layer processes the sequence from time step 1 to time step t to obtain the forward hidden state sequence.

[0019] (3) The sequence from time step t to time step 1 is processed using an inverse long short-term memory network layer to obtain the inverse hidden state sequence.

[0020] (4) Concatenate the forward and backward hidden states at each time step to obtain a comprehensive hidden state sequence.

[0021] (5) Use the mapping matrix Q of the linear output layer to map the hidden state sequence H t Mapping to n-dimensional space, where n represents the number of label categories, the mapping matrix Q = (Q1, Q2, ..., Q...). i )∈R i*n Q i R represents the score of the i-th category relative to the n labels, where R is a real number;

[0022] (6) The conditional random field decoder is used to learn the dependency relationship between entity labels and to obtain the optimal entity recognition sequence by utilizing the relationship between adjacent entity labels, thereby reducing the probability of unreasonable entity recognition sequences appearing in the prediction sequence.

[0023] The specific working principle of the above-mentioned conditional random field decoder is as follows:

[0024] The Conditional Random Field Decoder learns the transition probabilities between labels, constrains the rationality of the label sequence, and optimizes the model's output by utilizing the overall information of the label sequence. The role of the Conditional Random Field Decoder in the model is to transform the features output by the bidirectional Long Short-Term Memory (LSTM) network layer into an optimal entity sequence. Given the input sentence X = (x1, x2, ..., x...),... n X corresponds to the label sequence Y = (y1, y2, ..., y3). n The formula for calculating the path score of a label sequence using a Conditional Random Field decoder is as follows:

[0025]

[0026] Where n represents the length of the sequence, y i This represents the label at the i-th position in the sequence. For the transition probability matrix from label y i Transfer to label y i+1 The probability, This indicates that the i-th position in the output probability matrix of the bidirectional long short-term memory network layer is labeled as y. i The probability of;

[0027] After calculating the path scores of all possible label sequences, the Conditional Random Field decoder selects the label sequence with the highest score as the final recognition result. The formula for calculating the best label sequence is as follows:

[0028] Y* = argmax{Score(X,Y)}

[0029] Conditional random field decoders constrain the rationality of label sequences by learning the transition probabilities between labels, learn label sequence restriction rules, and reduce the probability of unreasonable sequences.

[0030] Step S203: Based on entity recognition, extract relationships from the entities;

[0031] The specific principle behind entity relation extraction in step S203 is as follows:

[0032] For a given sentence S = {c1, c2, ..., c n Given two target entities e1 and e2, the formula for calculating the sentence vector is:

[0033] M0′=W0·tanh(M0)+b0

[0034] Where M0 represents the final hidden layer vector of the bidirectional encoder model of Transformer, W0 is the weight matrix, and b0 is the bias vector.

[0035] For each target entity, calculate its entity vector, and take the average of the word vectors in the entity vector. The calculation formula is as follows:

[0036]

[0037] Among them, l s , l e Indicates the start and end positions of an entity, M i Represents word vectors, i≥1;

[0038] Finally, the two entity vectors and the sentence vector are concatenated and then fed into a fully connected layer to obtain the output vector M” as follows:

[0039] M″=W1·concat(M0′,M i ′,M j ′)+b1

[0040] Where W1∈R p*3d R represents a real number, where p is the total number of relation types, d represents the hidden layer dimension of each word vector in the Transformer encoder; M0' represents the final vector of sentence S, M i 'and M j 'Represents the target entity e respectively i and e j The final entity vector, b1 is the bias vector;

[0041] Finally, M” is input into a SoftMax layer to classify the relationship type and obtain the relationship between the target entities, as shown in the following formula:

[0042] R(ei , e j ) = SoftMax(M″)

[0043] Step S204: On the basis of entity recognition, perform event extraction on the multi-modal data, and then construct an event database, and store it in the knowledge graph database.

[0044] Furthermore, the specific steps of step S3 include:

[0045] Step S301: Select a suitable pre-trained large language model according to the actual tasks of the target industry;

[0046] Step S302: Inject the knowledge graph in the knowledge graph database obtained in step S2 into the large language model for supervised fine-tuning to adapt to the Q&A of the target industry;

[0047] Step S303: Through the supervised fine-tuning algorithm, without changing the original weights of the pre-trained model, quickly adjust the model through a low-rank matrix to adapt to the new task, reduce the number of parameters that need to be fine-tuned, speed up the training speed and reduce the demand for computing resources, and adapt to the specific target industry.

[0048] Furthermore, the specific steps of step S303 include:

[0049] (1) Obtain the attention weight matrix W of the pre-trained large language model q , W k , W v ;

[0050] (2) For the selected weight matrix W q (the operations of W k and W v are the same), perform low-rank decomposition on its updated matrix ΔW, expressed as:

[0051] W q + ΔW = W q + B·A

[0052] where B ∈ R d×r , A ∈ R r×k , R represents real numbers, and r << min(d, k), k represents the dimension of the input layer features, d represents the dimension of the output layer features, r represents the rank of the intermediate hidden layer of the supervised fine-tuning algorithm, R d×r represents a matrix with d rows and r columns, and R r×k represents a matrix with r rows and k columns;

[0053] (3) Define the total loss function Loss as follows:

[0054] Loss = Loss t + λ * (||B||2 F +||A|| 2 F )

[0055] Among them, Loss t Let ||B|| represent the target task loss, λ represent the regularization coefficient, and ||B|| represent the target task loss. 2 F This indicates that L2 regularization is applied to B, ||A|| 2 F This indicates that A is subjected to L2 regularization;

[0056] Define the target loss function Loss t As shown below:

[0057]

[0058] Where j represents the input question, y t P(y) represents the word vector of the large model's answer at time step t. t |j) represents each word y in the target answer y for question j. t The predicted probability, Loss t This represents the sum of the negative log probabilities of each word being correctly predicted, and T represents the total number of time steps;

[0059] (4) Use the optimizer to update the parameters of the large language model to adapt to the target industry task.

[0060] Furthermore, step S4 specifically includes:

[0061] Step S401: On the supervised fine-tuning large language model, use knowledge graph-based retrieval enhancement technology to optimize the answer content of the large language model and inject target industry domain knowledge. The retrieval enhancement technology utilizes structured knowledge within the knowledge graph, and with the help of the retrieval module, retrieves entity information matching the user query in the knowledge graph. Based on the specific content of the user query, the retrieval module accurately locates relevant entities, attributes, and relationships in the knowledge graph, generating a more accurate answer that is more relevant to the target industry. The specific steps of the knowledge graph-based retrieval enhancement technology include:

[0062] (1) When processing continuous multi-turn dialogues, the big language model first semantically integrates the historical dialogue records with the current question to form a composite question containing contextual elements; the integrated question not only covers the core issues in the dialogue evolution, but also fully preserves the user's intent, the keywords in the current question and their contextual associations.

[0063] (2) The large language model transforms the complex question into a retrieval instruction for the knowledge graph and locates the relevant subgraph in the knowledge graph through the relational path tracing algorithm; the retrieval results include entity nodes, attribute parameters and relational paths between entities that are directly related to the dialogue history and the current question.

[0064] (3) By semantically fusing the retrieved knowledge graph subgraph information with the original composite question, a new knowledge-enhanced question is reconstructed using a large language model; the question completed with graph information is used as a new input instruction and resubmitted to the large language model for parsing.

[0065] (4) The large language model performs dual parsing simultaneously during processing, namely: semantic reasoning of the question; real-time access to structured data in the knowledge graph through the interface; and obtaining the final response content, which includes objective fact nodes in the knowledge graph and logical deduction content generated by the model based on semantic understanding.

[0066] The specific steps of the relationship path tracing algorithm are as follows:

[0067] (1) Semantic anchor extraction and path initialization: Input a composite problem J = Σj, where j represents the specific problem. Extract the anchor set A through a large language model, as shown below:

[0068] A = {(E s ,r,E o )∣E s ∈E,r∈R,E o ∈E}

[0069] Where A represents the set of anchor points, E s Subject entity, r represents relation, E o Let E be the object entity, E be the set of entities in the knowledge graph, and R be the set of relations in the knowledge graph.

[0070] Initialize the entity neighborhood relation queue:

[0071]

[0072] Among them, N1(e i ) represents entity e i The set of first-degree adjacency relationships, that is, directly adjacent to entity e. i The associated entities, Qu represents the queue of entity neighborhood relationships to be expanded;

[0073] (2) Multi-level path expansion and weight evaluation: The breadth-first search algorithm is used to expand the path of entity relations. The specific method is as follows:

[0074]

[0075] Where, Pathn+1 Let represent the set of n+1 hop paths after path expansion, where 'path' represents a single path. It is the path concatenation operator, r new Indicates a new relationship, e new Represents a new entity, Path n Let e ​​represent the set of n-hop paths. last It is Path n Entity at the end of the path;

[0076] After expanding the entities, the overall path weight is calculated for each path. The formula for calculating the overall path weight is as follows:

[0077] W(path)=α*S(path,Q)+β*C(path)-γ*L(path)+c*H(path)

[0078] Where α, β, γ, and c are hyperparameters, S(·) represents the semantic matching degree function, which measures the semantic similarity between the path and the question; C(·) represents the statistical confidence function calculated based on the co-occurrence frequency of paths in the knowledge graph; L(·) represents the path length penalty term, where the longer the path, the lower the score; and H(·) represents the entropy measurement function, which measures the consistency of different nodes and relationships in the path.

[0079] (3) Dynamic pruning and path optimization:

[0080] The expanded path set Path is adjusted based on the comprehensive path weights obtained in step 2. n Dynamic pruning and path optimization are performed as follows:

[0081] 1) Filter low-quality paths. If the path score is below the known threshold, discard the path; if the score is above the threshold, keep the path.

[0082] 2) Detect logical conflicts and further optimize the path set. If there are semantic conflicts in the path, remove the logically conflicting path.

[0083] 3) Enhance the weight of paths containing core entities and increase the weight of paths directly related to core entities;

[0084] 4) Adopt an adaptive strategy to dynamically adjust the path weight hyperparameters.

[0085] Furthermore, step S5 specifically includes:

[0086] Step S501: Collect a real, publicly available dataset of knowledge-based Q&A questions for the target industry. The dataset comes from question-and-answer dialogues in online consultation and knowledge-based Q&A systems. Use the questions in the collected dataset as input to a custom model specific to the target industry. Sample multiple answers from the model and use real answers as a benchmark to generate preference data using evaluation metrics.

[0087] The preference data generation process in step S501 is as follows:

[0088] (1) Sample multiple answers to the same question from the model, and use the character matching rate (CMR) metric to evaluate the quality of the candidate answers. The specific calculation formula is as follows:

[0089] CMR=μ*e Σw*log{T}

[0090]

[0091] Where μ represents the penalty factor, which aims to prevent short texts from receiving excessively high scores; w represents the weight of the short sequence; T represents the short sequence matching rate; u represents the number of matched short sequences, where a short sequence is a sequence of n consecutive characters in the text; and v represents the total number of short sequences.

[0092] (2) Generate preference data based on the calculated character matching rate. A higher character matching rate indicates a higher similarity to the baseline answer and a higher quality of the candidate answer. Select the answer with the highest character matching rate as the best preferred answer and use the baseline answer as the standard answer. The specific format of the preference data is as follows:

[0093] (j,k b ,k z )

[0094] Where j represents the input question, k b k represents the best preferred answer. z Indicates the baseline answer;

[0095] Step S502 optimizes the question-answering output using a reward model:

[0096] A reward model is trained using preference data. This model provides reward values ​​for a customized model specific to the target industry. The reward model is generated by training and minimizing the following loss function:

[0097] Reward(j,k b ,k z ) = min(Loss r )

[0098] Loss r =-E[log{Sigmoid(reward(j,k)] z)-reward(j,k b ))}]

[0099] Where j represents the input question of the target industry-specific customized model, reward(j,k) z ) represents the reward value for the baseline answer to input question j, reward(j,k) b ) represents the reward value for the best preferred answer to input question j, Sigmoid(·) represents the sigmoid function; E[·] represents the average loss obtained by averaging the loss values ​​of each sample in the entire training dataset.

[0100] The beneficial effects of this invention include:

[0101] (1) This invention utilizes deep learning technology to construct a knowledge graph, including three steps: knowledge representation, extraction and fusion. By constructing a knowledge graph of the target industry, a large amount of professional knowledge of the target industry is injected into the large language model, enabling the customized model to more accurately understand industry-specific terms, concepts and logic, thereby significantly improving the question-answering ability of the large language model in the target industry domain.

[0102] (2) This invention uses a conditional random field decoder to learn the dependency relationship between entity labels and uses the relationship between adjacent entity labels to obtain the optimal entity recognition sequence. The conditional random field decoder learns the transition probability between labels to constrain the rationality of the label sequence and uses the overall information of the label sequence to reduce the probability of unreasonable entity recognition sequences appearing in the prediction sequence.

[0103] (3) This invention uses a supervised fine-tuning algorithm to quickly adjust the model to adapt to new tasks without changing the original weights of the pre-trained model, thereby reducing the number of parameters that need to be fine-tuned, speeding up the training process and reducing the demand for computing resources, and adapting to specific target industries. The use of the supervised fine-tuning algorithm to build a customized model ensures high accuracy and high relevance of the model when answering questions related to the target industry.

[0104] (4) This invention constructs a reward model and introduces a reinforcement learning algorithm to guide the large language model to continuously optimize the output results during the content generation process, generating answers that are more in line with user preferences and industry norms. This mechanism effectively enhances the consistency between the model and the real question-and-answer scenarios in the target industry, significantly improves the relevance and accuracy of the output of the customized model, and further strengthens the application value and intelligence level of the customized model in the target industry.

[0105] (5) This invention uses knowledge graph-based retrieval enhancement technology to optimize model answers. With the help of the retrieval module, entity information matching the user query is retrieved in the knowledge graph. Based on the specific content of the user query, the retrieval module accurately locates relevant entities, attributes and relationships in the knowledge graph, generating more accurate answers that are more relevant to the target industry and generating question-and-answer results that meet the user's preferences.

[0106] (6) This invention combines the collaborative mechanism of knowledge graph retrieval and large language model reasoning, which significantly improves the domain adaptability and factual accuracy of large model question answers; through the complementarity of the precise knowledge positioning capability of knowledge graph and the semantic understanding capability of large language model, not only is the reliability of professional knowledge guaranteed, but also the fluency of natural dialogue response is maintained, thereby achieving dual optimization of quality and user experience. Attached Figure Description

[0107] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will now be described in further detail with reference to the accompanying drawings, wherein:

[0108] Figure 1 This is a schematic diagram of the process for generating an industry-specific customized model based on a large model according to the present invention.

[0109] Figure 2 This invention provides an overall framework and main module diagram of an industry-specific customized model based on a large model.

[0110] Figure 3 This invention provides a flowchart for obtaining multi-source heterogeneous data.

[0111] Figure 4 This is a diagram of the internal structure of the bidirectional long short-term memory network-conditional random field of the present invention;

[0112] Figure 5 This is a diagram illustrating the process of constructing the industry knowledge graph for this invention.

[0113] Figure 6 , Figure 7 This is a diagram illustrating the actual question-answering effect of an industry-specific customized model based on a large model, as described in this invention. Detailed Implementation

[0114] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be understood that the preferred embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.

[0115] Knowledge graphs, as a structured representation of semantic knowledge, construct a multi-dimensional graph-structured data model by using nodes to represent entities and edges to represent relationships between entities. Their main function is to enhance the semantic understanding of data and improve the efficiency of information organization and retrieval. In natural language processing and intelligent question answering, knowledge graphs can effectively achieve entity disambiguation, relational reasoning, and contextual semantic enhancement, thereby improving the system's intelligence level and decision-making accuracy. Injecting target industry domain knowledge from knowledge graphs into industry-specific customized models can effectively enhance the industry relevance of the models' answers.

[0116] Supervised fine-tuning is one of the core technologies in the current process of customizing large language models. Its basic idea is to introduce manually labeled or high-quality datasets onto a pre-trained language model, and further optimize the model parameters in a supervised manner to improve the model's question-answering ability in specific tasks or domains. Supervised fine-tuning can significantly reduce the number of parameters in industry-specific customized models, reduce training time, and make the model more suitable for question answering in the target industry by fine-tuning some parameters.

[0117] Reinforcement learning, a machine learning method centered on interactive learning, has demonstrated significant value in the customization and optimization of large language models in recent years. Through the dynamic interaction between the agent and the environment, reinforcement learning can continuously adjust its strategy based on user feedback or reward signals in scenarios lacking supervised signals, thereby guiding industry-specific customized models to generate outputs that better suit the preferences of the user group.

[0118] This invention utilizes deep learning technology to construct a knowledge graph, achieving structured modeling and semantic enhancement of knowledge in the target industry domain; it employs supervised fine-tuning algorithms to efficiently adapt to large-scale language question-answering tasks within the target industry with minimal parameter adjustments; and it leverages reinforcement learning algorithms to optimize the model's output, ultimately forming a customized model specifically for the target industry with high accuracy and high industry relevance. Figure 1 As shown in this embodiment, a method for generating industry-specific customized models based on large models includes the following steps:

[0119] Step S1: Collect structured and semi-structured multimodal data, such as documents and reports, containing key entities, concepts, and relationships within the target industry;

[0120] Step S2: Construct a knowledge graph using deep learning methods, including three steps: knowledge representation, knowledge extraction, and knowledge fusion.

[0121] Step S3: In the model building stage, select a pre-trained large language model, perform feature engineering and personalized adjustments to the model architecture according to industry characteristics, and design a customized model that meets the characteristics of the target industry through fine parameter tuning and strict training process monitoring.

[0122] Step S4: Based on the constructed knowledge graph, use knowledge graph-based retrieval enhancement technology to optimize the answer content of the large language model and inject target industry domain knowledge;

[0123] Step S5: Utilize reinforcement learning algorithms to optimize model output by training a reward model and provide feedback on the best question-and-answer results.

[0124] This invention proposes an overall framework and main modules for an industry-specific customized model based on a large model, as follows: Figure 2 As shown.

[0125] In this embodiment, step S1 specifically includes the following steps:

[0126] Step S101: Obtain reports published by target industry analysis institutions and publicly available datasets such as MySQL and Oracle, build a structured relational database for the target industry, select a suitable dataset, and transform the structured data in the dataset into entities and relationships between entities in a knowledge graph;

[0127] Step S102: Obtain semi-structured and unstructured text corpus data of the target industry from web pages, online encyclopedias (Wikipedia), online books, and documents using network technology. The specific process is as follows: Obtain the website links of the target industry and collect them into a list. Obtain unstructured text corpus data for each link sequentially until the list is empty. After filtering, deduplication, and data aggregation, finally store the data in the neo4j database. The flowchart for obtaining multi-source heterogeneous data in this invention is shown below. Figure 3 As shown.

[0128] In this embodiment, step S2 will be described in detail below with specific examples:

[0129] Step S201: Use deep learning methods to represent the multimodal data of the target industry obtained in S1. Deep learning algorithms can effectively integrate multimodal information, enhance the complementarity of multi-source heterogeneous information and the effectiveness of knowledge representation. Use a Transformer-based bidirectional encoder to pre-train the target industry dataset and generate word embeddings.

[0130] Step S202: Use the word embedding vectors generated by the Transformer-based bidirectional encoder as input to the bidirectional long short-term memory conditional random field model for entity recognition. The specific steps are as follows:

[0131] (1) Use the word vectors output by the bidirectional encoder model of Transformer as the input of the bidirectional long short-term memory network at each time step;

[0132] (2) At each time step t, the forward long short-term memory network layer processes the sequence from time step 1 to time step t to obtain the forward hidden state sequence.

[0133] (3) The sequence from time step t to time step 1 is processed using an inverse long short-term memory network layer to obtain the inverse hidden state sequence.

[0134] (4) Concatenate the forward and backward hidden states at each time step to obtain a comprehensive hidden state sequence.

[0135] (5) Use the mapping matrix Q of the linear output layer to map the hidden state sequence H t Mapping to n-dimensional space, where n represents the number of label categories, the mapping matrix Q = (Q1, Q2, ..., Q...). i )∈R i*n Q i R represents the score of the i-th category relative to the n labels, where R is a real number;

[0136] (6) By using a Conditional Random Field decoder to learn the dependencies between entity labels, and utilizing the relationships between adjacent entity labels to obtain the optimal entity recognition sequence, the probability of unreasonable entity recognition sequences appearing in the predicted sequence is reduced; the internal structure diagram of the bidirectional long short-term memory network-conditional random field of this invention is shown below. Figure 4 As shown.

[0137] The specific working principle of the above-mentioned conditional random field decoder is as follows:

[0138] The Conditional Random Field Decoder learns the transition probabilities between labels, constrains the rationality of the label sequence, and optimizes the model's output by utilizing the overall information of the label sequence. The role of the Conditional Random Field Decoder in the model is to transform the features output by the bidirectional Long Short-Term Memory (LSTM) network layer into an optimal entity sequence. Given the input sentence X = (x1, x2, ..., x...),... n X corresponds to the label sequence Y = (y1, y2, ..., y3). n The formula for calculating the path score of a label sequence using a Conditional Random Field decoder is as follows:

[0139]

[0140] Where n represents the length of the sequence, y i This represents the label at the i-th position in the sequence. For the transition probability matrix from label y i Transfer to label y i+1 The probability, This indicates that the i-th position in the output probability matrix of the bidirectional long short-term memory network layer is labeled as y. i The probability of;

[0141] After calculating the path scores of all possible label sequences, the Conditional Random Field decoder selects the label sequence with the highest score as the final recognition result. The formula for calculating the best label sequence is as follows:

[0142] Y* = argmax{Score(X,Y)}

[0143] Conditional random field decoders constrain the rationality of label sequences by learning the transition probabilities between labels, learn label sequence restriction rules, and reduce the probability of unreasonable sequences.

[0144] The following example, using data from the healthcare industry, illustrates the working principle of a conditional random field decoder:

[0145] Suppose we need to identify the following entity types from electronic medical records:

[0146] Diseases (such as high blood pressure), medications (such as aspirin), symptoms (such as stomach pain), examinations (such as electrocardiogram).

[0147] The input statement is processed using the BIO tagging method, as shown below:

[0148] Input statement: The patient has hypertension and diabetes, and experienced stomach pain after taking aspirin.

[0149] Target tags: OO{B-disease}{I-disease}OO{B-medication}OO{B-symptoms}O

[0150] Where B- indicates the beginning of an entity, I- indicates the interior of an entity, and O- indicates a non-entity.

[0151] Using a conditional random field decoder can impose reasonable constraints on label dependencies. In medical texts, the transfer of entity labels needs to be logical, for example:

[0152] It is reasonable to associate medication with symptoms, such as stomach pain (B-symptom) after taking aspirin (B-drug).

[0153] The conditional random field decoder learns the high transfer probability from B-drug to B-symptom;

[0154] After the initial diagnosis, other diseases or tests may be required, such as hypertension (B-disease) and diabetes (B-disease), or hypertension (B-disease) may require an electrocardiogram (B-test).

[0155] The Conditional Random Field decoder learns the high metastasis probability of B-disease → B-examination.

[0156] Step S203: Based on entity recognition, extract relationships from the entities;

[0157] The specific principle behind entity relation extraction in step S203 is as follows:

[0158] For a given sentence S = {c1, c2, ..., c n Given two target entities e1 and e2, the formula for calculating the sentence vector is:

[0159] M0′=W0·tanh(M0)+b0

[0160] Where M0 represents the final hidden layer vector of the bidirectional encoder model of Transformer, W0 is the weight matrix, and b0 is the bias vector.

[0161] For each target entity, calculate its entity vector, and take the average of the word vectors in the entity vector. The calculation formula is as follows:

[0162]

[0163] Among them, l s , l e Indicates the start and end positions of an entity, M i Represents word vectors, i≥1;

[0164] Finally, the two entity vectors and the sentence vector are concatenated and then fed into a fully connected layer to obtain the output vector M” as follows:

[0165] M″=W1·concat(M0′,M i ′,M j ′)+b1

[0166] Where W1∈R p*3d R represents a real number, where p is the total number of relation types, d represents the hidden layer dimension of each word vector in the Transformer encoder; M0' represents the final vector of sentence S, M i 'and M j 'Represents the target entity e respectively i and e j The final entity vector, b1 is the bias vector;

[0167] Finally, M” is input into a SoftMax layer to classify the relationship type and obtain the relationship between the target entities, as shown in the following formula:

[0168] R(e i ,e j =SoftMax(M″)

[0169] Step S204: Based on entity recognition, perform event extraction on multi-modal data, and then construct an event database, which is stored in the knowledge graph database; The process diagram of constructing the industry knowledge graph of the present invention is as Figure 5 shown.

[0170] In this embodiment, step S3 includes:

[0171] Step S301: Select a suitable pre-trained large language model according to the actual tasks of the target industry;

[0172] Step S302: Inject the knowledge graph in the knowledge graph database obtained in step S2 into the large language model for supervised fine-tuning to adapt to the Q&A of the target industry;

[0173] Step S303: Through the supervised fine-tuning algorithm, without changing the original weights of the pre-trained model, quickly adjust the model through a low-rank matrix to adapt to the new task, reduce the number of parameters that need to be fine-tuned, speed up the training speed and reduce the demand for computing resources, and adapt to the specific target industry.

[0174] As a further improvement, step S303 specifically includes:

[0175] (1) Obtain the attention weight matrix W of the pre-trained large language model q , W k , W v ;

[0176] (2) For the selected weight matrix W q (The operations of W k and W v are the same), perform low-rank decomposition on its updated matrix ΔW, which is expressed as:

[0177] W q +ΔW = W q +B·A

[0178] where B ∈ R d×r , A ∈ R r×k , R represents real numbers, and r << min(d, k), k represents the dimension of the input layer features, d represents the dimension of the output layer features, r represents the rank of the intermediate hidden layer of the supervised fine-tuning algorithm, R d×r represents a matrix with d rows and r columns, and R r×k represents a matrix with r rows and k columns;

[0179] (3) Define the total loss function Loss as follows:

[0180] Loss = Loss t +λ*(||B|| 2 F +||A||2 F )

[0181] Among them, Loss t Let ||B|| represent the target task loss, λ represent the regularization coefficient, and ||B|| represent the target task loss. 2 F This indicates that L2 regularization is applied to B, ||A|| 2 F This indicates that A is subjected to L2 regularization;

[0182] Define the target loss function Loss t As shown below:

[0183]

[0184] Where j represents the input question, y t P(y) represents the word vector of the large model's answer at time step t. t |j) represents each word y in the target answer y for question j. t The predicted probability, Loss t This represents the sum of the negative log probabilities of each word being correctly predicted, and T represents the total number of time steps;

[0185] (4) Use the Adam optimizer to update the parameters of the large language model to suit the target industry task.

[0186] In this embodiment, step S4 includes:

[0187] Step S401: On the supervised fine-tuning large language model, use knowledge graph-based retrieval enhancement technology to optimize the answer content of the large language model and inject target industry domain knowledge. The retrieval enhancement technology utilizes structured knowledge within the knowledge graph, and with the help of the retrieval module, retrieves entity information matching the user query in the knowledge graph. Based on the specific content of the user query, the retrieval module accurately locates relevant entities, attributes, and relationships in the knowledge graph, generating a more accurate answer that is more relevant to the target industry. The specific steps of the knowledge graph-based retrieval enhancement technology include:

[0188] (1) When processing continuous multi-turn dialogues, the big language model first semantically integrates the historical dialogue records with the current question to form a composite question containing contextual elements. The integrated question not only covers the core issues in the dialogue evolution, but also fully preserves the user's intent, the keywords in the current question and their contextual associations.

[0189] (2) The large language model transforms the complex question into a retrieval instruction for the knowledge graph and locates the relevant subgraph in the knowledge graph through the relational path tracing algorithm; the retrieval results include entity nodes, attribute parameters and relational paths between entities that are directly related to the dialogue history and the current question.

[0190] (3) By semantically fusing the retrieved knowledge graph subgraph information with the original composite question, a new knowledge-enhanced question is reconstructed using a large language model; the question completed with graph information is used as a new input instruction and resubmitted to the large language model for parsing.

[0191] (4) The large language model performs dual parsing simultaneously during processing, namely: semantic reasoning of the question; real-time access to structured data in the knowledge graph through the interface; and finally, the response content, which includes objective fact nodes in the knowledge graph and logical deduction content generated by the model based on semantic understanding.

[0192] The specific steps of the relationship path tracing algorithm are as follows:

[0193] (1) Semantic anchor extraction and path initialization: Input a composite problem J = Σj, where j represents the specific problem. Extract the anchor set A through a large language model, as shown below:

[0194] A = {(E s ,r,E o )∣E s ∈E,r∈R,E o ∈E}

[0195] Where A represents the set of anchor points, E s Subject entity, r represents relation, E o Let E be the object entity, E be the set of entities in the knowledge graph, and R be the set of relations in the knowledge graph.

[0196] Initialize the entity neighborhood relation queue:

[0197]

[0198] Among them, N1(e i ) represents entity e i The set of first-degree adjacency relationships, that is, directly adjacent to entity e. i The associated entities, Qu represents the queue of entity neighborhood relationships to be expanded;

[0199] (2) Multi-level path expansion and weight evaluation: The breadth-first search algorithm is used to expand the path of entity relations. The specific method is as follows:

[0200]

[0201] Where, Pathn+1 Let represent the set of n+1 hop paths after path expansion, where 'path' represents a single path. It is the path concatenation operator, r new Indicates a new relationship, e new Represents a new entity, Path n Let e ​​represent the set of n-hop paths. last It is Path n Entity at the end of the path;

[0202] After expanding the entities, the overall path weight is calculated for each path. The formula for calculating the overall path weight is as follows:

[0203] W(path)=α*S(path,Q)+β*C(path)-γ*L(path)+c*H(path)

[0204] Where α, β, γ, and c are hyperparameters, S(·) represents the semantic matching degree function, which measures the semantic similarity between the path and the question; C(·) represents the statistical confidence function calculated based on the co-occurrence frequency of paths in the knowledge graph; L(·) represents the path length penalty term, where the longer the path, the lower the score; and H(·) represents the entropy measurement function, which measures the consistency of different nodes and relationships in the path.

[0205] (3) Dynamic pruning and path optimization:

[0206] The expanded path set Path is adjusted based on the comprehensive path weights obtained in step 2. n Dynamic pruning and path optimization are performed as follows:

[0207] 1) Filter low-quality paths. If the path score is below the known threshold, discard the path; if the score is above the threshold, keep the path.

[0208] 2) Detect logical conflicts and further optimize the path set. If there are semantic conflicts in the path, remove the logically conflicting path.

[0209] 3) Enhance the weight of paths containing core entities and increase the weight of paths directly related to core entities;

[0210] 4) Adopt an adaptive strategy to dynamically adjust the path weight hyperparameters.

[0211] The following example illustrates the process of multi-level path expansion and path evaluation for entity relationships:

[0212] (1) Semantic anchor point extraction and path initialization:

[0213] Question: Patient A has developed a fever and cough. What medications might the doctor prescribe?

[0214] Anchor point extraction: A = {(Patient A, presents with fever), (Patient A, presents with cough)}

[0215] Neighborhood expansion: Path = {(fever, symptoms, flu), (cough, symptoms, pneumonia)}

[0216] (2) Multi-stage path expansion and weight evaluation:

[0217] Path 1 = [Patient A → Onset → Fever → Indication → Influenza → Prescription → Oseltamivir]

[0218] Path 2 = [Patient A → Appearance → Cough → Indication → Pneumonia → Prescription → Parvovir]

[0219] Scoring of the two paths above:

[0220] W(Path1)=0.5×0.85+0.3×0.75-0.2×2+0.1×0.5=0.25

[0221] W(Path2)=0.5×0.92+0.3×0.80-0.2×2+0.1×0.4=0.34

[0222] (3) Dynamic pruning and path optimization:

[0223] After calculation in step (2), we know that W(Path1) is lower than the minimum threshold of 0.3, so the path is discarded; W(Path2) is higher than the minimum threshold, so the path is retained.

[0224] In this embodiment, step S5 includes:

[0225] Step S501: Collect a real, publicly available dataset of knowledge-based Q&A questions for the target industry. The dataset comes from question-and-answer dialogues in online consultation and knowledge-based Q&A systems. Use the questions in the collected dataset as input to a custom model specific to the target industry. Sample multiple answers from the model and use real answers as a benchmark to generate preference data using evaluation metrics.

[0226] The preference data generation process in step S501 is as follows:

[0227] (1) Sample multiple answers to the same question from the model, and use the character matching rate (CMR) metric to evaluate the quality of the candidate answers. The specific calculation formula is as follows:

[0228] CMR=μ*e Σw*log{T}

[0229]

[0230] Where μ represents the penalty factor, which aims to prevent short texts from receiving excessively high scores; w represents the weight of the short sequence; T represents the short sequence matching rate; u represents the number of matched short sequences, where a short sequence is a sequence of n consecutive characters in the text; and v represents the total number of short sequences.

[0231] (2) Generate preference data based on the calculated character matching rate. A higher character matching rate indicates a higher similarity to the baseline answer and a higher quality of the candidate answer. Select the answer with the highest character matching rate as the best preferred answer and use the baseline answer as the standard answer. The specific format of the preference data is as follows:

[0232] (j,k b ,k z )

[0233] Where j represents the input question, k b k represents the best preferred answer. z Indicates the baseline answer;

[0234] Step S502 optimizes the question-answering output using a reward model:

[0235] A reward model is trained using preference data. This model provides reward values ​​for a customized model specific to the target industry. The reward model is generated by training and minimizing the following loss function:

[0236] Reward(j,k b ,k z ) = min(Loss r )

[0237] Loss r =-E[log{Sigmoid(reward(j,k)] z )-reward(j,k b ))}]

[0238] Where j represents the input question of the target industry-specific customized model, reward(j,k) z ) represents the reward value for the baseline answer to input question j, reward(j,k) b Then, ) represents the reward value for the best preferred answer to input question j, Sigmoid(·) represents the sigmoid function; E[·] represents the average loss obtained by averaging the loss values ​​of each sample in the entire training dataset;

[0239] The following example illustrates the process of generating preference data:

[0240] Question input j: What is hypertension?

[0241] Sample multiple answers to the same question using the model:

[0242] k1: Hypertension is a chronic disease characterized by persistently elevated arterial blood pressure. It usually has no obvious symptoms, but can lead to damage to organs such as the heart, brain, and kidneys.

[0243] k2: Hypertension is a type of high blood pressure disease that can lead to a variety of complications.

[0244] K3: A condition characterized by high blood pressure, known as hypertension.

[0245] Benchmark responses were extracted from real, publicly available datasets:

[0246] k z Hypertension is a common chronic disease characterized by persistently elevated arterial blood pressure, which can lead to cardiovascular and cerebrovascular complications.

[0247] The similarity to the baseline answer is calculated using the character match rate (CMR), with the following parameters defined: n = 5, μ = 0.9, w = 1.5;

[0248] The character matching rates (CMRs) for k1, k2, and k3 are calculated and written into a table, as shown in Table 1:

[0249] Table 1

[0250] <![CDATA[k1]]> 35 68 0.5147 0.332 <![CDATA[k2]]> 11 24 0.4583 0.279 <![CDATA[k3]]> 4 13 0.3077 0.153

[0251] As can be seen from the table, answer k1 is the highest quality candidate answer with the highest character matching rate.

[0252] Finally, the embodiments provide a real question-answering result demonstration of an industry-specific customized model based on a large model according to the present invention, such as... Figure 6 , Figure 7 As shown.

[0253] It should be noted that this invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0254] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0255] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0256] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.

Claims

1. A method for generating industry-specific customized models based on large models, characterized in that: Includes the following steps: Step S1: Collect structured and semi-structured multimodal data containing key entities, concepts, and relationships within the target industry; Step S2: Construct a knowledge graph using deep learning methods, including three steps: knowledge representation, knowledge extraction, and knowledge fusion. Step S3: In the model building stage, select a pre-trained large language model, perform feature engineering and personalized adjustments to the model architecture according to industry characteristics, and design a customized model that meets the characteristics of the target industry through fine parameter tuning and strict training process monitoring. Step S4: Based on the constructed knowledge graph, use knowledge graph-based retrieval enhancement technology to optimize the answer content of the large language model and inject target industry domain knowledge; on the supervised fine-tuning large language model, use knowledge graph-based retrieval enhancement technology to optimize the answer content of the large language model and inject target industry domain knowledge. Step S4 specifically includes: Retrieval enhancement technology utilizes structured knowledge within the knowledge graph. With the help of the retrieval module, it retrieves entity information matching the user's query within the knowledge graph. Based on the specific content of the user's query, the retrieval module accurately locates relevant entities, attributes, and relationship information within the knowledge graph, generating a more accurate answer that is more relevant to the target industry. The specific steps of the knowledge graph-based retrieval enhancement technology include: (1) When processing multiple consecutive dialogues, the large language model first semantically integrates the historical dialogue records with the current question to form a composite question containing contextual elements. The integrated question not only covers the core issues in the dialogue evolution, but also fully preserves the user's intent, the keywords in the current question and their contextual associations. (2) The large language model transforms the complex question into a retrieval instruction in the knowledge graph, and locates the relevant subgraph in the knowledge graph through a relational path tracing algorithm; the retrieval results include entity nodes, attribute parameters, and relational paths between entities that are directly related to the dialogue history and the current question; the relational path tracing algorithm uses a breadth-first search algorithm to expand the path of entity relations, and after expanding the entities, calculates the comprehensive path weight of each path. The formula for calculating the comprehensive path weight is as follows: W(path)=α*S(path, Q)+β*C(path)-γ*L(path)+c*H(path) Where α, β, γ, and c are hyperparameters, S(·) represents the semantic matching degree function, which measures the semantic similarity between the path and the question; C(·) represents the statistical confidence function calculated based on the co-occurrence frequency of paths in the knowledge graph; L(·) represents the path length penalty term, where the longer the path, the lower the score; and H(·) represents the entropy measurement function, which measures the consistency of different nodes and relationships in the path. (3) By semantically fusing the retrieved knowledge graph subgraph information with the original composite question, a new knowledge-enhanced question is reconstructed using a large language model; the question, which has been completed with graph information, is used as a new input instruction and resubmitted to the large language model for parsing; (4) The large language model performs dual parsing simultaneously during processing, namely: semantic reasoning of the question; real-time access to structured data in the knowledge graph through the interface; and obtaining the final response content, which includes objective fact nodes in the knowledge graph and logical deduction content generated by the model based on semantic understanding. Step S5: Utilize reinforcement learning algorithms to optimize model output by training a reward model and provide feedback on the best question-and-answer results.

2. The method for generating industry-specific customized models based on large models according to claim 1, characterized in that: Step S1 specifically includes: Step S101: Obtain reports and publicly available datasets published by the target industry analysis agency, construct a structured relational database for the target industry, select a suitable dataset, and transform the structured data in the dataset into entities and relationships between entities in a knowledge graph; Step S102: Obtain semi-structured data and unstructured text corpus data of the target industry. The specific process is as follows: Obtain the website links of the target industry and collect them into a list. Obtain unstructured text corpus data for each link in turn until the list is empty. After filtering, deduplication and summarizing the data, finally store it in the database.

3. The method for generating industry-specific customized models based on large models according to claim 1, characterized in that: Step S2 specifically includes: Step S201: Use deep learning methods to represent the multimodal data of the target industry obtained in S1. Deep learning algorithms can effectively integrate multimodal information, enhance the complementarity of multi-source heterogeneous information and the effectiveness of knowledge representation. Use a Transformer-based bidirectional encoder to pre-train the target industry dataset and generate word embeddings. Step S202: Use the word embedding vectors generated by the Transformer-based bidirectional encoder as input to the bidirectional long short-term memory conditional random field model for entity recognition. The specific steps are as follows: (1) Use the word vectors output by the bidirectional encoder model of Transformer as the input of the bidirectional long short-term memory network at each time step; (2) At each time step t, the forward long short-term memory network layer processes the sequence from time step 1 to time step t to obtain the forward hidden state sequence. , , ..., ); (3) The sequence from time step t to time step 1 is processed using an inverse long short-term memory network layer to obtain the inverse hidden state sequence. , ..., , , ); (4) Concatenate the forward and backward hidden states at each time step to obtain the comprehensive hidden state sequence (H). t = [ , ]); (5) Use the mapping matrix Q of the linear output layer to map the hidden state sequence H t Mapping to n-dimensional space, where n represents the number of label categories, the mapping matrix Q = (Q1, Q2, ..., Q...). i ) ∈ R i*n Q i R represents the score of the i-th category relative to the n labels, where R is a real number; (6) The conditional random field decoder is used to learn the dependency relationship between entity labels and the relationship between adjacent entity labels is used to obtain the optimal entity recognition sequence, which reduces the probability of unreasonable entity recognition sequences appearing in the prediction sequence. Step S203: Based on entity recognition, extract relationships from the entities; Step S204: Based on entity recognition, extract events from multimodal data, construct an event database, and store it in a knowledge graph database.

4. The method for generating industry-specific customized models based on large models according to claim 1, characterized in that: Step S3 specifically includes: Step S301: Select a suitable pre-trained large language model based on the actual task of the target industry; Step S302: Inject the knowledge graph from the knowledge graph database obtained in step S2 into the large language model for supervised fine-tuning to adapt to the question-answering of the target industry; Step S303: Using a supervised fine-tuning algorithm, the model is quickly adjusted to adapt to the new task by using a low-rank matrix without changing the original weights of the pre-trained model. This reduces the number of parameters that need to be fine-tuned, speeds up training, reduces the demand for computing resources, and adapts to specific target industries.

5. The method for generating industry-specific customized models based on large models according to claim 1, characterized in that: Step S5 includes: Step S501: Collect real public datasets of knowledge Q&A in the target industry. The datasets come from Q&A dialogues in online consultation and knowledge Q&A systems. Use the questions in the collected Q&A dataset as input to the custom model for the target industry. Sample multiple answers from the model and use real answers as a benchmark to generate preference data using evaluation metrics. Step S502: Use the preference data generated in S501 as input to train the reward model. The reward model calculates the reward value of the preference data to provide an evaluation standard for the preference strategy. The preference strategy selects how to proceed to the next step of the answer based on the evaluation standard in order to maximize the long-term cumulative reward. The target industry-specific customized model optimizes the question-and-answer output through the reward model.

6. The method for generating industry-specific customized models based on large models according to claim 3, characterized in that: The specific working method of the conditional random field decoder in step S202 is as follows: The Conditional Random Field Decoder learns the transition probabilities between labels, constrains the rationality of the label sequence, and optimizes the model's output by utilizing the overall information of the label sequence. The role of the Conditional Random Field Decoder in the model is to transform the features output by the bidirectional Long Short-Term Memory (LSTM) network layer into an optimal entity sequence. Given the input sentence X = (x1, x2, ..., x...),... τ X corresponds to the label sequence Y = (y1, y2, ..., y...). τ The formula for calculating the path score of a label sequence using a Conditional Random Field decoder is as follows: Score(X, Y) = Where τ represents the length of the sequence, y i This represents the label at the i-th position in the sequence. For the transition probability matrix from label y i Transfer to label y i+1 The probability, This indicates that the i-th position in the output probability matrix of the bidirectional long short-term memory network layer is labeled as y. i The probability of; After calculating the path scores of all possible label sequences, the Conditional Random Field decoder selects the label sequence with the highest score as the final recognition result. The formula for calculating the best label sequence is as follows: Y* = argmax{Score(X, Y)} Conditional random field decoders constrain the rationality of label sequences by learning the transition probabilities between labels, learn label sequence restriction rules, and reduce the probability of unreasonable sequences.

7. The method for generating industry-specific customized models based on large models according to claim 3, characterized in that: The method for extracting relationships from entities in step S203 is as follows: For a given sentence S = {c1, c2, ..., c n Given two target entities e1 and e2, the formula for calculating the sentence vector is: W0· tanh(M0) + b0 Where M0 represents the final hidden layer vector of the bidirectional encoder model of Transformer, W0 is the weight matrix, and b0 is the bias vector. For each target entity, calculate its entity vector, and take the average of the word vectors in the entity vector. The calculation formula is as follows: Among them, l s , l e Indicates the start and end positions of an entity, M i Represents word vectors, i≥1; The two entity vectors and the sentence vector are concatenated and then fed into a fully connected layer to obtain the output vector. as follows: = W1 · concat( , , ) + b1 Where W1∈R p*3d R represents a real number, p is the total number of relation types, and d represents the hidden layer dimension of each word vector in the Transformer encoder; This represents the final vector of sentence S. and Representing the target entity e respectively i and e j The final entity vector, b1 is the bias vector; Finally, The input is passed to a SoftMax layer to classify the relationship type and obtain the relationship between the target entities, as shown in the following formula: Re i and j ) = SoftMax( ) 8. The method for generating industry-specific customized models based on a large model according to claim 4, characterized in that, The specific process of the supervised fine-tuning algorithm in step S303 is as follows: (1) Obtain the attention weight matrix W of the pre-trained large language model q W k W v ; (2) For the selected weight matrix W q The update matrix ∆W is decomposed into a low-rank form, which is represented as: W q + ∆W = W q + B·A Where, B ∈R d×r , A ∈R r×k R represents a real number, and r << min(d, k), where k represents the dimension of the input layer features, d represents the dimension of the output layer features, and r represents the rank of the hidden layers in the supervised fine-tuning algorithm. d×r Let R be a matrix with d rows and r columns. r ×k Represents a matrix with r rows and k columns; The weight matrix W k and W v The operation of low-rank decomposition and W q same; (3) Define the total loss function Loss as follows: Loss = Loss t + λ * (∥B∥ 2 F + ∥A∥ 2 F ) Among them, Loss t Let λ represent the target task loss, and ∥B∥ represent the regularization coefficient. 2 F This indicates that L2 regularization is applied to B, and ||A|| 2 F This indicates that A is subjected to L2 regularization; Define the target loss function Loss t As shown below: Loss t = - } Where j represents the input question, y t P(y) represents the word vector of the large model's answer at time step t. t |j) represents each word y in the target answer y for question j. t The predicted probability, Loss t This represents the sum of the negative log probabilities of each word being correctly predicted, and T represents the total number of time steps; (4) Use the optimizer to update the parameters of the large language model to adapt to the target industry task.

9. The method for generating industry-specific customized models based on a large model according to claim 5, characterized in that, The preference data generation process in step S501 is as follows: (1) Sample multiple answers to the same question from the model, and use the character matching rate (CMR) metric to evaluate the quality of the candidate answers. The specific calculation formula is as follows: CMR = μ * T = Where μ represents the penalty factor, which aims to prevent short texts from receiving excessively high scores; w represents the weight of the short sequence; T represents the short sequence matching rate; u represents the number of matched short sequences, where a short sequence is a sequence of n consecutive characters in the text; and v represents the total number of short sequences. (2) Generate preference data based on the calculated character matching rate. A higher character matching rate indicates a higher similarity to the baseline answer and a higher quality candidate answer. Select the answer with the highest character matching rate as the best preferred answer and use the baseline answer as the standard answer. The specific format of the preference data is as follows: (j, k b , k z ) Where j represents the input question, k b k represents the best preferred answer. z Indicates the baseline answer; Step S502 optimizes the question-answering output using a reward model: A reward model is trained using preference data. This model provides reward values ​​for a customized model specific to the target industry. The reward model is generated by training and minimizing the following loss function: Reward(j, k b , k z ) = min(Loss r ) Loss r = -E[log{Sigmoid(reward(j, k z ) - reward(j, k b ))}] Where j represents the input question of the target industry-specific customized model, reward(j, k) z ) represents the reward value for the baseline answer to input question j, reward(j, k) b ) represents the reward value for the best preferred answer to input question j, Sigmoid(·) represents the sigmoid function; E[·] represents the average loss obtained by averaging the loss values ​​of each sample in the entire training dataset.