Construction method and system of vertical domain large language model
By preprocessing and classifying topic words for multi-source vertical data, combining reinforcement learning training big models, vertical field knowledge base and prompt word templates are generated, the problem of poor correlation of general models in vertical fields is solved, and the implementation of vertical field big models and intelligent knowledge services are realized.
Patent Information
- Application Number
- CN202411260648.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-09-10
AI Technical Summary
When facing professional problems in vertical fields, the general-purpose large language model cannot provide satisfactory answers, mainly due to the lack of sufficient mining and in-depth understanding of high-quality vertical fields data.
By obtaining multi-source vertical data information, preprocessing and subject word classification, sending subject word information to the vertical domain big model for reinforcement learning training, adjusting neural network structure and weight parameters, generating vertical domain knowledge base and prompt word templates, and finally deploying the vertical domain big model.
The problem of poor content relevance in the application of general models in vertical fields was solved, and fine-tuning weight matrix, knowledge base and prompt word templates with professionalism in vertical fields were generated, and the implementation of large models in vertical fields was realized, and intelligent knowledge management and generative knowledge services were provided.
Smart Images

Figure CN119719256A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing technology, and in particular to a method and system for constructing a large language model in a vertical field. Background Art
[0002] As one of the core technologies of generative artificial intelligence, the large language model has initially achieved industrial application in the fields of financial investment, medical diagnosis, and smart railways with its excellent general generalization and language understanding capabilities. However, when facing professional problems in vertical fields, general large models often cannot provide satisfactory answers due to the lack of sufficient mining and in-depth understanding of high-quality vertical field data. The core of this problem is that data in vertical fields usually have the characteristics of multi-source, redundant information stacking, and uneven quality. For example, multi-dimensional vertical field text data covering different data sources such as books, the Internet, papers, and patents, the differences in their professionalism and data structure make it difficult for traditional general models to accurately grasp the professional knowledge and context, resulting in low relevance of the answer content.
[0003] There is an urgent need for a method to build a large language model in a vertical field based on deep learning and reinforcement learning technologies to overcome the limitations of traditional general models in professional field applications, so as to provide efficient and intelligent solutions and knowledge services for various professional problems. Summary of the invention
[0004] The purpose of the present invention is to provide a method and system for constructing a large language model in a vertical field to improve the above problems. In order to achieve the above purpose, the technical solution adopted by the present invention is as follows: In a first aspect, the present application provides a method for constructing a large language model in a vertical field, comprising: Acquire data information to be processed, wherein the data information to be processed includes vertical data information of at least one data source; Sending the data information to be processed to a preset data preprocessing model for preprocessing to obtain preprocessed data information; The preprocessed data information is sent to a preset classification model for subject word classification to obtain subject word information of at least two categories of data; Send the keyword information of all categories of data to the preset vertical field big model for reinforcement learning training, and adjust the neural network structure and weight parameters of the vertical field big model to obtain the trained vertical field big model; Generate a vertical domain knowledge base based on the preprocessed data information and the subject word information of all categories of data, and encode the subject word information of all categories of data based on a preset heuristic method to obtain a prompt word template for the vertical domain large model; Based on the preset deployment plan, the trained vertical field big model and vertical field knowledge base are deployed, and the application program interface of the trained vertical field big model is constructed to obtain the deployed vertical field big model.
[0005] In a second aspect, the present application also provides a system for constructing a large language model in a vertical field, including: An acquisition unit, configured to acquire data information to be processed, wherein the data information to be processed includes vertical data information of at least one data source; A processing unit, used for sending the data information to be processed to a preset data preprocessing model for preprocessing to obtain preprocessed data information; A classification unit, used to send the preprocessed data information to a preset classification model for subject word classification, and obtain subject word information of at least two categories of data; A training unit, used to send the keyword information of all categories of data to a preset vertical field big model for reinforcement learning training, and adjust the neural network structure and weight parameters of the vertical field big model to obtain a trained vertical field big model; The encoding unit is used to generate a vertical domain knowledge base based on the preprocessed data information and the subject word information of all categories of data, and encode the subject word information of all categories of data based on a preset heuristic method to obtain a prompt word template of the vertical domain large model; The deployment unit is used to deploy the trained vertical field big model and vertical field knowledge base based on a preset deployment plan, and to build an application program interface for the trained vertical field big model to obtain a deployed vertical field big model.
[0006] The beneficial effects of the present invention are: The present invention can remove irrelevant and poor-quality data from different data sources, and generate fine-tuning weight matrices, knowledge bases and prompt word templates with vertical field professionalism based on high-quality vertical field text data, so as to solve the problem of poor content relevance of general large models when answering vertical field professional questions. In addition, by constructing and training vertical field large models, the professionalism of the input data of the large models in terms of knowledge bases and prompt word templates is ensured, the practical application of vertical field large models is realized, intelligent knowledge management and generative knowledge services are provided, and high-value information retrieval and work report writing are assisted.
[0007] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by implementing the embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0009] Figure 1 A flowchart of a method for constructing a large language model in a vertical field as described in an embodiment of the present invention; Figure 2 Schematic diagram of the structure of the vertical domain large language model construction system described in an embodiment of the present invention.
[0010] In the figure: 701, acquisition unit; 702, processing unit; 703, classification unit; 704, training unit; 705, encoding unit; 706, deployment unit; 7021, first processing subunit; 7022, second processing subunit; 7031, third processing subunit; 7032, first classification subunit; 7033, second classification subunit; 7041, first training subunit; 7042, second training subunit; 7043, third training subunit; 7044, fourth training subunit; 70431, acquisition subunit; 70432, fourth processing subunit; 70433, fifth processing subunit; 7051, first encoding subunit; 7052, second encoding subunit; 7053, third encoding subunit. DETAILED DESCRIPTION
[0011] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0012] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance. Embodiment 1:
[0013] This embodiment provides a method for constructing a large language model in a vertical field.
[0014] See also Figure 1 , the figure shows that the method includes step S1, step S2, step S3, step S4, step S5 and step S6.
[0015] Step S1, obtaining data information to be processed, wherein the data information to be processed includes vertical data information of at least one data source; It can be understood that this step obtains data distributed in different data sources such as books, journals, patents, internal companies, and public networks. Obtaining data from data sources in specific vertical fields ensures the professionalism and high relevance of the model training data, allowing the model to understand and generate professional terms and content in the field. Obtaining data from multiple data sources allows the model to cover different types of information, enhancing the comprehensiveness and robustness of the model. By comprehensively collecting different types of data, the integrity of the model training data is guaranteed, allowing the model to respond to application needs in a variety of scenarios.
[0016] Step S2: sending the data information to be processed to a preset data preprocessing model for preprocessing to obtain preprocessed data information; It can be understood that this step can effectively improve the quality and consistency of data through preprocessing, thereby providing a reliable basis for subsequent model training. In this step, step S2 includes step S21 and step S22.
[0017] Step S21, constructing a set of all the data information to be processed, and performing deduplication processing on the set according to a preset deduplication formula to obtain a deduplicated text block set; It can be understood that this step removes duplicate and invalid data by performing deduplication processing to ensure the purity and high quality of the data set. In this step, the preset deduplication formula is as follows:
[0018] in, represents the set of text blocks after the k-th deduplication operation. represents the set of text blocks after the k-1th deduplication operation. represents the i-th text block, represents the jth text block, represents the similarity between the i-th text block and the j-th text block, are the preset parameters.
[0019] Step S22: Classify the deduplicated text block set according to a preset classification formula, and perform missing value interpolation processing on the classified text block set to obtain preprocessed data information.
[0020] It can be understood that in this step, through standardization and classification, the format and structure of the data are ensured to be consistent, facilitating subsequent processing and analysis. Among them, the preset classification formula is as follows: ;
[0021] Among them, represents the a-th word vector, represents the b-th word vector, represents a preset threshold, represents the distance between the a-th word vector and the b-th word vector, represents the text block set.
[0022] Step S3: Send the preprocessed data information to a preset classification model for topic word classification to obtain topic word information of data in at least two categories; It can be understood that in this step, by performing topic word classification on the preprocessed data, important topic words in the text can be effectively extracted, and these topic words can be classified into different technical directions, providing key inputs for subsequent model reinforcement learning training and knowledge base construction. In this step, Step S3 includes Step S31, Step S32, and Step S33.
[0023] Step S31: Retrieve the preprocessed data information. Among them, check whether the preprocessed data information has preset vocabulary information. If so, delete the preset vocabulary information to obtain data information with the preset vocabulary information deleted; It can be understood that in this step, by removing function words with no practical meaning in the preprocessed data information, such as "de", "di", "zai", etc., and at the same time, eliminating content words with little meaning, such as "based on", "research", "consider", etc., the main topic words of the vertical domain text data set are reserved for the technical directions, systems / devices within the vertical domain. By retrieving and deleting the preset irrelevant vocabulary information, the quality and relevance of the data can be significantly improved, providing a more reliable input for subsequent topic word classification and model training.
[0024] Step S32: Based on the word frequency analysis method, perform keyword analysis on the data information with the preset vocabulary information deleted, determine the vocabulary information with a frequency greater than the preset threshold in the data information with the preset vocabulary information deleted, and use it as a keyword; It can be understood that this step can accurately extract high-frequency keywords in the text through word frequency analysis to ensure the representativeness and accuracy of the keywords. The extracted keywords can effectively reduce data noise and improve the purity and quality of the data. The extraction and screening of keywords make the subsequent topic classification and model training more concise and efficient.
[0025] Step S33, calling the technical direction corresponding to each data preset in all the data information to be processed, and calculating the distance between each technical direction and each keyword according to a preset distance calculation formula, wherein if the distance is less than a preset threshold, the keyword is classified into the category of the corresponding technical direction.
[0026] It can be understood that the preset distance formula in this step is to calculate the Euclidean distance, through which the similarity between keywords and technical directions can be accurately measured to ensure the accuracy of classification. Categorizing keywords into corresponding technical directions transforms the data from an unordered set of keywords into a structured classification result, which is convenient for subsequent processing and analysis.
[0027] Step S4: Send the keyword information of all categories of data to the preset vertical field big model for reinforcement learning training, and adjust the neural network structure and weight parameters of the vertical field big model to obtain the trained vertical field big model; It can be understood that in this step, through reinforcement learning, the model can better adapt to data in a specific field and improve its ability to handle related tasks. After reinforcement learning training, the model has better generalization ability when facing new data and can effectively process data of different categories. In this step, step S4 includes step S41, step S42, step S43 and step S44.
[0028] Step S41: construct a vertical domain knowledge tree structure based on the keywords and their corresponding technical direction categories, wherein the first-level nodes of the vertical domain knowledge tree structure are technical directions and the second-level nodes are keywords; It can be understood that this step organizes and classifies keywords according to technical directions, making the knowledge in the field clearer and more structured. Users can quickly find and navigate to the required fields and related terms based on the knowledge tree structure, and it is convenient to manage and update key terms and technical directions in the field to maintain the timeliness and accuracy of the knowledge base.
[0029] Step S42: input the vertical domain knowledge tree structure as a training data set into a preset vertical domain big model for training, wherein an original weight matrix of the vertical domain big model is initialized, and a first adjusted weight matrix is determined based on the original weight matrix and a preset weight matrix adjustment formula; It can be understood that the preset weight matrix adjustment formula in this step is as follows:
[0030] Where W is the first adjustment weight matrix, is the original weight matrix, To fine-tune the weight matrix, A and B are two preset low-rank matrices.
[0031] Step S43: training and calculating the first adjustment weight matrix based on the reinforcement learning method until the first adjustment weight matrix reaches a preset threshold, thereby obtaining a second adjustment weight matrix, wherein the second adjustment weight matrix is the first adjustment weight matrix adjusted by the reinforcement learning method; It can be understood that this step automatically adjusts the weight matrix according to the reward feedback during the training process to adapt to different data distributions and input conditions. In this step, step S43 includes step S431, step S432 and step S433.
[0032] Step S431, obtaining the weight matrix in the current state of the state space setting, and setting the action of its reinforcement learning to adjust the size of the weight matrix when the current state is set, wherein the reward function for adjusting the size of the weight matrix is the loss function between the predicted value and the original value of each data in the training data set; The reward function is as follows:
[0033] in, represents the reward function, G represents the number of text training sets, Represents the predicted value of the qth word vector in text training, Represents the original value of the qth word vector in text training.
[0034] Step S432, randomly select an action, determine whether the current state corresponding to the action is the terminal state, if not, calculate through the reward function to obtain the reward function value, and iterate to the next state until the current state corresponding to the action is the terminal state, and obtain the weight matrix in the final state; Step S433: Use the weight matrix in the final state as the second adjusted weight matrix.
[0035] It can be understood that this step automatically optimizes the weight matrix according to the preset reward function through reinforcement learning methods to adapt to the needs of specific tasks and data. By iteratively selecting actions and calculating rewards, the learning process in the simulated environment is gradually improved to improve the performance of the weight matrix. It also improves the performance and robustness of large vertical field models on complex tasks and data, providing more powerful model support for solving practical problems.
[0036] Step S44: Based on the second adjustment weight matrix, the multi-head self-attention and feedforward neural network parts in the preset vertical domain large model are adjusted to obtain the trained vertical domain large model.
[0037] It is understandable that this step improves the performance and generalization ability of the model by adjusting the self-attention and feedforward neural network parts according to the optimized weight matrix. According to the specific needs and data characteristics of the vertical field, the model is customized to make it more effective in learning and expressing complex relationships and patterns in the field. By fine-tuning the model structure, the performance and application ability of the model on specific tasks are enhanced, and the efficiency and accuracy of problem solving are improved.
[0038] Step S5: Generate a vertical domain knowledge base based on the preprocessed data information and the subject word information of all categories of data, and encode the subject word information of all categories of data based on a preset heuristic method to obtain a prompt word template of the vertical domain large model; It can be understood that in this step, step S5 includes step S51, step S52 and step S53.
[0039] Step S51, read, split and embed the preprocessed data information and the subject word information of all categories of data to construct a vertical field knowledge base; It can be understood that this step uses word embedding technology to convert text information into dense vector representation, which improves the data's expressiveness and computational efficiency, helps optimize and enhance the performance and practical application capabilities of large vertical field models, and thus better serves the needs and challenges of specific fields.
[0040] Step S52: embedding the preset user question, and searching the embedded user text vector in the vertical domain knowledge base, wherein the correlation between the user text vector and the word vector in the vertical domain knowledge base is calculated by a preset similarity calculation formula, and the word vector with the maximum correlation with the user text vector is output as a related text block; It can be understood that the similarity calculation formula in this step is the calculation formula of cosine similarity. By calculating the similarity between the user text vector and the word vector in the knowledge base, the information or answer related to the user's question can be accurately found. It helps to improve the response speed and accuracy of the vertical field large model when processing user queries and needs, thereby improving user experience and service quality.
[0041] Step S53: Process the relevant text blocks and the user questions based on a preset heuristic algorithm calculation formula to obtain a prompt word template for a vertical field large model.
[0042] It can be understood that this step uses a heuristic algorithm to process relevant text blocks and user questions, generating a prompt word template that is highly matched with user needs, thereby improving the model's ability to respond to and answer user questions. The template generation formula is as follows:
[0043] Among them, Prompt represents the prompt word template, F represents the function expression of the heuristic algorithm, Represents a related text block, and Query represents a user question.
[0044] Step S6: deploy the trained vertical domain big model and vertical domain knowledge base based on the preset deployment plan, and build an application program interface for the trained vertical domain big model to obtain a deployed vertical domain big model.
[0045] It is understandable that in this step, through the application program interface constructed, users can submit requests in real time and obtain model prediction results, realizing the ability to quickly respond to user needs. The deployed vertical domain knowledge base can effectively support the reasoning process of the model and help the model better understand and process user input. The trained vertical domain large model is successfully transformed into a useful tool in practical applications, which improves the intelligence level of the system and user experience. Embodiment 2:
[0046] like Figure 2 As shown, this embodiment provides a system for constructing a large language model in a vertical field, see Figure 2 The system includes an acquisition unit 701 , a processing unit 702 , a classification unit 703 , a training unit 704 , an encoding unit 705 and a deployment unit 706 .
[0047] An acquisition unit 701 is used to acquire data information to be processed, where the data information to be processed includes vertical data information of at least one data source; The processing unit 702 is used to send the data information to be processed to a preset data preprocessing model for preprocessing to obtain preprocessed data information; Wherein, the processing unit 702 includes a first processing subunit 7021 and a second processing subunit 7022. The first processing subunit 7021 is used to construct a set of all the data information to be processed, and perform deduplication processing on the set according to a preset deduplication formula to obtain a deduplicated text block set; The second processing sub-unit 7022 is used to classify the deduplicated text block set according to a preset classification formula, and perform missing value interpolation processing on the classified text block set to obtain pre-processed data information.
[0048] The classification unit 703 is used to send the preprocessed data information to a preset classification model for subject word classification to obtain subject word information of at least two categories of data; The classification unit 703 includes a third processing subunit 7031 , a first classification subunit 7032 and a second classification subunit 7033 .
[0049] The third processing subunit 7031 is used to search the preprocessed data information, wherein the preprocessed data information is searched to see whether it has preset vocabulary information, and if so, the preset vocabulary information is deleted to obtain data information with the preset vocabulary information deleted; The first classification subunit 7032 is used to perform keyword analysis on the data information of deleting the preset vocabulary information based on the word frequency analysis method, determine the vocabulary information with a frequency greater than a preset threshold in the data information of deleting the preset vocabulary information, and use it as a keyword; The second classification subunit 7033 is used to call the technical direction corresponding to each data preset in all the data information to be processed, and calculate the distance between each technical direction and each of the keywords according to a preset distance calculation formula, wherein if the distance is less than a preset threshold, the keyword is classified into the category of the corresponding technical direction.
[0050] The training unit 704 is used to send the keyword information of all categories of data to the preset vertical field big model for reinforcement learning training, and adjust the neural network structure and weight parameters of the vertical field big model to obtain the trained vertical field big model; The training unit 704 includes a first training subunit 7041 , a second training subunit 7042 , a third training subunit 7043 and a fourth training subunit 7044 .
[0051] The first training subunit 7041 is used to construct a vertical domain knowledge tree structure based on the keywords and their corresponding technical direction categories, wherein the first-level nodes of the vertical domain knowledge tree structure are technical directions and the second-level nodes are keywords; The second training subunit 7042 is used to input the vertical domain knowledge tree structure as a training data set into a preset vertical domain big model for training, wherein an original weight matrix of the vertical domain big model is initialized, and a first adjusted weight matrix is determined based on the original weight matrix and a preset weight matrix adjustment formula; The third training subunit 7043 is used to perform training calculation on the first adjustment weight matrix based on the reinforcement learning method until the first adjustment weight matrix reaches a preset threshold, thereby obtaining a second adjustment weight matrix, where the second adjustment weight matrix is the first adjustment weight matrix adjusted by the reinforcement learning method; The third training subunit 7043 includes an acquisition subunit 70431 , a fourth processing subunit 70432 and a fifth processing subunit 70433 .
[0052] An acquisition subunit 70431 is used to acquire a weight matrix in a current state of a state space setting, and to adjust the size of the weight matrix when setting its reinforcement learning action to the current state, wherein the reward function for adjusting the size of the weight matrix is a loss function between a predicted value and an original value of each data in a training data set; The fourth processing subunit 70432 is used to randomly select an action, determine whether the current state corresponding to the action is a terminal state, and if not, calculate through the reward function to obtain a reward function value, and iterate to the next state until the current state corresponding to the action is a terminal state, and obtain a weight matrix in the final state; The fifth processing subunit 70433 is configured to use the weight matrix in the final state as a second adjustment weight matrix.
[0053] The fourth training subunit 7044 is used to adjust the multi-head self-attention and feedforward neural network parts in the preset vertical field large model based on the second adjustment weight matrix to obtain the trained vertical field large model.
[0054] The encoding unit 705 is used to generate a vertical domain knowledge base based on the preprocessed data information and the subject word information of all categories of data, and encode the subject word information of all categories of data based on a preset heuristic method to obtain a prompt word template of the vertical domain large model; The encoding unit 705 includes a first encoding subunit 7051 , a second encoding subunit 7052 and a third encoding subunit 7053 .
[0055] The first encoding subunit 7051 is used to read, split and embed the pre-processed data information and the subject word information of all categories of data to construct a vertical field knowledge base; The second encoding subunit 7052 is used to embed the preset user question, and search the embedded user text vector in the vertical domain knowledge base, wherein the correlation between the user text vector and the word vector in the vertical domain knowledge base is calculated by a preset similarity calculation formula, and the word vector with the maximum correlation with the user text vector is output as a related text block; The third encoding subunit 7053 is used to process the relevant text blocks and the user questions based on the calculation formula of the preset heuristic algorithm to obtain the prompt word template of the vertical field large model.
[0056] The deployment unit 706 is used to deploy the trained vertical field big model and the vertical field knowledge base based on a preset deployment plan, and to construct an application program interface of the trained vertical field big model to obtain a deployed vertical field big model.
[0057] It should be noted that, regarding the system in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0058] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0059] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for constructing a large language model in a vertical field, characterized in that: include: Acquire data information to be processed, wherein the data information to be processed includes vertical data information of at least one data source; Sending the data information to be processed to a preset data preprocessing model for preprocessing to obtain preprocessed data information; The preprocessed data information is sent to a preset classification model for subject word classification to obtain subject word information of at least two categories of data; Send the keyword information of all categories of data to the preset vertical field big model for reinforcement learning training, and adjust the neural network structure and weight parameters of the vertical field big model to obtain the trained vertical field big model; Generate a vertical domain knowledge base based on the preprocessed data information and the subject word information of all categories of data, and encode the subject word information of all categories of data based on a preset heuristic method to obtain a prompt word template for the vertical domain large model; Based on the preset deployment plan, the trained vertical field big model and vertical field knowledge base are deployed, and the application program interface of the trained vertical field big model is constructed to obtain the deployed vertical field big model.
2. The method for constructing a large vertical language model according to claim 1, characterized in that , sending the data information to be processed to a preset data preprocessing model for preprocessing, including: Constructing a set of all the data information to be processed, and performing deduplication processing on the set according to a preset deduplication formula to obtain a deduplicated text block set; The deduplicated text block set is classified according to a preset classification formula, and the classified text block set is interpolated for missing values to obtain preprocessed data information.
3. The method for constructing a large vertical language model according to claim 1, characterized in that ,The pre-processed data information is sent to the preset classification model for subject word classification, including: Retrieving the preprocessed data information, wherein the preprocessed data information is retrieved to see whether it has preset vocabulary information, and if so, deleting the preset vocabulary information to obtain data information with the preset vocabulary information deleted; Perform keyword analysis on the data information of deleting the preset vocabulary information based on the word frequency analysis method, determine the vocabulary information with a frequency greater than a preset threshold in the data information of deleting the preset vocabulary information, and use it as a keyword; Call the technical direction corresponding to each data preset in all the data information to be processed, and calculate the distance between each technical direction and each keyword according to the preset distance calculation formula, wherein if the distance is less than the preset threshold, the keyword is classified into the category of the corresponding technical direction.
4. The method for constructing a large vertical language model according to claim 1, characterized in that , send the keyword information of all categories of data to the preset vertical field big model for reinforcement learning training, and adjust the neural network structure and weight parameters of the vertical field big model to obtain the trained vertical field big model, including: Constructing a vertical domain knowledge tree structure based on the keywords and their corresponding technical direction categories, wherein the first-level nodes of the vertical domain knowledge tree structure are technical directions and the second-level nodes are keywords; The vertical domain knowledge tree structure is input as a training data set into a preset vertical domain big model for training, wherein an original weight matrix of the vertical domain big model is initialized, and a first adjusted weight matrix is determined based on the original weight matrix and a preset weight matrix adjustment formula; Performing training calculation on the first adjustment weight matrix based on the reinforcement learning method until the first adjustment weight matrix reaches a preset threshold, thereby obtaining a second adjustment weight matrix, wherein the second adjustment weight matrix is the first adjustment weight matrix adjusted by the reinforcement learning method; Based on the second adjustment weight matrix, the multi-head self-attention and feedforward neural network parts in the preset vertical field large model are adjusted to obtain the trained vertical field large model.
5. The method for constructing a large vertical language model according to claim 4, characterized in that ,Based on the reinforcement learning method, the first adjustment weight matrix is trained and calculated, including: Obtain the weight matrix of the current state of the state space setting, and adjust the size of the weight matrix when setting its reinforcement learning action to the current state, where the reward function for adjusting the size of the weight matrix is the loss function between the predicted value and the original value of each data in the training data set; Randomly select an action, determine whether the current state corresponding to the action is the terminal state, if not, calculate through the reward function to obtain the reward function value, and iterate to the next state until the current state corresponding to the action is the terminal state, and obtain the weight matrix in the final state; The weight matrix in the final state is used as the second adjusted weight matrix.
6. A system for constructing a large language model in a vertical field, characterized in that: include: An acquisition unit, configured to acquire data information to be processed, wherein the data information to be processed includes vertical data information of at least one data source; A processing unit, used for sending the data information to be processed to a preset data preprocessing model for preprocessing to obtain preprocessed data information; A classification unit, used to send the preprocessed data information to a preset classification model for subject word classification, and obtain subject word information of at least two categories of data; A training unit, used to send the keyword information of all categories of data to a preset vertical field big model for reinforcement learning training, and adjust the neural network structure and weight parameters of the vertical field big model to obtain a trained vertical field big model; The encoding unit is used to generate a vertical domain knowledge base based on the preprocessed data information and the subject word information of all categories of data, and encode the subject word information of all categories of data based on a preset heuristic method to obtain a prompt word template of the vertical domain large model; The deployment unit is used to deploy the trained vertical field big model and vertical field knowledge base based on a preset deployment plan, and to build an application program interface for the trained vertical field big model to obtain a deployed vertical field big model.
7. The vertical domain large language model construction system according to claim 6, characterized in that: The processing unit comprises: A first processing subunit is used to construct a set of all the data information to be processed, and perform deduplication processing on the set according to a preset deduplication formula to obtain a deduplicated text block set; The second processing sub-unit is used to classify the deduplicated text block set according to a preset classification formula, and perform missing value interpolation processing on the classified text block set to obtain pre-processed data information.
8. The vertical domain large language model construction system according to claim 6, characterized in that: The classification unit includes: The third processing sub-unit is used to search the pre-processed data information, wherein the pre-processed data information is searched to see whether it has preset vocabulary information, and if so, the preset vocabulary information is deleted to obtain data information with the preset vocabulary information deleted; The first classification subunit is used to perform keyword analysis on the data information of deleting the preset vocabulary information based on the word frequency analysis method, determine the vocabulary information with a frequency greater than a preset threshold in the data information of deleting the preset vocabulary information, and use it as a keyword; The second classification subunit is used to call the technical direction corresponding to each data preset in all the data information to be processed, and calculate the distance between each technical direction and each of the keywords according to a preset distance calculation formula, wherein if the distance is less than a preset threshold, the keyword is classified into the category of the corresponding technical direction.
9. The vertical domain large language model construction system according to claim 6, characterized in that: The training unit comprises: A first training subunit is used to construct a vertical domain knowledge tree structure based on the keywords and their corresponding technical direction categories, wherein the first-level nodes of the vertical domain knowledge tree structure are technical directions and the second-level nodes are keywords; A second training subunit is used to input the vertical domain knowledge tree structure as a training data set into a preset vertical domain big model for training, wherein an original weight matrix of the vertical domain big model is initialized, and a first adjusted weight matrix is determined based on the original weight matrix and a preset weight matrix adjustment formula; A third training subunit is used to perform training calculation on the first adjustment weight matrix based on the reinforcement learning method until the first adjustment weight matrix reaches a preset threshold, thereby obtaining a second adjustment weight matrix, where the second adjustment weight matrix is the first adjustment weight matrix adjusted by the reinforcement learning method; The fourth training sub-unit is used to adjust the multi-head self-attention and feedforward neural network parts in the preset vertical field large model based on the second adjustment weight matrix to obtain the trained vertical field large model.
10. The vertical domain large language model construction system according to claim 9, characterized in that: The third training subunit comprises: An acquisition subunit is used to acquire a weight matrix in a current state of a state space setting, and to adjust the size of the weight matrix when setting its reinforcement learning action to the current state, wherein the reward function for adjusting the size of the weight matrix is a loss function between the predicted value and the original value of each data in the training data set; The fourth processing subunit is used to randomly select an action, determine whether the current state corresponding to the action is a terminal state, and if not, calculate through the reward function to obtain a reward function value, and iterate to the next state until the current state corresponding to the action is a terminal state, and obtain a weight matrix in the final state; The fifth processing subunit is configured to use the weight matrix in the final state as a second adjustment weight matrix.
Citation Information
Patent Citations
Construction method and device of vertical field large model, equipment and storage medium
CN117033603A
Method and system for quickly constructing industry question and answer knowledge base
CN117290489A
Method and system for improving performance of vertical domain language model
CN117312545A
Normal intelligent question-answering method and system fusing knowledge graph and large language model
CN117668182A
Dispute solution intelligent question-answering system based on retrieval enhanced large language model
CN117874192A
Cited By
Knowledge base construction and retrieval method and system based on multi-source text in building field
CN121681810A