Data processing method, device and equipment
The method addresses the challenges of large language models by using a domain-specific knowledge database to enhance domain knowledge and security, enabling rapid and flexible risk response and improving output accuracy.
Patent Information
- Application Number
- CN202411215609.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-27
AI Technical Summary
Large language models face challenges in quickly and cost-effectively mastering domain knowledge and responding to risks such as AI hallucinations, data leakage, and bias, necessitating a rapid emergency response mechanism.
A data processing method that utilizes a pre-trained domain model to identify the target domain for user input, retrieves relevant knowledge from a knowledge database, and uses configuration answer data from the database to respond to user queries, supplemented by a large language model when necessary, with security checks to ensure accuracy.
Enables rapid and flexible risk response by leveraging domain-specific knowledge databases to enhance the security and accuracy of large language model outputs, reducing blind spots and improving controllability.
Smart Images

Figure CN119204099A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of computer technology, and in particular to a data processing method, device and equipment. Background Art
[0002] As AI technology continues to develop, the size and performance of large models are also increasing. Currently, large models with billions or even trillions of parameters have emerged, which can be used to generate text, translate languages, analyze and protect privacy data, write different types of creative content, and answer questions in an informative way.
[0003] However, the information generation process of large models is itself a probabilistic problem, and it is easy to have risks such as AI hallucinations, data leakage, discrimination, and bias. Therefore, the security of large models is essential. Therefore, in the risk defense process of large models, the optimization cycle of the recognition model is long and it is difficult to respond quickly. For this reason, it is necessary to provide a technical solution that can deal with the defects of large models in mastering domain knowledge and respond to risks quickly in a low-cost and flexible way. Summary of the invention
[0004] The purpose of the embodiments of this specification is to provide a technical solution to address the deficiencies in the large model's grasp of domain knowledge and to quickly respond to risks in a low-cost and flexible manner.
[0005] In order to implement the above technical solution, the embodiments of this specification are implemented as follows:
[0006] A data processing method provided by an embodiment of the present specification comprises: receiving question data input by a user. Inputting the question data into a pre-trained domain model to obtain a target domain for content security risks to which the question data belongs. If the target domain belongs to a domain in a preset domain set, obtaining a knowledge database corresponding to the target domain, and retrieving configuration question data matching the question data from the knowledge database corresponding to the target domain. If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, using configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain as answer data for the question data, and outputting the answer data.
[0007] A data processing device provided in an embodiment of the present specification comprises: a question receiving module for receiving question data input by a user; a domain determination module for inputting the question data into a pre-trained domain model to obtain a target domain for content security risks to which the question data belongs; a retrieval module for obtaining a knowledge database corresponding to the target domain if the target domain belongs to a domain in a preset domain set, and retrieving configuration question data matching the question data from the knowledge database corresponding to the target domain; a first answer output module for using configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain as answer data for the question data if configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, and outputting the answer data.
[0008] A data processing device provided in an embodiment of the present specification includes: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor: receives question data input by a user. The question data is input into a pre-trained domain model to obtain a target domain for content security risks to which the question data belongs. If the target domain belongs to a domain in a preset domain set, a knowledge database corresponding to the target domain is obtained, and configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain. If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, the configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as the answer data for the question data, and the answer data is output.
[0009] The embodiments of this specification also provide a storage medium, which is used to store computer-executable instructions, and the executable instructions implement the following process when executed by a processor: Receive question data input by a user. Input the question data into a pre-trained domain model to obtain a target domain for content security risks to which the question data belongs. If the target domain belongs to a domain in a preset domain set, obtain a knowledge database corresponding to the target domain, and retrieve configuration question data matching the question data from the knowledge database corresponding to the target domain. If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, use the configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain as answer data for the question data, and output the answer data.
[0010] The embodiments of this specification also provide a computer program product, including a computer program, which implements the following process when executed by a processor: receiving question data input by a user. Inputting the question data into a pre-trained domain model to obtain a target domain for content security risks to which the question data belongs. If the target domain belongs to a domain in a preset domain set, obtaining a knowledge database corresponding to the target domain, and retrieving configuration question data matching the question data from the knowledge database corresponding to the target domain. If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, using configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain as answer data for the question data, and outputting the answer data. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the drawings required for use in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.
[0012] Figure 1 This is an embodiment of a data processing method of this specification;
[0013] Figure 2 A schematic diagram of a knowledge database in this specification;
[0014] Figure 3 A schematic diagram of a data processing process of this specification;
[0015] Figure 4 This is a schematic diagram of a knowledge database construction process of this specification;
[0016] Figure 5 This is an embodiment of a data processing device of the present specification;
[0017] Figure 6 This is an embodiment of a data processing device in this specification. DETAILED DESCRIPTION
[0018] The embodiments of this specification provide a data processing method, device and equipment.
[0019] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0020] The embodiment of this specification provides a rapid emergency response mechanism for large model risk defense based on a knowledge base, wherein the large model is a large machine learning model with billions or trillions of parameters. The large model is usually constructed by a deep neural network, which can process massive data and complete various complex tasks, such as natural language processing, computer vision, speech recognition, etc. Risk defense refers to a series of measures and means taken to ensure the security of information systems. Large model risk defense refers to measures taken against risk threats of large language models (Large Language Model, LLM). LLM is an artificial intelligence model with millions or billions of parameters. It can generate text, translate language, write different types of creative content, and answer questions in an informative way. Due to the powerful capabilities of LLM, large language models have also become the target of security attacks, so corresponding security defense is required. Knowledge base (Knowledge Base) is a special database used for knowledge management, so as to facilitate the collection, organization and extraction of relevant domain knowledge. The knowledge in the knowledge base can come from domain experts. It is a collection of domain knowledge required to solve problems, including basic facts, rules and other relevant information. In this embodiment, it is mainly represented as a question-answering knowledge base.
[0021] With the continuous development of artificial intelligence technology, the scale and performance of large models are also constantly improving. At present, large models with billions or even trillions of parameters have appeared. Large models can be used to generate text, translate languages, write different types of creative content, and answer questions in an information-rich way. For example, GPT-3 can generate realistic news articles, poems, codes, etc. The information generation process of large models is itself a probabilistic problem, and it is easy to have risks such as AI hallucinations, data leakage, discrimination, and bias. Therefore, the security of large models is essential. Therefore, in the risk defense process of large models, the optimization cycle of the recognition model is long and it is difficult to respond quickly. The embodiments of this specification provide a low-cost and flexible way (external knowledge base and / or knowledge embedding method) to solve the problem of large models' mastery of domain knowledge and rapid risk response. For specific processing, please refer to the specific content in the following embodiments.
[0022] like Figure 1As shown, an embodiment of this specification provides a data processing method, and the execution subject of the method can be a terminal device or a server, etc., and a large model (which can be a large language model) is set in the execution subject. The terminal device can be a mobile terminal device such as a mobile phone, a tablet computer, or a computer device such as a laptop or a desktop computer, or an IoT device (specifically such as a smart watch, a car device, an intelligent robot, etc.), etc. The server can be an independent server, or a server cluster composed of multiple servers, etc. The server can be a background server for financial services or online shopping services, or a background server for an application, etc. In this embodiment, the execution subject is taken as an example for detailed description. For the case where the execution subject is a terminal device, please refer to the following server situation processing, which will not be repeated here. The method can specifically include the following steps:
[0023] In step S102, question data input by a user is received.
[0024] The user may be any user, and the user may be a user who needs to obtain answer data corresponding to the question data raised by the user through the large model. The question data may be data of any question, for example, the question data may be "Are potatoes and potatoes the same plant?" or "I have a fever, please recommend some antipyretic drugs." The specific setting may be based on actual conditions, and the embodiments of this specification do not limit this.
[0025] In implementation, when a user needs to understand a certain question, the question data of the question can be constructed, and the question data can be input into the question input box in the question and answer page provided by the server. During the input process, the user can input voice data by voice input. After receiving the voice data, the server can recognize the voice data and obtain corresponding text data, which can be displayed in the question input box in the question and answer page. Alternatively, the user can directly input the question data into the question input box in the question and answer page in the form of text data. After the input is completed, the user can click the OK button in the question and answer page. At this time, the user's terminal device can obtain the question data entered in the question input box and can send the question data to the server, and the server can receive the question data entered by the user.
[0026] In step S104, the above-mentioned problem data is input into a pre-trained domain model to obtain the target domain for content security risks to which the problem data belongs.
[0027] Wherein, the domain model can also be called a business object model. The domain model can be an object model that describes the implementation of business use cases. It is an abstraction of how business roles and business entities should be connected and collaborated to perform business. The domain model defines business use cases from the perspective of the business role. The domain model determines the static and dynamic relationships that should exist between business personnel and the objects (business classes and objects) they process and use in order to produce the expected results. The objects of these model classes can be combined to execute all business use cases. The domain model can be constructed in a variety of different ways. For example, the domain model can be constructed by a neural network, or by a specified algorithm, etc., which can be specifically set according to actual conditions, and this specification embodiment does not limit this. The target domain can be any pre-specified domain, for example, the financial field, the medical field, etc., which can be specifically set according to actual conditions.
[0028] In implementation, the training data and corresponding label information used to train the domain model can be obtained, the training data can be input into the domain model to obtain the predicted domain corresponding to the training data, based on the predicted domain and the label information, the corresponding loss information is calculated by a preset loss function, and the model parameters of the domain model are adjusted by the loss information to obtain the domain model after adjusting the model parameters, and then the above process can be repeated to adjust the model parameters of the domain model to perform model training on the domain model to obtain the trained domain model. The trained domain model can be used to perform domain analysis on the input data to determine the domain for content security risks to which the input data belongs. After obtaining the problem data input by the user in the above manner, the problem data can be input into the above-mentioned trained domain model to obtain the target domain for content security risks to which the problem data belongs.
[0029] In step S106, if the target domain belongs to a domain in the preset domain set, a knowledge database corresponding to the target domain is obtained, and configuration question data matching the above question data is retrieved from the knowledge database corresponding to the target domain.
[0030] Among them, the preset field set may include multiple different fields for content security risks. For example, the preset field set may include the financial field, medical field, entertainment field, etc., which can be set specifically according to actual conditions.
[0031] In implementation, the knowledge database can be pre-set according to the actual situation, and the corresponding knowledge database can be set according to different fields. For the knowledge database in different fields, as many data pairs of question data and answer data in the field as possible can be collected, and the knowledge database contains configuration question data and corresponding configuration answer data. In actual applications, a certain question data can correspond to one or more different answer data, or a certain question data can be set with the answer data with the highest matching degree, etc., which can be set according to the actual situation.
[0032] The target domain can be matched with the domains in the preset domain set. If the target domain belongs to a domain in the preset domain set, the knowledge database corresponding to the target domain can be obtained. Then, the configuration problem data contained in the knowledge database corresponding to the target domain can be retrieved to see whether the above-mentioned problem data exists, so as to retrieve the configuration problem data matching the above-mentioned problem data from the knowledge database corresponding to the target domain.
[0033] In step S108, if configuration question data matching the above question data is retrieved from the knowledge database corresponding to the target domain, the configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as the answer data of the question data and the answer data is output.
[0034] During implementation, if configuration question data matching the above-mentioned question data is retrieved from the knowledge database corresponding to the target domain, it indicates that answer data for the above-mentioned question data exists in the knowledge database corresponding to the target domain. At this time, the configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain can be used as answer data for the question data, and the answer data can be output.
[0035] The embodiments of this specification provide a data processing method, which receives question data input by a user, and then inputs the question data into a pre-trained domain model to obtain a target domain for content security risks to which the question data belongs. If the target domain belongs to a domain in a preset domain set, the knowledge database corresponding to the target domain is obtained, and configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain. If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as answer data for the question data, and the answer data is output. In this way, when the large model has defects in its grasp of domain knowledge, rapid risk response can be performed by searching knowledge databases corresponding to different domains, thereby enabling rapid emergency response and rapid coverage of risks and illusion content. In addition, topic expansion can be performed to reduce the blind spot range of the large model's own topic.
[0036] In practical applications, such as Figure 2 As shown, if the target domain does not belong to a domain in the preset domain set, the corresponding answer data can be obtained through the large model. For details, please refer to the processing of the following steps A2 to A6.
[0037] In step A2, if the target domain does not belong to a domain in the preset domain set, the above question data is input into a pre-trained large language model to obtain corresponding output data.
[0038] Among them, the large language model can be a deep learning model that is trained using a large amount of data and has hundreds of millions (tens of billions or even more) of model parameters. The large language model can be a large model built based on GPT-3, GPT-4, PaLM, ChatGLM, etc., and can be set specifically according to actual conditions.
[0039] In implementation, the large language model can be obtained by training the model with training sample data, or the large language model can be obtained by training with fine-tuning, which can be set according to the actual situation. If the target domain does not belong to the domain in the preset domain set, it means that the question data in the target domain does not need to be retrieved and determined through the knowledge database. At this time, the corresponding answer data can be obtained through the large model. Specifically, the above question data can be input into the pre-trained large language model to obtain the corresponding output data.
[0040] In step A4, a security check is performed on the output data for content security risks to obtain corresponding test results.
[0041] In implementation, since large language models are prone to content security risks such as hallucinations, data leakage, and bias, the above-mentioned output data can be subjected to security testing for content security risks to determine whether the large language model has content security risks such as hallucinations, data leakage, and bias, thereby obtaining corresponding test results.
[0042] In step A6, if the detection result indicates that the output data passes the security detection for the content security risk, the output data is used as the answer data of the question data and the answer data is output.
[0043] During implementation, if the large language model does not exhibit content security risks such as hallucinations, data leakage, or bias when obtaining output data, the above-mentioned detection result indicates that the above-mentioned output data has passed the security detection for content security risks, and the output data is used as the answer data of the above-mentioned question data, and the answer data is output.
[0044] In practical applications, such as Figure 2 As shown, if the configuration question data matching the above question data is not retrieved from the knowledge database corresponding to the target domain, the corresponding answer data can be obtained through the large model. For details, please refer to the processing of the following steps B2 to B6.
[0045] In step B2, if no configuration question data matching the above question data is retrieved from the knowledge database corresponding to the target domain, the question data is input into a pre-trained large language model to obtain corresponding output data.
[0046] In implementation, if configuration question data matching the above question data is not retrieved from the knowledge database corresponding to the target domain, it indicates that configuration question data matching the above question data has not been collected in the knowledge database corresponding to the target domain. At this time, the corresponding answer data can be obtained through the large model. Specifically, the above question data can be input into a pre-trained large language model to obtain corresponding output data.
[0047] In step B4, a security check is performed on the output data for content security risks to obtain corresponding test results.
[0048] In step B6, if the detection result indicates that the output data passes the security detection for the content security risk, the output data is used as the answer data of the question data and the answer data is output.
[0049] The specific processing procedures of the above steps B4 and B6 can refer to the relevant contents of the above steps A4 and A6, which will not be repeated here.
[0050] There are many specific processing methods for retrieving the configuration problem data matching the problem data from the knowledge database corresponding to the target domain in the above step S106. An optional processing method is provided below, such as Figure 3 As shown, it may specifically include the following contents: based on the above-mentioned question data, configuration question data matching the question data is retrieved from the knowledge database corresponding to the target field through preset matching retrieval rules, and the matching retrieval rules include one or more of complete matching retrieval rules, regular matching retrieval rules, similarity matching retrieval rules, full-text matching retrieval rules and intention matching retrieval rules.
[0051] Among them, the complete match retrieval rule can be a retrieval process that requires the question data entered by the user to be exactly the same as the configuration question data in the knowledge database after appropriate preprocessing (preprocessing may not be required in actual applications). The regular match retrieval rule can be a retrieval process that requires the question data entered by the user to be retrievaled by regular matching with the configuration question data in the knowledge database after appropriate preprocessing (preprocessing may not be required in actual applications). The similar match retrieval rule can be a retrieval process that requires the question data entered by the user to be retrievaled by semantic similarity matching with the configuration question data in the knowledge database after appropriate preprocessing (preprocessing may not be required in actual applications). The full-text match retrieval rule can be a retrieval process that requires the question data entered by the user to be retrievaled by full-text content retrieval with the configuration question data in the knowledge database after appropriate preprocessing (preprocessing may not be required in actual applications). The intent matching retrieval rule may be to perform intent detection on the question data input by the user, obtain the intent information corresponding to the question data, and perform retrieval processing by matching the intent information corresponding to the question data with the intent information corresponding to the configuration question data in the knowledge database.
[0052] In implementation, configuration question data matching the question data may be retrieved from a knowledge database corresponding to the target domain according to the above-mentioned various specific matching retrieval rules, which will not be described in detail here.
[0053] In practical applications, matching retrieval rules include multiple types of complete matching retrieval rules, regular matching retrieval rules, similar matching retrieval rules, full-text matching retrieval rules and intention matching retrieval rules. Based on the above question data, the specific processing methods for retrieving configuration question data matching the question data from the knowledge database corresponding to the target field through preset matching retrieval rules can be various. The following is an optional processing method, such as Figure 3 As shown, the following steps C2 to C6 may be specifically included.
[0054] In step C2, based on the above question data, knowledge links matching the question data are obtained in the knowledge database corresponding to the target domain, wherein each knowledge link corresponds to one of the multiple rules included in the matching retrieval rules.
[0055] In implementation, Figure 3 As shown in the figure, the knowledge database uses certain logic to identify the specific content of the user's question and then returns the knowledge link of the knowledge copy. In the knowledge link, one answer data can correspond to multiple question data, and one question data can correspond to multiple different matching search rules ( Figure 3 Only the complete match search rule, regular match search rule, similar match search rule, etc. are used in the search. Figure 3 Based on the above question data, obtain the knowledge link that matches the question data in the knowledge database corresponding to the target field. Specifically, for the question data, the knowledge link that matches the question data can be obtained in the knowledge database corresponding to the target field through a complete match retrieval rule, or the knowledge link that matches the question data can be obtained in the knowledge database corresponding to the target field through a regular match retrieval rule, or the knowledge link that matches the question data can be obtained in the knowledge database corresponding to the target field through a similar match retrieval rule, etc. The specific setting can be based on actual conditions.
[0056] In step C4, a matching retrieval rule for searching the above-mentioned question data is determined according to the priorities of the multiple rules included in the matching retrieval rule.
[0057] In step C6, configuration question data matching the above question data is obtained from the corresponding knowledge link based on the determined matching retrieval rule.
[0058] Based on the processing of the above steps C2 to C6, the specific processing method of the above step S108 can be varied. An optional processing method is provided below, which may specifically include the following contents: based on the determined matching retrieval rules and the above configuration question data, the configuration answer data corresponding to the configuration question data is obtained from the corresponding knowledge link, and the configuration answer data corresponding to the obtained configuration question data is used as the answer data of the above question data.
[0059] In implementation, Figure 3 As shown, based on the determined matching retrieval rule, the configuration answer data corresponding to the determined matching retrieval rule and the configuration question data can be obtained from the corresponding knowledge link, and the configuration answer data corresponding to the obtained configuration question data can be used as the answer data of the above question data.
[0060] Based on the above processing, the matching retrieval rules include intention matching retrieval rules. The specific processing methods of the above step C2 can be varied. An optional processing method is provided below, which can specifically include the processing of the following steps C22 to C26.
[0061] In step C22, based on the above question data, it is determined that the question data corresponds to intention information.
[0062] In step C24, based on the intention information corresponding to the question data, the question data is classified to obtain the intention category corresponding to the question data, and the intention category includes one or more of the character introduction category and the rule explanation category.
[0063] In step C26, based on the entity information contained in the above question data, a knowledge link matching the question data and the intention matching retrieval rule is obtained in the knowledge database corresponding to the target domain.
[0064] The entity information may be information about the question object contained in the question data input by the user, wherein the question object may be a person, a building, a place name, etc., and may be set according to actual conditions.
[0065] In practical applications, the knowledge databases corresponding to different fields can be constructed in the following manner. Taking the knowledge database corresponding to the target field as an example, the knowledge database corresponding to the target field can be constructed by processing the following steps D2 to D6.
[0066] In step D2, the preset prompt information is obtained.
[0067] Among them, Figure 4 As shown, the prompt information can be constructed by a variety of different data, wherein the various different data may include public opinion information, data on specified topics, information on scenario mining, etc., which can be set specifically according to actual conditions.
[0068] In step D4, the prompt information is input into the question generation model to obtain one or more different benchmark question data.
[0069] In step D6, the benchmark answer data corresponding to each benchmark question data is obtained, and a knowledge database corresponding to the target domain is constructed based on each benchmark question data and the benchmark answer data corresponding to each benchmark question data.
[0070] In implementation, the benchmark answer data corresponding to each benchmark question data can be obtained in a variety of different ways. For example, the answer data corresponding to each benchmark question data can be obtained in a specified database, and the obtained answer data can be used as the benchmark answer data, or each benchmark question data can be input into a specified large model to obtain the benchmark answer data corresponding to each benchmark question data, or each benchmark question data can be input into a specified neural network model to obtain the benchmark answer data corresponding to each benchmark question data. The specific setting can be based on actual conditions. A corresponding correspondence can be constructed based on each benchmark question data and the benchmark answer data corresponding to each benchmark question data, and a knowledge database corresponding to the target field can be constructed based on the corresponding relationship.
[0071] In practical applications, there may be various specific processing methods for obtaining the benchmark answer data corresponding to each benchmark question data in the above step D6. An optional processing method is provided below, which may specifically include the processing of the following steps D62 to D66.
[0072] In step D62, based on preset question analysis rules, the category to which each benchmark question data belongs is determined, and the category includes fact categories and other categories. The question analysis rules include one or more rules for clustering benchmark question data with the same semantics and rules for qualitatively characterizing the intent of the benchmark question data.
[0073] Among them, other categories can be categories other than the fact category.
[0074] In implementation, Figure 4 As shown, based on the rule for clustering benchmark question data with the same semantics in the preset question analysis rules, the benchmark question data with the same semantics can be clustered to obtain the category to which each benchmark question data belongs. In addition, based on the intent qualitative rule in the preset question analysis rules, the benchmark question data can be qualitatively processed according to intent to obtain the intent information corresponding to each benchmark question data. Based on the intent information corresponding to each benchmark question data, the category to which each benchmark question data belongs can be determined.
[0075] In step D64, if the category to which the benchmark question data belongs is the fact category, the benchmark question data is input into the preset first largest language model to obtain one or more different model output data, and the benchmark answer data corresponding to the benchmark question data is determined from the one or more different model output data, or, if the category to which the benchmark question data belongs is the fact category, based on the benchmark question data, the benchmark answer data corresponding to the benchmark question data is obtained from the authoritative data provided by the authoritative organization.
[0076] In implementation, Figure 4As shown, if the category to which the benchmark question data belongs is the fact class, the benchmark question data is input into the preset first largest language model, and different model output data can be generated through multiple rounds of output of the first largest language model. Different first largest language models may generate different model output data. As many model output data as possible can be collected to obtain one or more different model output data. Then, the benchmark answer data corresponding to the benchmark question data can be determined from one or more different model output data by manual annotation, or it can be determined whether the model output data corresponding to the benchmark question data has model output data that matches or is similar to the existing benchmark answer data in the knowledge database. If so, the benchmark question data-matching or similar model output data can be directly used to determine the benchmark answer data corresponding to the benchmark question data.
[0077] like Figure 4 As shown, if the category to which the benchmark question data belongs is a factual category, then based on the benchmark question data, the benchmark answer data corresponding to the benchmark question data is obtained from the authoritative data provided by the authoritative institution. Specifically, based on the benchmark question data, the benchmark answer data corresponding to the benchmark question data can be obtained from the authoritative data such as the question and answer database, books, and websites provided by the authoritative institution. Then, it can be determined whether the benchmark answer data obtained above is correct. If it is correct, the benchmark answer data corresponding to the benchmark question data can be stored in the knowledge database.
[0078] In step D66, if the category to which the benchmark question data belongs is other categories, the benchmark question data is input into a preset first language model to obtain benchmark answer data corresponding to the benchmark question data.
[0079] In implementation, if the category to which the benchmark question data belongs is other categories, the benchmark question data is input into the preset first language model to obtain benchmark answer data corresponding to the benchmark question data. Then, it can be determined whether the benchmark answer data obtained above is correct. If correct, the benchmark answer data corresponding to the benchmark question data can be stored in the knowledge database.
[0080] In practical applications, knowledge databases can also be constructed manually. Specifically, manpower can be invested in following up external public opinion or other channel information to quickly produce knowledge databases for use. In this way, the database can be updated in seconds.
[0081] In practical applications, the processing may also be performed through the following steps E2 to E8.
[0082] In step E2, receiving question data input by the user;
[0083] In step E4, the question data is input into a pre-trained domain model to obtain a target domain for content security risks to which the question data belongs, and the question data is input into a pre-trained large language model to obtain corresponding output data;
[0084] In step E6, if the target domain belongs to a domain in the preset domain set, a knowledge database corresponding to the target domain is obtained, and configuration problem data matching the problem data is retrieved from the knowledge database corresponding to the target domain, and a security test for content security risks is performed on the output data to obtain a corresponding test result;
[0085] In step E8, if configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, and the detection result indicates that the output data fails the security detection for content security risks, the configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as the answer data for the question data, and the answer data is output.
[0086] In addition, if configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, and the detection result indicates that the output data passes the security detection for content security risks, then answer data that can serve as the question data can be selected from the configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain and the above-mentioned output data, and the answer data can be output.
[0087] It should be noted that the above-mentioned processing of inputting the problem data into the pre-trained large language model to obtain the corresponding output data; performing security detection on the output data for content security risks to obtain the corresponding detection results, etc. may not need to be processed separately with step E4 and step E6, but only needs to be executed at step E8 or before step E8.
[0088] The embodiments of this specification provide a data processing method, which receives question data input by a user, and then inputs the question data into a pre-trained domain model to obtain a target domain for content security risks to which the question data belongs. If the target domain belongs to a domain in a preset domain set, the knowledge database corresponding to the target domain is obtained, and configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain. If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as answer data for the question data, and the answer data is output. In this way, when the large model has defects in its grasp of domain knowledge, rapid risk response can be performed by searching knowledge databases corresponding to different domains, thereby enabling rapid emergency response and rapid coverage of risks and illusion content. In addition, topic expansion can be performed to reduce the blind spot range of the large model's own topic.
[0089] In addition, through a variety of different matching retrieval rules and based on safe answering output, it is possible to quickly respond to risks and improve the controllability of the large model. In addition, using the large model to build a knowledge database can greatly improve knowledge coverage, and a topic can be expanded infinitely, reducing the blind spots of the large model itself.
[0090] The above is a data processing method provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a data processing device, such as Figure 5 shown.
[0091] The data processing device comprises: a question receiving module 501, a domain determining module 502, a retrieval module 503 and a first answer output module 504, wherein:
[0092] The question receiving module 501 receives question data input by the user;
[0093] A domain determination module 502 inputs the problem data into a pre-trained domain model to obtain a target domain for content security risks to which the problem data belongs;
[0094] A retrieval module 503, if the target domain belongs to a domain in a preset domain set, obtains a knowledge database corresponding to the target domain, and retrieves configuration problem data matching the problem data from the knowledge database corresponding to the target domain;
[0095] The first answer output module 504, if configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, uses the configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain as answer data for the question data, and outputs the answer data.
[0096] In the embodiment of this specification, the device further includes:
[0097] A first model prediction module, if the target domain does not belong to a domain in the preset domain set, inputs the question data into a pre-trained large language model to obtain corresponding output data;
[0098] A first security detection module performs a security detection on the output data for content security risks to obtain a corresponding detection result;
[0099] The second answer output module uses the output data as answer data to the question data and outputs the answer data if the detection result indicates that the output data passes the security detection for the content security risk.
[0100] In the embodiment of this specification, the device further includes:
[0101] A second model prediction module, if no configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, inputs the question data into a pre-trained large language model to obtain corresponding output data;
[0102] A second security detection module performs a security detection on the output data for content security risks to obtain a corresponding detection result;
[0103] The third answer output module uses the output data as answer data to the question data and outputs the answer data if the detection result indicates that the output data passes the security detection for the content security risk.
[0104] In an embodiment of the present specification, the retrieval module 503, based on the problem data, retrieves configuration problem data that matches the problem data from a knowledge database corresponding to the target field through preset matching retrieval rules, and the matching retrieval rules include one or more of a complete matching retrieval rule, a regular matching retrieval rule, a similarity matching retrieval rule, a full-text matching retrieval rule and an intent matching retrieval rule.
[0105] In the embodiment of this specification, the matching search rule includes multiple types of a complete matching search rule, a regular matching search rule, a similar matching search rule, a full-text matching search rule, and an intention matching search rule. The retrieval module 503 includes:
[0106] A link acquisition unit, based on the question data, acquires knowledge links matching the question data in a knowledge database corresponding to the target domain, wherein each knowledge link corresponds to one of the multiple rules included in the matching retrieval rule;
[0107] A search rule determination unit, which determines a matching search rule for searching the problem data according to the priorities of the multiple rules included in the matching search rule;
[0108] A retrieval unit, which obtains configuration problem data matching the problem data from the corresponding knowledge link based on the determined matching retrieval rule;
[0109] The first answer output module 504, based on the determined matching retrieval rule and the configuration question data, obtains configuration answer data corresponding to the configuration question data from the corresponding knowledge link, and uses the obtained configuration answer data corresponding to the configuration question data as answer data for the question data.
[0110] In an embodiment of the present specification, the matching retrieval rule includes an intention matching retrieval rule, and the link acquisition unit determines the intention information corresponding to the question data based on the question data; classifies the question data based on the intention information corresponding to the question data to obtain the intention category corresponding to the question data, and the intention category includes one or more of a character introduction category and a rule explanation category; and obtains a knowledge link matching the question data and the intention matching retrieval rule in a knowledge database corresponding to the target domain based on the entity information contained in the question data.
[0111] In the embodiment of this specification, the device further includes:
[0112] A prompt acquisition module is used to acquire preset prompt information;
[0113] A problem determination module inputs the prompt information into a problem generation model to obtain one or more different benchmark problem data;
[0114] The database construction module obtains the benchmark answer data corresponding to each benchmark question data, and constructs a knowledge database corresponding to the target field based on each benchmark question data and the benchmark answer data corresponding to each benchmark question data.
[0115] In the embodiment of this specification, the database construction module includes:
[0116] A category determination unit, based on a preset question analysis rule, determines the category to which each of the benchmark question data belongs, wherein the category includes a fact category and other categories, and the question analysis rule includes one or more of a rule for clustering benchmark question data with the same semantics and a rule for qualitatively determining the intent of the benchmark question data;
[0117] A first answer determination unit, if the category to which the benchmark question data belongs is a factual category, inputs the benchmark question data into a preset first language model to obtain one or more different model output data, and determines benchmark answer data corresponding to the benchmark question data from the one or more different model output data, or, if the category to which the benchmark question data belongs is a factual category, obtains benchmark answer data corresponding to the benchmark question data from authoritative data provided by an authoritative organization based on the benchmark question data;
[0118] The second answer determination unit inputs the benchmark question data into a preset first language model to obtain benchmark answer data corresponding to the benchmark question data if the category to which the benchmark question data belongs is other categories.
[0119] The embodiments of this specification provide a data processing device, which receives question data input by a user, and then inputs the question data into a pre-trained domain model to obtain a target domain for content security risks to which the question data belongs. If the target domain belongs to a domain in a preset domain set, the knowledge database corresponding to the target domain is obtained, and configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain. If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as answer data for the question data, and the answer data is output. In this way, when the large model has defects in its grasp of domain knowledge, rapid risk response can be performed by searching knowledge databases corresponding to different domains, thereby enabling rapid emergency response and rapid coverage of risks and illusion content. In addition, topic expansion can be performed to reduce the blind spot range of the large model's own topic.
[0120] The above is a data processing device provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a data processing device, such as Figure 6 shown.
[0121] The data processing device may provide a terminal device or a server, etc. for the above embodiments.
[0122] The data processing device may have relatively large differences due to different configurations or performances, and may include one or more processors 601 and memory 602, and the memory 602 may store one or more storage applications or data. Among them, the memory 602 may be a short-term storage or a persistent storage. The application stored in the memory 602 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the data processing device. Furthermore, the processor 601 may be configured to communicate with the memory 602 to execute a series of computer executable instructions in the memory 602 on the data processing device. The data processing device may also include one or more power supplies 603, one or more wired or wireless network interfaces 604, one or more input and output interfaces 605, and one or more keyboards 606.
[0123] Specifically in this embodiment, the data processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the data processing device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0124] Receive question data input by the user;
[0125] Inputting the problem data into a pre-trained domain model to obtain a target domain for content security risks to which the problem data belongs;
[0126] If the target domain belongs to a domain in the preset domain set, obtaining a knowledge database corresponding to the target domain, and retrieving configuration problem data matching the problem data from the knowledge database corresponding to the target domain;
[0127] If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as answer data for the question data and the answer data is output.
[0128] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the data processing device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0129] The embodiments of this specification provide a data processing device, which receives question data input by a user, and then inputs the question data into a pre-trained domain model to obtain a target domain for content security risks to which the question data belongs. If the target domain belongs to a domain in a preset domain set, the knowledge database corresponding to the target domain is obtained, and configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain. If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as answer data for the question data, and the answer data is output. In this way, when the large model has defects in its grasp of domain knowledge, rapid risk response can be performed by searching knowledge databases corresponding to different domains, thereby enabling rapid emergency response and rapid coverage of risks and illusion content. In addition, topic expansion can be performed to reduce the blind spot range of the large model's own topic.
[0130] Furthermore, based on the above Figures 1 to 4 In one embodiment, the present specification further provides a storage medium for storing computer executable instruction information. In a specific embodiment, the storage medium may be a USB flash drive, an optical disk, a hard disk, etc. When the computer executable instruction information stored in the storage medium is executed by the processor, the following process can be implemented:
[0131] Receive question data input by the user;
[0132] Inputting the problem data into a pre-trained domain model to obtain a target domain for content security risks to which the problem data belongs;
[0133] If the target domain belongs to a domain in the preset domain set, obtaining a knowledge database corresponding to the target domain, and retrieving configuration problem data matching the problem data from the knowledge database corresponding to the target domain;
[0134] If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as answer data for the question data and the answer data is output.
[0135] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the above-mentioned storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0136] The embodiment of this specification provides a storage medium, which receives question data input by a user, and then inputs the question data into a pre-trained domain model to obtain a target domain for content security risks to which the question data belongs. If the target domain belongs to a domain in a preset domain set, the knowledge database corresponding to the target domain is obtained, and configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain. If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as answer data for the question data, and the answer data is output. In this way, when the large model has defects in its grasp of domain knowledge, rapid risk response can be performed by searching knowledge databases corresponding to different domains, thereby enabling rapid emergency response and rapid coverage of risks and illusion content. In addition, topic expansion can be performed to reduce the blind spot range of the large model's own topic.
[0137] Furthermore, based on the above Figures 1 to 4 In one or more embodiments of the present specification, a computer program product is provided, including a computer program. When the computer program in the computer program product is executed by a processor, the following process can be implemented:
[0138] Receive question data input by the user;
[0139] Inputting the problem data into a pre-trained domain model to obtain a target domain for content security risks to which the problem data belongs;
[0140] If the target domain belongs to a domain in the preset domain set, obtaining a knowledge database corresponding to the target domain, and retrieving configuration problem data matching the problem data from the knowledge database corresponding to the target domain;
[0141] If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as answer data for the question data and the answer data is output.
[0142] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the above-mentioned computer program product embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0143] The embodiments of this specification provide a computer program product, which receives question data input by a user, and then inputs the question data into a pre-trained domain model to obtain a target domain for content security risks to which the question data belongs. If the target domain belongs to a domain in a preset domain set, the knowledge database corresponding to the target domain is obtained, and configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain. If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as answer data for the question data, and the answer data is output. In this way, when the large model has defects in its grasp of domain knowledge, rapid risk response can be performed by searching knowledge databases corresponding to different domains, thereby enabling rapid emergency response and rapid coverage of risks and illusion content. In addition, topic expansion can be performed to reduce the blind spot range of the large model's own topic.
[0144] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0145] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0146] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0147] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0148] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0149] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0150] The embodiments of this specification are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable fraud case serial and parallel device to produce a machine, so that the instructions executed by the processor of the computer or other programmable fraud case serial and parallel device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0151] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable fraud case serial and parallel device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0152] These computer program instructions may also be loaded onto a computer or other programmable device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0153] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0154] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0155] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0156] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0157] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0158] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0159] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0160] The above description is only an embodiment of this specification and is not intended to limit this document. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims of this specification.
Claims
1. A data processing method, the method comprising: Receive question data input by the user; Inputting the problem data into a pre-trained domain model to obtain a target domain for content security risks to which the problem data belongs; If the target domain belongs to a domain in the preset domain set, obtaining a knowledge database corresponding to the target domain, and retrieving configuration problem data matching the problem data from the knowledge database corresponding to the target domain; If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as answer data for the question data and the answer data is output.
2. The method according to claim 1, further comprising: If the target domain does not belong to a domain in the preset domain set, the question data is input into a pre-trained large language model to obtain corresponding output data; Performing a security test on the output data for content security risks to obtain a corresponding test result; If the detection result indicates that the output data passes the security detection for the content security risk, the output data is used as answer data to the question data, and the answer data is output.
3. The method according to claim 1, further comprising: If no configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, the question data is input into a pre-trained large language model to obtain corresponding output data; Performing a security test on the output data for content security risks to obtain a corresponding test result; If the detection result indicates that the output data passes the security detection for the content security risk, the output data is used as answer data to the question data, and the answer data is output.
4. The method according to claim 1, wherein the step of retrieving configuration problem data matching the problem data from a knowledge database corresponding to the target domain comprises: Based on the problem data, configuration problem data matching the problem data is retrieved from the knowledge database corresponding to the target field through preset matching retrieval rules, and the matching retrieval rules include one or more of complete matching retrieval rules, regular matching retrieval rules, similarity matching retrieval rules, full-text matching retrieval rules and intention matching retrieval rules.
5. According to the method of claim 4, the matching retrieval rule comprises a plurality of the following: a complete matching retrieval rule, a regular matching retrieval rule, a similar matching retrieval rule, a full-text matching retrieval rule and an intention matching retrieval rule, and the step of retrieving configuration question data matching the question data from the knowledge database corresponding to the target domain based on the question data by using a preset matching retrieval rule comprises: Based on the problem data, obtaining knowledge links matching the problem data in a knowledge database corresponding to the target domain, wherein each knowledge link corresponds to one of the multiple rules included in the matching retrieval rule; Determining a matching retrieval rule for searching the problem data according to the priorities of the multiple rules included in the matching retrieval rule; Acquire configuration problem data matching the problem data from the corresponding knowledge link based on the determined matching retrieval rule; If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as answer data for the question data, including: Based on the determined matching retrieval rule and the configuration question data, configuration answer data corresponding to the configuration question data is obtained from the corresponding knowledge link, and the obtained configuration answer data corresponding to the configuration question data is used as answer data for the question data.
6. The method according to claim 5, wherein the matching retrieval rule comprises an intention matching retrieval rule, and the step of acquiring knowledge links matching the question data in the knowledge database corresponding to the target domain based on the question data comprises: Based on the question data, determining the intention information corresponding to the question data; Based on the intention information corresponding to the question data, the question data is classified to obtain the intention category corresponding to the question data, where the intention category includes one or more of a character introduction category and a rule explanation category; Based on the entity information included in the question data, a knowledge link matching the question data and the intention matching retrieval rule is obtained in a knowledge database corresponding to the target domain.
7. The method according to claim 1, further comprising: Get the preset prompt information; Inputting the prompt information into a large model for question generation to obtain one or more different benchmark question data; Obtain benchmark answer data corresponding to each benchmark question data, and construct a knowledge database corresponding to the target field based on each benchmark question data and the benchmark answer data corresponding to each benchmark question data.
8. The method according to claim 7, wherein obtaining the benchmark answer data corresponding to each benchmark question data comprises: Based on preset question analysis rules, determine the category to which each benchmark question data belongs, wherein the category includes a fact category and other categories, and the question analysis rules include one or more of a rule for clustering benchmark question data with the same semantics and a rule for qualitatively identifying the intent of the benchmark question data; If the category to which the benchmark question data belongs is a factual category, the benchmark question data is input into a preset first language model to obtain one or more different model output data, and the benchmark answer data corresponding to the benchmark question data is determined from the one or more different model output data; or, if the category to which the benchmark question data belongs is a factual category, based on the benchmark question data, the benchmark answer data corresponding to the benchmark question data is obtained from authoritative data provided by an authoritative organization; If the category to which the benchmark question data belongs is other categories, the benchmark question data is input into a preset first language model to obtain benchmark answer data corresponding to the benchmark question data.
9. A data processing device, comprising: A question receiving module receives question data input by the user; A domain determination module, which inputs the problem data into a pre-trained domain model to obtain a target domain for content security risks to which the problem data belongs; A retrieval module, if the target domain belongs to a domain in a preset domain set, obtains a knowledge database corresponding to the target domain, and retrieves configuration question data matching the question data from the knowledge database corresponding to the target domain; The first answer output module uses the configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target field as the answer data of the question data, and outputs the answer data, if the configuration question data matching the question data is retrieved from the knowledge database corresponding to the target field.
10. A data processing device, comprising: processor; as well as a memory arranged to store computer executable instructions which, when executed, cause the processor to: Receive question data input by the user; Inputting the problem data into a pre-trained domain model to obtain a target domain for content security risks to which the problem data belongs; If the target domain belongs to a domain in the preset domain set, obtaining a knowledge database corresponding to the target domain, and retrieving configuration problem data matching the problem data from the knowledge database corresponding to the target domain; If configuration question data matching the question data is retrieved from the knowledge database corresponding to the target domain, configuration answer data corresponding to the configuration question data recorded in the knowledge database corresponding to the target domain is used as answer data for the question data and the answer data is output.
