Question and answer model generation method, system and equipment and medium
The autoencoder is used to encode sensitive data into feature vectors and combine it with unencrypted data for model training, which solves the problem of data providers unwilling to disclose sensitive data, achieves the safety and effectiveness of model training, and expands the application scenarios of the model. .
Patent Information
- Application Number
- CN202411043116.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-10-11
AI Technical Summary
The data provider does not want to disclose sensitive data to the client for model training to prevent the leakage and tampering of confidential data, and existing technology is difficult to effectively solve this problem.
The data to be encrypted is encoded into an encrypted combination vector of feature vectors and type label vectors through the autoencoder, combined with the non-encrypted data to form a question and answer data set, and sent to the client for model training. During the training process, only the encrypted data vectors and other text vectors are understood context relationship to avoid learning encrypted data text. After the model is trained, a question and answer model and a non-encrypted data mapping set are provided. During the prediction process, the type label vector is used for similarity comparison to obtain the answer text.
While not leaking sensitive data during model training, it is possible to generate a question and answer model suitable for data providers, prevent leakage or tampering of confidential data, and expand the use scenarios of the model.
Smart Images

Figure CN118760756A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning technology, and in particular to a method, system, device and medium for generating a question-answering model. Background Art
[0002] The large model has the ability to handle complex tasks and has achieved remarkable results after being implemented in various scenarios such as natural language processing, image recognition, and speech processing.
[0003] However, many companies need to combine their own data to implement tasks such as intelligent customer service and quick query of internal company information. Therefore, many companies want to take advantage of the current big model to bring better services to the company. However, many companies do not know how to use and train the model. They need to provide data to the client as a data provider to train the corresponding functional model. However, the data provider does not want to disclose sensitive data to the client to prevent the leakage and tampering of confidential data.
[0004] In view of this, there is an urgent need to provide a method for generating a question-answering model based on private data. Summary of the invention
[0005] In order to overcome the problems existing in the related art, the present disclosure provides a method, system, device and medium for generating a question-answering model to solve the technical problem in the related art that the data provider does not want to disclose sensitive data to the client for model training.
[0006] One or more embodiments of this specification provide a method for generating a question-answering model, comprising the following steps:
[0007] Construct a question-answering dataset for the corresponding field. The question-answering dataset includes multiple question-answer pairs composed of the data to be encrypted and the data not to be encrypted. The data to be encrypted and the data not to be encrypted are labeled with corresponding data types.
[0008] The encrypted data in the question-answer pair is encoded by the autoencoder to obtain an encrypted combination vector consisting of a feature vector and a type label vector, thereby obtaining an encrypted data set and a corresponding index file and storing them in the data provider database;
[0009] The question-answering dataset consisting of the encrypted combination vector and the unencrypted data is sent to the client. The client encodes the unencrypted data in the question-answering pair through an autoencoder to obtain an unencrypted combination vector consisting of a feature vector and a type label vector, thereby obtaining an unencrypted dataset and a corresponding index file.
[0010] The client inputs the question-answer pair consisting of the encrypted combination vector and the non-encrypted combination vector into the machine learning model for training until convergence, thereby generating a question-answer model for the corresponding field; and
[0011] The client sends the question-answering model, the non-encrypted dataset and the corresponding index file to the data provider, wherein the question is input into the question-answering model to predict the corresponding answer vector sequence, and the similarity is calculated with the encrypted dataset and / or the non-encrypted dataset based on the type label vector corresponding to each answer vector, and the text corresponding to the corresponding answer vector is obtained based on the index file, thereby obtaining the answer text and outputting it.
[0012] Furthermore, each field in the question-answer pair is provided with a data type label, and each field is converted into an n+1-dimensional vector after being processed by the autoencoder, wherein one dimension is a type label vector.
[0013] Furthermore, the client vectorizes and saves the obtained question and answer dataset, which specifically includes the following steps:
[0014] Classify the encrypted combination vector and non-encrypted data of each question-answer pair in the question-answer dataset;
[0015] Vectorizing each field of the classified non-encrypted data and the corresponding type label through an autoencoder to obtain an n-dimensional vector and a corresponding 1-dimensional type label vector added to the beginning or end of the n-dimensional vector, i.e., a non-encrypted combination vector; and
[0016] The encrypted combination vectors and the non-encrypted combination vectors are classified and stored according to the type label vector, and an encrypted data vector set and a non-encrypted data vector set are obtained respectively, and the corresponding type label vector is used as the category vector of the two vector sets.
[0017] Furthermore, the basic model of the initial question-answering model is the Bert model or the RoBerta model;
[0018] The initial question-answering model calculates an autoregressive loss value based on the predicted answer information, and trains the initial question-answering model based on the autoregressive loss value until convergence to obtain the question-answering model.
[0019] One or more embodiments of the present specification provide a system for generating a question-answering model, including a data provider subsystem and a client subsystem, wherein the data provider subsystem is provided with a question-answering data set construction module, a first encoding module and a prediction module, and the client subsystem is provided with a second encoding module and a model training module;
[0020] A question-answering dataset construction module is used to construct a question-answering dataset for a corresponding field. The question-answering dataset includes a plurality of question-answering pairs respectively composed of data to be encrypted and non-encrypted data. Corresponding data type labels are set for the data to be encrypted and the non-encrypted data.
[0021] The first encoding module is used to encode the data to be encrypted in the question-answer pair through an autoencoder to obtain an encrypted combination vector composed of a feature vector and a type label vector, thereby obtaining an encrypted data set and a corresponding index file and storing them in a data provider database; and sending the question-answer data set composed of the encrypted combination vector and non-encrypted data to the client;
[0022] The second encoding module is used to encode the non-encrypted data in each question-answer pair through an autoencoder to obtain a non-encrypted combination vector composed of a feature vector and a type label vector, thereby obtaining a non-encrypted data set and a corresponding index file;
[0023] A model training module, which is used to input the question-answer pairs consisting of the encrypted combined vector and the unencrypted combined vector into the machine learning model for training until convergence, generate a question-answer model for the corresponding field, and send the question-answer model, the unencrypted data set and the corresponding index file to the data provider subsystem; and
[0024] The prediction module is used to obtain the corresponding answer vector sequence based on the question-answering model, the non-encrypted data set and the corresponding index file. The question-answering model predicts the corresponding answer vector sequence according to the input question, and calculates the similarity with the encrypted data set and / or the non-encrypted data set according to the type label vector corresponding to each answer vector, and obtains the text corresponding to the corresponding answer vector based on the index file, thereby obtaining the answer text and outputting it.
[0025] Furthermore, the first encoding module and the second encoding module convert each field into an n+1-dimensional vector after processing by the autoencoder, wherein 1 dimension is a type label vector.
[0026] Furthermore, the client subsystem is also provided with:
[0027] The first classification module is used to classify each question-answer pair in the question-answer data set into encrypted combination vectors and non-encrypted data;
[0028] A second encoding module is used to vectorize each field of the non-encrypted data and the corresponding type label through an autoencoder to obtain an n-dimensional vector and a corresponding 1-dimensional type label vector added to the beginning or end of the n-dimensional vector, that is, a non-encrypted combination vector; and
[0029] The second classification module is used to classify and store each encrypted combination vector and the non-encrypted combination vector according to the type label vector, obtain an encrypted data vector set and a non-encrypted data vector set respectively, and use the corresponding type label vector as the category vector of the two vector sets.
[0030] Furthermore, the basic model of the initial question-answering model is the Bert model or the RoBerta model;
[0031] The initial question-answering model calculates an autoregressive loss value based on the predicted answer information, and trains the initial question-answering model based on the autoregressive loss value until convergence to obtain the question-answering model.
[0032] One or more embodiments of the present specification provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for generating a question-answering model as described in any one of the above items when executing the computer program.
[0033] One or more embodiments of the present specification provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the method for generating a question-answering model as described in any one of the above items is implemented.
[0034] The present disclosure provides a method, device, equipment and medium for generating a question-answering model. The advantages are that, in order to achieve the goal of providing the sensitive data of the data provider to the client for model training without leaking it and being able to train an application model suitable for the data provider, the sensitive data in the question-answering text is firstly self-encoded as encrypted data to obtain the corresponding vector data, and then the question-answering text with the vector data is obtained and provided to the client for model training, and an index file is created for the encrypted data set and stored in the data provider's index library. During the model training process, it is only necessary to understand the contextual relationship between the encrypted data vector and other text vectors and the correlation between the question-answering text vectors, without having to learn the encrypted data vectors. Corresponding text, after the model training is completed, the client will provide the question-answering model and the text-vector mapping set corresponding to the non-encrypted data to the data provider. During the model prediction process, the corresponding answer vector sequence is first predicted based on the input question, and then the encrypted data vector is compared with the encrypted data set stored in the data provider according to the type label vector of each vector in the answer vector sequence to determine the corresponding text. The non-encrypted data vector is compared with the non-encrypted data set sent by the client to determine the corresponding text, thereby obtaining the answer text. This prevents the leakage or tampering of confidential data and realizes the training of the model, making the model training method more applicable. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate one or more embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1A flow chart of a method for generating a question-answering model provided for one or more embodiments of this specification;
[0037] Figure 2 An architecture diagram of the initial question-answering model training process provided for one or more embodiments of this specification;
[0038] Figure 3 An example diagram of the initial question-answering model training process provided for one or more embodiments of this specification;
[0039] Figure 4 A system block diagram of a question-answering model generation system provided for one or more embodiments of this specification; and
[0040] Figure 5 A schematic diagram of the structure of a computer device provided for one or more embodiments of this specification. DETAILED DESCRIPTION
[0041] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below in conjunction with the drawings in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the protection scope of the present invention.
[0042] The present invention is described in detail below in conjunction with specific implementation methods and the accompanying drawings.
[0043] Method Embodiment
[0044] According to an embodiment of the present invention, a method for generating a question-answering model is provided. Figure 1 As shown, it is a flow chart of the method for generating a question-answering model provided in this embodiment. The method for generating a question-answering model according to an embodiment of the present invention includes:
[0045] Step S1, construct a question-answering dataset of the corresponding field, wherein the question-answering dataset includes a plurality of question-answering pairs respectively composed of data to be encrypted and non-encrypted data, and corresponding data type labels are set for the data to be encrypted and the non-encrypted data.
[0046] Step S2, encode the data to be encrypted in the question-answer pair through an autoencoder to obtain an encrypted combination vector composed of a feature vector and a type label vector, thereby obtaining an encrypted data set and a corresponding index file and storing them in the data provider database.
[0047] Step S3, sending the question-answer data set consisting of the encrypted combination vector and the unencrypted data to the client, and the client encodes the unencrypted data in the question-answer pair through an autoencoder to obtain an unencrypted combination vector consisting of a feature vector and a type label vector, thereby obtaining the unencrypted data set and the corresponding index file.
[0048] In step S4, the client inputs the question-answer pair consisting of the encrypted combination vector and the unencrypted combination vector into the machine learning model for training until convergence, thereby generating a question-answer model for the corresponding field.
[0049] In step S5, the client sends the question-answering model, the non-encrypted data set and the corresponding index file to the data provider, wherein the question is input into the question-answering model to predict the corresponding answer vector sequence, and the similarity is calculated with the encrypted data set and / or the non-encrypted data set based on the type label vector corresponding to each answer vector, and the text corresponding to the corresponding answer vector is obtained based on the index file, thereby obtaining the answer text and outputting it.
[0050] The method provided in this embodiment is to achieve that the sensitive data of the data provider is provided to the client for model training without leakage and to train an application model suitable for the data provider. First, the sensitive data in the question and answer text is used as encrypted data for self-encoding to obtain the corresponding vector data, and then the question and answer text with the vector data is obtained and provided to the client for model training, and an index file is created for the encrypted data set and stored in the data provider index library. During the model training process, it is only necessary to understand the contextual relationship between the encrypted data vector and other text vectors and the association relationship between the question and answer text vectors, and there is no need to learn the text corresponding to the encrypted data vector. After the model training is completed, the client provides the question and answer model and the text-vector mapping set corresponding to the non-encrypted data to the data provider. During the model prediction process, the corresponding answer vector sequence is first predicted according to the input question, and then according to the type label vector of each vector in the answer vector sequence, the encrypted data vector is compared with the encrypted data set stored in the data provider for similarity to determine the corresponding text, and the non-encrypted data vector is compared with the non-encrypted data set sent by the client for similarity to determine the corresponding text, thereby obtaining the answer text. In this way, the leakage or tampering of confidential data is prevented and the model training is realized, so that the application scenarios of the model training method are wider.
[0051] In this embodiment, reference Figure 2 and 3As shown, it is an architecture diagram of the initial question-answer model training process and an example diagram of the initial question-answer model training process provided by this embodiment. According to the figure, the data to be encrypted in the question-answer pair has been converted into a vector by the autoencoder before being provided to the client, and the non-encrypted data is converted into a vector by the autoencoder at the client, and then the converted vector sequence is input into the model for training; in this embodiment, in order to facilitate the distinction between encrypted and non-encrypted data, a data type label is also set for each field in the question-answer pair, and each field is converted into an n+1-dimensional encrypted vector after processing by the autoencoder, where 1 dimension is a type label vector
[0052] In a specific embodiment, for example, the text of the question and answer pair is {Xiao Ming's identity, Xiao Bai's company engineer}, where the "Xiao Bai's company engineer" in the answer is sensitive data, and therefore needs to be converted into a 512-dimensional vector + 1-dimensional type label vector through an autoencoder. The question and answer pair transmitted to the client is {Xiao Ming's identity (text), vec1, vec2, vec3, vec4, vec5, vec6, vec7}, where vec1-vec7 are 513-dimensional vector data. At the client, all the text in the question and answer pair is converted into 513-dimensional vector data through an autoencoder. Therefore, the question and answer pair is converted into a vector sequence and then input into the model.
[0053] In another specific embodiment, for example, the text of the question-answer pair is {How much is Xiao Ming's salary in July? The salary is five thousand}, where the salary in the question and the salary and five thousand in the answer are sensitive data, and therefore need to be converted into a 512-dimensional vector + 1-dimensional type label vector through an autoencoder. The question-answer pair transmitted to the client is {Xiao Ming in July (text), vec1, how much (text), vec2, is (text), vec3}, where vec1, vec2 and vec3 are 513-dimensional vector data. At the client, all text in the question-answer pair is converted into 513-dimensional vector data through an autoencoder. Therefore, the question-answer pair is converted into a vector sequence and then input into the model.
[0054] In this embodiment, the type label vector may be added at the beginning or end of the n-dimensional encrypted vector or the non-encrypted vector.
[0055] In this embodiment, the client vectorizes and saves the acquired question and answer data set to obtain an n-dimensional encrypted data vector set and an n-dimensional non-encrypted data vector set, which specifically includes the following steps:
[0056] Step 11, classifying each question-answer pair in the question-answer dataset into encrypted combination vectors and non-encrypted data;
[0057] Step 12, vectorize each field of the non-encrypted data and the corresponding type label through the autoencoder to obtain an n-dimensional vector and add a corresponding 1-dimensional type label vector at the beginning or end of the n-dimensional vector, that is, a non-encrypted combination vector;
[0058] Step 13: Classify and store the encrypted combination vectors and the non-encrypted combination vectors according to the type label vectors, obtain encrypted data vector sets and non-encrypted data vector sets respectively, and use the corresponding type label vectors as category vectors of the two vector sets.
[0059] In this embodiment, the type tag of the encrypted data vector is set to 0, and the type tag of the non-encrypted data vector is set to 1.
[0060] The method provided in this embodiment is that, in order to avoid leakage of sensitive data or key data to cooperative users, the data owner will now encrypt the data to be encrypted through vector encoding processing by an autoencoder before sending the data, and use the decryption model obtained by the data owner using text vector data including encrypted data and a preset n-dimensional encrypted data vector set and an n-dimensional non-encrypted data vector set for model training, which not only avoids leakage during data transmission and sharing of key data, but also enables the user to obtain the text data sent by the owner.
[0061] In this embodiment, the basic model of the initial question-answering model can be a model such as Bert (Bidirectional Encoder Representation from Transformers) and RoBerta (A Robustly Optimized Bert). The loss function of the model is set to the sum of the correlation of the 512-dimensional word vector and the category loss of the last 1-dimensional vector. The autoencoder can use one-hot encoding technology; the initial question-answering model calculates the autoregressive loss value based on the predicted answer information, and trains the initial question-answering model based on the autoregressive loss value until convergence to obtain the question-answering model.
[0062] In this embodiment, in the test phase, based on the encrypted data set and the corresponding index file in the data provider's database, and the non-encrypted data set and the corresponding index file provided by the client, after the question is input into the question-answering model, the answer text vector is predicted, and each vector in the obtained text vector data is respectively calculated with the encrypted data vector set or the non-encrypted data vector set according to the type label vector, which specifically includes the following steps:
[0063] According to the input text vector data, the category type label vector of each vector is sequentially obtained, and similarity is calculated with the category vector of the encrypted data vector set or the non-encrypted data vector set to obtain the target vector set;
[0064] Then, the similarity between the n-dimensional vector and each n-dimensional vector in the target vector set is calculated to obtain the target vector with the highest similarity;
[0065] Finally, the corresponding fields are matched according to the target vector and index library to obtain the target field;
[0066] Output the obtained target fields in sequence to obtain the answer text.
[0067] In this embodiment, considering that the trained model is used by the data provider, and the existing natural language processing model needs to pre-process the input corpus into vectors that the model can analyze and process, for sensitive data, the data provider only needs to convert it into vector data that the model can process, store the corresponding index file locally, and combine it with non-encrypted data to form a question-answer pair to provide it to the client. During the training process, the model only needs to understand the contextual relationship between vectors and the influence weights between vectors to obtain a trained question-answer model. During the use of the question-answer model by the data provider, the encrypted data vector in the model predicted answer can determine the corresponding field through the local index file to obtain the complete answer text.
[0068] System Example
[0069] According to an embodiment of the present invention, a training system for a question-answering model is provided. Figure 4 As shown, it is a block diagram of the training system of the question-answering model provided in this embodiment. The training system of the question-answering model according to the embodiment of the present invention includes a data provider subsystem and a client subsystem, wherein the data provider subsystem is provided with a question-answering data set construction module 10, a first encoding module 20 and a prediction module 50; the client subsystem is provided with a second encoding module 30 and a model training module 40;
[0070] The question-answer data set construction module 10 is used to construct a question-answer data set for a corresponding field, wherein the question-answer data set includes a plurality of question-answer pairs respectively composed of data to be encrypted and non-encrypted data, and corresponding data type labels are set for the data to be encrypted and the non-encrypted data.
[0071] The first encoding module 20 is used to encode the data to be encrypted in the question-answer pair through an autoencoder to obtain an encrypted combination vector composed of a feature vector and a type label vector, thereby obtaining an encrypted data set and a corresponding index file and storing them in a data provider database; and sending the question-answer data set composed of the encrypted combination vector and non-encrypted data to the client;
[0072] The second encoding module 30 is used to encode the non-encrypted data in each question-answer pair through an autoencoder to obtain a non-encrypted combination vector composed of a feature vector and a type label vector, thereby obtaining a non-encrypted data set and a corresponding index file;
[0073] The model training module 40 is used to input the question-answer pairs consisting of the encrypted combined vector and the unencrypted combined vector into the machine learning model for training until convergence, generate a question-answer model for the corresponding field, and send the question-answer model, the unencrypted data set and the corresponding index file to the data provider subsystem;
[0074] The prediction module 50 is used to obtain the corresponding answer vector sequence based on the question-answering model, the non-encrypted data set and the corresponding index file. The question-answering model predicts the corresponding answer vector sequence according to the input question, and calculates the similarity with the encrypted data set and / or the non-encrypted data set according to the type label vector corresponding to each answer vector, and obtains the text corresponding to the corresponding answer vector based on the index file, thereby obtaining the answer text and outputting it.
[0075] The method provided in this embodiment is to achieve the goal of providing the sensitive data of the data provider to the client for model training without leaking it and to be able to train an application model suitable for the data provider. First, the data provider uses the first encoding module 20 to self-encode the sensitive data in the question and answer text as encrypted data to obtain the corresponding vector data, and then obtains the question and answer text with the vector data and provides it to the client for model training. An index file is created for the encrypted data set and stored in the data provider's index library. During the model training process, it is only necessary to understand the contextual relationship between the encrypted data vector and other text vectors, and the correlation between the question and answer text vectors. There is no need to learn the text corresponding to the encrypted data vector. The model After training, the client provides the question-answering model and the text-vector mapping set corresponding to the non-encrypted data to the data provider subsystem. During the model prediction process, the prediction module 50 first predicts the corresponding answer vector sequence based on the input question, and then compares the encrypted data vector with the encrypted data set stored in the data provider based on the type label vector of each vector in the answer vector sequence to determine the corresponding text. The non-encrypted data vector is compared with the non-encrypted data set sent by the client to determine the corresponding text, thereby obtaining the answer text. This prevents the leakage or tampering of confidential data and realizes model training, making the model training method more applicable.
[0076] In this embodiment, each field in the question and answer pair is set with a data type label. After processing by the autoencoder, each field is converted into an n+1-dimensional vector, where 1 dimension is a type label vector. The type label vector can be added at the beginning or end of the n-dimensional vector.
[0077] In this embodiment, the client subsystem is further provided with:
[0078] A first classification module 60, for classifying each question-answer pair in the question-answer data set into encrypted combination vectors and non-encrypted data;
[0079] The second encoding module 30 is used to vectorize each field of the non-encrypted data and the corresponding type label through an autoencoder to obtain an n-dimensional vector and a corresponding 1-dimensional type label vector added to the beginning or end of the n-dimensional vector, that is, a non-encrypted combination vector;
[0080] The second classification module 70 is used to classify and store the encrypted combination vectors and the non-encrypted combination vectors according to the type label vector, obtain the encrypted data vector set and the non-encrypted data vector set respectively, and use the corresponding type label vector as the category vector of the two vector sets.
[0081] In this embodiment, the basic model of the initial question and answer model can be Bert, RoBerta and other models. The loss function of the model is set to the sum of the correlation of the 512-dimensional word vector and the category loss of the last 1-dimensional vector. The autoencoder can use one-hot encoding technology; the initial question and answer model calculates the autoregressive loss value based on the predicted answer information, and trains the initial question and answer model based on the autoregressive loss value until convergence to obtain the question and answer model.
[0082] The embodiment of the present invention is an apparatus embodiment corresponding to the above-mentioned method embodiment. The specific operations of the processing steps of each module can be understood by referring to the description of the method embodiment, which will not be repeated here.
[0083] like Figure 5 As shown, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which implements the method for generating the question-answering model in the above-mentioned embodiment when the computer program is executed by a processor, or implements the method for generating the question-answering model in the above-mentioned embodiment when the computer program is executed by a processor.
[0084] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0085] 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 device or 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. The device and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and the contents not described in detail in the specification of the present invention belong to the common knowledge of those skilled in the art.
Claims
1. A method for generating a question-answering model, characterized in that The following steps are involved: Construct a question-answering dataset for the corresponding field. The question-answering dataset includes multiple question-answer pairs composed of the data to be encrypted and the data not to be encrypted. The data to be encrypted and the data not to be encrypted are labeled with corresponding data types. The encrypted data in the question-answer pair is encoded by the autoencoder to obtain an encrypted combination vector consisting of a feature vector and a type label vector, thereby obtaining an encrypted data set and a corresponding index file and storing them in the data provider database; The question-answering dataset consisting of the encrypted combination vector and the unencrypted data is sent to the client. The client encodes the unencrypted data in the question-answering pair through an autoencoder to obtain an unencrypted combination vector consisting of a feature vector and a type label vector, thereby obtaining an unencrypted dataset and a corresponding index file. The client inputs the question-answer pair consisting of the encrypted combination vector and the non-encrypted combination vector into the machine learning model for training until convergence, and generates a question-answer model for the corresponding field; as well as The client sends the question-answering model, the non-encrypted dataset and the corresponding index file to the data provider, wherein the question is input into the question-answering model to predict the corresponding answer vector sequence, and the similarity is calculated with the encrypted dataset and / or the non-encrypted dataset based on the type label vector corresponding to each answer vector, and the text corresponding to the corresponding answer vector is obtained based on the index file, thereby obtaining the answer text and outputting it.
2. The method for generating a question-answering model according to claim 1, wherein: Each field in the question-answer pair is provided with a data type label, and each field is converted into an n+1-dimensional vector after being processed by the autoencoder, wherein one dimension is a type label vector.
3. The method for generating a question-answering model according to claim 1, wherein: The client vectorizes and saves the obtained question-answering dataset, which specifically includes the following steps: Classify the encrypted combination vector and non-encrypted data of each question-answer pair in the question-answer dataset; Vectorizing each field of the classified non-encrypted data and the corresponding type label through an autoencoder to obtain an n-dimensional vector and a corresponding 1-dimensional type label vector added to the beginning or end of the n-dimensional vector, i.e., a non-encrypted combination vector; and The encrypted combination vectors and the non-encrypted combination vectors are classified and stored according to the type label vector, and an encrypted data vector set and a non-encrypted data vector set are obtained respectively, and the corresponding type label vector is used as the category vector of the two vector sets.
4. The method for generating a question-answering model according to claim 1, wherein: The basic model of the initial question-answering model is the Bert model or the RoBerta model; The initial question-answering model calculates an autoregressive loss value based on the predicted answer information, and trains the initial question-answering model based on the autoregressive loss value until convergence to obtain the question-answering model.
5. A system for generating a question-answering model, characterized in that: It includes a data provider subsystem and a client subsystem, wherein the data provider subsystem is provided with a question-answer data set construction module, a first encoding module and a prediction module, and the client subsystem is provided with a second encoding module and a model training module; A question-answering dataset construction module is used to construct a question-answering dataset for a corresponding field. The question-answering dataset includes a plurality of question-answering pairs respectively composed of data to be encrypted and non-encrypted data. Corresponding data type labels are set for the data to be encrypted and the non-encrypted data. The first encoding module encodes the data to be encrypted in the question-answer pair through an autoencoder to obtain an encrypted combination vector consisting of a feature vector and a type label vector, thereby obtaining an encrypted data set and a corresponding index file and storing them in a data provider database; the question-answer data set consisting of the encrypted combination vector and non-encrypted data is sent to the client; The second encoding module is used to encode the non-encrypted data in each question-answer pair through an autoencoder to obtain a non-encrypted combination vector composed of a feature vector and a type label vector, thereby obtaining a non-encrypted data set and a corresponding index file; A model training module, which is used to input the question-answer pairs consisting of the encrypted combined vector and the unencrypted combined vector into the machine learning model for training until convergence, generate a question-answer model for the corresponding field, and send the question-answer model, the unencrypted data set and the corresponding index file to the data provider subsystem; and The prediction module is used to obtain the corresponding answer vector sequence based on the question-answering model, the non-encrypted data set and the corresponding index file. The question-answering model predicts the corresponding answer vector sequence according to the input question, and calculates the similarity with the encrypted data set and / or the non-encrypted data set according to the type label vector corresponding to each answer vector, and obtains the text corresponding to the corresponding answer vector based on the index file, thereby obtaining the answer text and outputting it.
6. The system for generating a question-answering model according to claim 5, wherein: The first encoding module and the second encoding module convert each field into an n+1-dimensional vector after processing by the autoencoder, wherein one dimension is a type label vector.
7. The system for generating a question-answering model according to claim 5, wherein: The client subsystem is also provided with: The first classification module is used to classify each question-answer pair in the question-answer data set into encrypted combination vectors and non-encrypted data; The second encoding module is used to vectorize each field of the non-encrypted data and the corresponding type label through an autoencoder to obtain an n-dimensional vector and add a corresponding 1-dimensional type label vector at the beginning or end of the n-dimensional vector, that is, a non-encrypted combination vector; as well as The second classification module is used to classify and store each encrypted combination vector and the non-encrypted combination vector according to the type label vector, obtain an encrypted data vector set and a non-encrypted data vector set respectively, and use the corresponding type label vector as the category vector of the two vector sets.
8. The system for generating a question-answering model according to claim 5, wherein: The basic model of the initial question-answering model is the Bert model or the RoBerta model; The initial question-answering model calculates an autoregressive loss value based on the predicted answer information, and trains the initial question-answering model based on the autoregressive loss value until convergence to obtain the question-answering model.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for generating a question-answering model as described in any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for generating a question-answering model as described in any one of claims 1 to 4 is implemented.
Citation Information
Cited By
Encryption enhancement generation method and system applying large language model, and program product
CN120337268A
Encryption enhancement generation method, system and program product using large language model
CN120337268B
