Question and answer model training method based on AI large model
By selecting multi-dimensional data from enterprise data, building and completing knowledge graphs, supervising and fine-tuning and pruning training of AI models, the problem of low training efficiency of multi-dimensional data is solved, and efficient question-and-answer model training is achieved.
Patent Information
- Application Number
- CN202410974957.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-15
AI Technical Summary
When training multi-dimensional data, the existing AI Q&A model has high data complexity, resulting in increased computing resource requirements and low training efficiency.
Multi-dimensional data is selected from enterprise data through hierarchical sampling or random sampling methods, initial knowledge graph is constructed, and missing values are completed through pre-trained language models, supervised fine-tuning and pruning training are performed to obtain enterprise question-and-answer models.
While ensuring data diversity, it reduces the consumption of computing resources, reduces data complexity and model scale, and improves model training efficiency.
Smart Images

Figure CN118964555A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of AI question-answering technology, and in particular to a question-answering model training method based on an AI large model. Background Art
[0002] The existing AI question-answering model training methods usually use single-dimensional data for training and apply it to question-answering in a single field after training. For example, the model is trained with Chinese medical texts and then the trained model is used to answer users' medical questions. The model focuses on learning the distribution and characteristics of specific types of data. The advantage of this method is that the model can dig deep into the details of a specific field, but it may perform poorly when faced with diverse data.
[0003] When using multi-dimensional data to train the same model, the model needs to handle more complex data structures and associations, which helps the model learn the relationships between different data and a wider set of features, and improves its ability to adapt to new data. However, when training a model with multi-dimensional data, the data complexity of multi-dimensional data is high, requiring more computing resources and time for training, which can easily lead to low training efficiency. Summary of the invention
[0004] The main purpose of this application is to provide a question-answering model training method based on an AI large model, aiming to solve the technical problems of low training efficiency caused by high data complexity, more computing resources and time required for model training through multi-dimensional data.
[0005] To achieve the above objectives, the present application proposes a question-answering model training method based on an AI big model, wherein the method comprises:
[0006] Selecting multi-dimensional enterprise data from preset enterprise data by stratified sampling or random sampling method, wherein the multi-dimensional enterprise data includes human resources data, operation data and project data;
[0007] Constructing an initial knowledge graph based on the multi-dimensional enterprise data;
[0008] Completing the missing values in the initial knowledge graph through the knowledge completion task of the preset pre-trained language model to obtain a knowledge graph;
[0009] Perform supervised fine-tuning training on the preset AI big model according to the knowledge graph to obtain a trained AI big model;
[0010] The trained AI large model is pruned to obtain an enterprise question-answering model.
[0011] In one embodiment, the step of constructing an initial knowledge graph based on the multi-dimensional enterprise data includes:
[0012] Performing named entity recognition on the multi-dimensional enterprise data to obtain multi-dimensional named entities;
[0013] Performing relationship extraction on the multi-dimensional named entities to obtain semantic relationships between the multi-dimensional named entities;
[0014] An initial knowledge graph is constructed based on the multi-dimensional named entities and the semantic relationships.
[0015] In one embodiment, the step of constructing an initial knowledge graph according to the multi-dimensional named entities and the semantic relationships includes:
[0016] Modularize the multi-dimensional named entities and the semantic relationships to obtain a modular knowledge graph;
[0017] Determine the inheritance relationship between entities in each module of the modular knowledge graph, and construct superclasses and subclasses according to the inheritance relationship between the entities to obtain a hierarchical knowledge graph;
[0018] Setting up a data loading and updating mechanism in the hierarchical knowledge graph;
[0019] A logical reasoning engine is set in the hierarchical knowledge graph to obtain an initial knowledge graph.
[0020] In one embodiment, the step of performing supervised fine-tuning training on a preset AI big model according to the knowledge graph to obtain a trained AI big model includes:
[0021] Evaluate the importance of each dimension of the knowledge graph according to business needs and data quality, and set a weight value for each dimension according to the importance, wherein the dimensions include a human dimension, an operating dimension, and a project dimension;
[0022] Perform supervised fine-tuning training on the preset AI large model according to the knowledge graph and the weight value in each dimension to obtain the performance in each dimension;
[0023] The weight values are dynamically adjusted according to the performance in each dimension, and the preset AI big model is iteratively trained according to the dynamically adjusted weight values to obtain the trained AI big model.
[0024] In one embodiment, the step of performing supervised fine-tuning training on a preset AI big model according to the knowledge graph to obtain a trained AI big model includes:
[0025] A loss function is defined on each dimension of the knowledge graph, and the loss on each dimension is determined according to the loss function, wherein the dimensions include a human dimension, an operation dimension, and a project dimension;
[0026] Add the losses on each dimension according to the preset weights to get the total loss;
[0027] The weight corresponding to the loss in each dimension is dynamically adjusted according to the total loss, and the preset AI big model is iteratively trained according to the dynamically adjusted weight to obtain the trained AI big model.
[0028] In one embodiment, the step of performing pruning training on the trained AI large model to obtain an enterprise question-answering model includes:
[0029] In the trained AI large model, L1 regularization is set to perform sparse pruning training on the parameters to obtain an enterprise question-answering model.
[0030] In addition, to achieve the above purpose, the present application also proposes a question-answering model training device based on an AI big model, and the question-answering model training device based on an AI big model includes:
[0031] A data selection module, used to select multi-dimensional enterprise data from preset enterprise data by stratified sampling or random sampling method, wherein the multi-dimensional enterprise data includes human resources data, business data and project data;
[0032] A knowledge graph construction module, used to construct an initial knowledge graph based on the multi-dimensional enterprise data;
[0033] A knowledge graph completion module is used to complete the missing values in the initial knowledge graph through the knowledge completion task of a preset pre-trained language model to obtain a knowledge graph;
[0034] A supervised fine-tuning training module is used to perform supervised fine-tuning training on a preset AI big model according to the knowledge graph to obtain a trained AI big model;
[0035] The pruning training module is used to perform pruning training on the trained AI large model to obtain an enterprise question-answering model.
[0036] In addition, to achieve the above-mentioned objectives, the present application also proposes a question-answering model training device based on an AI big model, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the question-answering model training method based on an AI big model as described above.
[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the question-and-answer model training method based on the AI large model as described above are implemented.
[0038] In addition, to achieve the above-mentioned objectives, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the question-and-answer model training method based on the AI big model as described above.
[0039] The present application provides a question-answering model training method based on an AI big model, which selects multi-dimensional enterprise data such as human resources data, business data, and project data from preset enterprise data through a sampling method; constructs an initial knowledge graph based on the multi-dimensional enterprise data; completes the missing values in the initial knowledge graph through the knowledge completion task of a preset pre-trained language model; performs supervised fine-tuning training on the preset AI big model based on the knowledge graph, and performs pruning training on the trained AI big model to obtain an enterprise question-answering model. Since the present application selects multi-dimensional data from preset enterprise data through a sampling method, it is possible to select representative training data, thereby reducing computing resources while ensuring data diversity; constructs a knowledge graph based on multi-dimensional data and completes the knowledge graph, which can be used for model training; supervises fine-tuning and pruning training on the AI big model, thereby reducing data complexity and model scale while improving model training efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0042] Figure 1 A flowchart diagram of the first embodiment of the question-answering model training method based on the AI big model of this application;
[0043] Figure 2 A flowchart diagram of the second embodiment of the question-answering model training method based on the AI big model of this application;
[0044] Figure 3 A flowchart diagram of the third embodiment of the question-answering model training method based on the AI big model of this application;
[0045] Figure 4 This is a schematic diagram of the module structure of a question-answering model training device based on an AI large model in an embodiment of the present application;
[0046] Figure 5This is a schematic diagram of the device structure of the hardware operating environment involved in the question-answering model training method based on the AI big model in the embodiment of the present application.
[0047] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0050] The main solution of the embodiment of the present application is: select multi-dimensional enterprise data from preset enterprise data through stratified sampling or random sampling methods, and the multi-dimensional enterprise data includes human data, business data and project data; construct an initial knowledge graph based on the multi-dimensional enterprise data; complete the missing values in the initial knowledge graph through the knowledge completion task of a preset pre-trained language model to obtain a knowledge graph; perform supervised fine-tuning training on a preset AI big model according to the knowledge graph to obtain a trained AI big model; perform pruning training on the trained AI big model to obtain an enterprise question and answer model.
[0051] In the existing technology, when multi-dimensional data is used to train the same model, the model needs to process more complex data structures and associations, which helps the model learn the relationships between different data and a wider set of features, and improves its adaptability to new data. However, when training a model with multi-dimensional data, the data complexity of multi-dimensional data is high, requiring more computing resources and time for training, which can easily lead to low training efficiency.
[0052] The present application provides a solution, which selects multi-dimensional enterprise data such as human resources data, business data and project data from preset enterprise data through a sampling method; constructs an initial knowledge graph based on the multi-dimensional enterprise data; completes the missing values in the initial knowledge graph through the knowledge completion task of the preset pre-trained language model; performs supervised fine-tuning training on the preset AI big model according to the knowledge graph, and performs pruning training on the trained AI big model to obtain an enterprise question-answering model. Since the present application selects multi-dimensional data from preset enterprise data through a sampling method, it is possible to select representative training data, thereby reducing computing resources while ensuring data diversity; constructs a knowledge graph based on multi-dimensional data and completes the knowledge graph, which can be used for model training; supervises fine-tuning and pruning training on the AI big model, thereby reducing data complexity and model scale while improving the efficiency of model training.
[0053] It should be noted that the execution subject of the method of this embodiment can be a computing service device with AI big model-based question-answering model training, network communication and program running functions, such as a tablet computer, personal computer, mobile phone, etc.; it can also be an AI big model-based question-answering model training device with the same or similar functions. This embodiment and the following embodiments will be described by taking the AI big model-based question-answering model training device as an example.
[0054] Based on this, the embodiment of the present application provides a question-answering model training method based on an AI large model, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the question-answering model training method based on the AI big model of this application.
[0055] In this embodiment, the question-answering model training method based on the AI big model includes steps S10 to S50:
[0056] Step S10, selecting multi-dimensional enterprise data from preset enterprise data by stratified sampling or random sampling method, wherein the multi-dimensional enterprise data includes human resources data, operating data and project data.
[0057] It is understandable that when training with data from a single dimension or field (such as Chinese medical text), the model focuses on learning the distribution and characteristics of a specific type of data. The advantage of this method is that the model can dig deep into the details of a specific field, but it may not perform well when faced with diversified data. In this embodiment, data including multiple dimensions are collected from real estate companies, such as human resources data, business operation data, and enterprise project data. For example, human resources data can be "Zhang San received a B rating in 2020, a B+ rating in 2021, and a B+ rating in 2022", business operation data can be "XX company's capital balance, cash flow, etc.", and enterprise project data can be "A project introduction, past cooperation projects, completion time, etc.".
[0058] It should be understood that the acquired original enterprise data can be cleaned by denoising, filling missing values, and unifying the format to reduce the interference of erroneous data on model training. For example, for missing values, the mean, median, or model-based prediction can be used to fill; for outliers, they can be identified and processed through box plot analysis or model-based methods. Since different data sources may use different formats, it is necessary to convert all data into a unified format, such as a unified date format (YYYY-MM-DD), numerical type, etc., for subsequent processing. In different data sources, the same entity may have different representations, so a mapping table needs to be established to associate the same entities in different data sources. For example, the "project ID" in the project data should correspond to the "contract ID" in the enterprise operation data. Due to the huge amount of data and high complexity, in order to reduce computing resources and improve the efficiency of model training, sampling methods such as stratified sampling and random sampling can be used to select representative multi-dimensional enterprise data subsets for training, which not only ensures the diversity of data, but also reduces the consumption of computing resources.
[0059] Step S20, constructing an initial knowledge graph based on the multi-dimensional enterprise data.
[0060] It is understandable that an initial knowledge graph can be constructed based on multi-dimensional enterprise data to assist in the training of question-answering models. The basic unit of the knowledge graph is a triple consisting of "entity-relationship-entity". An entity refers to something that is distinguishable and exists independently, and a relationship refers to the connection between entities.
[0061] Step S30, completing the missing values in the initial knowledge graph through the knowledge completion task of the preset pre-trained language model to obtain a knowledge graph.
[0062] It is understandable that pre-trained language models such as BERT can be used to perform knowledge completion tasks, infer missing information from the initial knowledge graph that may be missing, and predict missing entities or relations in the knowledge graph. For example, given an entity pair, the model can predict the most likely type of relationship between them, or predict the attribute value of an entity.
[0063] Step S40, performing supervised fine-tuning training on the preset AI big model according to the knowledge graph to obtain a trained AI big model.
[0064] It is understandable that the knowledge graph is used to supervise and fine-tune the preset AI model. Tuning during training is a complex process that requires comprehensive consideration of the characteristics of different data sources and business needs. Through reasonable weight distribution, effective data integration, flexible fine-tuning strategies, and evaluation and feedback, the performance of the question-answering model on multi-dimensional data can be effectively improved.
[0065] Step S50, pruning training is performed on the trained AI large model to obtain an enterprise question-answering model.
[0066] It is understandable that when multi-dimensional data is used to train the same model, the model needs to handle more complex data structures and associations, the training process is more complicated, and more computing resources and time are required. Therefore, the model can be pruned to reduce the size of the model and improve the training efficiency of the enterprise question-answering model.
[0067] In a feasible implementation, step S50 may include step S501:
[0068] Step S501, setting L1 regularization in the trained AI large model to perform sparse pruning training on parameters to obtain an enterprise question-answering model.
[0069] It should be understood that the size and computational requirements of the model can be reduced through techniques such as model pruning and quantization, thereby speeding up training and reducing resource consumption. Specifically, sparsity can be introduced directly during training, such as by using L1 regularization to perform sparsity pruning training on parameters, which encourages weights to converge to zero, thereby naturally producing small weights that can be pruned. In addition, after pruning, the model can be additionally fine-tuned to recover some of the performance lost due to pruning.
[0070] In this implementation, L1 regularization is used to perform parameter sparsity pruning to compress the model, thereby reducing the number of model parameters, lowering computational costs and storage requirements, while maintaining the question-answering performance of the model as much as possible.
[0071] This embodiment provides a question-answering model training method based on an AI big model, which selects multi-dimensional enterprise data such as human resources data, business data, and project data from preset enterprise data through a sampling method; constructs an initial knowledge graph based on the multi-dimensional enterprise data; completes the missing values in the initial knowledge graph through the knowledge completion task of a preset pre-trained language model; performs supervised fine-tuning training on the preset AI big model based on the knowledge graph, and performs pruning training on the trained AI big model to obtain an enterprise question-answering model. Since this embodiment selects multi-dimensional data from preset enterprise data through a sampling method, it is possible to select representative training data, thereby reducing computing resources while ensuring data diversity; constructs a knowledge graph based on multi-dimensional data and completes the knowledge graph, which can be used for model training; supervises fine-tuning and pruning training on the AI big model, thereby reducing data complexity and model scale while improving model training efficiency.
[0072] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 2 , step S20, the question-answering model training method based on the AI big model further includes steps S201 to S203:
[0073] Step S201 : performing named entity recognition on the multi-dimensional enterprise data to obtain multi-dimensional named entities.
[0074] It can be understood that named entity recognition (NER) is the process of identifying and classifying named entities (such as names, places, and organizations) in text. Named entity recognition can be performed on multi-dimensional enterprise data to obtain multi-dimensional named entities.
[0075] Step S202: extracting relations between the multi-dimensional named entities to obtain semantic relations between the multi-dimensional named entities.
[0076] It should be understood that relationship extraction is performed on multi-dimensional named entities, and the semantic connections between entities are identified and classified from the text, so as to obtain the semantic relationships between multi-dimensional named entities. For example, in the sentence "A project leader Zhang San", the relationship (A project, leader, Zhang San) can be extracted. In a project data, determining the roles and responsibilities of each participant requires understanding the specific content and organizational structure of the project. In addition, implicit relationships (such as colleague relationships and capital flows) also need to be derived through reasoning. Pre-trained language models such as BERT can be used to capture complex semantic information between entities. By fine-tuning these models, the accuracy of relationship extraction can be effectively improved. Specifically, entity pairs and sentences are taken as input, and the model is used to predict the type of relationship between them.
[0077] Step S203, constructing an initial knowledge graph based on the multi-dimensional named entities and the semantic relationships.
[0078] After obtaining multi-dimensional named entities and semantic relationships through named entity recognition and relationship extraction, the initial knowledge graph is constructed. In the process of building and using the knowledge graph, a large amount of sensitive information may be involved, such as employee personal information, financial status, and corporate strategy. While using this data, personal privacy can be protected and relevant regulations can be met through encryption, such as encryption, access control, and log auditing.
[0079] In a feasible implementation, step S203 may include steps S2031 to S2034:
[0080] Step S2031, modularize the multi-dimensional named entities and the semantic relationships to obtain a modular knowledge graph.
[0081] It should be noted that enterprise data is not static but constantly changing. New human resources data, project progress and business conditions are constantly generated, and the knowledge graph needs to be updated in real time to reflect these changes. This requires the construction of an efficient data pipeline that can process new data in a timely manner and integrate it into the existing knowledge structure. In addition, as corporate strategies are adjusted and the market environment changes, the structure and content of the knowledge graph may need to be adjusted accordingly. For example, when a company enters a new market or launches a new product line, it needs to add relevant entities and relationships to the graph. This requires the graph to have good scalability and flexibility.
[0082] It should be understood that in order to build a knowledge graph with good scalability and flexibility, multiple levels of design can be considered. The ontology can be designed to be modular, and multi-dimensional named entities and semantic relationships can be processed modularly. Each module is responsible for a sub-field, so that it can be expanded independently without affecting other parts.
[0083] Step S2032, determine the inheritance relationship between entities in each module of the modular knowledge graph, and construct superclasses and subclasses according to the inheritance relationship between the entities to obtain a hierarchical knowledge graph.
[0084] It is understandable that a clear hierarchical structure can also be established, using superclasses and subclasses to represent the inheritance relationship of entities, which helps to quickly classify and locate new entities. Specifically, the inheritance relationship between entities in each module of the modular knowledge graph is determined, and superclasses and subclasses are constructed according to the inheritance relationship between entities to obtain a hierarchical knowledge graph.
[0085] Step S2033, setting a data loading and updating mechanism in the hierarchical knowledge graph.
[0086] It should be understood that the data loading and updating mechanism can also be designed to support incremental updates, so that new entities and relationships can be added to the existing graph in real time without rebuilding the entire graph.
[0087] Step S2034, setting a logical reasoning engine in the hierarchical knowledge graph to obtain an initial knowledge graph.
[0088] It is understandable that logical reasoning engines (such as Pellet, HermiT, etc.) can also be used to infer implicit relationships and enhance the richness of the graph. Online or regular reasoning updates are implemented to reflect the impact of newly added entities and relationships.
[0089] In this implementation, by modular processing, hierarchical processing, setting up data loading, updating mechanisms and logical reasoning engines, it is possible to build a knowledge graph with good scalability and flexibility, so that the structure and content of the knowledge graph can be adjusted accordingly as the corporate strategy adjusts and the market environment changes.
[0090] In this embodiment, multi-dimensional named entities are obtained by performing named entity recognition on multi-dimensional enterprise data; relationship extraction is performed on multi-dimensional named entities to obtain semantic relationships between multi-dimensional named entities; and an initial knowledge graph is constructed based on multi-dimensional named entities and semantic relationships. Since this embodiment accurately identifies entities and relationships between entities in multi-dimensional data by performing named entity recognition and relationship extraction on multi-dimensional enterprise data, a more accurate knowledge graph can be constructed through multi-dimensional data.
[0091] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. Figure 3 , step S40, the question-answering model training method based on the AI big model further includes steps S401 to S403:
[0092] Step S401, evaluate the importance of the knowledge graph in each dimension according to business needs and data quality, and set a weight value for each dimension according to the importance, the dimensions including human dimension, business dimension and project dimension.
[0093] It is understandable that when multi-dimensional data is used to train the same model, tuning is more complicated, and it is necessary to consider the weights and integration methods of data sources of different dimensions, including human, operational, and project dimensions. The importance of the knowledge graph in each dimension can be evaluated according to business needs and data quality, and the weight value can be set according to the importance. At first, it can be assumed that data sources of all dimensions are equally important and give them the same weight. Then the weights of different data sources can be manually set according to business needs and domain knowledge. For example, if operational data is more critical to the question-and-answer task, it can be given a higher weight. Weights can also be set based on data quality assessments. For example, weights can be adjusted based on the accuracy and reliability of the data. More accurate data sources should receive higher weights. The coverage and representativeness of the data can also be considered. If a data source contains a wider range of information, its weight can be appropriately increased.
[0094] Step S402: Perform supervised fine-tuning training on the preset AI large model according to the knowledge graph and the weight value in each dimension to obtain the performance in each dimension.
[0095] Step S403: dynamically adjust the weight value according to the performance in each dimension, and iteratively train the preset AI big model according to the dynamically adjusted weight value to obtain the trained AI big model.
[0096] It is understandable that in the process of supervised fine-tuning the preset AI large model based on the knowledge graph and the weight values on each dimension, their weights can be dynamically adjusted according to the performance of the model on each data source. If the model performs poorly on a certain data source, the weight of the data source can be appropriately increased. You can also use a phased fine-tuning strategy for fine-tuning training, first fine-tuning on a single-dimensional data source, and then gradually introducing data sources of other dimensions for iterative training, which can help the model learn the characteristics of different data sources more stably.
[0097] In another feasible implementation, step S40 may further include steps S404 to S406:
[0098] Step S404, defining a loss function on each dimension of the knowledge graph, and determining the loss on each dimension according to the loss function, wherein the dimensions include a human dimension, an operation dimension, and a project dimension.
[0099] It should be understood that when performing supervised fine-tuning training on multi-dimensional data, it is crucial to design a loss function that comprehensively considers different data sources. Such a loss function can include different components such as cross entropy loss and contrast loss to optimize the performance of the model on these data. At the same time, setting different weights for the losses of different data sources is also a key strategy to balance their contributions to the total loss.
[0100] Step S405, adding the losses on each dimension according to the preset weights to obtain the total loss.
[0101] Step S406: dynamically adjust the weight corresponding to the loss in each dimension according to the total loss, and iteratively train the preset AI big model according to the dynamically adjusted weight to obtain the trained AI big model.
[0102] It should be understood that the losses of data sources of different dimensions can be added together according to certain weights to form a total loss. This method is simple and intuitive, and requires careful adjustment of weights to ensure the balance of each loss. The weights of each loss are then dynamically adjusted based on the performance of the model on the validation set. If a data source of a certain dimension causes performance degradation, its weight should be reduced. This can be achieved through methods such as loop iteration or Bayesian optimization.
[0103] In this embodiment, by defining loss functions separately in multiple dimensions, weighted summation is performed according to the loss in each dimension to obtain the total loss. This method is simpler and more intuitive, so that the weight in each dimension can be adjusted to ensure the balance of each loss and obtain a large model with better performance.
[0104] In this embodiment, when using multi-dimensional data such as human resources data, business data, and project data to supervise fine-tune the question-answering model, the complexity of tuning needs to be faced. The diversity and heterogeneity of these data bring special challenges. By evaluating the importance of the knowledge graph in each dimension and setting the weight value, supervised fine-tuning training is performed according to the weight value in each dimension to obtain the performance of the model in each dimension, and then dynamically adjust the weight value according to the performance, so that the model can be trained more accurately in each dimension.
[0105] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the question-answering model training method based on the AI big model of the present application. More forms of simple transformations based on this technical concept are all within the scope of protection of the present application.
[0106] This application also provides a question-answering model training device based on an AI large model, please refer to Figure 4 , the question-answering model training device based on the AI big model includes:
[0107] A data selection module 10 is used to select multi-dimensional enterprise data from preset enterprise data by stratified sampling or random sampling method, wherein the multi-dimensional enterprise data includes human resources data, business data and project data;
[0108] A knowledge graph construction module 20, used to construct an initial knowledge graph according to the multi-dimensional enterprise data;
[0109] A knowledge graph completion module 30, used to complete the missing values in the initial knowledge graph through the knowledge completion task of a preset pre-trained language model to obtain a knowledge graph;
[0110] A supervised fine-tuning training module 40 is used to perform supervised fine-tuning training on a preset AI big model according to the knowledge graph to obtain a trained AI big model;
[0111] The pruning training module 50 is used to perform pruning training on the trained AI large model to obtain an enterprise question-answering model.
[0112] The question-answering model training device based on the AI big model provided in this application adopts the question-answering model training method based on the AI big model in the above embodiment, which can solve the technical problem. Compared with the prior art, the beneficial effects of the question-answering model training device based on the AI big model provided in this application are the same as the beneficial effects of the question-answering model training method based on the AI big model provided in the above embodiment, and the other technical features in the question-answering model training device based on the AI big model are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0113] The present application provides a question-answering model training device based on an AI big model, and the question-answering model training device based on an AI big model includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the question-answering model training method based on the AI big model in the above-mentioned embodiment one.
[0114] Reference below Figure 5, which shows a schematic diagram of the structure of a question-answering model training device based on an AI big model suitable for implementing an embodiment of the present application. The question-answering model training device based on an AI big model in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The question-and-answer model training device based on the AI big model shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0115] like Figure 5 As shown, the question-answering model training device based on the AI large model may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the question-answering model training device based on the AI large model are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other via a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the AI large model-based question-answering model training device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows an AI large model-based question-answering model training device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or provided alternatively.
[0116] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0117] The question-answering model training device based on the AI big model provided in this application adopts the question-answering model training method based on the AI big model in the above-mentioned embodiment, which can solve the technical problems of question-answering model training based on the AI big model. Compared with the prior art, the beneficial effects of the question-answering model training device based on the AI big model provided in this application are the same as the beneficial effects of the question-answering model training method based on the AI big model provided in the above-mentioned embodiment, and the other technical features in the question-answering model training device based on the AI big model are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0118] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0119] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0120] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the question-and-answer model training method based on the AI big model in the above-mentioned embodiment.
[0121] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0122] The above-mentioned computer-readable storage medium may be included in the question-answering model training device based on the AI big model; or it may exist independently without being assembled into the question-answering model training device based on the AI big model.
[0123] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the question-answering model training device based on the AI big model, the question-answering model training device based on the AI big model: selects multi-dimensional enterprise data from the preset enterprise data through stratified sampling or random sampling methods, and the multi-dimensional enterprise data includes human data, business data and project data; constructs an initial knowledge graph based on the multi-dimensional enterprise data; completes the missing values in the initial knowledge graph through the knowledge completion task of the preset pre-trained language model to obtain a knowledge graph; performs supervised fine-tuning training on the preset AI big model according to the knowledge graph to obtain the trained AI big model; performs pruning training on the trained AI big model to obtain an enterprise question-answering model.
[0124] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0125] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0126] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0127] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned question-answering model training method based on the AI large model, and can solve technical problems. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the question-answering model training method based on the AI large model provided in the above-mentioned embodiment, and will not be repeated here.
[0128] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned question-answering model training method based on the AI big model.
[0129] The computer program product provided in this application can solve technical problems. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the question-answering model training method based on the AI big model provided in the above embodiment, which will not be repeated here.
[0130] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A question-answering model training method based on an AI big model, characterized in that: The method includes: Selecting multi-dimensional enterprise data from preset enterprise data by stratified sampling or random sampling method, wherein the multi-dimensional enterprise data includes human resources data, operation data and project data; Constructing an initial knowledge graph based on the multi-dimensional enterprise data; Completing the missing values in the initial knowledge graph through the knowledge completion task of the preset pre-trained language model to obtain a knowledge graph; Perform supervised fine-tuning training on the preset AI big model according to the knowledge graph to obtain a trained AI big model; The trained AI large model is pruned to obtain an enterprise question-answering model.
2. The method according to claim 1, characterized in that The step of constructing an initial knowledge graph based on the multi-dimensional enterprise data includes: Performing named entity recognition on the multi-dimensional enterprise data to obtain multi-dimensional named entities; Performing relationship extraction on the multi-dimensional named entities to obtain semantic relationships between the multi-dimensional named entities; An initial knowledge graph is constructed based on the multi-dimensional named entities and the semantic relationships.
3. The method according to claim 2, characterized in that The step of constructing an initial knowledge graph according to the multi-dimensional named entities and the semantic relationships comprises: Modularize the multi-dimensional named entities and the semantic relationships to obtain a modular knowledge graph; Determine the inheritance relationship between entities in each module of the modular knowledge graph, and construct superclasses and subclasses according to the inheritance relationship between the entities to obtain a hierarchical knowledge graph; Setting up a data loading and updating mechanism in the hierarchical knowledge graph; A logical reasoning engine is set in the hierarchical knowledge graph to obtain an initial knowledge graph.
4. The method according to claim 1, characterized in that The step of performing supervised fine-tuning training on the preset AI big model according to the knowledge graph to obtain the trained AI big model includes: Evaluate the importance of each dimension of the knowledge graph according to business needs and data quality, and set a weight value for each dimension according to the importance, wherein the dimensions include a human dimension, an operating dimension, and a project dimension; Perform supervised fine-tuning training on the preset AI large model according to the knowledge graph and the weight value in each dimension to obtain the performance in each dimension; The weight values are dynamically adjusted according to the performance in each dimension, and the preset AI big model is iteratively trained according to the dynamically adjusted weight values to obtain the trained AI big model.
5. The method according to claim 1, characterized in that The step of performing supervised fine-tuning training on the preset AI big model according to the knowledge graph to obtain the trained AI big model includes: A loss function is defined on each dimension of the knowledge graph, and the loss on each dimension is determined according to the loss function, wherein the dimensions include a human dimension, an operation dimension, and a project dimension; Add the losses on each dimension according to the preset weights to get the total loss; The weight corresponding to the loss in each dimension is dynamically adjusted according to the total loss, and the preset AI big model is iteratively trained according to the dynamically adjusted weight to obtain the trained AI big model.
6. The method according to claim 1, characterized in that The step of pruning the trained AI large model to obtain the enterprise question-answering model includes: In the trained AI large model, L1 regularization is set to perform sparse pruning training on the parameters to obtain an enterprise question-answering model.
7. A question-answering model training device based on an AI large model, characterized in that: The question-answering model training device based on the AI big model includes: A data selection module, used to select multi-dimensional enterprise data from preset enterprise data by stratified sampling or random sampling method, wherein the multi-dimensional enterprise data includes human resources data, business data and project data; A knowledge graph construction module, used to construct an initial knowledge graph based on the multi-dimensional enterprise data; A knowledge graph completion module is used to complete the missing values in the initial knowledge graph through the knowledge completion task of a preset pre-trained language model to obtain a knowledge graph; A supervised fine-tuning training module is used to perform supervised fine-tuning training on a preset AI big model according to the knowledge graph to obtain a trained AI big model; The pruning training module is used to perform pruning training on the trained AI large model to obtain an enterprise question-answering model.
8. A question-answering model training device based on an AI large model, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the AI big model-based question-answering model training method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the question-answering model training method based on the AI big model are implemented as described in any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product includes a computer program, which, when executed by a processor, implements the steps of the question-answering model training method based on an AI big model as described in any one of claims 1 to 6.
