Recall model training method, recall method, recall device, equipment, medium and vehicle
By iteratively training the recall model based on pre-trained network and quantitative network, the problem of insufficient reliability of voice recall in the prior art is solved, and a more efficient voice recall effect is achieved.
Patent Information
- Application Number
- CN202310920411.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2025-02-07
AI Technical Summary
The prior art is difficult to provide a recall model training method with good generalization capabilities, resulting in insufficient reliability of voice recall.
By obtaining the historical problem text and labeling data entries corresponding to historical voice data, using the pre-trained network and quantitative network in the initial recall model, the historical problem text is processed, the initial and target training entries are formed, and the recall model is iteratively trained, and the training is done well the problem text recall model.
It realizes that the entire recall model only generates semantic loss once during the joint training process, reducing the semantic loss generated by the model training process, thereby improving the effectiveness and reliability of speech recall.
Smart Images

Figure CN119398133A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of machine learning technology, and in particular to a recall model training method, a recall method, a device, equipment, a medium and a vehicle. Background Art
[0002] With the development of intelligent technology, voice recall technology based on artificial intelligence has provided many conveniences for users' lives. For example, users can use the voice assistant installed in the vehicle system for human-computer interaction, specifically to control vehicle windows, seats, air conditioners and other components through the voice assistant, and can also control navigation, audio and video entertainment and other functions.
[0003] In order to meet users' voice recall needs in different scenarios, it is necessary to provide a recall model training method with good generalization ability, so as to improve the reliability of voice recall based on the trained recall model. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a recall model training method, a recall method, an apparatus, a device, a medium and a vehicle.
[0005] In a first aspect, the present disclosure provides a recall model training method, the method comprising:
[0006] Obtain the historical question text corresponding to the historical voice data and the annotated data entry corresponding to the historical question text;
[0007] Based on the pre-trained network in the initial recall model, the historical question text is processed to obtain a keyword training vector corresponding to the historical question text, and an initial training entry is formed by the historical question text and the keyword training vector;
[0008] Based on the initial quantization network in the initial recall model, the keyword training vector is processed to obtain a keyword training identifier corresponding to the keyword training vector, and a target training item is formed by the initial training item and the keyword training identifier;
[0009] The initial recall model is iteratively trained using the initial training items, the target training items and the annotated data items to obtain a trained question text recall model.
[0010] In some embodiments of the present disclosure, the iterative training of the initial recall model using the initial training items, the target training items, and the annotated data items to obtain a trained question text recall model includes:
[0011] Calculating loss data of the initial recall model based on the target training item, the labeled data item, and the initial training item;
[0012] According to the loss data of the initial recall model, the network parameters of the pre-trained network in the initial recall model are fine-tuned and the network parameters of the initial quantization network are iteratively adjusted until the loss data of the initial recall model is minimized, thereby obtaining a fine-tuned pre-trained network and an adjusted target quantization network, and the fine-tuned pre-trained network and the adjusted target quantization network constitute the trained question text recall model.
[0013] In some embodiments of the present disclosure, the step of calculating the loss data of the initial recall model based on the target training entry, the labeled data entry, and the initial training entry includes:
[0014] Calculating recall loss data of the initial recall model based on the target training entry and the labeled data entry;
[0015] Calculating the quantization loss data of the initial recall model based on the keyword training vector in the target training item and the keyword training identifier in the initial training item;
[0016] The recall loss data and the quantified loss data are added to obtain the loss data of the initial recall model.
[0017] In some embodiments of the present disclosure, before calculating the recall loss data of the initial recall model based on the target training entry and the labeled data entry, the method further includes:
[0018] Constructing a first inverted index according to the keyword training identifier and the historical question texts in which the keyword training vector has appeared;
[0019] Accordingly, the step of calculating the recall loss data of the initial recall model based on the target training item and the labeled data item includes:
[0020] According to each keyword training identifier and the first inverted index, query each target training item, and calculate a first similarity between the queried target training item and the annotated data item;
[0021] Based on the first similarity, recall loss data of the initial recall model is calculated.
[0022] In a second aspect, the present disclosure provides a recall method, the method comprising:
[0023] Using a pre-trained network fine-tuned in a pre-trained question text recall model, the question text to be processed corresponding to the current voice data is processed to obtain a keyword prediction vector corresponding to the question text to be processed, wherein the text to be processed and the keyword prediction vector form an initial prediction entry;
[0024] Quantizing the keyword prediction vector using the adjusted target quantization network in the pre-trained question text recall model to obtain a keyword prediction identifier corresponding to the keyword prediction vector, wherein the initial prediction item and the keyword prediction identifier form a target prediction item;
[0025] Based on the target prediction item and the reference data items corresponding to each reference question text in the preset question and answer library, the target question text corresponding to the question text to be processed is recalled from the preset question and answer library.
[0026] In some embodiments of the present disclosure, before recalling the target question text corresponding to the to-be-processed question text from the preset question and answer library based on the target prediction item and the reference data items corresponding to each reference question text in the preset question and answer library, the method further includes:
[0027] Constructing a second inverted index according to the keyword prediction identifier and the text to be processed in which the keyword prediction vector has appeared;
[0028] Correspondingly, the step of recalling the target question text corresponding to the question text to be processed from the preset question and answer library based on the target prediction item and the reference data items corresponding to each reference question text in the preset question and answer library includes:
[0029] According to each keyword prediction identifier and the second inverted index, query each target prediction item, and calculate a second similarity between the queried target prediction item and the reference data item;
[0030] Based on the second similarity, the target question text is recalled from the preset question and answer library.
[0031] In a third aspect, the present disclosure provides a recall model training device, the device comprising:
[0032] A data acquisition module, used to acquire historical question texts corresponding to historical voice data and annotated data entries corresponding to the historical question texts;
[0033] A first processing module is used to process the historical question text based on the pre-trained network in the initial recall model to obtain a keyword training vector corresponding to the historical question text, and form an initial training entry from the historical question text and the keyword training vector;
[0034] A second processing module is used to process the keyword training vector based on the initial quantization network in the initial recall model to obtain a keyword training identifier corresponding to the keyword training vector, and form a target training item from the initial training item and the keyword training identifier;
[0035] The model training module is used to iteratively train the initial recall model using the initial training items, the target training items and the annotated data items to obtain a trained question text recall model.
[0036] In a fourth aspect, the present disclosure provides a recall device, the device comprising:
[0037] A third processing module is used to process the to-be-processed question text corresponding to the current voice data using a pre-trained network fine-tuned in the pre-trained question text recall model to obtain a keyword prediction vector corresponding to the to-be-processed question text, wherein the to-be-processed text and the keyword prediction vector form an initial prediction entry;
[0038] A fourth processing module is used to quantize the keyword prediction vector using the adjusted target quantization network in the pre-trained question text recall model to obtain a keyword prediction identifier corresponding to the keyword prediction vector, wherein the initial prediction item and the keyword prediction identifier form a target prediction item;
[0039] The recall module is used to recall the target question text corresponding to the question text to be processed from the preset question and answer library based on the target prediction item and the reference data items corresponding to each reference question text in the preset question and answer library.
[0040] In a fifth aspect, the present disclosure provides an electronic device, including:
[0041] processor;
[0042] A memory for storing executable instructions;
[0043] The processor is used to read executable instructions from the memory and execute the executable instructions to implement the method described in the first aspect or the second aspect.
[0044] In a sixth aspect, the present disclosure provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor implements the method described in the first aspect or the second aspect.
[0045] In a seventh aspect, the present disclosure provides a vehicle, comprising:
[0046] The recall model training device as described in the third aspect; or,
[0047] The recall device as described in the fourth aspect; or,
[0048] The electronic device as described in the fifth aspect; or
[0049] A computer-readable storage medium as described in the sixth aspect.
[0050] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0051] The disclosed embodiment provides a recall model training method, a recall method, an apparatus, a device, a medium and a vehicle, the method comprising: obtaining a historical question text corresponding to the historical voice data and an annotated data entry corresponding to the historical question text; processing the historical question text based on the pre-trained network in the initial recall model to obtain a keyword training vector corresponding to the historical question text, and forming an initial training entry from the historical question text and the keyword training vector; processing the keyword training vector based on the initial quantization network in the initial recall model to obtain a keyword training identifier corresponding to the keyword training vector, and forming a target training entry from the initial training entry and the keyword training identifier; iteratively training the initial recall model using the initial training entry, the target training entry and the annotated data entry to obtain a trained question text recall model. Thus, the pre-trained network and the quantization network are located in the same question text recall model, and the pre-trained network and the quantization model are jointly trained using a unified training sample, so that the entire recall model ultimately only generates a semantic loss once during the joint training process, reducing the semantic loss generated during the model training process, and ultimately helping to improve the voice recall effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn according to probability.
[0053] Figure 1 A flowchart of a recall model training method provided in an embodiment of the present disclosure;
[0054] Figure 2 A logical schematic diagram of a recall model training method provided by an embodiment of the present disclosure;
[0055] Figure 3 A flowchart of a recall method provided by an embodiment of the present disclosure;
[0056] Figure 4 A schematic diagram of the structure of a recall model training device provided in an embodiment of the present disclosure;
[0057] Figure 5 A schematic diagram of the structure of a recall device provided in an embodiment of the present disclosure;
[0058] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0059] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0060] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0061] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0062] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0063] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0064] This embodiment provides a recall model training method, which can be executed by an electronic device or a server. Figure 1 A flowchart of a recall model training method provided by an embodiment of the present disclosure is shown.
[0065] like Figure 1 As shown, the recall model training method may include the following steps.
[0066] S110, obtaining historical question text corresponding to the historical voice data and annotated data entries corresponding to the historical question text.
[0067] In this embodiment, before model training, historical speech data is obtained and speech processed to obtain historical question text, and then data entries related to the historical question text and data entries not related to the historical question text are annotated to obtain annotated data entries corresponding to the historical question text.
[0068] The annotation data entry may specifically be in the form of (historical question text, keyword annotation vector, keyword annotation identifier).
[0069] S120. Based on the pre-trained network in the initial recall model, the historical question text is processed to obtain the keyword training vector corresponding to the historical question text, and the initial training items are formed by the historical question text and the keyword training vector.
[0070] Among them, the keyword training vector refers to the vector representation obtained after vectorizing the keywords in the historical question text.
[0071] Specifically, the pre-trained network can perform feature extraction processing on the historical question text to obtain a quantitatively identified keyword training vector, and form initial training items from the historical question text and the keyword training vector. The initial training items can specifically be in the form of (historical question text, keyword training vector).
[0072] Optionally, pre-trained networks include but are not limited to BERT, UniLM and other models.
[0073] S130 . Based on the initial quantization network in the initial recall model, the keyword training vector is processed to obtain a keyword training identifier corresponding to the keyword training vector, and a target training item is formed by the initial training item and the keyword training identifier.
[0074] The keyword training identifier refers to a discretized vector representation obtained after discretizing the keyword training vector.
[0075] Specifically, the initial quantization network can process the keyword training vector into several discrete identifiers, that is, obtain the keyword training identifier, and form the target training item by the initial training item and the keyword training identifier. The target training item can be specifically in the form of (historical question text, keyword training vector, keyword training identifier), and the keyword training identifier is specifically in the form of ID1, ID2...
[0076] Optionally, the initial quantized network includes but is not limited to a model embedding a function such as argmax.
[0077] S140, iteratively training the initial recall model using the initial training items, the target training items, and the annotated data items to obtain a trained question text recall model.
[0078] In this embodiment, after determining the initial training entries, target training entries and annotated data entries, the loss data of the initial recall model can be calculated based on the initial training entries, target training entries and annotated data entries, and based on the loss data of the initial recall model, the pre-trained network and the quantization model are jointly adjusted, that is, the initial recall model is iteratively trained until the value of the loss data reaches a stable state, thereby obtaining a trained question text recall model.
[0079] In this embodiment, specific implementations of S140 include but are not limited to the following:
[0080] S1401, calculating the loss data of the initial recall model based on the target training items, the labeled data items and the initial training items;
[0081] S1402. According to the loss data of the initial recall model, fine-tune the network parameters of the pre-trained network in the initial recall model and iteratively adjust the network parameters of the initial quantization network until the loss data of the initial recall model is minimized, thereby obtaining a fine-tuned pre-trained network and an adjusted target quantization network, and the fine-tuned pre-trained network and the adjusted target quantization network constitute a trained question text recall model.
[0082] Among them, S1401 specifically includes: calculating the recall loss data of the initial recall model based on the target training entries and the labeled data entries; calculating the quantization loss data of the initial recall model based on the keyword training vectors in the target training entries and the keyword training identifiers in the initial training entries; adding the recall loss data and the quantization loss data to obtain the loss data of the initial recall model.
[0083] Among them, the recall loss data includes but is not limited to cross entropy loss data, deep structured semantic model (DSSM) loss data, etc.
[0084] The quantitative loss data include but are not limited to Euclidean distance, relative entropy (ie KL divergence), etc.
[0085] In order to improve the calculation efficiency of the recall loss data, an inverted index can be constructed before calculating the recall loss data; accordingly, before "calculating the recall loss data of the initial recall model based on the target training entries and the labeled data entries", the method also includes: constructing a first inverted index based on the historical question texts in which the keyword training identifiers and the keyword training vectors have appeared; accordingly, "calculating the recall loss data of the initial recall model based on the target training entries and the labeled data entries" includes: querying each target training entry based on each keyword training identifier and the first inverted index, and calculating the first similarity between the queried target training entry and the labeled data entry; based on the first similarity, calculating the recall loss data of the initial recall model.
[0086] Specifically, after constructing the first inverted index, the target training entries corresponding to each keyword training identifier are retrieved according to each keyword training identifier and the first inverted index, and then the first similarity between the queried target training entry and the annotated data entry is calculated, and the first similarity is input into a function such as a cross entropy loss function to calculate the recall loss data of the initial recall model.
[0087] In this way, when calculating the recall loss data, the target training items corresponding to each keyword training identifier can be quickly found based on the inverted index to improve the calculation efficiency of the recall loss data, and ultimately accelerate the calculation speed of the loss data of the question text recall model.
[0088] It can be understood that since the pre-trained network and the quantized network are located in a question text recall model, and the pre-trained network and the quantized network are trained jointly, the entire question text recall model ultimately only generates semantic loss once during the joint training process, thereby reducing the semantic loss generated during the model training process.
[0089] To understand the training process of the recall model, see Figure 2 A logical schematic diagram of the recall model training method is shown. First, the historical question text is input into the pre-trained network in the initial recall model for processing to obtain the keyword training vector corresponding to the historical question text and form an initial training entry; then, the keyword training vector is input into the initial quantization network in the initial recall model for processing to obtain the keyword training identifier and form a target training entry; then, the recall loss data is calculated based on the target training entry and the labeled data entry, and the quantization loss data is calculated based on the keyword training vector and the keyword training identifier; finally, the recall loss data and the quantization loss data are input into the optimizer, so that the optimizer fine-tunes the network parameters of the pre-trained network and iteratively adjusts the network parameters of the initial quantization network based on the recall loss data and the quantization loss data, until the sum of the recall loss data and the quantization loss data is minimized, thereby obtaining a trained question text recall model.
[0090] The embodiment of the present disclosure provides a recall model training method, including: obtaining a historical question text corresponding to the historical voice data and an annotated data entry corresponding to the historical question text; processing the historical question text based on the pre-trained network in the initial recall model to obtain a keyword training vector corresponding to the historical question text, and forming an initial training entry from the historical question text and the keyword training vector; processing the keyword training vector based on the initial quantization network in the initial recall model to obtain a keyword training identifier corresponding to the keyword training vector, and forming a target training entry from the initial training entry and the keyword training identifier; iteratively training the initial recall model using the initial training entry, the target training entry, and the annotated data entry to obtain a trained question text recall model. Thus, the pre-trained network and the quantization network are located in the same recall model, and the pre-trained network and the quantization model are jointly trained using a unified training sample, so that the entire question text recall model ultimately only generates a semantic loss once during the joint training process, reducing the semantic loss generated during the model training process, and ultimately helping to improve the voice recall effect.
[0091] This embodiment provides a recall method, which can be executed by an electronic device or a server. Figure 3 A flowchart of a recall method provided by an embodiment of the present disclosure is shown.
[0092] like Figure 3 As shown, the recall method may include the following steps.
[0093] S310. Using the fine-tuned pre-trained network in the pre-trained question text recall model, the question text to be processed corresponding to the current voice data is processed to obtain a keyword prediction vector corresponding to the question text to be processed, wherein the text to be processed and the keyword prediction vector form an initial prediction entry.
[0094] In this embodiment, after the user starts the voice assistant, the user asks a question to the voice assistant installed on the electronic device, the audio acquisition device of the electronic device collects the current voice data corresponding to the question, and then the electronic device performs voice processing on the current voice data to obtain the text of the question to be processed.
[0095] The audio acquisition device may be a microphone or a microphone array.
[0096] The current voice data may be voice data of any language type and include various types of keywords such as weather, location, etc.
[0097] The keyword prediction vector refers to the vector representation obtained after vectorizing the keywords in the problem text to be processed.
[0098] Furthermore, the electronic device calls a pre-trained question text recall model, and uses the pre-trained network fine-tuned in the pre-trained question text recall model to convert the question text to be processed into a vector representation, obtains the keyword prediction vector corresponding to the question text to be processed, and forms an initial prediction item by the question text to be processed and the keyword prediction vector. The initial prediction item can specifically be in the form of (question text to be processed, keyword prediction vector).
[0099] S320. Quantize the keyword prediction vector using the adjusted target quantization network in the pre-trained question text recall model to obtain a keyword prediction identifier corresponding to the keyword prediction vector, wherein the initial prediction item and the keyword prediction identifier form a target prediction item.
[0100] The keyword prediction identifier refers to a discretized vector representation obtained after discretizing the keyword prediction vector.
[0101] In this embodiment, the electronic device continues to use the target quantization network adjusted in the question text recall model to discretize the keyword prediction vector, obtain the keyword prediction identifier corresponding to the keyword prediction vector, and form a target prediction item from the keyword prediction identifier and the initial prediction item. The target prediction item can be specifically in the form of (question text to be processed, keyword prediction vector, keyword prediction identifier), and the keyword prediction identifier is specifically in the form of ID1, ID2...
[0102] S330: Based on the target prediction item and the reference data items corresponding to each reference question text in the preset question and answer library, the target question text corresponding to the question text to be processed is recalled from the preset question and answer library.
[0103] The reference question text refers to the question text obtained by performing voice conversion on the reference voice data in a historical scenario.
[0104] In order to improve the efficiency of question recall, before S330, the method also includes: constructing a second inverted index based on the text to be processed in which the keyword prediction identifier and the keyword prediction vector have appeared; accordingly, S330 specifically includes: querying each target prediction item according to each keyword prediction identifier and the second inverted index, and calculating the second similarity between the queried target prediction item and the reference data item; based on the second similarity, recalling the target question text from the preset question and answer library.
[0105] Specifically, after constructing the second inverted index, the target prediction items corresponding to each keyword prediction identifier are retrieved according to the respective keyword prediction identifiers and the second inverted index. Then, the second similarity between the queried target prediction items and the reference data items is calculated, and the reference question text with the largest second similarity is selected from the preset question and answer library as the target question text.
[0106] In this way, when calculating the recalled question text, the target prediction item corresponding to each keyword prediction identifier can be quickly found based on the inverted index to improve the recall efficiency of the question text.
[0107] Furthermore, after recalling the target question text, the target answer text can be determined based on the target question text, and the target answer text can be converted into speech for playback.
[0108] The embodiment of the present disclosure provides a recall method, which includes: using a pre-trained network fine-tuned in a pre-trained question text recall model to process the question text to be processed corresponding to the current voice data, and obtain a keyword prediction vector corresponding to the question text to be processed, wherein the text to be processed and the keyword prediction vector form an initial prediction entry; using a target quantization network adjusted in a pre-trained question text recall model to quantize the keyword prediction vector to obtain a keyword prediction identifier corresponding to the keyword prediction vector, wherein the initial prediction entry and the keyword prediction identifier form a target prediction entry; based on the target prediction entry and the reference data entry corresponding to each reference question text in the preset question and answer library, recall the target question text corresponding to the question text to be processed from the preset question and answer library, wherein the target answer text corresponding to the target question text is used to be converted into answer voice data for playback. It can be seen that the present application uses a pre-trained question processing model to sequentially vectorize and quantize the question text to be processed corresponding to the current voice data, and obtains the target question text corresponding to the question text to be processed, thereby ensuring the reliability of the voice recall result.
[0109] The present disclosure also provides a recall model training device for implementing the above recall model training method. Figure 4 Provide explanation.
[0110] Figure 4 A schematic structural diagram of a recall model training device provided by an embodiment of the present disclosure is shown.
[0111] like Figure 4 As shown, the recall model training device 400 may include:
[0112] The data acquisition module 410 is used to acquire the historical question text corresponding to the historical voice data and the annotated data items corresponding to the historical question text;
[0113] A first processing module 420 is used to process the historical question text based on the pre-trained network in the initial recall model to obtain a keyword training vector corresponding to the historical question text, and form an initial training entry from the historical question text and the keyword training vector;
[0114] A second processing module 430 is used to process the keyword training vector based on the initial quantization network in the initial recall model to obtain a keyword training identifier corresponding to the keyword training vector, and form a target training item from the initial training item and the keyword training identifier;
[0115] The model training module 440 is used to iteratively train the initial recall model using the initial training items, the target training items and the annotated data items to obtain a trained question text recall model.
[0116] The recall model training device of the disclosed embodiment includes: obtaining the historical question text corresponding to the historical voice data and the annotated data entry corresponding to the historical question text; processing the historical question text based on the pre-trained network in the initial recall model to obtain the keyword training vector corresponding to the historical question text, and forming the initial training entry by the historical question text and the keyword training vector; processing the keyword training vector based on the initial quantization network in the initial recall model to obtain the keyword training identifier corresponding to the keyword training vector, and forming the target training entry by the initial training entry and the keyword training identifier; iteratively training the initial recall model using the initial training entry, the target training entry and the annotated data entry to obtain the trained question text recall model. Thus, the pre-trained network and the quantization network are located in the same question text recall model, and the pre-trained network and the quantization model are jointly trained using a unified training sample, so that the entire recall model only generates one semantic loss in the joint training process, reducing the semantic loss generated in the model training process, and ultimately helping to improve the voice recall effect.
[0117] In some embodiments of the present disclosure, the model training module 440 includes:
[0118] A loss function calculation unit, configured to calculate loss data of the initial recall model based on the target training entry, the labeled data entry, and the initial training entry;
[0119] An iterative training unit is used to fine-tune the network parameters of the pre-trained network in the initial recall model and iteratively adjust the network parameters of the initial quantization network according to the loss data of the initial recall model, until the loss data of the initial recall model is minimized, thereby obtaining a fine-tuned pre-trained network and an adjusted target quantization network, and the fine-tuned pre-trained network and the adjusted target quantization network constitute the trained question text recall model.
[0120] In some embodiments of the present disclosure, the loss function calculation unit is specifically used to:
[0121] Calculating recall loss data of the initial recall model based on the target training entry and the labeled data entry;
[0122] Calculating the quantization loss data of the initial recall model based on the keyword training vector in the target training item and the keyword training identifier in the initial training item;
[0123] The recall loss data and the quantified loss data are added to obtain the loss data of the initial recall model.
[0124] In some embodiments of the present disclosure, the loss function calculation unit is further used to: construct a first inverted index according to the keyword training identifier and the historical question text in which the keyword training vector has appeared;
[0125] According to each keyword training identifier and the first inverted index, query each target training item, and calculate a first similarity between the queried target training item and the annotated data item;
[0126] Based on the first similarity, recall loss data of the initial recall model is calculated.
[0127] It should be noted that Figure 4 The voice response module 400 shown may perform Figure 1-Figure 2 The various steps in the method embodiment shown in the figure are implemented Figure 1-Figure 2 The various processes and effects in the method embodiment shown are not described in detail here.
[0128] The present disclosure also provides a recall device for implementing the above-mentioned recall method. Figure 4 Provide explanation.
[0129] Figure 5 A schematic structural diagram of a recall device provided in an embodiment of the present disclosure is shown.
[0130] like Figure 5 As shown, the recall device 500 may include:
[0131] The third processing module 510 is used to process the question text to be processed corresponding to the current voice data using the pre-trained network fine-tuned in the pre-trained question text recall model to obtain a keyword prediction vector corresponding to the question text to be processed, wherein the text to be processed and the keyword prediction vector form an initial prediction entry;
[0132] The fourth processing module 520 is used to quantize the keyword prediction vector using the adjusted target quantization network in the pre-trained question text recall model to obtain a keyword prediction identifier corresponding to the keyword prediction vector, wherein the initial prediction item and the keyword prediction identifier form a target prediction item;
[0133] The recall module 530 is used to recall the target question text corresponding to the question text to be processed from the preset question and answer library based on the target prediction item and the reference data items corresponding to each reference question text in the preset question and answer library.
[0134] The embodiment of the present disclosure provides a recall device, which includes: using a pre-trained network fine-tuned in a pre-trained question text recall model to process the question text to be processed corresponding to the current voice data, and obtain a keyword prediction vector corresponding to the question text to be processed, wherein the text to be processed and the keyword prediction vector form an initial prediction entry; using a target quantization network adjusted in a pre-trained question text recall model to quantize the keyword prediction vector to obtain a keyword prediction identifier corresponding to the keyword prediction vector, wherein the initial prediction entry and the keyword prediction identifier form a target prediction entry; based on the target prediction entry and the reference data entry corresponding to each reference question text in the preset question and answer library, recall the target question text corresponding to the question text to be processed from the preset question and answer library, wherein the target answer text corresponding to the target question text is used to be converted into answer voice data for playback. It can be seen that the present application uses a pre-trained question processing model to sequentially vectorize and quantize the question text to be processed corresponding to the current voice data, and obtains the target question text corresponding to the question text to be processed, thereby ensuring the reliability of the voice recall result.
[0135] In some embodiments of the present disclosure, the device further includes:
[0136] An inverted index construction module, used to construct a second inverted index according to the keyword prediction identifier and the text to be processed in which the keyword prediction vector has appeared;
[0137] The recall module 530 is specifically used to: query each target prediction item according to each keyword prediction identifier and the second inverted index, and calculate the second similarity between the queried target prediction item and the reference data item;
[0138] Based on the second similarity, the target question text is recalled from the preset question and answer library.
[0139] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure is shown. The electronic device may be a controller on a vehicle or a cloud server communicating with the vehicle.
[0140] like Figure 6 As shown, the voice response device may include a controller 601 and a memory 602 storing computer program instructions.
[0141] Specifically, the controller 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0142] The memory 602 may include a large capacity memory for information or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 602 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 602 may be inside or outside the integrated gateway device. In a particular embodiment, the memory 602 is a non-volatile solid-state memory. In a particular embodiment, the memory 602 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (Electrically Erasable Programmable ROM, EEPROM), an electrically rewritable ROM (EAROM) or a flash memory, or a combination of two or more of these.
[0143] The controller 601 reads and executes the computer program instructions stored in the memory 602 to perform the steps of the voice response method provided in the embodiment of the present disclosure.
[0144] In one example, the voice response device may further include a transceiver 603 and a bus 604. Figure 6 As shown, the controller 601, the memory 602 and the transceiver 603 are connected via a bus 604 and communicate with each other.
[0145] The bus 604 includes hardware, software, or both. For example, but not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 604 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0146] The following is an embodiment of a computer-readable storage medium provided in an embodiment of the present disclosure. The computer-readable storage medium and the voice response method of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the computer-readable storage medium, reference can be made to the embodiment of the above-mentioned voice response method.
[0147] This embodiment provides a storage medium containing computer executable instructions, which are used to execute the above-mentioned recall model training method or recall method when executed by a computer processor.
[0148] Of course, the storage medium containing computer executable instructions provided in the embodiments of the present disclosure is not limited to the above method operations, and the computer executable instructions can also execute the recall model training method or related operations in the recall method provided in any embodiment of the present disclosure.
[0149] Through the above description of the implementation methods, the technical personnel in the relevant field can clearly understand that the present disclosure can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer cloud platform (which can be a personal computer, a server, or a network cloud platform, etc.) to execute the voice response method provided by each embodiment of the present disclosure.
[0150] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising" is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0151] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A recall model training method, characterized in that: include: Obtain the historical question text corresponding to the historical voice data and the annotated data entry corresponding to the historical question text; Based on the pre-trained network in the initial recall model, the historical question text is processed to obtain a keyword training vector corresponding to the historical question text, and an initial training entry is formed by the historical question text and the keyword training vector; Based on the initial quantization network in the initial recall model, the keyword training vector is processed to obtain a keyword training identifier corresponding to the keyword training vector, and a target training item is formed by the initial training item and the keyword training identifier; The initial recall model is iteratively trained using the initial training items, the target training items and the annotated data items to obtain a trained question text recall model.
2. The method according to claim 1, characterized in that The method of iteratively training the initial recall model by using the initial training items, the target training items, and the annotated data items to obtain a trained question text recall model includes: Calculating loss data of the initial recall model based on the target training item, the labeled data item, and the initial training item; According to the loss data of the initial recall model, the network parameters of the pre-trained network in the initial recall model are fine-tuned and the network parameters of the initial quantization network are iteratively adjusted until the loss data of the initial recall model is minimized, thereby obtaining a fine-tuned pre-trained network and an adjusted target quantization network, and the fine-tuned pre-trained network and the adjusted target quantization network constitute the trained question text recall model.
3. The method according to claim 2, characterized in that The calculating the loss data of the initial recall model based on the target training entry, the labeled data entry and the initial training entry includes: Calculating recall loss data of the initial recall model based on the target training entry and the labeled data entry; Calculating the quantization loss data of the initial recall model based on the keyword training vector in the target training item and the keyword training identifier in the initial training item; The recall loss data and the quantified loss data are added to obtain the loss data of the initial recall model.
4. The method according to claim 3, characterized in that: Before calculating the recall loss data of the initial recall model based on the target training entry and the labeled data entry, the method further includes: Constructing a first inverted index according to the keyword training identifier and the historical question texts in which the keyword training vector has appeared; Accordingly, the step of calculating the recall loss data of the initial recall model based on the target training item and the labeled data item includes: According to each keyword training identifier and the first inverted index, query each target training item, and calculate a first similarity between the queried target training item and the annotated data item; Based on the first similarity, recall loss data of the initial recall model is calculated.
5. A recall method, characterized in that: include: Using a pre-trained network fine-tuned in a pre-trained question text recall model, the question text to be processed corresponding to the current voice data is processed to obtain a keyword prediction vector corresponding to the question text to be processed, wherein the text to be processed and the keyword prediction vector form an initial prediction entry; Quantizing the keyword prediction vector using the adjusted target quantization network in the pre-trained question text recall model to obtain a keyword prediction identifier corresponding to the keyword prediction vector, wherein the initial prediction item and the keyword prediction identifier form a target prediction item; Based on the target prediction item and the reference data items corresponding to each reference question text in the preset question and answer library, the target question text corresponding to the question text to be processed is recalled from the preset question and answer library.
6. The method according to claim 5, characterized in that Before recalling the target question text corresponding to the to-be-processed question text from the preset question and answer library based on the target prediction item and the reference data items corresponding to each reference question text in the preset question and answer library, the method further includes: Constructing a second inverted index according to the keyword prediction identifier and the text to be processed in which the keyword prediction vector has appeared; Correspondingly, the step of recalling the target question text corresponding to the question text to be processed from the preset question and answer library based on the target prediction item and the reference data items corresponding to each reference question text in the preset question and answer library includes: According to each keyword prediction identifier and the second inverted index, query each target prediction item, and calculate a second similarity between the queried target prediction item and the reference data item; Based on the second similarity, the target question text is recalled from the preset question and answer library.
7. A recall model training device, characterized in that: include: A data acquisition module, used to acquire historical question texts corresponding to historical voice data and annotated data entries corresponding to the historical question texts; A first processing module is used to process the historical question text based on the pre-trained network in the initial recall model to obtain a keyword training vector corresponding to the historical question text, and form an initial training entry from the historical question text and the keyword training vector; A second processing module is used to process the keyword training vector based on the initial quantization network in the initial recall model to obtain a keyword training identifier corresponding to the keyword training vector, and form a target training item from the initial training item and the keyword training identifier; The model training module is used to iteratively train the initial recall model using the initial training items, the target training items and the annotated data items to obtain a trained question text recall model.
8. A recall device, characterized in that: include: A third processing module is used to process the to-be-processed question text corresponding to the current voice data using a pre-trained network fine-tuned in the pre-trained question text recall model to obtain a keyword prediction vector corresponding to the to-be-processed question text, wherein the to-be-processed text and the keyword prediction vector form an initial prediction entry; A fourth processing module is used to quantize the keyword prediction vector using the adjusted target quantization network in the pre-trained question text recall model to obtain a keyword prediction identifier corresponding to the keyword prediction vector, wherein the initial prediction item and the keyword prediction identifier form a target prediction item; The recall module is used to recall the target question text corresponding to the question text to be processed from the preset question and answer library based on the target prediction item and the reference data items corresponding to each reference question text in the preset question and answer library.
9. An electronic device, characterized in that: include: processor; A memory for storing executable instructions; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the method of any one of claims 1 to 4 or any one of claims 5 to 6.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the method according to any one of claims 1 to 4 or any one of claims 5 to 6.
11. A vehicle, characterized in that: include: The recall model training device as claimed in claim 7; or, The recall device as claimed in claim 8; or The electronic device as claimed in claim 9; or The computer readable storage medium of claim 10.