Retrieval model training method and data processing method
By using the SimCSE model and hidden tags in intelligent customer service, the shortcomings of manual annotation data in retrieval model training are solved, and efficient and accurate retrieval model training is achieved.
Patent Information
- Application Number
- CN202510005484.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-05-02
AI Technical Summary
In intelligent customer service, the training of retrieval models requires a large amount of manual labeling of data, resulting in waste of human resources and low training efficiency, and the training results are low in accuracy.
By obtaining the sample set used to train the search model, identify the target sample pair with the same semantics from other sample pairs for each sample pair, and hide the label between the target sample pair and the sample pair, train it using the SimCSE model to obtain an accurate search model.
It realizes that training can obtain accurate retrieval models without the participation of manual annotation, improving training efficiency and model accuracy.
Smart Images

Figure CN119918606A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent customer service technology, and in particular to a retrieval model training method and a data processing method. Background Art
[0002] In intelligent customer service, users ask questions to the intelligent assistant, and the intelligent assistant calls the retrieval model to search for the enterprise customer service knowledge base related to the user's question to answer the user's question.
[0003] Therefore, the accuracy of the retrieval model is crucial. When training the retrieval model, a large amount of labeled data related to business knowledge is generally required, and the general labeling is based on manual participation.
[0004] This leads to a waste of human resources and a strong subjective consciousness of manual standards. The accuracy of the retrieval model trained afterwards is low and the training process is slow. Summary of the invention
[0005] The embodiments of the present application provide a retrieval model training method and a data processing method to achieve the effect of being able to train an accurate retrieval model without the need for manual labeling.
[0006] In a first aspect, an embodiment of the present application provides a method for training a retrieval model, comprising:
[0007] Acquire a sample set for training a retrieval model, the sample set comprising: a plurality of sample pairs, each sample pair comprising: a first sample and a second sample, the second sample being a copy of the first sample, and the samples in the sample set being used to describe business problems;
[0008] For each sample pair, determining a target sample pair having the same semantics as the sample pair from other sample pairs;
[0009] Hiding the labels between the target sample pair and the sample pair;
[0010] The SimCSE model is trained according to the sample set after the hiding process to obtain the retrieval model.
[0011] In a possible implementation manner, determining a target sample having the same semantics as the sample pair from other sample pairs includes:
[0012] For any first sample pair in other sample pairs, input any sample in the first sample pair and the first sample into the guidance model, and output a semantic analysis result;
[0013] If the semantic analysis result indicates that the semantics are the same, the first sample pair is determined as a target sample having the same semantics as the sample pair.
[0014] In a possible implementation, for each sample pair, obtaining the sample pair includes:
[0015] Acquire the first sample from a business database;
[0016] Converting the first sample into vector information for representing semantic information of the first sample;
[0017] A random feature discarding process is performed on the vector information to determine a second sample corresponding to the first sample.
[0018] In a second aspect, an embodiment of the present application provides a data processing method, including:
[0019] Get pending business issues sent by users;
[0020] Determine, in a knowledge base, a target business problem with the same semantics as the business problem to be processed according to a retrieval model, wherein the retrieval model is obtained by training based on the method of any one of claims 1 to 3, and the knowledge base includes: at least one business problem and answer data corresponding to each business problem;
[0021] The target answer data corresponding to the target business question is sent to the user.
[0022] In a possible implementation, determining, in a knowledge base according to a retrieval model, a target business problem having the same semantics as the business problem to be processed includes:
[0023] For any business problem in the knowledge base, input the business problem and the business problem to be processed into the retrieval model to obtain the semantic similarity between the business problem and the business problem to be processed;
[0024] The business problem with the greatest semantic similarity is determined as the target business problem with the same semantics as the business problem to be processed.
[0025] In a third aspect, an embodiment of the present application provides a training device for a retrieval model, comprising:
[0026] An acquisition module is used to acquire a sample set for training a retrieval model, wherein the sample set includes: a plurality of sample pairs, each sample pair includes: a first sample and a second sample, the second sample is a copy of the first sample, and the samples in the sample set are used to describe business problems;
[0027] A determination module, configured to determine, for each sample pair, a target sample pair having the same semantics as the sample pair from other sample pairs;
[0028] A processing module, used for hiding the labels between the target sample pair and the sample pair;
[0029] The training module is used to train the SimCSE model according to the sample set after the hidden processing to obtain the retrieval model.
[0030] In a possible implementation manner, the determination module determines, from other sample pairs, a target sample having the same semantics as the sample pair, specifically for:
[0031] For any first sample pair in other sample pairs, input any sample in the first sample pair and the first sample into the guidance model, and output a semantic analysis result;
[0032] If the semantic analysis result indicates that the semantics are the same, the first sample pair is determined as a target sample having the same semantics as the sample pair.
[0033] In a possible implementation manner, the acquisition module acquires the sample pair for each sample pair, specifically for:
[0034] Acquire the first sample from a business database;
[0035] Converting the first sample into vector information for representing semantic information of the first sample;
[0036] A random feature discarding process is performed on the vector information to determine a second sample corresponding to the first sample.
[0037] In a fourth aspect, an embodiment of the present application provides a data processing device, including:
[0038] The acquisition module is used to obtain pending business issues issued by users;
[0039] a determination module, configured to determine, in a knowledge base, a target business problem with the same semantics as the business problem to be processed according to a retrieval model, wherein the retrieval model is obtained by training based on the method of the first aspect and any one of the aspects, and the knowledge base comprises: at least one business problem and answer data corresponding to each business problem;
[0040] The sending module is used to send the target answer data corresponding to the target business question to the user.
[0041] In a possible implementation manner, the determining module is specifically configured to:
[0042] For any business problem in the knowledge base, input the business problem and the business problem to be processed into the retrieval model to obtain the semantic similarity between the business problem and the business problem to be processed;
[0043] The business problem with the greatest semantic similarity is determined as the target business problem with the same semantics as the business problem to be processed.
[0044] In a fifth aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
[0045] The memory stores computer-executable instructions;
[0046] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the first and second aspects and / or various possible implementations of the first and second aspects as described above.
[0047] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement the first and second aspects above and / or various possible implementations of the first and second aspects.
[0048] In a seventh aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the first and second aspects above and / or various possible implementations of the first and second aspects.
[0049] The training method and data processing method of the retrieval model provided in the embodiments of the present application. The training method of the retrieval model includes: obtaining a sample set for training the retrieval model, the sample set includes: multiple sample pairs, each sample pair includes: a first sample and a second sample, the second sample is a copy of the first sample, and the samples in the sample set are used to describe business problems; for each sample pair, determine a target sample pair with the same semantics as the sample pair from other sample pairs; hide the labels between the target sample pair and the sample pair; according to the sample set after the hiding process, train the SimCSE model to obtain a retrieval model. This method is used to achieve the effect of training an accurate retrieval model without the participation of manual annotation. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0051] Figure 1 A schematic diagram of the training principle of the retrieval model provided in the embodiment of the present application;
[0052] Figure 2 Schematic diagram of the training method of the retrieval model provided in this application Figure 1 ;
[0053] Figure 3Schematic diagram of the training method of the retrieval model provided in this application Figure 2 ;
[0054] Figure 4 A flowchart of the data processing method provided in this application;
[0055] Figure 5 A schematic diagram of the structure of the training device for the retrieval model provided in this application;
[0056] Figure 6 A schematic diagram of the structure of the data processing device provided by this application;
[0057] Figure 7 A schematic diagram of the structure of the electronic device provided in this application.
[0058] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0059] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0060] Large Language Model (LLM) is a natural landing scenario in the field of intelligent customer service technology. In practical applications, in order to solve the problem of how to integrate internal knowledge into large models, the Retrieval-Augmented Generation (RAG) technology is usually used to plug in the internal knowledge base of the enterprise.
[0061] In intelligent customer service, users ask questions to the intelligent assistant, which then calls the retrieval model to search for the enterprise customer service knowledge base related to the user's question. The retrieved knowledge is input into the LLM together with the user's question, and the LLM responds.
[0062] In order for user questions to be able to accurately retrieve the company's customer service knowledge base, the retrieval model needs to be trained. Training requires a large amount of labeled data related to business knowledge. Data is difficult to obtain and is generally based on manual labeling.
[0063] Due to the large amount of data, low efficiency and strong subjectivity of manual labeling, the accuracy is relatively low when training the retrieval model.
[0064] In response to the technical problems existing in the prior art, the inventors have the following technical ideas in the process of solving the above technical problems: based on the Simple Contrastive Sentence Embedding (SimCSE) model and the LLM data generation capability, a retrieval model can be trained without the participation of manual annotation. In order to improve the SimCSE effect, a guide model (English: guide model) can be added to guide SimCSE training to eliminate erroneous data in the data labels generated by LLM. Specifically, the labels between samples with the same semantics as the samples in the generated training set are hidden.
[0065] Figure 1 A schematic diagram of the training principle of the retrieval model provided in the embodiment of the present application, such as Figure 1 As shown, the schematic diagram includes: LLM generates labels, guides model training, unsupervised sentences, SimCSE training, and retrieval model.
[0066] In one possible implementation, SimCSE training can be based on creating copies of samples of unsupervised sentence input, LLM generates labels for unsupervised sentences, and guides model training to determine the erroneous data existing in SimCSE training, and then hides these erroneous data, so as to perform SimCSE training based on the samples and labels after hiding processing to obtain a retrieval model.
[0067] The execution subject of the method involved in the embodiment of the present disclosure is an electronic device, which can be a mobile phone, a computer, a tablet computer, a server, etc.
[0068] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0069] Figure 2 Schematic diagram of the training method of the retrieval model provided in this application Figure 1 ,like Figure 2 As shown, the method includes:
[0070] Step 21: Obtain a sample set (English: batch) for training the retrieval model;
[0071] The sample set includes: a plurality of sample pairs, each sample pair includes: a first sample and a second sample, the second sample is a copy of the first sample, and the samples in the sample set are used to describe business problems;
[0072] In this step, a plurality of first samples describing business problems may be acquired in advance, such as questions asked during the interaction with the user during customer service, questions in a customer service knowledge base, and the like.
[0073] Furthermore, based on the training method of SimCSE, the first sample obtained above can be described as a copy close to the first sample, which is recorded as a second sample.
[0074] In a possible implementation, an example of the first sample (sentence) is shown in Table 1:
[0075] Table 1:
[0076] Sentence number Example S1 Does it support cellular network (card insertion)? S2 How much does it cost to replace the outer screen glass? S3 Can the mobile phone be inserted with a card?
[0077] Optionally, in step 21, for each sample pair, the implementation of obtaining the sample pair may be:
[0078] Step 1: Obtain the first sample from the business database;
[0079] In this implementation, the business database stores conversation information between different users and customer service in the after-sales, pre-sales and other stages, from which different first samples can be obtained.
[0080] Step 2: converting the first sample into vector information for representing semantic information of the first sample;
[0081] In this implementation, the bidirectional encoder representations from Transformer (Bidirectional Encoder Representations from Transformers, BERT) or other pre-trained language models (such as RoBERTa, GPT, etc.) can be used to convert the text of the input first sample into high-dimensional vector (English: embedding) information.
[0082] The output of the BERT model is a vector representation that captures the semantic information of the text.
[0083] Step 3: Perform random feature discarding on the vector information to determine the second sample corresponding to the first sample.
[0084] In this implementation, random dropout is applied to BERT’s embedding. When generating text embeddings, feature values can be randomly dropped to generate “different versions” of text embeddings, thereby generating a second sample corresponding to the first sample.
[0085] Specifically, dropout acts on the embedding dimension and randomly discards some values.
[0086] Step 22: for each sample pair, determine a target sample pair with the same semantics as the sample pair from other sample pairs;
[0087] In this step, for each first sample obtained above, since the advantage of SimCSE is that it does not require any training data, it only needs to create a copy of the first sample (i.e., the second sample) and treat other samples in the batch as negative samples for training, which can achieve quite good results. However, in the process of this implementation, there may be a situation where the first sample has similar semantics to other first samples, which is regarded as a positive sample in the business.
[0088] However, due to the mechanism of negative samples in the batch, it is mistakenly regarded as a negative sample. Therefore, in order to avoid the above problem, for each sample pair, a target sample pair with the same semantics as the sample pair can be determined from other sample pairs.
[0089] Optionally, before determining the target sample pair, the definition of the label in the training of SimCSE is explained first, and Table 2 is used as an example for explanation. Table 2 is a label schematic table, as shown in Table 2:
[0090] Table 2:
[0091]
[0092]
[0093] Among them, ~S1 is the second sample corresponding to S1, ~S2 is the second sample corresponding to S2, and ~S3 is the second sample corresponding to S3.
[0094] In a possible implementation, taking the first row as an example, sentence S1 and the label of sentence S1 itself are masked (mask means it is not effective in training), the label of sentence S1 and sentence ~S1 is 1, that is, the sample and its own copy are regarded as positive samples, and the labels of sentence S1 and sentences S2, ~S2, S3, and ~S3 are all 0, that is, the sample regards other samples in the batch and the copies of other samples as negative samples.
[0095] Taking the sample pair (S1, ~S1) as an example, the sentences "Does it support cellular network (card insertion)" and "Can the mobile phone insert a card?" are similar in meaning. At this time, the sample pair (S3, ~S3) can be determined as the target sample pair.
[0096] Step 23: Mask the labels between the target sample pair and the sample pair;
[0097] In this step, in order to prevent the target sample from being mistakenly regarded as a negative sample of the above sample pair, the label between the target sample pair and the sample pair can be hidden.
[0098] In a possible implementation, Table 3 is a schematic table of hiding a label, as shown in Table 3:
[0099] Table 3:
[0100] S1 ~S1 S2 ~S2 S3 ~S3 S1 mask 1 0 0 mask mask ~S1 1 mask 0 0 mask mask S2 0 0 mask 1 0 0 ~S2 0 0 1 mask 0 0 S3 mask mask 0 0 mask 1 ~S3 mask mask 0 0 1 mask
[0101] Step 24: Train the SimCSE model based on the sample set after the hidden processing to obtain a retrieval model.
[0102] In this step, after the erroneous data introduced by the negative samples in the above batch are eliminated, they will not have any impact on the training of this step.
[0103] That is, by training the SimCSE model with the improved labels, we get the retrieval model of RAG.
[0104] The training method of the retrieval model provided in the embodiment of the present application obtains a sample set for training the retrieval model, the sample set includes: multiple sample pairs, each sample pair includes: a first sample and a second sample, the second sample is a copy of the first sample, and the samples in the sample set are used to describe business problems; for each sample pair, a target sample pair with the same semantics as the sample pair is determined from other sample pairs; the labels between the target sample pair and the sample pair are hidden; according to the sample set after the hidden processing, the SimCSE model is trained to obtain a retrieval model. This method is used to achieve the effect of training an accurate retrieval model without the participation of manual annotation.
[0105] Figure 3 Schematic diagram of the training method of the retrieval model provided in this application Figure 2 ,like Figure 3 As shown, the method in step 22 may include the following steps:
[0106] Step 31: for any first sample pair in other sample pairs, input any sample in the first sample pair and the first sample into the guidance model, and output a semantic analysis result;
[0107] In this step, based on the guide model, the samples in the first sample pair and the first samples in other sample pairs can be respectively input into the guide model, and the semantic analysis results corresponding to the first samples in different other sample pairs can be respectively obtained.
[0108] In a possible implementation, Table 4 is a schematic table of guide model output, as shown in Table 4:
[0109] Table 4:
[0110] Sentence 1 Sentence 2 Semantic analysis results Does it support cellular network (card insertion)? How much does it cost to replace the outer screen glass? 0 Does it support cellular network (card insertion)? Can the mobile phone be inserted with a card? 1 Can the mobile phone be inserted with a card? How much does it cost to replace the outer screen glass? 0
[0111] Among them, the semantic analysis result 0 indicates different semantics, and the semantic analysis result 1 indicates the same semantics.
[0112] Optionally, the training-related part for the guidance model can be:
[0113] The label of the guide model is to determine whether two sentences have the same meaning. In this case, we can randomly extract user questions from the customer service conversation data and form sentence pairs, and use LLM such as qwen2.5-7b and llama3.2-8b to determine the labels of the sentence pairs;
[0114] In a possible implementation, LLM judges the labels of the sentence pair "how to connect" and "why the computer cannot connect to the Internet", and returns the judgment results in JSON format.
[0115] The json format contains two fields. The conclusion field represents the LLM conclusion, and the answer is "yes" or "no". Yes means that the sentence pairs have the same meaning, and no means they are different. The analysis field is the LLM's analysis process for judging the sentence pair labels.
[0116] Furthermore, after generating labels through LLM, the guide model is trained. The guide model training adopts the dual-tower model with BERT as the base and the cross entropy loss to increase the accuracy of the trained guide model.
[0117] Step 32: If the semantic analysis result indicates that the semantics are the same, determine the first sample pair as a target sample with the same semantics as the sample pair.
[0118] In this step, if the semantic analysis result indicates the same semantics, the first sample pair (S3, ˜S3) with the same semantics is determined as the target sample with the same semantics as the sample pair (S1, ˜S1).
[0119] That is, the operation of starting to execute step 23 is executed.
[0120] The training method of the retrieval model provided in the embodiment of the present application is to input any sample in the first sample pair and the first sample into the guidance model for any first sample pair in other sample pairs, output the semantic analysis result, and then if the semantic analysis result indicates the same semantics, determine the first sample pair as the target sample with the same semantics as the sample pair. This method is used to determine the sample pairs with the same semantics, so that the labels of the samples with the same semantics can be hidden later.
[0121] Figure 4 A flow chart of the data processing method provided in this application, such as Figure 4 As shown, the method includes:
[0122] Step 41: Obtain pending business issues sent by users;
[0123] In this step, based on the retrieval model obtained through the above training, the retrieval model can be applied to actual customer service business.
[0124] Furthermore, in response to the pending business problem input by the user in the customer service chat interface of the terminal device, the electronic device obtains the pending business problem.
[0125] In a possible implementation, the pending business question input by the user in the customer service chat interface is "Can this mobile phone be plugged in with a card?"
[0126] Step 42: According to the retrieval model, a target business problem having the same semantics as the business problem to be processed is determined in the knowledge base;
[0127] The retrieval model is trained based on the above-mentioned retrieval model training method, and the knowledge base includes: at least one business question and the answer data corresponding to each business question.
[0128] Optionally, step 42 may include the following implementation:
[0129] Step 1: For any business problem in the knowledge base, input the business problem and the business problem to be processed into the retrieval model to obtain the semantic similarity between the business problem and the business problem to be processed;
[0130] In this implementation, the business problem to be processed and any business problem in the knowledge base can be simultaneously input into the retrieval model, and after being processed by the retrieval model, the semantic similarity between the business problem and the business problem to be processed is output.
[0131] For example, semantic similarity can be expressed as 0-1, such as:
[0132] 1. The semantic similarity between “Can this mobile phone be used to insert a card?” and “Can a mobile phone be used to insert a card?” in the knowledge base is 0.9;
[0133] 2. The semantic similarity between “Can this phone be used to insert a card?” and “What are the dimensions of this phone?” in the knowledge base is 0.1.
[0134] It should be understood that before executing step 1, the business problems to be processed can be used to perform a preliminary screening of the business problems in the knowledge base to improve the retrieval efficiency of the retrieval model.
[0135] Step 2: Identify the business problem with the greatest semantic similarity as the target business problem with the same semantics as the business problem to be processed.
[0136] In this implementation, the greater the semantic similarity, the higher the consistency of the meanings of the two business problems. At this time, the business problem with the greatest semantic similarity can be determined as the target business problem with the same semantics as the business problem to be processed.
[0137] For example, the question “Can a mobile phone insert a card?” in the knowledge base is identified as the target business question corresponding to “Can this mobile phone insert a card?”
[0138] Step 43: Send the target answer data corresponding to the target business question to the user.
[0139] In this step, in the knowledge base, each business question has corresponding answer data. After the target business question is determined in the above steps, the answer data corresponding to the target business question can be used as the target answer data.
[0140] Furthermore, the terminal device obtains the target reply data and displays the target reply data in the customer service chat interface.
[0141] In a possible implementation, the answer data corresponding to "Can the mobile phone be plugged in with a card?" is "Yes," then after the user inputs "Can this mobile phone be plugged in with a card?", the customer service side in the customer service chat interface displays "Yes."
[0142] The data processing method provided in the embodiment of the present application obtains the business problem to be processed sent by the user; according to the retrieval model, the target business problem with the same semantics as the business problem to be processed is determined in the knowledge base, and the retrieval model is obtained by training based on the above training method, and the knowledge base includes: at least one business problem and the answer data corresponding to each business problem; the target answer data corresponding to the target business problem is sent to the user. In this scheme, the answer data corresponding to the business problem to be processed is retrieved quickly and accurately by using the retrieval model to increase the user experience.
[0143] Figure 5 A schematic diagram of the structure of the training device for the retrieval model provided in this application, such as Figure 5 As shown, the training device of the retrieval model provided in this embodiment includes:
[0144] An acquisition module 51 is used to acquire a sample set for training a retrieval model, the sample set comprising: a plurality of sample pairs, each sample pair comprising: a first sample and a second sample, the second sample being a copy of the first sample, and the samples in the sample set being used to describe business problems;
[0145] A determination module 52, configured to determine, for each sample pair, a target sample pair having the same semantics as the sample pair from other sample pairs;
[0146] A processing module 53, used for hiding labels between target sample pairs and sample pairs;
[0147] The training module 54 is used to train the SimCSE model according to the sample set after the hiding process to obtain a retrieval model.
[0148] In a possible implementation, the determination module 52 determines a target sample having the same semantics as the sample pair from other sample pairs, specifically for:
[0149] For any first sample pair in other sample pairs, any sample in the first sample pair and the first sample are input into the guidance model, and a semantic analysis result is output;
[0150] If the semantic analysis result indicates that the semantics are the same, the first sample pair is determined as a target sample having the same semantics as the sample pair.
[0151] In a possible implementation, the acquisition module 51 acquires the sample pair for each sample pair, specifically for:
[0152] Obtain a first sample from a business database;
[0153] Converting the first sample into vector information for representing semantic information of the first sample;
[0154] A random feature discarding process is performed on the vector information to determine a second sample corresponding to the first sample.
[0155] The retrieval model training device provided in this embodiment can execute the retrieval model training method provided in the above method embodiment. Its implementation principle and technical effects are similar, and this embodiment will not be described in detail here.
[0156] Figure 6 A schematic diagram of the structure of the data processing device provided in this application, such as Figure 6 As shown, the data processing device provided in this embodiment includes:
[0157] The acquisition module 61 is used to acquire the pending business issues sent by the user;
[0158] A determination module 62 is used to determine a target business problem with the same semantics as the business problem to be processed in the knowledge base according to a retrieval model, the retrieval model is obtained by training based on the method of the first aspect and any one of the items, and the knowledge base includes: at least one business problem and answer data corresponding to each business problem;
[0159] The sending module 63 is used to send the target answer data corresponding to the target business question to the user.
[0160] In a possible implementation, the determination module 62 is specifically configured to:
[0161] For any business problem in the knowledge base, the business problem and the business problem to be processed are input into the retrieval model to obtain the semantic similarity between the business problem and the business problem to be processed;
[0162] The business problem with the greatest semantic similarity is determined as the target business problem with the same semantics as the business problem to be processed.
[0163] The data processing device provided in this embodiment can execute the data processing method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.
[0164] Figure 7 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 7 As shown, the electronic device 7 provided in this embodiment includes: at least one processor 71 and a memory 72.
[0165] Optionally, the device 7 further includes a communication component 73 , wherein the processor 71 , the memory 72 and the communication component 73 are connected via a bus 74 .
[0166] In the specific implementation process, at least one processor 71 executes the computer execution instructions stored in the memory 72, so that at least one processor 71 executes the above method.
[0167] The specific implementation process of the processor 71 can be found in the above-mentioned method embodiment. Its implementation principle and technical effects are similar, and will not be repeated here in this embodiment.
[0168] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0169] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk storage.
[0170] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0171] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0172] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0173] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0174] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0175] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0176] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0177] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0178] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0179] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0180] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A training method for a retrieval model, characterized in that: include: Acquire a sample set for training a retrieval model, the sample set comprising: a plurality of sample pairs, each sample pair comprising: a first sample and a second sample, the second sample being a copy of the first sample, and the samples in the sample set being used to describe business problems; For each sample pair, determining a target sample pair having the same semantics as the sample pair from other sample pairs; Hiding the labels between the target sample pair and the sample pair; The SimCSE model is trained according to the sample set after the hiding process to obtain the retrieval model.
2. The method according to claim 1, characterized in that The determining, from other sample pairs, a target sample having the same semantics as the sample pair, comprises: For any first sample pair in other sample pairs, input any sample in the first sample pair and the first sample into the guidance model, and output a semantic analysis result; If the semantic analysis result indicates that the semantics are the same, the first sample pair is determined as a target sample having the same semantics as the sample pair.
3. The method according to claim 1 or 2, characterized in that: For each sample pair, obtaining the sample pair includes: Acquire the first sample from a business database; Converting the first sample into vector information for representing semantic information of the first sample; A random feature discarding process is performed on the vector information to determine a second sample corresponding to the first sample.
4. A data processing method, characterized in that: include: Get pending business issues sent by users; Determine, in a knowledge base, a target business problem with the same semantics as the business problem to be processed according to a retrieval model, wherein the retrieval model is obtained by training based on the method of any one of claims 1 to 3, and the knowledge base includes: at least one business problem and answer data corresponding to each business problem; The target answer data corresponding to the target business question is sent to the user.
5. The method according to claim 4, characterized in that Determining, in the knowledge base according to the retrieval model, a target business problem having the same semantics as the business problem to be processed includes: For any business problem in the knowledge base, input the business problem and the business problem to be processed into the retrieval model to obtain the semantic similarity between the business problem and the business problem to be processed; The business problem with the greatest semantic similarity is determined as the target business problem with the same semantics as the business problem to be processed.
6. A retrieval model training device, characterized in that: include: An acquisition module is used to acquire a sample set for training a retrieval model, wherein the sample set includes: a plurality of sample pairs, each sample pair includes: a first sample and a second sample, the second sample is a copy of the first sample, and the samples in the sample set are used to describe business problems; A determination module, configured to determine, for each sample pair, a target sample pair having the same semantics as the sample pair from other sample pairs; A processing module, used for hiding the labels between the target sample pair and the sample pair; The training module is used to train the SimCSE model according to the sample set after the hidden processing to obtain the retrieval model.
7. A data processing device, characterized in that: include: The acquisition module is used to obtain pending business issues issued by users; A determination module, configured to determine, in a knowledge base, a target business problem with the same semantics as the business problem to be processed according to a retrieval model, wherein the retrieval model is obtained by training based on the method of any one of claims 1 to 3, and the knowledge base comprises: at least one business problem and answer data corresponding to each business problem; The sending module is used to send the target answer data corresponding to the target business question to the user.
8. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 5 when executed by a processor.
10. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 5 when the computer program is executed by a processor.