Data processing method, device, electronic device and computer readable storage medium

By simplifying the feature matching process in speech recognition technology and using neural networks to extract features and perform matching, the problems of high complexity and poor scalability in the existing technology are solved, and the accuracy and efficiency of speech recognition are improved.

CN114444609BActive Publication Date: 2024-10-01TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210118785.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-08
Publication Date
2024-10-01
Estimated Expiration
2042-02-08

AI Technical Summary

Technical Problem

Existing speech recognition technology solutions are complex, costly and have poor scalability. They cannot effectively recognize multiple types of speech data and have low recognition accuracy.

Method used

Use data processing methods to obtain the characteristics of the data to be processed and match them with the candidate standard data characteristics in the target database to determine the matching target standard data. Use neural network model training to extract features, simplify the feature identification process, and improve identification. efficiency.

Benefits of technology

It achieves fast matching between different modal data, reduces the amount of calculation, improves recognition accuracy and efficiency, and is suitable for multi-type speech data recognition scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114444609B_ABST
    Figure CN114444609B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a data processing method, device, electronic device and computer-readable storage medium, which relate to the fields of artificial intelligence, multimedia, games and cloud technology. The method includes: obtaining data to be processed, the data to be processed is data of a first modality; extracting a first data feature of the data to be processed; matching the first data feature with at least one second data feature in a target database, and determining target standard data that matches the data to be processed from each candidate standard data according to the matching results corresponding to each second data feature, wherein the target database includes at least one candidate standard data and a second data feature of each candidate standard data, and the candidate standard data is data of a second modality. Based on the method provided in the embodiments of the present application, matching between data of different modalities can be achieved simply and quickly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of artificial intelligence, multimedia technology, games and cloud technology. Specifically, the present application relates to a data processing method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the development and promotion of speech recognition technology, the application of speech recognition has appeared in various application scenarios. For example, at present, most electronic devices are equipped with artificial intelligence (AI) voice assistants. AI voice assistants can recognize the collected voice data based on speech recognition technology, obtain the corresponding text content, and perform corresponding functions based on the recognized text content.

[0003] In the prior art, speech recognition technology is mostly implemented through complex speech recognition models, which usually obtain the encoding features of speech data through a speech encoder, and then predict the category of the speech data through a classification network. Although it can meet the needs to a certain extent, the solution is complex to implement and the cost is high. In addition, the solution has poor scalability and cannot add new categories. When there are many categories of speech data, the recognition accuracy is difficult to guarantee. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, device, electronic device, and computer-readable storage medium, based on which the matching between data of different modalities can be realized simply and quickly. The technical solutions provided by the embodiments of the present application are as follows:

[0005] On the one hand, an embodiment of the present application provides a data processing method, the method comprising:

[0006] Acquire data to be processed, where the data to be processed is data of the first mode;

[0007] Extracting a first data feature of the data to be processed;

[0008] Matching the first data feature with at least one second data feature in the target database to obtain matching results corresponding to each second data feature, wherein the target database includes at least one candidate standard data and the second data feature of each candidate standard data, and the candidate standard data is data of the second modality;

[0009] According to the matching results corresponding to the second data features, target standard data matching the data to be processed is determined from the candidate standard data.

[0010] On the other hand, an embodiment of the present application provides a data processing device, the device comprising:

[0011] A module for acquiring data to be processed, used for acquiring data to be processed, where the data to be processed is data of the first mode;

[0012] A feature acquisition module, used for extracting a first data feature of the data to be processed;

[0013] a data identification module, configured to match the first data feature with at least one second data feature in the target database, obtain matching results corresponding to the second data features, and determine target standard data matching the data to be processed from the candidate standard data according to the matching results corresponding to the second data features;

[0014] The target database includes at least one candidate standard data and a second data feature of each candidate standard data, and the candidate standard data is data of the second modality.

[0015] Optionally, the data identification module is further used to: determine the data type of the to-be-processed data according to the first data feature; accordingly, the data identification module can be used to:

[0016] When the data type of the data to be processed is a specified type, the first data feature is matched with at least one second data feature in the target database.

[0017] Optionally, the data of the first modality and the data of the second modality are data of different modalities, the data of the first modality includes at least one of text, voice, video or image, and the data of the second modality includes at least one of text, voice, video or image.

[0018] Optionally, the candidate standard data is a standard expression that matches the first standard data in the standard database, the first standard data is data of a first modality, and one first standard data corresponds to at least one standard expression.

[0019] Optionally, the feature acquisition module is also used to: when there is newly added first standard data in the standard database, obtain at least one standard expression corresponding to the newly added first standard data; extract the second data features of each standard expression corresponding to the newly added first standard data; and associate and store each standard expression corresponding to the newly added first standard data and the second data features corresponding to each standard expression in the target database.

[0020] Optionally, the first data feature is extracted by a first feature extraction network; the second data feature of the candidate standard data is extracted by a second feature extraction network; wherein the first feature extraction network and the second feature extraction network are trained by the model training module in the following manner:

[0021] Acquire a training data set, where the training data set includes a first training set, where each first sample in the first training set includes first data of a first modality and second data of a second modality matching the first data;

[0022] The initial neural network model is iteratively trained based on the training data set until the total training loss value meets the preset training end condition, wherein the neural network model includes a first network model and a second network model, and the first network model that meets the training end condition is used as the first feature extraction network, and the second network model that meets the training end condition is used as the second feature extraction network; the training process includes:

[0023] Input each first data into the first network model to obtain the characteristics of each first data, and input each second data into the second network model to obtain the characteristics of each second data;

[0024] Determine a first training loss value based on the matching degree between the feature of the first data and the feature of the second data in each first sample, and the matching degree between the feature of the first data and the feature of the second data in each first negative example; wherein the first negative example includes the first data of one first sample and the second data of another first sample;

[0025] If the first training loss value does not meet the first preset condition, the model parameters of the first network model and the second network model are adjusted, and the above-mentioned total training loss value meets the preset training end condition including that the first training loss value meets the first preset condition.

[0026] Optionally, when inputting each first data into the first network model to obtain the features of each first data, the model training module is used to:

[0027] For each first data, the following operations are performed on the first data through the first network model to obtain the features of the first data:

[0028] The first data is divided into at least two sub-data to obtain a sub-data sequence corresponding to the first data; based on a dictionary, a feature of each sub-data in the sub-data sequence is extracted, and based on the feature of each sub-data, a feature of the first data is obtained, wherein the dictionary includes a plurality of data elements, the number of feature values ​​included in the feature of each sub-data is equal to the number of elements in the dictionary, and a feature value represents the probability that the sub-data contains a data element corresponding to the position of the feature value in the dictionary;

[0029] The model training module is also used to: for each second data, determine, based on the dictionary, a data feature of the second data corresponding to the dictionary, wherein the data feature represents a probability that the second data corresponds to each data element in the dictionary;

[0030] When determining the first training loss value, the model training module is used to: determine the first training loss value based on the degree of matching between the features of each sub-data of the first data in each first sample and the data features of the second data corresponding to the dictionary, the degree of matching between the features of the first data in each first sample and the features of the second data, and the degree of matching between the features of the first data in each first negative example and the features of the second data.

[0031] Optionally, the model training module can be used to:

[0032] Determine the degree of difference between the characteristics of the first data and the characteristics of the second data of each first sample to obtain a first loss value;

[0033] For each first data, determine a first similarity corresponding to the first data and a second similarity corresponding to the first data, wherein the first similarity is the similarity between a feature of the first data and a feature of second data matching the first data, and the second similarity is the similarity between the first data and the second data in a first negative example where the first data is located;

[0034] Acquire a reference tag corresponding to each first data, the reference tag including a similarity tag corresponding to the first similarity and a similarity tag corresponding to the second similarity;

[0035] Determine a second loss value based on the predicted similarity and the reference label corresponding to each first data, wherein the predicted similarity includes the first similarity and the second similarity, and the second loss value represents the difference between the predicted similarity and the reference label corresponding to each first data;

[0036] A first training loss value is determined according to the first loss value and the second loss value.

[0037] Optionally, the candidate standard data is a standard expression of the second modality corresponding to the first standard data of the specified type; the initial neural network model also includes a classification model; the training data set also includes a second training set, each second sample in the second training set includes third data of the first modality, and fourth data of the second modality matching the third data, wherein the third data in the second training data set includes third data of the specified type and third data of the non-specified type, and each second sample also includes a type label of the third data in the sample; after obtaining the neural network model whose first training loss value satisfies the first preset condition, the model training module is further used to perform the following training process:

[0038] The training operation is continued to be repeatedly performed on the neural network model based on the second training set until the second training loss value satisfies the second preset condition, wherein the total training loss value satisfies the preset training end condition and also includes the second training loss value satisfying the second preset condition; the above training operation includes:

[0039] Input each third data into the first network model to obtain the characteristics of each third data, input each fourth data into the second network model to obtain the characteristics of each fourth data, input the characteristics of each third data into the classification model to obtain the prediction type corresponding to each third data;

[0040] Determine a second training loss value based on the degree of matching between the features of the third data in each second sample and the features of the fourth data, the degree of matching between the features of the third data in each second negative example and the features of the fourth data, and the degree of matching between the type label and the predicted type of each third data;

[0041] If the second training loss value does not meet the second preset condition, the model parameters of the neural network model are adjusted.

[0042] Optionally, the data of the first modality is speech, the data of the second modality is text, and the data elements are phonemes.

[0043] Optionally, specify the type as command voice.

[0044] On the other hand, an embodiment of the present application further provides an electronic device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the computer program to implement the method provided in any optional embodiment of the present application.

[0045] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method provided in any optional embodiment of the present application is implemented.

[0046] On the other hand, an embodiment of the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the method provided in any optional embodiment of the present application.

[0047] The beneficial effects of the technical solution provided by the embodiment of the present application are as follows:

[0048] The data processing method provided in the embodiment of the present application provides a novel data processing idea. When the method is used to process the data to be processed, after obtaining the data features of the data to be processed, there is no need to perform complex and cumbersome feature recognition on the data features. Instead, the matching between different modal data can be achieved simply and quickly through feature matching, which can greatly reduce the amount of calculation and improve data processing efficiency. In addition, since the target database stores candidate standard data, the standard data of the second modality that matches the data to be processed of the first modality determined by the method of the embodiment of the present application can also be well guaranteed in terms of recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0050] Figure 1 A flowchart of a data processing method provided in an embodiment of the present application;

[0051] Figure 2 A schematic diagram of the structure of a data processing system provided in an embodiment of the present application;

[0052] Figure 3 A schematic diagram of a training process of a neural network model provided in an embodiment of the present application;

[0053] Figure 4 A schematic diagram of a process flow of a pre-training phase provided in an embodiment of the present application;

[0054] Figure 5 A schematic diagram of a process flow of a fine-tuning training phase provided in an embodiment of the present application;

[0055] Figure 6 A schematic diagram of the principle of constructing an instruction vector library provided in an embodiment of the present application;

[0056] Figure 7 A schematic diagram of a voice command recognition process provided in an embodiment of the present application;

[0057] Figure 8a and Figure 8b A schematic diagram of a user interface provided in an example of the present application;

[0058] Fig. 9 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0059] Fig.10 A schematic diagram of the structure of an electronic device applicable to an embodiment of the present application. DETAILED DESCRIPTION

[0060] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0061] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" may be implemented as "A", or as "B", or as "A and B". When describing multiple (two or more) items, if the relationship between the multiple items is not clearly defined, the multiple items may refer to one, multiple or all of the multiple items. For example, the description of "parameter A includes A1, A2, A3" can be implemented as parameter A including A1 or A2 or A3, and can also be implemented as parameter A including at least two of the three items A1, A2, A3.

[0062] It should be noted that in the optional embodiments of the present application, the user information (such as voice data corresponding to the user) and other related data involved, when the above embodiments of the present application are applied to specific products or technologies, need to obtain user permission or consent, and the collection, use and processing of related data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. In other words, if the embodiments of the present application involve data related to the user, these data need to be obtained with the authorization and consent of the user and in compliance with the relevant laws, regulations and standards of the country and region.

[0063] Optionally, the data processing method provided in the embodiment of the present application can be implemented based on artificial intelligence (AI) technology. For example, feature extraction of data to be processed, feature extraction of candidate standard data, and feature extraction of data in the training data set can be implemented by a trained neural network model. AI is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. With the research and progress of artificial intelligence technology, artificial intelligence technology has been widely studied and applied in many fields. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0064] Optionally, the data processing involved in the embodiments of the present application can be implemented based on cloud technology. For example, the data calculation involved in the training of the above-mentioned neural network model and the data calculation involved in the processing of the data to be processed can be implemented using cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize the calculation, storage, processing, and sharing of data. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model application, which can form a resource pool, which is used on demand and is flexible and convenient. Cloud computing technology will become an important support. Cloud computing refers to the delivery and use mode of IT infrastructure, which refers to obtaining the required resources through the network in an on-demand and easily scalable manner; generalized cloud computing refers to the delivery and use mode of services, which refers to obtaining the required services through the network in an on-demand and easily scalable manner. This service can be IT and software, Internet-related, or other services. With the development of the Internet, real-time data streams, and the diversification of connected devices, as well as the promotion of search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Different from previous parallel distributed computing, the emergence of cloud computing will drive revolutionary changes in the entire Internet model and enterprise management model in terms of concept.

[0065] In order to better understand and illustrate the solutions provided by the embodiments of the present application, some relevant technical terms involved in the embodiments of the present application are first explained below.

[0066] Binary cross entropy error: Cross entropy loss is an objective function / loss function in deep learning. It is used to measure the similarity between the predicted result distribution (the predicted result output by the neural network) and the true label (i.e. the sample label). The error is calculated based on the sample prediction result (usually a probability between 0 and 1) and the true label (0 or 1). Assuming that the probability of the sample prediction result being true is y and the true label is y′, the corresponding error L can be expressed as: L = -y′log(y)-(1-y′)log(1-y).

[0067] Speech-translated text pair: Speech audio (i.e., speech signal / speech data) and the corresponding translated text (text data) constitute a pair.

[0068] Voice-command pair: the command voice and the natural language text that expresses the intention of the command. For example, the voice "Mark item A" and the text "There is item A here" can be a pair, and the voice "Mark item A" and the text "Mark item A" can also be a pair.

[0069] MFCC (Mel-Frequency Cepstral Coefficients) feature: MFCC feature is an audio feature for speech processing and can be used for neural network model input.

[0070] Phoneme: The basic acoustic unit of speech. It is a phonetic unit divided according to the natural properties of speech. It is analyzed based on the pronunciation actions in the syllable, and one action constitutes a phoneme.

[0071] CNN (Convolutional Neural Networks): CNN is a deep learning network structure that can capture local information of the input.

[0072] Transformer network: A deep learning network structure based on the attention mechanism, which can be applied to sequence inputs such as text and speech.

[0073] CTC (Connectionist Temporal Classification) error: also known as CTC loss, is the objective function used in deep learning to allow the model to automatically learn alignment.

[0074] MSE (Mean Squared Error): It is a loss function in deep learning and is used to calculate the distance between two vectors.

[0075] The following is an explanation of the technical solutions of various optional embodiments provided by the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following implementations can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different implementations will not be described repeatedly.

[0076] Figure 1A flow chart of a data processing method provided by an embodiment of the present application is shown, and the method can be executed by any electronic device, such as a user terminal or a server, or can be completed by the interaction between a user terminal and a server. For example, the data to be processed can be a user's voice command, and the user terminal can conveniently and quickly identify the specific content of the user's voice command (target standard data, i.e., the standard text expression of the user's intention) by executing the method provided by the embodiment of the present application, and can perform corresponding operations according to the recognition result. For another example, the method can also be executed by a server, and the server can receive the user's voice command sent by the user terminal, and identify the specific content of the user's voice command and perform corresponding operations by executing the method provided by the embodiment of the present application. Among them, the above-mentioned user terminal includes but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, wearable electronic devices, AR / VR devices, etc. The above-mentioned server can be a cloud server or a physical server, which can be a server or a server cluster.

[0077] The method provided in the embodiment of the present application can be applied to any application scenario where data of another modality matching the data needs to be identified based on data of one modality, wherein the "modality" in the embodiment of the present application refers to the form of data, the data style presented to people, that is, the type of data, such as voice data is data of one modality, and text data is data of another modality. For example, the method provided in the embodiment of the present application can be implemented as a functional module / plug-in of an application, for example, the application can be a game application, by applying the data processing method provided in the embodiment of the present application to the game application, the user can initiate a voice command when playing the game, and the recognition result (target standard data) of the user's voice command can be quickly determined through the functional module, and the game server can perform corresponding operations according to the recognition result, and can display the operation result to the user.

[0078] Among them, the method provided in the embodiment of the present application can be applied to any game with different modal data matching requirements, which may include but are not limited to action, adventure, simulation, role-playing, leisure and other types of games. For example, the method can be used in tactical competitive games or competition games. In these games, players can collect various game resources (such as virtual game props) on the game map in the virtual game scene through operations. Optionally, players can collect game resources by initiating voice commands. Based on the scheme provided in the embodiment of the present application, the characteristics of the player's voice command (i.e., the first data feature) can be matched with the pre-configured intention text features in the game database (i.e., the target database in the application scenario) (i.e., the characteristics of the standard text expression corresponding to the standard voice command, that is, the second data feature in the embodiment of the present application), and the player's intention (i.e., the matching standard text expression, that is, the target standard data) can be quickly and accurately determined, so that the corresponding operation can be performed according to the intention to complete the collection of game resources corresponding to the player's voice command.

[0079] Combine the following Figure 1 The flow chart shown in FIG. 1 is used to describe the data processing method provided in the embodiment of the present application. Figure 1 As shown in , the data processing method provided in the embodiment of the present application may include the following steps S110 to S140.

[0080] Step S110: Acquire data to be processed, wherein the data to be processed is data of the first modality.

[0081] Step S120: extracting the first data feature of the data to be processed.

[0082] Among them, the embodiment of the present application does not limit the specific form of the data of the first modality. Optionally, the data of the first modality may include but is not limited to at least one of text, voice, video or image. For example, in some application scenarios, the data to be processed may be the voice data of the acquired user, and in other application scenarios, the data to be processed may be the text data entered by the user. For another example, the data to be processed may include two types of data: text and image.

[0083] The first data feature of the data to be processed may be extracted by a trained first feature extraction network, wherein the input of the first feature extraction network may be the data to be processed, or data that meets the network input data format requirements after preprocessing the data to be processed. For example, the initial features of the data to be processed may be extracted by preprocessing, and the extracted initial features may be input into the feature extraction network, and the first data features with better feature expression capabilities may be further extracted through the network.

[0084] As an example, the data to be processed may be speech data. The speech data may be first subjected to time-frequency transformation to obtain audio features of the speech data (such as Mel-spectrogram features or MFCC features, etc.). The audio features may be used as input to a first feature extraction network, and a high-level feature representation of the speech data (also referred to as a speech vector representation or a speech representation vector) may be obtained through the network, which is the first data feature in this example.

[0085] Step S130: Match the first data feature with at least one second data feature in the target database to obtain matching results corresponding to each second data feature.

[0086] Step S140: According to the matching results corresponding to the second data features, target standard data matching the data to be processed is determined from the candidate standard data.

[0087] In the embodiment of the present application, the target database includes at least one candidate standard data and a second data feature of each candidate standard data, and the candidate standard data is data of the second modality.

[0088] Similarly, the specific form of the data of the second modality is not limited in the present embodiment, and may include but is not limited to at least one of text, voice, video or image. It is understandable that the data of the first modality and the data of the second modality are not data of the same modality. For example, the data of the first modality may be voice data, and the data of the second modality may be text data.

[0089] It should be noted that, in the embodiments of the present application, the data of the first modality and the data of the second modality may only include one type of data, and the data of the first modality or the data of the second modality may also include two or more types of data. When at least one of the data of the first modality or the data of the second modality includes two types of data, the data of the first modality and the data of the second modality are data of different modalities. It can be understood that at least one type of data in the data of the first modality and the data of the second modality is different. For example, the data of the first modality may be data including text and images, and the data of the second modality may be voice data. Taking the case where the data to be processed includes two types of data as an example, the first data feature of the data to be processed may be obtained by fusing (such as concatenating or adding) the features of the two types of data contained in the data to be processed. As an example, for example, the data to be processed includes voice data and text data. For the data to be processed, the features of the voice data and the features of the text data can be extracted respectively, and the data features of the data to be processed can be obtained by fusing the features of the two parts of the data.

[0090] The standard data in the embodiments of the present application (the candidate standard data mentioned above, and the first standard data mentioned below) can be understood as benchmark data or reference data, which is a standard expression of information. The standard data can be pre-configured according to application requirements.

[0091] In an embodiment of the present application, the second data feature of each candidate standard data may also be extracted through a trained neural network model. Specifically, each candidate standard data may be subjected to feature extraction through a second feature extraction network to obtain the second data feature of each candidate standard data. Similarly, the input of the second feature extraction network may be the candidate standard data, or the candidate standard data may be preprocessed and then the preprocessed data may be input into the second feature extraction network to obtain the second data feature of the candidate standard data. For example, the candidate standard data may be text data, and the initial feature representation of the text data may be obtained through word embedding or one-hot encoding, and the initial feature representation may be input into the second feature extraction network to obtain a high-level feature representation of the text data, i.e., the second data feature.

[0092] As an optional solution, the candidate standard data in the above-mentioned target database can be a standard expression that matches each first standard data in the standard database, the first standard data is data of the first modality, and one first standard data corresponds to at least one standard expression.

[0093] A first standard data and a standard expression of the standard data can be understood as two standard descriptions / expressions of a piece of information in different data forms. For example, the first standard data is data in voice form, and the standard expression is data in text form. The first standard data and the corresponding standard expression can be understood as the voice expression and text expression of the same information. For example, as an example, the information is "hello", the first standard data is the voice data of "hello", and the corresponding standard expression is the text content "hello".

[0094] As an example, a voice command library can be preconfigured in a game application, and the voice command library can store standard text expressions (which can also be understood as recognition results of voice commands) corresponding to various standard voice commands (the first standard data in the application scenario) supported by the game application. Game players can input voice commands (data to be processed) on the client side of the game application, and the game server can find the voice recognition results that match the voice commands currently input by the user from the standard text expressions corresponding to the standard voice commands by executing steps S120 to S140 above.

[0095] Optionally, the matching result corresponding to a second data feature may be the matching degree between the first data feature and the second data feature, such as similarity. After obtaining the matching results between the first data feature and each second data feature, the candidate standard data corresponding to the second data feature with the highest matching degree may be used as the target standard data. Alternatively, the candidate standard data corresponding to a set number of matching degrees that are ranked top in order of matching degree may be used as the target standard data. Alternatively, the candidate standard data corresponding to each second data feature with a matching degree greater than a set value may be used as the target standard data.

[0096] The data processing method provided in the embodiment of the present application is a novel data processing method. When the method is used to process the data to be processed, it is not necessary to perform complex data recognition based on the data features of the data to be processed. Instead, the matching between different modal data can be conveniently and quickly achieved by matching the features. Based on this method, since there is no need to further identify the first data feature of the data to be processed, the amount of calculation can be greatly reduced and the data processing efficiency can be improved. Furthermore, since the target database stores candidate standard data, the standard data of the second modality that matches the first modal data to be processed is determined by the method of the embodiment of the present application, and the recognition accuracy can also be well guaranteed.

[0097] In addition, in actual applications, when it is necessary to perform corresponding operations based on the data to be processed, since the standard data matching the data to be processed is determined, the operation can be performed directly based on the standard data. Compared with some existing methods of obtaining corresponding recognition results by further identifying data features, there is no need to further process the recognition results into standardized data, which can better meet the actual application needs.

[0098] In an optional embodiment of the present application, the data processing method may further include:

[0099] When there is newly added first standard data in the standard database, obtaining at least one standard expression corresponding to the newly added first standard data;

[0100] Extracting second data features of each standard expression corresponding to the newly added first standard data;

[0101] Each standard expression corresponding to the newly added first standard data and the second data feature corresponding to each standard expression are associated and stored in the target database.

[0102] When there is new first standard data in the standard database (for example, as game applications are continuously updated and optimized, game applications have more functions and can support the input of more voice commands), the standard expressions corresponding to these newly added standard data can be obtained, and the second data features of the standard expressions can be extracted. The standard expressions (that is, the newly added candidate standard data) and the corresponding second data features can be associated and stored in the target database to expand the target database.

[0103] Among them, after obtaining the first data feature of the data to be processed, if the existing technology is adopted (for example, the first data feature is processed by a neural network model to obtain the matching data of the second mode corresponding to the data to be processed), when new first standard data appears, the neural network model needs to be retrained so that if the data to be processed is a standard expression corresponding to the newly added data, the neural network model can support the recognition of the data to be processed. The solution is complex to implement and the cost is high. However, the solution provided by the embodiment of the present application, when new first standard data appears, only the standard expression corresponding to the newly added first standard data and the second data feature of the standard expression need to be added to the target database. By matching the first data feature of the data to be processed with the second data feature in the updated target database, the target standard data corresponding to the data to be processed can be determined from the candidate standard data, which is simple to implement and low in cost.

[0104] In an optional embodiment of the present application, the data processing method may further include: determining the data type of the data to be processed according to the first data feature; at this time, in the above step S130, matching the first data feature with at least one second data feature in the target database may include:

[0105] When the data type of the data to be processed is a specified type, the first data feature is matched with at least one second data feature in the target database.

[0106] In some application scenarios, only one or some specified types of data may need to be specifically processed. In order to meet this application requirement, as an optional solution, before matching the data features of the data to be processed with the data features of the candidate standard data, the data type of the data to be processed can be pre-determined. When the data type of the data to be processed is a specified type, matching processing is performed to reduce unnecessary data processing and save computing resources. In this optional solution, the candidate standard data in the target database can be the standard expression corresponding to each first standard data of the specified type. In actual applications, the specified type can be one type or at least two types, which can be configured according to actual needs.

[0107] It should be noted that when the optional scheme is actually implemented, the data type of the data to be processed can be determined first, and when the data type is a specified type, subsequent matching processing can be performed. It is also possible that both the data type determination and the matching processing are performed, and then the subsequent further processing method is determined based on the matching result and the data type determination result. For example, after extracting the first data feature of the data to be processed, the data type of the data to be processed can be determined based on the feature, and the first data feature can be matched with the second data feature in the target database, and then the target standard data corresponding to the data to be processed can be determined based on the determined data type and the matching results corresponding to each second data feature. It can be understood that the target standard data of the data to be processed may exist or may not exist. For example, when any of the following conditions is not met, it can be determined that there is no target standard data matching the data to be processed:

[0108] The data type is not the specified type; the matching degree corresponding to each second data feature is less than the set value.

[0109] In an embodiment of the present application, the data type of the data to be processed is determined according to the first data feature of the data to be processed, which can also be implemented through a neural network model, for example, it can be implemented through a classification model. Specifically, the first data feature of the data to be processed can be input into a trained classification model, and the probability that the data type of the data to be processed belongs to a specified type can also be obtained through the model, and whether the data to be processed is of a specified type can be determined based on the probability. Among them, the classification model can be a two-classification model, that is, the classification categories corresponding to the model include two types of specified types and non-specified types, and the output of the model can include a first probability and a second probability that the data type of the data to be processed belongs to a specified type and a non-specified type, respectively. It can be determined whether the data type is of a specified type based on the first probability and the second probability. For example, if the first probability is greater than the set probability, it is determined that the data type of the data to be processed is of a specified type.

[0110] As an optional solution, the specified type may include at least two types, and the classification model may be a multi-classification model. The classification categories corresponding to the model include non-specified types and various specified types. If there are two specified types, which are recorded as the first type and the second type, then the classification categories corresponding to the classification model may be three types. The model can be used to predict the probability that the data to be processed belongs to the non-specified type, the first type, and the second type, respectively, and the type corresponding to the largest probability value can be determined as the data type of the data to be processed. Optionally, for this solution, the target database may include multiple sub-libraries, each of which corresponds to a standard expression (second modal data) corresponding to the first standard data (first modal data) of a specified type. The classification model can be used to identify whether the data to be processed is of the specified type. If it is an instruction type, it can also be identified as which specific specified type it is. Accordingly, the first data feature of the data to be processed can be matched with the second data feature of the candidate standard data in the sub-library corresponding to the specified type, without matching the first data feature with the second data feature in each sub-library, which can further reduce the amount of data processing.

[0111] From the foregoing description, it can be seen that in an embodiment of the present application, for data of the first modality (such as data to be processed), its data features can be extracted through a first feature extraction network; for data of the second modality (such as each candidate standard data), its data features can be extracted through a second feature extraction network; wherein, the first feature extraction network and the second feature extraction network are obtained by training a neural network model based on a training data set.

[0112] In the embodiment of the present application, the neural network model includes a first network model and a second network model, and the first network model and the second network model can be iteratively trained based on a training data set, and the trained first network model is used as the first feature extraction network, and the trained second network model is used as the second feature extraction network. The model structure of the first network model and the second network model is not limited in the present embodiment of the application, and can be configured according to application requirements. For example, the first network model and the second network model can both adopt a model based on CNN. Optionally, the model structure can be configured according to the form of the data to be processed by the model. For example, the data of the first modality is voice data, and the first network model can adopt a network structure that can well extract the features of the voice data, such as a Wac2vec model. If the data of the second modality is text data, the second network model can adopt a network structure that has a good effect on text data, for example, a model based on a Transformer network can be adopted, such as a structure based on a Bert (Bidirectional Encoder Representation from Transformers, a bidirectional encoding network based on Transformer) model.

[0113] Optionally, the neural network model including the first network model and the second network model in the embodiment of the present application may be trained in the following manner:

[0114] Acquire a training data set, wherein the training data set includes a first training set, and each first sample in the first training set includes first data of a first modality and second data of a second modality matching the first data;

[0115] The initial neural network model is iteratively trained based on the above training data set until the total training loss value meets the preset training end condition, and the first network model that meets the training end condition is used as the first feature extraction network, and the second network model that meets the training end condition is used as the second feature extraction network; the above training process may include the following steps:

[0116] Input each first data into the first network model to obtain the characteristics of each first data, and input each second data into the second network model to obtain the characteristics of each second data;

[0117] Determine a first training loss value based on the matching degree between the features of the first data and the features of the second data in each first sample, and the matching degree between the features of the first data and the features of the second data in each first negative example; wherein the first negative example includes the first data of one first sample and the second data of another first sample;

[0118] If the first training loss value does not meet the first preset condition, the model parameters of the first network model and the second network model are adjusted, wherein the total training loss value meets the preset training end condition including that the first training loss value meets the first preset condition.

[0119] When training the neural network model, the first data and the second data of each first sample in the first training set are two modal data that match each other. The first sample can also be called a positive example, that is, a positive sample. The first negative example (negative sample) is the first data and the second data in different first samples, that is, two modal data that do not match each other. For any first data, the data can be a plurality of other second data (except the second data that matches the first data) to constitute a negative example. During the training process, the training loss value is determined based on the matching degree between the data features of the positive samples and the matching degree between the data features of the negative samples.

[0120] The embodiment of the present application does not limit the specific form of the loss function selected in the training process. The purpose of model training is to make the similarity between the features of the first data and the second data that match each other as large as possible, and the similarity between the features of the first data and the second data that do not match each other as small as possible.

[0121] Among them, for positive samples, the degree of difference between the features of the first data learned through the first network model and the features of the second data learned through the second network model (for example, 1 minus the similarity, or the mean square error between the two features, etc.) can be calculated to obtain the corresponding training loss. For negative samples, an optional method is to calculate the degree of matching between the features of the first data learned through the first network model and the features of the second data learned through the second network model to obtain the corresponding training loss. Through continuous training and learning, the degree of matching between the data features of positive samples learned by the model can be made higher and higher (that is, the difference is getting smaller and smaller), and the degree of matching between the data features of negative samples can be made lower and lower. For different loss functions, the calculation method of calculating the above-mentioned matching degree or difference degree is also different.

[0122] In an optional embodiment of the present application, the determining of the first training loss value based on the degree of matching between the feature of the first data in each first sample and the feature of the second data, and the degree of matching between the feature of the first data in each first negative example and the feature of the second data, may include:

[0123] Determine the degree of difference between the characteristics of the first data and the characteristics of the second data of each first sample to obtain a first loss value;

[0124] For each first data, determine a first similarity corresponding to the first data and a second similarity corresponding to the first data, wherein the first similarity is the similarity between a feature of the first data and a feature of second data matching the first data, and the second similarity is the similarity between a feature of the first data and a feature of the second data in a first negative example where the first data is located;

[0125] Acquire reference tags corresponding to each first data, where the reference tags include a similarity tag corresponding to the first similarity and a similarity tag corresponding to the second similarity;

[0126] Determine a second loss value based on the predicted similarity and the reference label corresponding to each first data, wherein the predicted similarity includes the first similarity and the second similarity, and the second loss value represents the difference between the predicted similarity and the reference label corresponding to each first data;

[0127] A first training loss value is determined according to the first loss value and the second loss value.

[0128] Optionally, the first loss value may be the sum of the mean square errors between the features of the first data and the features of the second data in each positive sample, or may be calculated by calculating the similarity between the features of the first data and the features of the second data in each positive sample, subtracting the similarity from 1 as the degree of difference, and taking the sum of the degrees of difference corresponding to each positive sample as the first loss value. The first loss value can make the features of the two modalities of data in the positive samples learned by the model as close as possible.

[0129] The above-mentioned second loss value can also be called a matching error, which is used to constrain the similarity between the features of the two data in the positive sample learned by the model to be higher than the similarity between the features of the two data in the negative sample. When calculating this part of the loss, the above-mentioned reference label is the real label during training, that is, the result that the model is expected to learn. Specifically, for each first data, the similarity label corresponding to the first similarity in the corresponding real label refers to the ideal similarity between the first data and the second data that matches it, such as 1 or a relatively high similarity. The second similarity in the real label refers to the ideal similarity between the second data and the second data that does not match it, such as 0 or a relatively small similarity. The reference label can be pre-configured. Based on the features of the first data and the features of the second data output by the model, the first similarity and each second similarity corresponding to each first data can be calculated, and these similarities can be formed into a similarity vector. By calculating the difference between the similarity vector and the reference label, the second loss value is obtained. For example, the similarity vector can be used as the probability distribution predicted by the model, and the reference label can be used as the real probability distribution, that is, the label, and the second loss value is obtained by calculating the cross entropy loss between the two.

[0130] In an optional embodiment of the present application, the step of inputting each first data into the first network model to obtain the features of each first data may include:

[0131] For each first data, the following operations are performed on the first data through the first network model to obtain the features of the first data:

[0132] The first data is divided into at least two sub-data to obtain a sub-data series corresponding to the first data; based on the dictionary, the features of each sub-data in the sub-data series are extracted, wherein the dictionary includes a plurality of data elements, the number of feature values ​​included in the features of each sub-data is equal to the number of elements in the dictionary, and a feature value represents the probability that the sub-data contains a data element corresponding to the position of the feature value in the dictionary; based on the features of each sub-data, the features of the first data are obtained;

[0133] In this solution, the data processing method may further include:

[0134] For each second data, based on the dictionary, determining a data feature of the second data corresponding to the dictionary, wherein the data feature represents a probability that the second data corresponds to each data element in the dictionary;

[0135] Accordingly, the above-mentioned determination of the first training loss value may include:

[0136] The first training loss value is determined based on the degree of matching between the features of each sub-data of the first data in each first sample and the data features of the second data corresponding to the dictionary, the degree of matching between the features of the first data in each first sample and the features of the second data, and the degree of matching between the features of the first data in each first negative example and the features of the second data.

[0137] It can be seen that in this optional scheme, the first training loss value also increases the loss (which can be called the third loss value) corresponding to the degree of matching between the features of each sub-data of the first data in each first sample and the data features of the second data corresponding to the above-mentioned dictionary (which can be called the third loss part). Based on this loss, the probability that the features of each sub-data in the first data learned by the first network model can be used to predict the second data matching the first data can be maximized. In other words, the third loss value is to constrain the first network model so that the features of each sub-data in the first data learned by the model can predict the second data.

[0138] Optionally, the third loss part can use CTC error (also called CTC loss), which allows the model to automatically learn the alignment between data of different modalities. In an embodiment of the present application, the data elements in the above-mentioned dictionary are data units that can be used to represent each sub-data of the first data and the second data. The form of the data elements can be configured according to needs. Optionally, the data elements may include but are not limited to pinyin or phonemes. Taking phonemes as an example, the data elements in the dictionary include each phoneme and a blank character (a pseudo-identifier added to it in CTC loss to achieve automatic alignment between data, also called blank). For each sub-data of the first data, the dimension of the feature of the sub-data (that is, the length of the feature vector) is equal to the number of data elements in the dictionary. The position of each data element in the dictionary is fixed. The feature of the sub-data represents the probability of the data element at each position in the sub-data. As an illustrative illustration, assuming that there are three elements a, b, and c in the dictionary, the length of the feature of a sub-data is 3, which can be expressed as (p1, p2, p3), where p1, p2, and p3 respectively represent the probability of a appearing at the first position as p1, the probability of b appearing at the second position as p2, and the probability of c appearing at the third position as p3. For the second data, its data feature corresponding to the dictionary represents the probability that the data feature represents the data feature corresponding to each data element in the dictionary. When calculating the third loss value corresponding to each positive sample, the probability of the data feature of the second data corresponding to the dictionary can be determined based on the feature sequence of each sub-data of the first data (that is, the feature vector composed of each feature value). Based on the constraint of the third loss value, the probability is maximized, so that the features of each sub-data of the first data learned by the first network model can contain the semantic information of the second data.

[0139] Optionally, the first data may be speech data, the second data may be text data, and the data elements in the dictionary may be phonemes. The second data corresponds to the data features of the dictionary, and may be a phoneme sequence corresponding to the second data, that is, a sequence of phonemes constituting the second data. When extracting features from speech data, features may be first extracted from each speech frame (i.e., sub-data) of the speech data based on the dictionary to obtain a feature representation corresponding to each speech frame. When calculating the CTC loss, the phoneme sequence corresponding to the text data is used as a label, and the CTC loss is calculated based on the feature representation of each speech frame and the label. The value of the loss represents the probability of predicting the phoneme sequence of the text data based on the feature representation of each speech frame. The greater the probability, the smaller the loss value.

[0140] In an optional embodiment of the present application, the candidate standard data may be a standard expression of a second modality corresponding to first standard data of a specified type; the initial neural network model further includes a classification model; at this time, the training data set further includes a second training set, each second sample in the second training set includes third data of the first modality, fourth data of the second modality matching the third data, and a type label of the third data, wherein the third data in the second training data set includes third data of a specified type and third data of a non-specified type; after obtaining a neural network model whose first training loss value satisfies a first preset condition, the model training process may further include:

[0141] Continue to repeatedly perform the training operation on the neural network model based on the second training set until the second training loss value meets the second preset condition, wherein the total training loss value meets the preset training end condition and also includes the second training loss value meeting the second preset condition; the training operation may include:

[0142] Input each third data into the first network model to obtain the characteristics of each third data, input each fourth data into the second network model to obtain the characteristics of each fourth data, input the characteristics of each third data into the classification model to obtain the prediction type corresponding to each third data;

[0143] Determine a second training loss value based on the degree of matching between the features of the third data in each second sample and the features of the fourth data, the degree of matching between the features of the third data in each second negative example and the features of the fourth data, and the degree of matching between the type label and the predicted type of each third data;

[0144] If the second training loss value does not meet the second preset condition, the model parameters of the neural network model are adjusted.

[0145] As can be seen from the foregoing description, in some application scenarios, it is necessary to discriminate the data type of the data to be processed, and further processing can be performed when the data type is of a specified type. In order to meet the application requirements, in this optional embodiment of the present application, in addition to the first network model and the second network model, the above-mentioned neural network model may also include a classification model, which is cascaded with the first network model to discriminate the type of data input to the first network model according to the characteristics output by the first network model. In this optional embodiment, the process of training the neural network model based on the first training set in the foregoing text can be called pre-training. Through pre-training, the first network model and the second network model that basically meet the application requirements can be obtained. After obtaining a neural network model that meets the first preset condition through pre-training (for convenience of description, the model is called an intermediate model), the intermediate model can continue to be fine-tuned based on the second training data set. Training, in order to obtain a model that can better meet the specific task requirements.

[0146] During the fine-tuning training process, a part of the training loss (matching loss) can be calculated based on the matching degree between the features of the third data in each second sample and the features of the fourth data, and the matching degree between the features of the third data in each second negative example and the features of the fourth data, and a part of the training loss (classification loss) can be calculated based on the type label and prediction label of each third data, and the further training of the model is constrained based on these two parts of the training losses. Among them, the method of calculating the loss based on the matching degree between the features of the third data in each second sample and the features of the fourth data, and the matching degree between the features of the third data in each second negative example and the features of the fourth data can adopt the method of calculating the matching loss (i.e., the second loss value) in the previous text, and of course, it can also be the scheme of calculating the first loss value and the second loss value in the previous text.

[0147] For the classification loss, the loss value of this part represents the similarity between the type of the third data predicted by the classification model and the actual type of the third data, that is, the type label. Optionally, the type label of the third data can be 1 or 0. For example, 1 indicates that the third data is data of a specified type, and 0 indicates that the third data is not data of a specified type. The output of the classification model may include a first probability that the third data is of a specified type and a second probability that the third data is not of a specified type. The training loss part corresponding to the classification model can be calculated based on the two probabilities output by the classification model of the type labels of each third data. Optionally, the loss part can be calculated using a binary cross entropy error. The smaller the error value, the closer the predicted type is to the actual type.

[0148] After obtaining a neural network model that meets the training end conditions through this optional embodiment, when applied, the data type of the data to be processed can be identified through the trained classification model. Specifically, the data to be processed can be input into the trained first network model (i.e., the first feature extraction network) to obtain the first data feature of the data to be processed, and the first data feature is input into the trained classification model to obtain the first probability that the data to be processed belongs to the specified type of data and the second probability that the data to be processed does not belong to the specified type of data. According to the first probability and the second probability, it can be determined whether the data to be processed is the specified type of data. For example, the data to be processed is voice data, and the instruction type is voice instruction, that is, the specified type of voice data is instruction-type voice. If it is determined through the classification model that the data to be processed is instruction-type voice data, its features can be matched with the features of each candidate standard data (such as text) in the target database to find the text expression that matches the voice data, which can also be understood as the recognition result of the voice data.

[0149] The data processing scheme provided in the embodiment of the present application proposes a data matching method based on cross-modal retrieval, which can only use the data features of the data to be processed without further in-depth identification of the data features, and can quickly find data of another modality that matches the data to be processed, that is, the target standard data, from the target database. Compared with the prior art, the scheme of the present application can greatly and effectively reduce the amount of data calculation, and the accuracy rate has also been significantly improved compared with the prior art.

[0150] The method provided in the embodiment of the present application can be applied to any scenario that requires cross-modal data processing. For example, the method can be applied to the command recognition scenario of an AI voice assistant, and can accurately and quickly identify the user's semantic instructions; the method can also be applied to the voice question and answer of an AI robot. Through this method, a text expression that matches the voice input by the user can be found, so that the answer information corresponding to the text expression can be provided to the user; the method can also be applied to cross-modal data retrieval scenarios, for example, it can be applied to search engines or various applications, and matching audio data can be found based on the text data input by the user. For example, the corresponding music can be found based on the search text input by the user and provided to the user. In addition, the above-mentioned first feature extraction network and the second feature extraction network provided in the embodiment of the present application can also be applied to various scenarios where data features need to be extracted, and data features with better semantic expression capabilities can be extracted.

[0151] In actual implementation, in the embodiment of the present application, both the data to be processed and the candidate standard data can include at least one type of data, such as the data of the first modality is speech, and the data of the second modality is text. It can be understood that when the data to be processed or the data of the second modality can include two types of data, when the above-mentioned first feature extraction network and the second feature extraction network are trained, the data of the first modality (first data and third data) and the data of the second modality (second data and fourth data) in the training data set should at least include data of types corresponding to the data to be processed and the candidate standard data, respectively. For example, the data to be processed can be data including data of the first type and data of the second type, and the candidate standard data is data of the third type. Then at least part of the first data and the third data in the training data set should also include data of the first type and data of the second type, and the second data corresponding to this part of the first data and the fourth data corresponding to this part of the third data should also be data of the third type, that is, the type of sample data in the training data set used when training the feature extraction network should correspond to the type of data processed after the network is trained.

[0152] In order to better understand the method provided in the embodiment of the present application and the practical value of the method, the method provided in the embodiment of the present application is described below in conjunction with a specific scenario embodiment.

[0153] The application scenario corresponding to this scenario embodiment is a game scenario. The method provided by the embodiment of the present application can be applied to the AI ​​voice assistant in the game application, and the A voice assistant can recognize the voice command input by the user. In the game scenario, when the user is playing the game, he can interact with the AI ​​voice assistant through voice. For example, when the user says "mark P city" while playing the game in his user terminal, the purpose is to let the AI ​​voice assistant mark the location "P city" on the map of the virtual scene of the game. The voice command "mark item A" is to let the AI ​​voice assistant mark "item A" in the virtual game scene.

[0154] Figure 2 A schematic diagram of the structure of a data processing system applicable to the embodiment of this scenario of the present application is shown, Figure 2 As shown in , the data processing system may include a user terminal 10, a game server 20 and a training server 30. The user terminal 10 may be connected to the game server 20 through a network. The user terminal 10 may be a user terminal of any game player. The game server 20 is used to provide game services for the players. The type of game application is not limited in this embodiment of the application. It may be a game application that the user needs to download and install, a cloud game application, or a game application in a mini program. The training server 30 may be connected to the game server 20 through a network. The training server 30 may be used to perform training operations of the neural network model and provide the trained neural network model to the game server 20.

[0155] Among them, the above-mentioned AI voice assistant can be deployed in the game server 20 or in the user terminal 10. Optionally, in order to reduce the computing resources of the user terminal 10, the following is an example of the AI ​​voice assistant being deployed on the side of the game server 20.

[0156] In this application scenario, the data to be processed is the user's voice data, the first standard data is the pre-configured standard voice command, that is, the voice command supported by the game application, and the standard expression corresponding to the first standard data is the text expression (that is, the candidate standard data). Figure 2 The data processing system shown in the figure illustrates an optional implementation process of the method provided by the present application in a game scene. The data processing process in this embodiment may include the following steps 1 to 5:

[0157] Step S1: training the neural network model.

[0158] This step may be performed by the training server 30 . Figure 3 The diagram below shows the training principle of the neural network model in this scenario. Figure 3 As shown in , the training process can include two stages: pre-training and fine-tuning training. Figure 4 The schematic diagram of the pre-training stage is shown. Figure 5 A schematic diagram showing the principle of the fine-tuning training phase.

[0159] like Figure 3 As shown in , the neural network model in this scenario embodiment includes a speech coding module (first network model), a text coding module (second network model) and a classification module. The speech data can obtain the corresponding speech representation vector (i.e., the characteristics of the speech data, which can also be called vector representation) through the speech coding module, and the text data can obtain the corresponding text representation vector (i.e., the characteristics of the text data) through the text coding module. This application does not limit the specific network structure of this module, and it can be configured according to actual needs.

[0160] Optionally, the speech encoding module may adopt a structure based on the Wav2vec2 model, for example, in the Wav2vec2 model ( Figure 4 Wav2vec2 as shown in ) followed by a pooling module ( Figure 4 The Wav2vec2 model is composed of a multi-layer CNN and a multi-layer Transformer. When the speech coding module is used for feature extraction, the speech data is first encoded by the Wav2vec2 model to obtain a vector sequence. Each value of the sequence is a vector (which can be understood as a feature vector of a speech segment). Then, the average value of the vector sequence can be calculated through the pooling operation to obtain a vector, which is the speech representation vector. For the text coding module, the module can optionally adopt a structure based on the Bert model, which is composed of a multi-layer Transformer. Figures 3 to 5 The training process of the two stages of pre-training and fine-tuning training of the neural network model is explained.

[0161] Pre-training process

[0162] The pre-training is performed based on the first training set, which includes a large amount of speech-to-text data (i.e., the first sample, including speech data and text data matching the speech data). Figure 3 The first data in the sample speech is called the sample speech, and the text data corresponding to the speech data ( Figure 3 The second data in is called translated text, which explains the pre-training process.

[0163] like Figure 3 and Figure 4As shown in , a training process may include: inputting each sample speech into a speech encoding module, obtaining a speech representation vector of each sample speech through the speech encoding module, inputting each translated text into a text encoding module to obtain a text representation vector of each translated text, and then calculating the training loss (first training loss value) of the pre-training stage based on the speech representation vector of each sample speech and the text representation vector of each translated text, that is, Figure 4 If the overall error of this training meets the first preset condition, the pre-training stage can be ended to obtain an intermediate model. If the overall error does not meet the first preset condition, the model parameters of the speech encoding module and the text encoding module are adjusted ( Figure 4 The update parameters shown in ), and the above training process is repeated until the overall error meets the first preset condition.

[0164] like Figure 4 As shown in , the pre-training in this scenario embodiment adopts multiple training targets, that is, multiple training errors, that is, multiple training losses, specifically including CTC error (third loss part), matching error (first loss part) and distillation error (second loss part). The first training loss value in the pre-training stage is the sum of the errors of these three parts. The meanings of these three parts of errors are as follows:

[0165] (1) CTC error: This error is calculated based on the intermediate vector of the speech coding module (the characteristics of each sub-data) and the label (the data characteristics of the translated text corresponding to the dictionary). It can characterize the similarity between the sample speech and the translated text in a positive sample. The label is generated based on the translated text and is the Chinese pinyin sequence corresponding to the text. Pinyin is used instead of characters to reduce the size of the dictionary, that is, the number of data elements in the dictionary, that is, the length of the label. The vector sequence output by the Wav2vec2 model is the characteristics of each speech segment of the speech data. The CTC error is passed in and used together with the label as the input for calculating the CTC error. The CTC error L corresponding to a positive sample ctc It can be expressed as follows:

[0166]

[0167] In this embodiment, y represents a label, x represents a sample speech, c1, c2, ..., c T represents the representation vector of each speech segment (speech frame) output after the sample speech is encoded by the Wav2vec2 model of the speech coding module. π represents the legal sequence corresponding to the sample speech x, which can be understood as the path to obtain the label y (i.e., the pinyin sequence) based on the representation vector of each speech segment of the sample speech. L ctcIt represents the probability that all paths corresponding to y can be obtained according to the representation vectors of each speech segment of the sample speech, that is, the probability that the label y can be obtained according to the representation vectors of each speech segment of the sample speech.

[0168] For a speech-translated text pair, this error represents the possibility of predicting the label y based on the feature vectors of the dictionary corresponding to each speech segment of the sample semantics output by the Wav2vec2 model. During the training process, the purpose of the CTC error is to make the vector sequence output by the Wav2vec2 model predict the pinyin of the translated text, so that these vectors contain semantic information.

[0169] (2) Matching error: The vector representations corresponding to the sample speech and the translated text are used as the input of this error. The goal of the matching error is to make the similarity between the two vector representations of speech-translated text (positive example) higher than the similarity between the two vector representations of speech-negative translated text (negative example). Optionally, the similarity can be calculated using cosine similarity. During training, a batch of speech-translated text data is calculated at one time. Each speech-translated text pair in the batch is a positive example, while other speech and translated text pairs in the batch constitute negative examples, that is, speech-negative translated text.

[0170] Optionally, the matching error can use multi-classification cross entropy loss. Specifically, after obtaining the speech vector representation of each sample speech and the text vector representation of each translated text through the model, for each sample speech, the first similarity between the two vector representations of the positive example to which the speech belongs and the second similarity between the two vector representations of the negative examples to which the speech belongs, that is, the similarity between the speech representation vector of the speech and the text representation vectors of other texts (texts in each translated text except the transferred text matching the speech) can be used. As a schematic illustration, assuming that there are 10 speech-transferred text pairs in a batch of data, then for each sample speech, the second similarity is 9 and the first similarity is One, these 10 similarities can be used as the prediction result distribution. For example, the first similarity is used as the first value of the distribution. The prediction result distribution can be expressed as a distribution vector [p1, p2, ..., p10], where p1 represents the first similarity and the other 9 are the second similarities. The true distribution (true label) corresponding to the prediction result distribution can be expressed as [1, 0, ..., 0], where 1 represents the true label of the similarity between the sample speech and the transfer text it matches, and 0 represents the true label of the similarity between the sample speech and the other text. The true distribution is used as the true label and the prediction result distribution is used as the prediction distribution of the model. The matching error corresponding to each sample speech can be calculated through multi-classification cross entropy loss.

[0171] During the training process, by constraining the matching error, the similarity between the vector representations of positive examples learned by the model can be made higher than the similarity between the vector representations of negative examples.

[0172] (3) Distillation error: The vector representation corresponding to the positive example is used as the input of this error, and the mean square error (MSE) of the two vectors is calculated. The purpose of this error is to make the two vector representations of the speech-translation text pair close to each other.

[0173] By calculating the above three errors, the three error values ​​are averaged or summed to obtain the overall error. If the overall error does not meet the first preset condition, the model parameters of the speech encoding module and the text encoding module are updated, and the training is repeated.

[0174] After obtaining the intermediate model that meets the first preset condition, each part of the intermediate model can continue to be trained based on the second training set, that is, fine-tuning training.

[0175] Fine-tuning the training process

[0176] Figure 5 A schematic diagram of the fine-tuning training process is shown, Figure 3 and Figure 5 As shown in , in the fine-tuning training phase, in addition to continuing to train the speech encoding module and the text encoding module, the classification model ( Figure 5 The speech encoding module and the classification module shown in the figure are trained, and through fine-tuning training, a neural network model that meets the second preset condition is obtained. The speech encoding module and the classification module at this time can be deployed in the AI ​​voice assistant of the game server 20 to identify the category of the speech data input by the game player and extract the speech representation vector of the speech data. Optionally, the text encoding module can also be deployed in the game server to extract the text representation vector of the standard text expression corresponding to the standard voice instruction. Alternatively, the text encoding module can also be deployed in other devices, which extract the text representation vector of the standard text expression corresponding to each standard voice instruction and provide it to the game server for use. The present application does not limit the structure of the classification module. Optionally, the rejection classification module can be composed of a fully connected layer network. The following is combined with Figure 3 and Figure 5 The process of fine-tuning training is explained.

[0177] In the fine-tuning training stage, because the rejection classification module determines whether the sample speech input to the speech encoding module is a command, the second sample in the second training set includes not only the sample speech and the translated text corresponding to the sample speech, but also the type label of the sample speech. In this stage, each second sample includes not only the sample consisting of the command speech-the transferred text of the command speech, but also the sample consisting of the non-command speech-the translated text of the non-command speech. For example, the type label is 1 for command speech, and 0 for non-command speech.

[0178] like Figure 5 As shown in , in the fine-tuning training stage, similarly, each sample speech (command speech and non-command speech) is passed through the speech encoding module to obtain the speech representation vector of each sample speech, and the transfer text of each sample speech is passed through the text encoding module to obtain the corresponding text representation vector. The speech representation vector of each sample speech is passed through the rejection classification module to obtain the probability that the sample speech is the command speech. Optionally, there may be two objective functions (i.e., loss functions) in this stage, namely, the rejection classification error and the matching error, wherein the rejection classification error may adopt the binary cross entropy error, which calculates the difference between the probability that the sample speech predicted by the classification model is the command speech and the type label of the sample speech, and the matching error may adopt the same matching error as that in the pre-training stage. Afterwards, the two errors may be averaged or summed as the second training loss value ( Figure 5 If the overall error meets the second preset condition, the trained model is obtained. If the overall error does not meet the second preset condition, the model parameters of the speech encoding module, the text encoding module and the classification model are updated, and the above fine-tuning training process is repeated.

[0179] Step S2: Build the target database.

[0180] Before applying the model and processing the data, you need to build the target database. The target database in this application scenario includes: Figure 2 The instruction library and instruction vector library shown in . Among them, the instruction library stores the standard expression in text form corresponding to each standard voice instruction (candidate standard data), and the instruction vector library stores the text vector representation (second data feature) of each standard expression in the instruction library. The instruction library structure can be constructed according to the instruction intention category. The instruction library contains multiple specific intentions (corresponding to standard voice instructions, each standard voice instruction can be understood as an intention of the user). Each intention can be used as a category and assigned a category id. At the same time, one or more natural language texts expressing the intention can be constructed for each intention as the standard expression of the intention. For example, the voice instruction "mark item A" can be used as a category, and its corresponding standard expressions can include "mark item A", "there is item A here", "mark item A" and other standard expressions.

[0181] For the instruction vector library, the text vector representation can be extracted through the trained text encoding module. Figure 6 As shown in , for each standard expression in the instruction library, it can be input into the text encoding module, through which the corresponding text vector representation is obtained, and the text vector representation of the standard expression corresponding to each intent is stored in the instruction vector library.

[0182] Based on the solution provided in the embodiments of the present application, it is possible to conveniently and quickly implement updates and expansions of the instruction database. For example, when a new voice instruction is added, it is only necessary to add the text expression corresponding to the new voice instruction to the instruction library, and extract the corresponding text vector representation through the text encoding module and include it in the instruction vector library. There is no need to retrain the model, and this can well meet the application requirements when the instruction categories in the target database (a standard voice instruction can be regarded as a category) are not fixed.

[0183] Optionally, in the fine-tuning training stage, the command speech-command speech translation text pairs in the second training set may include text pairs consisting of standard voice commands in the command library and standard expressions corresponding to the standard voice commands.

[0184] Step S3: Process the data to be processed.

[0185] In the application stage, for each voice input of the user (i.e. voice command, which is the data to be processed in this application scenario), you can use Figure 7 Specifically, the trained speech encoding module can be used to obtain the speech representation vector (i.e., the first data feature) of each speech input, and the vector representation is used as the query vector to calculate the similarity (i.e., the matching score) between the query vector and each vector representation of the instruction vector library, and the maximum matching score and the text vector representation corresponding to the matching score can be selected ( Figure 7 Instructions and matching scores shown in ), in addition, the speech representation vector is input into the rejection classification module to obtain the rejection score (such as the probability that the speech input is a speech instruction) through the rejection classification module. Then, based on the matching score and the rejection score, the rule judgment module can judge whether the standard expression corresponding to the text vector representation corresponding to the maximum similarity is the target standard data that matches the speech input according to the pre-configured judgment rule. For example, the judgment rule is that the matching score is greater than the first threshold and the rejection score is greater than the second threshold. If this condition is met, the standard expression corresponding to the maximum similarity is determined as the target standard data, that is, it is considered that the speech input by the user at this time is the speech instruction corresponding to the standard expression ( Figure 7The game server can execute the action corresponding to the standard voice command corresponding to the standard expression according to the user's voice input. For example, if the standard expression is "mark item A", the game server can execute the corresponding marking action and display the marking result to the player through the user interface of the user terminal (i.e., the interactive interface of the game application).

[0186] As an example, Figure 8a and Figure 8b , a schematic diagram of a user interface of a game scene is shown in FIG. During the game, the player can perform game operations by issuing voice commands or manual operations. Specifically, the player can control the player character through the input control device on the terminal device or the input control device connected to the terminal device, such as Figure 8a During the game, players can click the "Voice Assistant" control ( Figure 8a The control 81 in the figure turns the AI ​​voice assistant on or off. When the AI ​​voice assistant is turned on, voice commands can be issued. In this game scene, if the player wants to mark virtual item A in the scene, he can control his player character (through the character's designated virtual props) to aim at item A. After aiming, he can issue a voice command of "mark item A", or click the "mark" control ( Figure 8a Control 81 in the figure marks item A. When voice is used, after receiving the voice command of "mark item A", the AI ​​voice assistant can execute the data processing method provided by the implementation of this application (such as any optional implementation corresponding to the above steps S120 to 140), or send the voice command to the game server. The game server determines the user's true intention (i.e., the target standard data) by executing the method, that is, the user needs to mark "item A". The AI ​​voice assistant can then mark the item A in the game scene based on the true intention. Figure 8b As shown, after marking item A, the corresponding marking information may be displayed, which includes but is not limited to the attribute information of item A (such as category, etc.), marking prompt information (such as Figure 8b "abc marks item A" and a mark 83 suspended above item A, where abc is the name of the player in the game (i.e., the player's nickname) and the current distance between the player character and the item in the game scene (5 meters as shown in the figure), etc.

[0187] In actual applications, if the player is currently in a team game, after the player marks item A, other players in the player's team can also see corresponding prompt information in their user interface, such as "abc marked item A", the relative position information of other players' player characters and item A in the game scene, etc.

[0188] As an optional solution, in order to speed up the retrieval efficiency, when determining the standard expression with the highest matching score by calculating the similarity between the query vector and the vector representation of the instruction vector library, the Faiss retrieval method (a fast retrieval method) can be used. Accordingly, after obtaining the text vector representation of each standard expression through the text encoding module, the feature vector library construction method in the Faiss retrieval method can be used to construct the instruction vector library to improve the retrieval efficiency.

[0189] It can be seen that, by adopting the method provided by the embodiment of the present application, when the voice data is recognized, there is no need for a voice recognition model, and the text expression matching the voice data can be quickly and accurately identified based on the similarity between the voice representation vector of the voice data and the text representation vector of the text data, and the standard voice instruction corresponding to the text expression can be used as the true intention of the voice data, and the corresponding operation is performed according to the intention. The method can effectively reduce the computing cost and improve the processing efficiency. In addition, the cross-modal retrieval method of voice retrieval text can well solve the problem of poor recognition accuracy in the case of multiple instruction categories, and can meet the actual application requirements of instruction categories. When there is a new instruction category, there is no need to retrain the model, and only the new instruction text needs to be added to the retrieval library (i.e., the instruction vector library). In addition, by the two-stage training method of pre-training and fine-tuning training, combined with a multi-objective optimization scheme, the speech coding module can well learn the semantic information of the speech, which can improve the recognition accuracy.

[0190] It should be noted that, in practical applications, in addition to the above-mentioned staged training method provided in the embodiment of the present application, a method of merging two stages or performing training in alternating stages can also be adopted.

[0191] In order to verify the effect of the method provided in the embodiment of the present application, a comparison test was conducted on the method provided in the embodiment of the present application and the existing scheme in the game scene. During the test, 1469 pieces of data manually annotated were used. The existing scheme adopted the method of automatic speech recognition (ASR, Automatic Speech Recognition) plus natural speech understanding (NLU, Natural Language Processing), and adopted accuracy, recall rate and false call rate as effect evaluation indicators. The false call rate refers to the proportion of command recognition results given by the model for non-command speech. The higher the accuracy and recall rate, the better, and the lower the false call rate, the better. The test results of the scheme of the embodiment of the present application and the existing scheme are shown in Table 1 below. It should be noted that during the test, the test data used was screened data, and the non-command speech data was very similar to voice commands, so the false call rates of the two schemes were relatively high.

[0192] Table 1 Comparison of the effects of manually labeled data

[0193] Model Accuracy Recall False Call Rate Existing solutions 38.02% 61.97% 64.20% This application 42.86% 76.40% 60.34%

[0194] It can be seen from the test results that compared with the existing solutions, the accuracy and recall rate corresponding to the neural network model provided in the embodiment of the present application are significantly improved compared with the existing solutions, and the false call rate is significantly reduced.

[0195] Based on the same principle as the method provided in the embodiment of the present application, the embodiment of the present application also provides a data processing device, such as Fig. 9 As shown in , the data processing device 100 may include a to-be-processed data acquisition module 110 , a feature acquisition module 120 and a data identification module 130 .

[0196] The to-be-processed data acquisition module 110 is used to acquire the to-be-processed data, where the to-be-processed data is data of the first modality;

[0197] A feature acquisition module 120, used to extract a first data feature of the data to be processed;

[0198] The data identification module 130 is used to match the first data feature with at least one second data feature in the target database to obtain matching results corresponding to each second data feature, and to determine target data matching the data to be processed from each candidate data according to the matching results corresponding to each second data feature;

[0199] The target database includes at least one candidate standard data and a second data feature of each candidate standard data, and the candidate standard data is data of the second modality.

[0200] Optionally, the data identification module is further used to: determine the data type of the to-be-processed data according to the first data feature; accordingly, when matching the first data feature with at least one second data feature in the target database, the data identification module is used to:

[0201] When the data type of the data to be processed is a specified type, the first data feature is matched with at least one second data feature in the target database.

[0202] Optionally, the data of the first modality and the data of the second modality are data of different modalities, the data of the first modality includes at least one of text, voice, video or image, and the data of the second modality includes at least one of text, voice, video or image.

[0203] Optionally, the candidate standard data is a standard expression that matches the first standard data in the standard database, the first standard data is data of a first modality, and one first standard data corresponds to at least one standard expression.

[0204] Optionally, the feature acquisition module is also used to: when there is newly added first standard data in the standard database, obtain at least one standard expression corresponding to the newly added first standard data; extract the second data features of each standard expression corresponding to the newly added first standard data; and associate and store each standard expression corresponding to the newly added first standard data and the second data features corresponding to each standard expression in the target database.

[0205] Optionally, the first data feature is extracted by a first feature extraction network; the second data feature of the candidate standard data is extracted by a second feature extraction network; wherein the first feature extraction network and the second feature extraction network are trained by the model training module in the following manner:

[0206] Acquire a training data set, where the training data set includes a first training set, where each first sample in the first training set includes first data of a first modality and second data of a second modality matching the first data;

[0207] The initial neural network model is iteratively trained based on the training data set until the total training loss value meets the preset training end condition, wherein the neural network model includes a first network model and a second network model, and the first network model that meets the training end condition is used as the first feature extraction network, and the second network model that meets the training end condition is used as the second feature extraction network; the training process includes:

[0208] Input each first data into the first network model to obtain the characteristics of each first data, and input each second data into the second network model to obtain the characteristics of each second data;

[0209] Determine a first training loss value based on the matching degree between the features of the first data and the features of the second data in each first sample, and the matching degree between the features of the first data and the features of the second data in each first negative example; wherein the first negative example includes the first data of one first sample and the second data of another first sample;

[0210] If the first training loss value does not meet the first preset condition, the model parameters of the first network model and the second network model are adjusted, and the total training loss value meets the preset training end condition, including that the first training loss value meets the first preset condition.

[0211] Optionally, the model training module is used to perform operations when inputting each first data into the first network model to obtain the features of each first data:

[0212] For each first data, the following operations are performed on the first data through the first network model to obtain the features of the first data: the first data is divided into at least two sub-data to obtain a sub-data series corresponding to the first data; based on the dictionary, the features of each sub-data in the sub-data series are extracted, wherein the dictionary includes a plurality of data elements, the number of feature values ​​included in the features of each sub-data is equal to the number of elements in the dictionary, and a feature value represents the probability that the sub-data contains a data element corresponding to the position of the feature value in the dictionary; based on the features of each sub-data, the features of the first data are obtained;

[0213] The model training module may also be used to: for each second data, determine, based on the dictionary, a data feature of the second data corresponding to the dictionary, wherein the data feature represents a probability that the second data corresponds to each data element in the dictionary;

[0214] When determining the first training loss value, the model training module can be used to: determine the first training loss value based on the degree of matching between the features of each sub-data of the first data in each first sample and the data features of the second data corresponding to the dictionary, the degree of matching between the features of the first data in each first sample and the features of the second data, and the degree of matching between the features of the first data in each first negative example and the features of the second data.

[0215] Optionally, when the model training module determines the first training loss value based on the matching degree between the feature of the first data and the feature of the second data in each first sample, and the matching degree between the feature of the first data and the feature of the second data in each first negative example, it can be used to:

[0216] Determine the degree of difference between the characteristics of the first data and the characteristics of the second data of each first sample to obtain a first loss value;

[0217] For each first data, determine a first similarity corresponding to the first data and a second similarity corresponding to the first data, wherein the first similarity is the similarity between a feature of the first data and a feature of second data matching the first data, and the second similarity is the similarity between the first data and the second data in a first negative example where the first data is located;

[0218] Acquire reference tags corresponding to each first data, where the reference tags include a similarity tag corresponding to the first similarity and a similarity tag corresponding to the second similarity;

[0219] Determine a second loss value based on the predicted similarity and the reference label corresponding to each first data, wherein the predicted similarity includes the first similarity and the second similarity, and the second loss value represents the difference between the predicted similarity and the reference label corresponding to each first data;

[0220] A first training loss value is determined according to the first loss value and the second loss value.

[0221] Optionally, the candidate standard data is a standard expression of the second modality corresponding to the first standard data of the specified type; the initial neural network model also includes a classification model; the training data set also includes a second training set, each second sample in the second training set includes third data of the first modality, fourth data of the second modality matching the third data, and a type label of the third data, wherein the third data in the second training data set includes third data of the specified type and third data of a non-specified type; after obtaining the neural network model whose first training loss value satisfies the first preset condition, the model training module is further used to perform the following training process:

[0222] The training operation is continued to be repeatedly performed on the neural network model based on the second training set until the second training loss value satisfies the second preset condition, wherein the total training loss value satisfies the preset training end condition and also includes the second training loss value satisfying the second preset condition; the above training operation includes:

[0223] Input each third data into the first network model to obtain the characteristics of each third data, input each fourth data into the second network model to obtain the characteristics of each fourth data, input the characteristics of each third data into the classification model to obtain the prediction type corresponding to each third data;

[0224] Determine a second training loss value based on the degree of matching between the features of the third data in each second sample and the features of the fourth data, the degree of matching between the features of the third data in each second negative example and the features of the fourth data, and the degree of matching between the type label and the predicted type of each third data;

[0225] If the second training loss value does not meet the second preset condition, the model parameters of the neural network model are adjusted.

[0226] Optionally, the data of the first modality is speech, the data of the second modality is text, and the data elements are phonemes.

[0227] Optionally, specify the type as command voice.

[0228] The device of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description and beneficial effects of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.

[0229] An embodiment of the present application also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory, and the processor executes the above computer program to implement the steps of the method provided in any optional embodiment of the present application.

[0230] Fig.10 A schematic diagram of the structure of an electronic device applicable to the embodiment of the present application is shown. Fig.10 As shown, the electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0231] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0232] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0233] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.

[0234] The memory 4003 stores a computer program for executing the method provided in the embodiment of the present application, and can be controlled to execute by the processor 4001. When the processor 4001 executes the above computer program stored in the memory 4003, the steps shown in any of the above method embodiments of the present application can be implemented.

[0235] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of any of the aforementioned method embodiments of the present application can be implemented.

[0236] An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps and corresponding contents of any of the aforementioned method embodiments of the present application can be implemented.

[0237] It should be noted that the terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchangeable where appropriate, so that the embodiments of the application described herein can be implemented in an order other than that shown or described in the drawings.

[0238] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.

[0239] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.

Claims

1. A data processing method, characterized in that: include: Acquire data to be processed, where the data to be processed is data in a first mode, and the data in the first mode is voice data; Extracting a first data feature of the data to be processed through a first feature extraction network, wherein the first data feature is a speech feature vector; Determine the similarity between the first data feature and at least one second data feature in a target database, and obtain matching results corresponding to each second data feature, wherein the target database includes at least one candidate standard data and a second data feature of each candidate standard data, the candidate standard data is data of a second modality, the data of the second modality is text data, and the second data feature is a text feature vector obtained by extracting features from the candidate standard data through a second feature extraction network; According to the matching results corresponding to the second data features, target standard data matching the data to be processed is determined from the candidate standard data, wherein the target standard data is the speech recognition result of the data to be processed; The first feature extraction network and the second feature extraction network are trained in the following manner: Acquire a training data set including a first training set, wherein each first sample in the first training set includes first data of a first modality and second data of a second modality matching the first data; Iteratively train the initial neural network model including the first network model and the second network model until the total training loss value meets the preset training end condition, and use the first network model and the second network model that meet the condition as the first feature extraction network and the second feature extraction network respectively; the training process includes: Inputting each of the first data into a first network model to obtain a feature of each of the first data, and inputting each of the second data into a second network model to obtain a feature of each of the second data; Determine the degree of difference between the characteristics of the first data and the characteristics of the second data in each of the first samples to obtain a first loss value; For each of the first data, determine a first similarity between a feature of the first data and a feature of second data matching the first data, and a second similarity between a feature of the first data and a feature of the second data in a first negative example where the first data is located, and obtain a predicted probability distribution based on the first similarities and each of the second similarities; the first negative example includes first data of a first sample and second data of another first sample; Acquire reference tags corresponding to each of the first data, wherein the reference tags include a similarity tag corresponding to the first similarity and a similarity tag corresponding to the second similarity; Taking the reference label as the true probability distribution, and determining a second loss value based on the difference between the predicted probability distribution and the true probability distribution corresponding to each of the first data; Determine a first training loss value according to the first loss value and the second loss value; If the first training loss value does not meet the first preset condition, the model parameters of the first network model and the second network model are adjusted, and the total training loss value meets the preset training end condition including that the first training loss value meets the first preset condition.

2. The method according to claim 1, characterized in that Also includes: Determining the data type of the data to be processed according to the first data feature; The matching of the first data feature with at least one second data feature in the target database includes: When the data type of the to-be-processed data is a specified type, the first data feature is matched with at least one second data feature in the target database.

3. The method according to claim 2, characterized in that The designated type is a command-type voice.

4. The method according to any one of claims 1 to 3, characterized in that The candidate standard data is a standard expression that matches the first standard data in the standard database, the first standard data is data of a first modality, and one first standard data corresponds to at least one standard expression.

5. The method according to claim 4, characterized in that Also includes: When there is newly added first standard data in the standard database, obtaining at least one standard expression corresponding to the newly added first standard data; Extracting second data features of each standard expression corresponding to the newly added first standard data; Each standard expression corresponding to the newly added first standard data and the second data feature corresponding to each standard expression are associated and stored in the target database.

6. The method according to claim 1, characterized in that The step of inputting each of the first data into the first network model to obtain the features of each of the first data includes: For each of the first data, the following operations are performed on the first data through the first network model to obtain the features of the first data: Dividing the first data into at least two sub-data to obtain a sub-data sequence corresponding to the first data; Extracting features of each sub-data in the sub-data sequence based on a dictionary, wherein the dictionary includes a plurality of data elements, the number of feature values ​​included in the features of each sub-data is equal to the number of elements in the dictionary, and a feature value represents the probability that the sub-data contains a data element corresponding to the position of the feature value in the dictionary; Based on the characteristics of each of the sub-data, obtaining the characteristics of the first data; The training process also includes: For each of the second data, based on the dictionary, determining a data feature of the second data corresponding to the dictionary, wherein the data feature represents a probability that the second data corresponds to each data element in the dictionary; The determining of the first training loss value comprises: determining a third loss value based on a degree of matching between a feature of each sub-data of the first data in each of the first samples and a data feature of the second data corresponding to the dictionary; A first training loss value is determined according to the first loss value, the second loss value, and the third loss value.

7. The method according to claim 1 or 6, characterized in that: The candidate standard data is a standard expression of the second modality corresponding to the first standard data of a specified type; the initial neural network model also includes a classification model; The training data set further includes a second training set, each second sample in the second training set includes third data of the first modality, fourth data of the second modality matching the third data, and a type label of the third data, wherein the third data in the second training set includes third data of a specified type and third data of a non-specified type; After obtaining the neural network model whose first training loss value satisfies the first preset condition, the training process further includes: The training operation of the neural network model is repeatedly performed based on the second training set until the second training loss value satisfies a second preset condition, wherein the total training loss value satisfies a preset training end condition, and further includes that the second training loss value satisfies the second preset condition; the training operation includes: Input each of the third data into the first network model to obtain the characteristics of each of the third data, input each of the fourth data into the second network model to obtain the characteristics of each of the fourth data, input the characteristics of each of the third data into the classification model to obtain the prediction type corresponding to each of the third data; Determine a second training loss value based on the degree of matching between the features of the third data in each of the second samples and the features of the fourth data, the degree of matching between the features of the third data in each of the second negative examples and the features of the fourth data, and the degree of matching between the type label and the predicted type of each of the third data; If the second training loss value does not meet the second preset condition, the model parameters of the neural network model are adjusted.

8. A data processing device, characterized in that: The device comprises: A module for acquiring data to be processed, used for acquiring data to be processed, wherein the data to be processed is data of a first modality, and the data of the first modality is voice data; A feature acquisition module, used to extract a first data feature of the data to be processed through a first feature extraction network, wherein the first data feature is a speech feature; a data identification module, configured to determine the similarity between the first data feature and at least one second data feature in a target database, obtain matching results corresponding to each of the second data features, and determine target standard data matching the data to be processed from each of the candidate standard data according to the matching results corresponding to each of the second data features; The target database includes at least one candidate standard data and a second data feature of each candidate standard data, the candidate standard data is data of a second modality, the data of the second modality is text data, and the second data feature is a text feature vector obtained by extracting features from the candidate standard data through a second feature extraction network; The data of the second modality is text data, the second data feature is a text feature, and the target standard data is a speech recognition result of the data to be processed; The first feature extraction network and the second feature extraction network are trained in the following manner: Acquire a training data set including a first training set, wherein each first sample in the first training set includes first data of a first modality and second data of a second modality matching the first data; Iteratively train the initial neural network model including the first network model and the second network model until the total training loss value meets the preset training end condition, and use the first network model and the second network model that meet the condition as the first feature extraction network and the second feature extraction network respectively; the training process includes: Inputting each of the first data into a first network model to obtain a feature of each of the first data, and inputting each of the second data into a second network model to obtain a feature of each of the second data; Determine the degree of difference between the characteristics of the first data and the characteristics of the second data in each of the first samples to obtain a first loss value; For each of the first data, determine a first similarity between a feature of the first data and a feature of second data matching the first data, and a second similarity between a feature of the first data and a feature of the second data in a first negative example where the first data is located, and obtain a predicted probability distribution based on the first similarities and each of the second similarities; the first negative example includes first data of a first sample and second data of another first sample; Acquire reference tags corresponding to each of the first data, wherein the reference tags include a similarity tag corresponding to the first similarity and a similarity tag corresponding to the second similarity; Taking the reference label as the true probability distribution, and determining a second loss value based on the difference between the predicted probability distribution and the true probability distribution corresponding to each of the first data; Determine a first training loss value according to the first loss value and the second loss value; If the first training loss value does not meet the first preset condition, the model parameters of the first network model and the second network model are adjusted, and the total training loss value meets the preset training end condition including that the first training loss value meets the first preset condition.

9. The device according to claim 8, characterized in that The data identification module, when matching the first data feature with at least one second data feature in the target database, is used to: Determining the data type of the data to be processed according to the first data feature; When the data type of the to-be-processed data is a specified type, the first data feature is matched with at least one second data feature in the target database.

10. The device according to claim 9, characterized in that The designated type is a command-type voice.

11. The device according to any one of claims 8 to 10, characterized in that The candidate standard data is a standard expression that matches the first standard data in the standard database, the first standard data is data of a first modality, and one first standard data corresponds to at least one standard expression.

12. The device according to claim 11, characterized in that The feature acquisition module is also used for: When there is newly added first standard data in the standard database, obtaining at least one standard expression corresponding to the newly added first standard data; Extracting second data features of each standard expression corresponding to the newly added first standard data; Each standard expression corresponding to the newly added first standard data and the second data feature corresponding to each standard expression are associated and stored in the target database.

13. The device according to claim 8, characterized in that The characteristics of each of the first data are obtained in the following manner: For each of the first data, the following operations are performed on the first data through the first network model to obtain the features of the first data: Dividing the first data into at least two sub-data to obtain a sub-data sequence corresponding to the first data; Extracting features of each sub-data in the sub-data sequence based on a dictionary, wherein the dictionary includes a plurality of data elements, the number of feature values ​​included in the features of each sub-data is equal to the number of elements in the dictionary, and a feature value represents the probability that the sub-data contains a data element corresponding to the position of the feature value in the dictionary; Based on the characteristics of each of the sub-data, obtaining the characteristics of the first data; The training process also includes: For each of the second data, based on the dictionary, determining a data feature of the second data corresponding to the dictionary, wherein the data feature represents a probability that the second data corresponds to each data element in the dictionary; The first training loss value is determined by: determining a third loss value based on a degree of matching between a feature of each sub-data of the first data in each of the first samples and a data feature of the second data corresponding to the dictionary; A first training loss value is determined according to the first loss value, the second loss value, and the third loss value.

14. The device according to claim 8 or 13, characterized in that The candidate standard data is a standard expression of the second modality corresponding to the first standard data of a specified type; the initial neural network model also includes a classification model; The training data set further includes a second training set, each second sample in the second training set includes third data of the first modality, fourth data of the second modality matching the third data, and a type label of the third data, wherein the third data in the second training set includes third data of a specified type and third data of a non-specified type; After obtaining the neural network model whose first training loss value satisfies the first preset condition, the training process further includes: The training operation of the neural network model is repeatedly performed based on the second training set until the second training loss value satisfies a second preset condition, wherein the total training loss value satisfies a preset training end condition, and further includes that the second training loss value satisfies the second preset condition; the training operation includes: Input each of the third data into the first network model to obtain the characteristics of each of the third data, input each of the fourth data into the second network model to obtain the characteristics of each of the fourth data, input the characteristics of each of the third data into the classification model to obtain the prediction type corresponding to each of the third data; Determine a second training loss value based on the degree of matching between the features of the third data in each of the second samples and the features of the fourth data, the degree of matching between the features of the third data in each of the second negative examples and the features of the fourth data, and the degree of matching between the type label and the predicted type of each of the third data; If the second training loss value does not meet the second preset condition, the model parameters of the neural network model are adjusted.

15. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the computer program to implement the method according to any one of claims 1 to 7.

16. 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 method according to any one of claims 1 to 7 is implemented.

17. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.