Question-answer interaction method, device and medium
By building a domain knowledge graph and multi-agent conference mechanism, the problem of large models performing poorly in specific fields is solved, the professionalism and accuracy of the model are improved, and its effectiveness and reliability in practical applications are enhanced.
Patent Information
- Application Number
- CN202410912266.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-07-09
AI Technical Summary
The use of unstructured data during training of existing large models causes the generated content to be inconsistent with the facts, affecting their performance and credibility in a specific field.
By constructing a domain knowledge graph, freeze some parameters for preliminary training, and then gradually thaw the key parameters, combining the multi-agent conference mechanism and background knowledge processing, the professionalism and accuracy of the model in a specific field are enhanced.
It significantly improves the expressiveness and accuracy of the large model in specific fields, improves its effectiveness and reliability in actual applications, and ensures the flexibility of the model and its knowledge iteration capabilities.
Smart Images

Figure CN118469021B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of large models, and specifically provides a question-answering interaction method, device and medium. Background Art
[0002] With the development of AI technology, large models are increasingly widely used and valued.
[0003] However, in the existing large model training, the training corpus uses a large amount of unstructured data, but unstructured data often causes the model to generate content that is inconsistent with the facts during the training process, that is, to produce "hallucinations". These hallucinations seriously affect the performance of large models in practical applications and reduce their effectiveness and credibility in specific fields.
[0004] Accordingly, this field needs a new large model training solution to solve the above problems. Summary of the invention
[0005] In order to overcome the above-mentioned defects, the present invention is proposed to provide a solution or at least partially solve the technical problem in the prior art that unstructured corpus affects the credibility of large models.
[0006] In a first aspect, the present invention provides a question-answering interaction method, comprising: obtaining user request information, and obtaining return information based on a second large model trained by a large model training method, an intelligent agent corresponding to the second large model, and request information; the intelligent agent returns the return information to the user; the second large model trained by the large model training method, the intelligent agent corresponding to the second large model, and the request information, and obtaining the return information includes: the intelligent agent determines whether the trained second large model is insufficient to complete the task request alone based on the request information; in response to determining that the trained second large model is insufficient to complete the task request alone, sending a request to the corresponding second domain. The method comprises the steps of: obtaining relevant information from a knowledge graph of the second field and the knowledge graph corresponding to the first field, wherein the knowledge graph corresponding to the second field and the knowledge graph corresponding to the first field are knowledge graphs of different fields, and the knowledge graph corresponding to the second field and at least part of the information in the request information belong to the same field; inputting the relevant information and the request information into the trained second large model to obtain return information; the second large model trained based on the large model training method, the intelligent agent corresponding to the second large model and the request information, and obtaining the return information includes: in response to the intelligent agent judging that the trained second large model is not sufficient to complete the task request alone based on the request information, the intelligent agent and at least one other An intelligent agent forms a meeting, wherein the second largest model corresponding to different intelligent agents is constructed based on knowledge graphs in different fields; sending at least the request information to the intelligent agents in the meeting, and obtaining return information based on the feedback results of the intelligent agents in the meeting, wherein the feedback results of the intelligent agents are obtained based on at least the trained second largest model corresponding to the intelligent agents; the meeting includes at least three intelligent agents, one of which is a coordinating intelligent agent, wherein the coordinating intelligent agent is used for the regulation of the meeting, and the method further includes: obtaining background knowledge corresponding to the request information, including historical data of the relevant field, previous case studies, relevant literature or information in the database; sending at least the request information The method includes: sending the background knowledge and the request information to the intelligent agent in the meeting, and providing context information for the intelligent agent; wherein the large model training method includes: obtaining first domain data; constructing a knowledge graph corresponding to the first domain based on the first domain data; performing a first training on the large model based on the knowledge graph corresponding to the first domain to obtain a first large model, wherein during the first training, some parameters of the first large model are frozen; performing a second training on the first large model based on the knowledge graph corresponding to the first domain to obtain a trained second large model, wherein during the second training, at least some parameters of the frozen parameters are unfrozen;The second training is divided into a plurality of stages for training, wherein "unfreezing at least some of the frozen parameters" is performed during at least some of the stages for training, and no new training corpus is added to the stage for "unfreezing at least some of the frozen parameters" compared to the training of the previous stage. ;
[0007] As an alternative or supplement to the above scheme, in a method according to an embodiment of the present invention, the construction of a knowledge graph corresponding to the first domain based on the first domain data includes: preprocessing the first domain data to obtain preprocessed first domain data; performing entity classification and attribute extraction on the preprocessed first domain data to obtain entity categories and attributes; analyzing different entity categories to obtain the relationship between different entity categories; and constructing a structured knowledge graph corresponding to the first domain based on entity categories, attributes, and the relationship between different entity categories.
[0008] As an alternative or supplement to the above solution, in a method according to an embodiment of the present invention, when the second training is performed, at least part of the frozen parameters are unfrozen, including: the second training is divided into a plurality of stages that are performed sequentially; when at least part of the plurality of stages are trained, "unfreezing at least part of the frozen parameters" is performed. When the stages are trained sequentially along the time sequence, at least part of the frozen parameters are gradually unfrozen until the first large model meets the preset conditions, and then the parameter unfreezing is stopped.
[0009] As an alternative or supplement to the above scheme, in a method according to an embodiment of the present invention, the stage of "unfreezing at least part of the frozen parameters" does not add new training corpus compared to the training in the adjacent previous stage, wherein the training corpus is obtained based on the knowledge graph corresponding to the first field.
[0010] In a second aspect, a control device is provided, which includes a processor and a storage device, wherein the storage device is suitable for storing multiple computer programs, and the computer programs are suitable for being loaded and run by the processor to execute the large model training method described in any one of the technical solutions of the above-mentioned large model training method.
[0011] In a third aspect, a computer-readable storage medium is provided, which stores a plurality of computer programs, wherein the computer programs are suitable for being loaded and run by a processor to execute the large model training method described in any one of the technical solutions of the above-mentioned large model training method.
[0012] The above one or more technical solutions of the present invention have at least one or more of the following beneficial effects:
[0013] In the technical solution of the present invention, a knowledge graph corresponding to the first field is constructed by structuring the data of the first field, and the large model is trained by converting it into structured data, thereby improving the professionalism and accuracy of the large model. The knowledge graph is used and more than half of the parameters are frozen in the first training, which retains the original general processing ability of the model and also enhances the absorption of specific knowledge in the first field by the large model. After that, the key parameters are gradually unfrozen to make the large model deeply adaptable to complex needs. This method significantly enhances the expressiveness and accuracy of the model in a specific field, greatly improves its effectiveness and reliability in practical applications, and ensures the flexibility of model updates and knowledge iterations. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The disclosure of the present invention will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present invention. In addition, similar numbers in the figures are used to represent similar components, among which:
[0015] Figure 1 is a flowchart of the main steps of a large model training method according to an embodiment of the present invention;
[0016] Figure 2 is a schematic flow chart of steps for constructing a knowledge graph corresponding to a first domain according to a large model training method according to an embodiment of the present invention;
[0017] Figure 3 is a flowchart of main steps of a question-answering interactive method according to an embodiment of the present invention;
[0018] Figure 4 is a flowchart of the secondary steps of the question-answering interactive method according to an embodiment of the present invention;
[0019] Figure 5 It is a flowchart of large model construction and application according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] Some embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0021] In the description of the present invention, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, and memories, and may also include software parts, such as computer programs, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware, or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store computer programs, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B", and may include only A, only B, or A and B. The singular terms "one" and "the" may also include plural forms.
[0022] Embodiment 1:
[0023] See attached Figure 1 , Figure 1 FIG. 1 is a flow chart of the main steps of a large model training method according to an embodiment of the present invention. Figure 1 and Figure 5 As shown, the large model training method in the embodiment of the present invention mainly includes the following steps S10 to S40.
[0024] Step S10: Acquire first domain data.
[0025] In this embodiment, the first domain data refers to an original data set from a first domain, wherein the first domain is a specific domain and also a preset domain, such as astronomy and medicine.
[0026] In one embodiment, the first domain data refers to an original data set from a specific field. For example, when the first domain is the medical field, the first domain data may include but is not limited to patient medical records, clinical trial results, drug response data, and medical research publications.
[0027] In one embodiment, the technology used in the process of obtaining the first field data may include crawler technology or other technologies such as API calls. The above technologies can be optimized for different data sources and formats to ensure the quality and availability of the data.
[0028] Among them, in this embodiment, the crawler technology automatically captures data from network resources such as online medical databases and research forums. The crawler technology can extract a large amount of structured and unstructured data from public web pages.
[0029] In this embodiment, API calls refer to obtaining data from various online services and databases, such as obtaining data from medical and health applications and clinical databases. Through the API call method, real-time updated data can be obtained, such as the latest changes in the drug database or real-time statistics of disease outbreaks.
[0030] In this embodiment, by integrating automated data collection and processing technology, rapid and efficient collection of medical field data is achieved. By obtaining the first field data, it is ensured that the construction of the knowledge graph can accurately reflect the actual application and needs of the first field, which is helpful for the subsequent training of the large model.
[0031] Step S20: construct a knowledge graph corresponding to the first field based on the first field data.
[0032] In one implementation, step S20 includes steps S201-S204, and steps S201-S204 are used to construct a knowledge graph corresponding to the first field, such as Figure 2 As shown, the details are as follows:
[0033] Step S201: preprocess the first domain data to obtain preprocessed first domain data.
[0034] In one implementation, the preprocessed first domain data is preprocessed first domain data, and the preprocessing includes: data cleaning, unified data format, and language processing.
[0035] In this embodiment, data cleaning mainly refers to removing invalid, erroneous or incomplete data from the first field data, thereby ensuring the accuracy of the data. In data cleaning, techniques such as missing value processing, outlier detection and removal of duplicate records can be applied to improve the reliability of data and the effectiveness of analysis.
[0036] In this embodiment, the unified data format can further ensure the consistency of the data in the first field. For example, when the first field is the medical field, different information systems may record the same information in different formats, such as dates and times may exist in multiple formats, and numbers may differ due to different units. Unifying these data formats is a prerequisite for ensuring that the data can be correctly parsed and processed, thereby supporting efficient data integration and analysis. For example, unifying all dates into a standard format (YYYY-MM-DD) can simplify subsequent time series analysis and event sorting.
[0037] In this embodiment, language processing mainly processes unstructured text data. In one embodiment, language processing can use natural language processing (NLP) technology, such as word segmentation, part-of-speech tagging, named entity recognition, etc. For example, by performing word segmentation and part-of-speech tagging on clinical notes, key information such as diseases, symptoms, and treatment methods can be effectively identified.
[0038] In this step, by comprehensively applying preprocessing techniques such as data cleaning, unified format and language processing technology, the data quality is improved, the consistency of the data is enhanced, and the amount of data information is enriched. The preprocessed first domain data can not only reduce errors in subsequent knowledge graph construction and model training, but also improve the accuracy and depth of data analysis, ensuring that the training effect of the large model is more in line with actual application needs.
[0039] Step S202: performing entity classification and attribute identification on the pre-processed first domain data to obtain entity categories and attributes.
[0040] In one embodiment, entity classification is to divide the key information segments in the first domain data into predefined categories, such as "disease", "symptom", "drug" and "treatment method" in the medical field. Attribute recognition is to determine the relevant attributes of these entities, for example, a drug includes its manufacturer, etc.
[0041] In one embodiment, entity classification and attribute recognition are achieved by using a large language model (LLM), such as GPT-4, to achieve more accurate and efficient data processing.
[0042] In this embodiment, entity classification is to input the first domain data into a large language model to automatically identify and classify specific entities from the text into predefined categories. The traditional approach relies on a lot of manual feature engineering and rule writing, but using a large language model based on Transformers, such as GPT-4, it is possible to learn how to identify and classify entities directly from large-scale text data. These models take advantage of deep learning, can capture subtle patterns in language, and perform effective entity recognition without explicit rules.
[0043] In this embodiment, the attribute recognition work is performed using a large language model. For example, through the first domain data, the large language model can identify the attributes of "aspirin", such as its use and potential side effects. In this process, the large language model not only considers the entity itself, but also analyzes the information in the context. In this embodiment, the same large language model can identify the entity category and its attributes separately by setting the prompt word.
[0044] In this step, by using the large language model to automatically process the first domain data, the efficiency of data preprocessing and the output quality can be significantly improved. In this way, not only the entity categories and attributes of the first domain data are extracted, but also the unstructured data is refined and converted into structured data, which is helpful for the subsequent construction of the first domain knowledge graph.
[0045] Step S203: Analyze different entity categories to obtain the relationships between different entity categories.
[0046] In one embodiment, the relationship between entity categories is analyzed by a large language model, and the deep learning capability of the large language model is used to automatically identify various potential connections between entities from complex data sets using appropriate prompt words.
[0047] For example, in the medical field, large language models can identify the relationship between diseases and symptoms, the interaction between drugs and treatment responses, and the dependencies between treatment methods. By analyzing large amounts of text data, large language models can not only capture obvious entity relationships, such as "treatment-disease", but also reveal more complex indirect relationships, such as linking different disease states through common biomarkers.
[0048] In this step, scattered and unrelated data are linked through precise relationship mapping, thereby enhancing the information value and application potential of the final knowledge graph.
[0049] Step S204: Construct a structured knowledge graph corresponding to the first domain based on entity categories, attributes, and relationships between different entity categories.
[0050] In one implementation, entity categories, attributes, and relationships between different entity categories are all vectorized. Then, a knowledge graph corresponding to the first domain is constructed with entity categories as nodes and relationships between different entity categories as edges. In the knowledge graph of the first domain, entity categories all have corresponding attributes. The constructed knowledge graph of the first domain is then stored in a storage system.
[0051] The knowledge graph corresponding to the first field is composed of entity categories, attributes, and different entity categories. Therefore, it has a high degree of information retrievability, which enables it to effectively support complex query and data analysis tasks. It is conducive to the training of subsequent models and query when needed.
[0052] Step S30: Perform a first training on the large model based on the knowledge graph corresponding to the first field to obtain a first large model.
[0053] In this embodiment, when the first training is performed, some parameters of the first large model are frozen.
[0054] In one embodiment, a training corpus is first constructed based on the knowledge graph corresponding to the first field. The purpose of constructing the training corpus is to use the rich information in the knowledge graph to generate effective data sets, which will be used to train and optimize the performance of the large model. In one embodiment, a method for constructing a training corpus from a knowledge graph corresponding to the first field is given, as follows:
[0055] First, obtain a series of question templates, which are predefined based on common query patterns in the field. The templates are designed to cover a variety of question types from basic definitions to complex relationships to ensure the comprehensiveness of model training. Question templates are predefined question frameworks, such as:
[0056] “What are the common symptoms of [X]?”
[0057] “What medication should [X] be treated with?”
[0058] “What is the relationship between [X] and [Y]?”
[0059] Here [X] and [Y] are placeholders that will be filled by entity categories, attributes, or relationships between different entity categories.
[0060] Then, entity categories, attributes, or relationships between different entity categories are extracted from the knowledge graph corresponding to the first domain to fill in the question template. In this step, entity categories, attributes, or relationships between different entity categories are used to dynamically generate specific question-answer pairs, which directly reflect the data structure and logical relationship in the knowledge graph corresponding to the first domain.
[0061] Finally, the generated question-answer pairs are manually reviewed or verified by an expert system to ensure the accuracy and applicability of the content. Thus, the training corpus is established.
[0062] In one implementation, a large model GLM-13B is taken as an example as the base model for description.
[0063] In one embodiment, the large model is first trained using the training corpus. The main purpose of this training step is to adjust and optimize the large model so that it can deepen its understanding of the first domain without losing its original capabilities.
[0064] In one embodiment, this step of training is performed by adding a low-rank matrix to the weight matrix of the large model to perform parameter updates. In this way, the number of additional training parameters is reduced, thereby saving computing resources and reducing training time.
[0065] In this embodiment, during the first training, some parameters are frozen. Preferably, more than half of the parameters are frozen. In this embodiment, the frozen parameters will not change during the training of the large model. Preferably, in one embodiment, during the first training, the parameters of the pre-test layer structure of the large model are not frozen.
[0066] In this embodiment, in order to prevent the model from overfitting during the training process, regularization technology is used. Regularization technology prevents the model from overfitting the training data by randomly "discarding" some nodes in the neural network during the training process. In addition, weight decay and early stopping can also be used in combination as other regularization methods to ensure the stability of the training process and the generalization ability of the model. Weight decay controls the complexity of the model by imposing a small penalty on the weights of large models, while early stopping stops training when the performance on the validation set no longer improves to avoid meaningless iterations.
[0067] In this embodiment, by freezing parameters, the performance of the large model in the first domain is optimized while protecting the effect of its original learning results. In addition, this training strategy increases the adaptability of the model to the data in the first domain, enabling it to provide more accurate and effective solutions in practical applications, greatly improving the practical value and response speed of the model in a specific domain.
[0068] Step S40: Perform a second training on the first large model based on the knowledge graph corresponding to the first field to obtain a trained second large model.
[0069] In this embodiment, when the second training is performed, at least part of the frozen parameters are unfrozen.
[0070] In one embodiment, the second training is started based on the learning effect of the large model. In one embodiment, when the learning effect of the large model in the first training is almost not improved, the second training is started.
[0071] In one embodiment, the second training is divided into a plurality of stages that are performed sequentially, wherein "unfreezing at least part of the frozen parameters" is performed during at least part of the stages.
[0072] In one implementation, the ultimate goal of the second training is to complete the training of the second largest model and obtain a model with ideal effects.
[0073] In this embodiment, a phased approach is used for training. The corpus used in each phase of training remains unchanged, and the parameters of the large model remain unchanged in each phase. In each phase, the performance of the model is evaluated, and the next training plan is determined based on the evaluation results. For example, if it is found that the model performs poorly on a specific task at a certain stage, at least some of the frozen parameters can be unfrozen to increase the learning depth of the model in these areas.
[0074] In this embodiment, when performing the stage of "unfreezing at least part of the frozen parameters", no new training corpus is added compared to the training in the previous adjacent stage. This step is to avoid the influence of unnecessary factors that affect the judgment when training at different stages. The learning progress of the large model is affected by both the corpus and the frozen parameters. Therefore, at a certain stage, when at least part of the frozen parameters are unfrozen, if new training corpus is added at the same time, it is not easy to distinguish who is working. Therefore, not adding new training corpus at this time can help determine which part of the large model training is working again.
[0075] Furthermore, when training is performed sequentially at different stages, at least part of the frozen parameters are gradually unfrozen until the first large model meets the preset conditions, and then parameter unfreezing is stopped.
[0076] In this embodiment, when the first large model meets the preset conditions, the model training can be considered to be completed. The preset conditions are conditions for judging whether the first large model has been trained. This can be done through an accuracy threshold and an F1 score threshold.
[0077] Embodiment 2:
[0078] In this embodiment, a question-answering interaction method is also proposed. The question-answering interaction method includes steps S50-S70. Figure 3 As shown, the details are as follows:
[0079] Step S50: Obtain request information from the user.
[0080] In one implementation, the request information is sent to the agent, which is responsible for receiving the user's request information. In this implementation, the trained second largest model serves as the "brain" of the agent.
[0081] In one embodiment, the request information is sent by the user, and the request information is usually for seeking a reliable response, that is, hoping that the intelligent agent can give a satisfactory answer to the user's question. In this embodiment, the intelligent agent and the trained second largest model are combined to give a corresponding response to the user.
[0082] Step S60: Based on the intelligent agent, the trained second largest model and the request information, return information is obtained.
[0083] In this embodiment, the trained second largest model refers to the trained second largest model obtained in Example 1.
[0084] In one implementation, the returned information is obtained through steps S601-S603, as follows:
[0085] Step S601: The agent determines, based on the request information, whether the trained second largest model is insufficient to complete the task request alone.
[0086] In one embodiment, the brain of the intelligent agent is the trained second largest model. The intelligent agent first packages the request information and the connected prompt words and sends them to the trained second largest model to analyze whether the trained second largest model can complete the task request corresponding to the request information alone.
[0087] Step S602: In response to determining that the trained second largest model is not sufficient to complete the task request alone, relevant information is obtained from the knowledge graph corresponding to the second domain.
[0088] In this embodiment, the knowledge graph corresponding to the second field and the knowledge graph corresponding to the first field are knowledge graphs of different fields, and the knowledge graph corresponding to the second field and at least part of the information in the request information belong to the same field.
[0089] In one embodiment, when it is determined that the trained second largest model is not sufficient to complete the task request alone, the intelligent body will obtain relevant information from the knowledge graph corresponding to the second field. The knowledge graph of the second field belongs to the same field as part of the information in the request information. For example, when the first field is the medical field, and the request information is "what is a neutron star". The judgment result at this time may be that the second largest model is not sufficient to complete the requested task alone, because the second largest model is trained based on the knowledge graph corresponding to the first field, and is not proficient in the field of astronomy. At this time, the intelligent body will look for the knowledge graph corresponding to the second field, where the second field is related to astronomy, and obtain relevant information from the knowledge graph corresponding to the second field by retrieval.
[0090] Since in this embodiment, the knowledge graph of the second field is constructed in the same way as the knowledge graph of the first field, it is beneficial to obtain relevant content of the knowledge graph of the second field, that is, related information, by requesting information.
[0091] Step S603: input the relevant information and the request information into the trained second largest model to obtain return information.
[0092] In one embodiment, the agent integrates the relevant information provided by the second domain knowledge graph with the request information and inputs it into the trained second largest model to obtain the return information. In this way, the answer to the field that the trained second largest model is not good at can be output.
[0093] Step S70: The agent returns the return information to the user.
[0094] Embodiment 3:
[0095] Most of the techniques in this embodiment are the same as those in Embodiment 2, except that there are multiple agents in this embodiment. Other than that, the remaining techniques are the same as those in Embodiment 2, and will not be described in detail here.
[0096] In this embodiment, the interaction of multiple intelligent agents is also involved, and the second largest model corresponding to the different intelligent agents is constructed by domain knowledge graphs of different fields.
[0097] The agent is best at handling transactions in its field, so the agent itself has certain intelligent characteristics. In Example 2, the defect of the second largest model being too specialized is compensated by retrieving relevant information from the knowledge graph corresponding to the second field. However, the returned information obtained in this way still has certain defects, that is, when the requested information spans multiple fields, the effectiveness of the returned information will be discounted.
[0098] In one embodiment, step S60 includes steps S604-S605, such as Figure 4 As shown, the details are as follows:
[0099] Step S604: In response to the agent determining, based on the request information, that the trained second largest model is insufficient to complete the task request alone, a meeting is formed by the agent and at least one other agent.
[0100] In one embodiment, in response to the intelligent agent determining based on the request information that the trained second largest model is not sufficient to complete the task request alone, this determination is the same as in Example 2 and will not be repeated here.
[0101] In this embodiment, when it is determined that the trained second largest model is not sufficient to complete the task request alone, the conference mechanism is triggered. At this time, the intelligent agent will form a conference with at least one other intelligent agent. In this process, the intelligent agent can select which intelligent agents in corresponding fields to form to participate in the conference, or a judgment intelligent agent can be set up to analyze the request information and select intelligent agents in appropriate fields to participate in the conference according to the request information.
[0102] In this embodiment, the agents participating in the meeting belong to different fields, and each agent corresponds to a second largest model that has been trained on a knowledge graph in a specific field.
[0103] Preferably, the conference includes at least three agents, one of which is a coordinating agent, wherein the coordinating agent is used to control the conference, which includes the progress of the conference, the decision on the results of the conference, and the like.
[0104] Step S605: Send at least the request information to the agent in the meeting, and obtain return information based on the feedback results of the agent in the meeting, wherein the feedback results of the agent are obtained based on at least the second largest model that has been trained corresponding to the agent.
[0105] In this embodiment, background knowledge corresponding to the request information is obtained; and the background knowledge and the request information are sent to the intelligent agent in the meeting.
[0106] In one embodiment, before the meeting begins, background knowledge related to the requested information is first collected. This may include historical data in the relevant field, previous case studies, relevant literature or information in databases. The acquisition of background knowledge provides the agent with necessary contextual information, enabling them to more accurately parse and respond to user needs. In particular, when the user's request information involves multiple fields, the background knowledge will alleviate the situation where each second-largest model is unfamiliar with the involved field knowledge, thereby making the subsequent feedback results and returned information more accurate.
[0107] The request information and its related background knowledge are then sent to all agents participating in the meeting. These agents analyze the received information and provide feedback and suggestions based on their own areas of expertise and trained models. The agents may use their second largest model to perform in-depth data analysis and pattern recognition to identify possible solutions or courses of action.
[0108] The coordinating agent is responsible for managing the progress of the meeting and the final decision-making process. This includes scheduling the discussion order of the meeting, ensuring comprehensive information exchange, and providing mediation when there are disagreements between agents. The coordinating agent is also responsible for integrating the input of each agent to form a coordinated final response.
[0109] In this embodiment, the collective wisdom of multiple agents through the conference mechanism can provide a more comprehensive perspective and deeper analysis than a single agent, thereby improving the accuracy and reliability of the returned information. And the conference mechanism makes up for the shortcomings of simply retrieving knowledge graphs in other fields.
[0110] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order, and they can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.
[0111] It is understood by those skilled in the art that the present invention implements all or part of the processes in the method of the above embodiment, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes a computer program, and the computer program can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0112] Furthermore, the present invention also provides a control device. In an embodiment of a control device according to the present invention, the control device includes a processor and a storage device, the storage device can be configured to store a program for executing the large model training method of the above method embodiment, and the processor can be configured to execute the program in the storage device, which includes but is not limited to the program for executing the large model training method of the above method embodiment. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The control device can be a control device device formed by various electronic devices.
[0113] Furthermore, the present invention also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present invention, the computer-readable storage medium can be configured to store a program for executing the large model training method of the above-mentioned method embodiment, and the program can be loaded and run by the processor to implement the above-mentioned large model training method. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present invention is a non-temporary computer-readable storage medium.
[0114] Further, it should be understood that since the setting of each module is only for illustrating the functional units of the device of the present invention, the physical devices corresponding to these modules may be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only schematic.
[0115] Those skilled in the art will appreciate that the modules in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principle of the present invention, and therefore, the technical solutions after splitting or merging will fall within the protection scope of the present invention.
[0116] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. A question-answering interactive method, characterized in that: include: Obtain user request information, and obtain return information based on a second large model trained by the large model training method, an agent corresponding to the second large model, and request information; The intelligent agent returns the return information to the user; The second large model trained based on the large model training method, the agent corresponding to the second large model and the request information, and the return information includes: The agent determines, based on the request information, whether the trained second largest model is insufficient to complete the task request alone; In response to determining that the trained second largest model is insufficient to complete the task request alone, obtaining relevant information from a knowledge graph corresponding to a second field, wherein the knowledge graph corresponding to the second field and the knowledge graph corresponding to the first field are knowledge graphs of different fields, and the knowledge graph corresponding to the second field and at least part of the information in the request information belong to the same field; Inputting the relevant information and the request information into the trained second largest model to obtain return information; The second large model trained based on the large model training method, the agent corresponding to the second large model, and the request information, the return information includes: In response to the agent determining, based on the request information, that the trained second largest model is insufficient to complete the task request alone, the agent and at least one other agent form a meeting, wherein the second largest models corresponding to different agents are constructed based on knowledge graphs in different fields; Sending at least the request information to the agent in the meeting, and obtaining return information based on the feedback result of the agent in the meeting, wherein the feedback result of the agent is obtained based on at least the second largest model corresponding to the agent that has been trained; The conference includes at least three agents, one of which is a coordination agent, wherein the coordination agent is used for regulating the conference, and the method further includes: Obtain background knowledge corresponding to the requested information, including historical data in the relevant field, previous case studies, and information in relevant literature or databases; The sending at least the request information to the agent in the conference includes: Sending the background knowledge and the request information to the intelligent agent in the meeting, providing context information for the intelligent agent; Wherein, the large model training method includes: Get the first field data; Construct a knowledge graph corresponding to the first field based on the data in the first field; Performing a first training on the large model based on the knowledge graph corresponding to the first field to obtain a first large model, wherein during the first training, some parameters of the first large model are frozen; Performing a second training on the first large model based on the knowledge graph corresponding to the first field to obtain a trained second large model, wherein during the second training, at least part of the frozen parameters are unfrozen; The second training is divided into a plurality of stages for training which are performed sequentially, wherein "unfreezing at least some of the frozen parameters" is performed during at least some of the stages for training, and no new training corpus is added during the stage for "unfreezing at least some of the frozen parameters" compared to the training during the adjacent previous stage.
2. The question-answering interactive method according to claim 1, characterized in that: The step of constructing a knowledge graph corresponding to the first field based on the first field data includes: Preprocessing the first domain data to obtain preprocessed first domain data; Performing entity classification and attribute recognition on the preprocessed first domain data to obtain entity categories and attributes; Analyze different entity categories to obtain the relationship between different entity categories; A structured knowledge graph corresponding to the first domain is constructed based on the entity categories, the attributes and the relationships between the different entity categories.
3. The question-answer interaction method according to claim 1, characterized in that: When performing the second training, unfreezing at least part of the frozen parameters includes: When training is performed sequentially at different stages, at least part of the frozen parameters are gradually unfrozen until the first largest model meets the preset conditions, then parameter unfreezing is stopped to obtain the trained second largest model.
4. The question-answer interaction method according to claim 3, characterized in that: The stage of "unfreezing at least part of the frozen parameters" does not add new training corpus compared to the training in the previous adjacent stage, wherein the training corpus is obtained based on the knowledge graph corresponding to the first field.
5. A control device, comprising a processor and a storage device, wherein the storage device is suitable for storing a plurality of computer programs, characterized in that: The computer program is suitable for being loaded and run by the processor to execute the question-answering interactive method according to any one of claims 1 to 4.
6. A computer-readable storage medium storing a plurality of computer programs, characterized in that: The computer program is suitable for being loaded and run by a processor to execute the question-answering interactive method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Multi-mode small target detection method based on knowledge distillation
CN113449680A
Question and answer method and system based on knowledge enhancement generative language model and medium
CN115759254A
Text processing method and device, computer equipment and storage medium
CN116029273A
Intelligent agent interactive emergency decision-making method for flood disaster in urban complex geographic scene
CN116128322A
Problem solving method and device based on intelligent agent
CN116628158A
