Voice instruction recognition method, apapratus, electronic device, and vehicle

The voice command recognition method that combines resource recognition models and entity word annotation processing solves the problem of low voice command recognition accuracy in the existing technology, achieves accurate understanding of media resource instructions, and improves user experience.

WO2024199225A1PCT designated stage expired Publication Date: 2024-10-03BEIJING CO WHEELS TECH CO LTD

Patent Information

Application Number
PCT/CN2024/083835
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-29
Filing Date
2024-03-26
Publication Date
2024-10-03

AI Technical Summary

Technical Problem

In the existing technology, the accuracy of voice command recognition is not high and cannot satisfy the user experience. In particular, in-vehicle voice assistants have insufficient understanding of user commands related to media resources.

Method used

By providing a voice command recognition method, the resource recognition model and entity word annotation processing are used, combined with the preset arbitration strategy, to identify the command text corresponding to the voice command, determine the resource field corresponding to the voice command, and improve the recognition accuracy.

Benefits of technology

It improves the accuracy of voice command recognition, enhances user experience, can more accurately understand users' media resource commands, and meets the needs of in-vehicle voice assistants.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083835_03102024_PF_FP_ABST
    Figure CN2024083835_03102024_PF_FP_ABST
Patent Text Reader

Abstract

A voice instruction recognition method, an apparatus, an electronic device, and a vehicle, relating to the domain of natural language processing. The method comprises: in response to receiving a voice instruction, identifying instruction text corresponding to the voice instruction (101); inputting the instruction text into a resource recognition model, and determining a first resource domain indicated by the voice instruction (102); performing entity word annotation on the instruction text, and determining a second resource domain corresponding to the voice instruction (103); performing resource domain arbitration on the first resource domain and the second resource domain according to a preset arbitration strategy, and determining a target resource indicated by the voice instruction (104). In the solution, parallel calculation can be achieved by means of using a recognition module and an entity word annotation recognition module of the resource recognition model, and resource domain arbitration is executed on resource domain recognition results under two feature recognition dimensions, so as to determine a target resource domain corresponding to the voice instruction. In this way, the accuracy of the recognition results can be guaranteed, and good user experience of voice instruction recognition can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Voice command recognition method, device, electronic equipment and vehicle

[0001] This disclosure claims priority to Chinese patent application No. 2023103233996, filed with the Patent Office of China on March 29, 2023, with the application number “Voice Command Recognition Method, Device, Electronic Device and Vehicle”, and claims priority to Chinese patent application No. 2023103237766, filed with the Patent Office of China on March 29, 2023, with the application number “Training Method of Resource Classification Model, Voice Command Recognition Method and Related Device”, the entire contents of which are incorporated into this disclosure by reference. Technical Field

[0002] The present disclosure relates to the field of natural language processing, and in particular to a method, device, electronic device, and vehicle for recognizing voice commands. Background Art

[0003] As cars become increasingly intelligent, in-car voice assistants should be able to understand user commands for media resources. When a user requests a song or a movie or TV show, the voice assistant should understand the resource domain corresponding to the user's request and send it to the corresponding third-party application for processing. Common resource domains include videos, music, and audiobooks.

[0004] Existing solutions to this problem often rely on text classification to identify whether a command is for a video resource, or employ intent slot value recognition algorithms to determine the underlying intent and corresponding title and author names. However, these voice command recognition methods only provide a rough classification of resource categories, failing to guarantee accurate recognition and, consequently, failing to meet user expectations.

[0005] Summary of the Invention

[0006] In view of this, the present disclosure provides a voice command recognition method, device, electronic device and vehicle, which can solve the technical problem that the accuracy of voice command recognition is not high and cannot meet the user's usage experience.

[0007] According to a first aspect of the present disclosure, a method for voice command recognition is provided, comprising:

[0008] In response to receiving a voice command, identifying a command text corresponding to the voice command;

[0009] Inputting the instruction text into a resource recognition model to obtain a first resource domain indicated by the voice instruction, wherein the resource recognition model is used to determine a domain prediction result corresponding to the instruction text, and determining the domain prediction result as the first resource domain;

[0010] Performing entity word tagging on the instruction text to determine a second resource domain indicated by the voice instruction, wherein the entity word tagging is used to extract entity words contained in the instruction text and determine a second resource domain that matches the resource tagging result of the entity words;

[0011] Resource domain arbitration is performed on the first resource domain and the second resource domain according to a preset arbitration strategy to determine the target resource indicated by the voice instruction, wherein the preset arbitration strategy is used to obtain an identification result of whether the first resource domain is a specific resource domain, and to select one of the first resource domain and the second resource domain to determine a target resource domain that matches the identification result.

[0012] In some embodiments of the present disclosure, the training process of the resource identification model includes:

[0013] Acquire a preset text feature configured with a resource domain label, wherein the resource domain label includes a sentence feature label and an entity feature label, and the preset text feature includes a first training sample configured with the entity feature label and a second training sample configured with the sentence feature label;

[0014] The first training sample and the second training sample are used as input features, and the sentence feature label and the entity feature label are used as training labels, and the resource identification model is iteratively trained until the loss function of the resource identification model is less than a preset threshold, and the resource identification model training is determined to be completed.

[0015] In some embodiments of the present disclosure, the first training sample and the second training sample are used as input features, and the sentence feature label and the entity feature label are used as training labels, and the resource identification model is iteratively trained until the loss function of the resource identification model is less than a preset threshold, and determining that the resource identification model training is complete includes:

[0016] Performing entity labeling training on the pre-trained model using the first training sample, and obtaining an entity labeling model having learned entity labeling characteristics after the entity labeling training is completed;

[0017] The entity annotation model is trained for resource classification using the second training sample. After the resource classification training is completed, a resource identification model with resource classification characteristics is obtained. The resource identification model is used to perform resource domain identification on the voice instruction text based on the entity annotation characteristics and the resource classification characteristics.

[0018] In some embodiments of the present disclosure, inputting the instruction text into a resource recognition model to obtain the first resource field indicated by the voice instruction includes:

[0019] Extracting text features of the instruction text;

[0020] The text feature is input into a resource recognition model to obtain a domain prediction result corresponding to the text feature, and the domain prediction result is determined as the first resource domain corresponding to the voice instruction.

[0021] In some embodiments of the present disclosure, performing entity word tagging on the instruction text to determine the second resource domain indicated by the voice instruction includes:

[0022] Determining a plurality of entity words contained in the instruction text based on an n-gram;

[0023] Using a preset vocabulary to mark the preset resource domain of each entity word in the plurality of entity words;

[0024] Among the preset resource domains obtained by corresponding annotation of the multiple entity words, the preset resource domain with the highest priority is determined as the second resource domain corresponding to the voice instruction.

[0025] In some embodiments of the present disclosure, the preset word list includes multiple preset resource fields, and corresponding feature words are configured for each preset resource field, and the feature words include at least one of entity feature words and action feature words;

[0026] The step of using a preset vocabulary to label the preset resource domain of each entity word in the plurality of entity words includes:

[0027] Calculating feature similarity between each entity word in the plurality of entity words and the feature word;

[0028] The preset resource domain represented by the feature word corresponding to the highest feature similarity is marked as the preset resource domain of the entity word.

[0029] In some embodiments of the present disclosure, performing resource domain arbitration on the first resource domain and the second resource domain according to a preset arbitration strategy to determine the target resource domain indicated by the voice instruction includes:

[0030] If it is determined that the first resource field is a specific resource field, verifying whether the second resource field belongs to a vertical field under the first resource field, and determining a target resource field indicated by the voice instruction that matches the verification result of the vertical field;

[0031] If it is determined that the first resource domain is not a specific resource domain, the first resource domain is determined as the target resource domain indicated by the voice instruction.

[0032] In some embodiments of the present disclosure, determining the target resource domain indicated by the voice instruction that matches the verification result of the vertical domain includes:

[0033] In response to a result of the vertical field verification that the second resource field belongs to a vertical field under the first resource field, determining the second resource field as the target resource field indicated by the voice instruction;

[0034] In response to the verification result of the vertical field being that the second resource field does not belong to the vertical field under the first resource field, the first resource field or the second resource field configured with the highest recognition priority is determined as the target resource field indicated by the voice instruction.

[0035] In some embodiments of the present disclosure, obtaining a preset text feature configured with a resource domain tag includes:

[0036] Get a preset number of entity texts;

[0037] Inserting the entity text into a preset position of a text construction template and splicing it with the fixed text in the text construction template to generate a first training sample;

[0038] An entity feature label that matches an entity category is configured for each character in the first training sample, where the entity feature label includes at least one of a non-entity label, an entity label, and an entity position label.

[0039] In some embodiments of the present disclosure, performing entity labeling training on a pre-trained model using the first training sample includes:

[0040] Inputting the first training sample into a pre-training model, and performing entity labeling training on the pre-training model;

[0041] Among them, during the entity labeling training process, the entity feature label is used as the training label to update the model parameters of the pre-trained model for entity labeling processing until the accuracy of the pre-trained model for entity labeling is greater than a first preset threshold, and the entity labeling training is judged to be completed.

[0042] In some embodiments of the present disclosure, obtaining a preset text feature configured with a resource domain tag includes:

[0043] Obtaining a preset number of sample instruction texts, wherein the sample instruction texts at least include resource indication information;

[0044] The sample instruction text is labeled with a sentence feature label that matches the resource indication information to obtain the second training sample, wherein different resource indication information corresponds to different sentence feature labels.

[0045] In some embodiments of the present disclosure, performing resource classification training on the entity annotation model using the second training sample includes:

[0046] Inputting the second training sample into the entity annotation model to perform resource classification training on the entity annotation model;

[0047] In which, during the resource classification training process, the sentence feature label is used as a training label to update the model parameters of the entity annotation model for resource classification processing until the accuracy of the entity annotation model for resource classification is greater than a second preset threshold, and the resource classification training is judged to be completed.

[0048] According to a second aspect of the present disclosure, a method for training a resource classification model is provided, comprising:

[0049] Generate a first training sample and a second training sample, wherein the first training sample is a training sample configured with an entity feature label, and the second training sample is a training sample configured with a sentence feature label;

[0050] Performing entity labeling training on the pre-trained model using the first training sample, and obtaining an entity labeling model having learned entity labeling characteristics after the entity labeling training is completed;

[0051] The entity annotation model is trained for resource classification using the second training sample. After the resource classification training is completed, a resource classification model with resource classification characteristics is obtained. The resource classification model is used to perform resource domain recognition on the voice instruction text based on the entity annotation characteristics and the resource classification characteristics.

[0052] In some embodiments of the present disclosure, the process of generating the first training sample includes:

[0053] Get a preset number of entity texts;

[0054] Inserting the entity text into a preset position of a text construction template and splicing it with the fixed text in the text construction template to generate a first training sample;

[0055] An entity feature label that matches an entity category is configured for each character in the first training sample, where the entity feature label includes at least one of a non-entity label, an entity label, and an entity position label.

[0056] In some embodiments of the present disclosure, performing entity labeling training on a pre-trained model using the first training sample includes:

[0057] Inputting the first training sample into a pre-training model, and performing entity labeling training on the pre-training model;

[0058] Among them, during the entity labeling training process, the entity feature label is used as the training label to update the model parameters of the pre-trained model for entity labeling processing until the accuracy of the pre-trained model for entity labeling is greater than a first preset threshold, and the entity labeling training is judged to be completed.

[0059] In some embodiments of the present disclosure, the process of generating the second training sample includes:

[0060] Obtaining a preset number of sample instruction texts, wherein the sample instruction texts at least include resource indication information;

[0061] The sample instruction text is labeled with a sentence feature label that matches the resource indication information to obtain the second training sample, wherein different resource indication information corresponds to different sentence feature labels.

[0062] In some embodiments of the present disclosure, performing resource classification training on the entity annotation model using the second training sample includes:

[0063] Inputting the second training sample into the entity annotation model to perform resource classification training on the entity annotation model;

[0064] In which, during the resource classification training process, the sentence feature label is used as a training label to update the model parameters of the entity annotation model for resource classification processing until the accuracy of the entity annotation model for resource classification is greater than a second preset threshold, and the resource classification training is judged to be completed.

[0065] According to a third aspect of the present disclosure, there is provided a voice command recognition device, comprising:

[0066] a recognition module, configured to, in response to receiving a voice instruction, recognize an instruction text corresponding to the voice instruction;

[0067] an input module, configured to input the instruction text into a resource recognition model to obtain a first resource domain indicated by the voice instruction, wherein the resource recognition model is configured to determine predicted scores of the instruction text corresponding to different preset resource domains, and to determine the preset resource domain corresponding to the highest preset score as the first resource domain;

[0068] a tagging module, configured to perform entity word tagging on the instruction text to determine a second resource domain indicated by the voice instruction, wherein the entity word tagging is configured to extract entity words contained in the instruction text and determine the second resource domain based on resource tagging results of the entity words;

[0069] The arbitration module is used to perform resource domain arbitration processing on the first resource domain and the second resource domain according to a preset arbitration strategy, and determine the target resource indicated by the voice instruction.

[0070] According to a fourth aspect of the present disclosure, a training device for a resource classification model is provided, comprising:

[0071] A generating module, configured to generate a first training sample and a second training sample, wherein the first training sample is a training sample configured with an entity feature label, and the second training sample is a training sample configured with a sentence feature label;

[0072] A first training module is configured to perform entity labeling training on a pre-trained model using the first training sample, and obtain an entity labeling model having learned entity labeling characteristics after the entity labeling training is completed;

[0073] The second training module is used to use the second training sample to perform resource classification training on the entity annotation model. After the resource classification training is completed, a resource classification model with resource classification characteristics is obtained. The resource classification model is used to perform resource domain recognition on the voice instruction text based on the entity annotation characteristics and the resource classification characteristics.

[0074] According to a fifth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the voice instruction recognition method described in the first aspect or the resource classification model training method described in the second aspect.

[0075] According to the sixth aspect of the present disclosure, an electronic device is provided, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein when the processor executes the computer program, the voice instruction recognition method described in the first aspect or the training method of the resource classification model described in the second aspect is implemented.

[0076] According to a seventh aspect of the present disclosure, a vehicle is provided, comprising: the electronic device as described in the sixth aspect.

[0077] By means of the above technical solution, the present disclosure provides a method, device, electronic device and vehicle for voice command recognition. Compared with the existing voice command recognition method, the present disclosure can first respond to receiving a voice command and identify the command text corresponding to the voice command; input the command text into the resource recognition model to determine the first resource field indicated by the voice command; perform entity word annotation processing on the command text to determine the second resource field indicated by the voice command; perform resource field arbitration processing on the first resource field and the second resource field according to the preset arbitration strategy to determine the target resource indicated by the voice command. In the technical solution of the present disclosure, two methods for voice command recognition are provided. By performing recognition of the resource recognition model and recognition of the entity word annotation, resource field recognition results under two recognition dimensions can be obtained, which can enrich the recognition dimension of the voice command. And by performing resource field arbitration processing on the resource field recognition results under the two feature recognition dimensions to determine the target resource field indicated by the voice command, the accuracy of the recognition result can be improved, thereby creating a good voice command recognition experience for the user.

[0078] The above description is only an overview of the technical solution of the present disclosure. In order to more clearly understand the technical means of the present disclosure, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the specific implementation methods of the present disclosure are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0080] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0081] FIG1 is a flow chart of a method for voice command recognition according to an embodiment of the present disclosure;

[0082] FIG2 is a flow chart of another method for voice command recognition provided by an embodiment of the present disclosure;

[0083] FIG3 is a flow chart of another method for voice command recognition provided by an embodiment of the present disclosure;

[0084] FIG4 shows a flow chart of a method for training a resource classification model provided by an embodiment of the present disclosure;

[0085] FIG5 shows a flow chart of another method for training a resource classification model provided by an embodiment of the present disclosure;

[0086] FIG6 shows a schematic diagram of the principle structure of a resource classification model training method provided by an embodiment of the present disclosure;

[0087] FIG7 is a schematic diagram of the structure of a voice command recognition device provided by an embodiment of the present disclosure;

[0088] FIG8 is a schematic structural diagram of a training device for a resource classification model provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0089] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0090] The following describes the voice command recognition method, device, electronic device, and vehicle according to embodiments of the present disclosure with reference to the accompanying drawings.

[0091] Existing speech recognition technologies often rely on text classification to determine whether a command is for an audio or video resource, or employ intent slot value recognition algorithms to determine the underlying intent and corresponding title and author names. These relatively narrow dimensions of speech command recognition only allow for a rough classification of resource categories, failing to guarantee accurate recognition and, consequently, failing to meet user expectations.

[0092] To solve the above technical problems, the present disclosure provides a voice command recognition method, device, electronic device and vehicle, which can solve the technical problem that the accuracy of voice command recognition is not high and cannot meet the user's usage experience.

[0093] As shown in FIG1 , an embodiment of the present disclosure provides a method for voice command recognition, comprising:

[0094] Step 101: In response to receiving a voice instruction, identify the instruction text corresponding to the voice instruction.

[0095] For the embodiment of the present disclosure, after receiving the voice instruction, the voice instruction can be converted into the form of instruction text, so as to facilitate the subsequent analysis of the instruction text to determine the target resource field indicated by the voice instruction. As a possible implementation method, a speech recognition system (Automatic Speech Recognition, ASR) can be used to analyze the received voice instruction and convert it into the corresponding instruction text. The speech recognition system may include trained acoustic models and language models, and the acoustic model may be a temporal connection classification model, a convolutional recurrent neural network, etc. When the speech recognition system is used to identify the instruction text corresponding to the voice instruction, the acoustic model in the speech recognition system can be used to convert the voice instruction into an acoustically represented pronunciation sequence. And the language model can also be used to resolve polyphones. After the acoustic model gives the pronunciation sequence, the character string sequence with the highest probability is found from the candidate text sequence as the instruction text corresponding to the voice instruction.

[0096] Step 102: Input the instruction text into a resource recognition model to obtain a first resource field indicated by the voice instruction.

[0097] The first resource domain can be any general resource domain, such as a media resource domain, a material resource domain, a family resource domain, an employment resource domain, a medical resource domain, and an educational resource domain. The resource identification model is used to determine the domain prediction result of the instruction text corresponding to the general resource domain, and the domain prediction result includes the predicted first resource domain. The resource identification model can be any pre-trained computing model that can realize the resource identification function, such as a neural network model, a deep learning model, etc. Exemplarily, the resource identification model in the present disclosure can be selected as a hidden Markov model, a conditional random field, and a neural network model, etc., which are not specifically limited here. In a specific application scenario, the training process of the resource identification model may include: first obtaining preset text features configured with resource domain labels, using the preset text features as input features, and using the resource domain labels as training labels, iteratively training the resource identification model until the loss function of the resource identification model is less than a preset threshold, and determining that the resource identification model training is completed. The preset text features are sentence features and / or text semantic features obtained after feature conversion processing of the sample instruction text, which are used to reflect the resource domain to which the sample instruction text corresponds. The preset threshold is a value greater than 0 and less than 1. The closer the preset threshold is to 1, the higher the recognition accuracy of the resource identification model. The specific value can be set according to the actual application scenario and is not specifically limited here.

[0098] In the embodiment of the present disclosure, the resource domain label includes a sentence feature label and an entity feature label, and the preset text feature includes a first training sample configured with an entity feature label and a second training sample configured with a sentence feature label. After obtaining the first training sample configured with an entity feature label and the second training sample configured with a sentence feature label, the first training sample and the second training sample can be used as input features, and the sentence feature label and the entity feature label can be used as training labels to iteratively train the resource identification model until the loss function of the resource identification model is less than a preset threshold, and the resource identification model training is determined to be completed. Among them, the first training sample is a sentence feature obtained after feature conversion processing of the sample instruction text, which is used to reflect the resource domain to which the sample instruction text corresponds. The second training sample is a text semantic feature (entity feature) obtained after feature conversion processing of the sample instruction text, which is used to reflect the resource domain to which the sample instruction text corresponds.

[0099] In an embodiment of the present disclosure, as a possible implementation method, when training a resource recognition model, it is first necessary to generate a first training sample and a second training sample, wherein the first training sample is a training sample configured with an entity feature label, and the entity feature label includes at least one of a non-entity label, an entity label, and an entity position label. The entity position label can be of three types: an entity start position label, an entity middle position label, and an entity end position label. The label representation of the entity feature label can be multiple, and this embodiment does not specifically limit this. For example, the format of the first training sample is "I, want, see, little, pig, Pei, Qi - O, O, O, VB, VI, VI, VE", where "O-outside" is the abbreviation for a non-entity label; "V-video" is the abbreviation for a video label; "B-begin" is the abbreviation for an entity start position label; "I-inside" is the abbreviation for an entity middle position label; and "E-end" is the entity end position label.

[0100] The second training sample is a training sample configured with a sentence feature label, wherein the sentence feature label is a label of the resource field corresponding to the sample sentence feature of the training sample, and the resource field label is a pre-set relevant vertical field under the resource field that requires accurate command recognition, which can be set according to the actual application scenario. For example, in the in-vehicle voice recognition scenario, voice command recognition should have the ability to understand user commands of the media resource type. When the in-vehicle user wants to listen to a song or watch a movie or TV series, the voice assistant should be able to understand the resource category field corresponding to the user command and send it to the corresponding third-party application for processing. Therefore, the resource field can be set to the media resource field at this time. When the resource field is the media resource field, the resource field label can correspond to the vertical field under the media resource field, such as the video field, music field, audiobook field, etc. In the following embodiment steps in the present disclosure, the resource field is taken as the media resource field as an example to illustrate the technical solution in the present disclosure, but it does not constitute a specific limitation. For example, if the training sample is “I want to watch The King of Comedy”, the “I want to watch” in the training sample is a sample sentence feature, which can directly reflect that the resource domain label of the training sample is the video domain label.

[0101] In the present disclosure, after obtaining the first training sample and the second training sample, the first training sample can be used to perform entity labeling training on the pre-training model, and after the entity labeling training is completed, an entity labeling model that has learned entity labeling characteristics can be obtained; the second training sample can be used to perform resource classification training on the entity labeling model, and after the resource classification training is completed, a resource identification model that has learned resource classification characteristics can be obtained. The resource identification model is used to perform resource domain identification on the voice command text based on the entity labeling characteristics and the resource classification characteristics.

[0102] Wherein, the pre-trained model is any model that can be used for model training using the first training sample, such as a pre-trained language representation (Bidirectional Encoder Representation from Transformers, BERT) model, which is not specifically limited in this embodiment; the entity labeling training is to use the instruction text in the first training sample as the training sample, and the labeling result corresponding to the instruction text as the entity feature label, and iteratively train the pre-trained model until the loss function of the pre-trained model is less than a preset threshold, and the pre-trained model training is determined to be completed. Wherein, the preset threshold is a value greater than 0 and less than 1. The closer the set value of the preset threshold is to 0, the higher the recognition accuracy of the pre-trained model. The specific value can be set according to the actual application scenario and is not specifically limited here. For the embodiment of the present disclosure, after the entity labeling training of the pre-trained model is completed using the first training sample, the trained pre-trained model is saved to obtain an entity labeling model that has learned entity labeling characteristics, wherein the entity labeling model is any model that can perform entity labeling on the instruction text obtained after the pre-training model is trained. This embodiment does not specifically limit this.

[0103] Resource classification training utilizes the voice command text in the second training sample as the training sample, uses the resource domain labels reflected in the voice command text as sentence feature labels, and iteratively trains the entity annotation model until the entity annotation model's loss function is less than a preset threshold. The entity annotation model training is then determined to be complete. The trained entity annotation model is then saved and added to a classification layer with classification characteristics to obtain a resource identification model with resource classification characteristics. The preset threshold is a value greater than 0 and less than 1. The closer the preset threshold is to 0, the higher the recognition accuracy of the entity annotation model. The specific value can be set based on the actual application scenario and is not specifically limited here. The classification layer with classification characteristics can be a variety of methods such as decision trees, multilayer perceptrons, naive Bayes, logistic regression, support vector machines, linear classifiers, and feedforward neural networks, and this embodiment does not specifically limit this. The resource identification model is used to identify the resource domain of the voice command text based on the entity annotation characteristics and resource classification characteristics. The resource identification model is any model that can be obtained after completing model training of the entity annotation model using the second training sample, and this embodiment does not specifically limit this.

[0104] For the embodiments disclosed herein, compared with the prior art, when using a resource identification model to identify a voice instruction text, the voice instruction text can be first annotated with entity words, the voice instruction text and the annotated results can be input into the resource identification model, and the text can be annotated based on the sentence features of the voice instruction text. The annotated result is the resource domain label to which the voice instruction text belongs, and the final resource domain to which the text belongs is determined by combining the entity word annotated result and the resource domain label to which the voice instruction text belongs. Taking "Play Peppa Pig" and "Play Qilixiang" as examples, both contain the keyword "play", so they both belong to the vertical domain related to media resources; however, "Peppa Pig" is a cartoon, and "Qilixiang" is a song, so they belong to the video and music categories respectively. The distinction between the two categories depends on the title in the instruction. By combining the two characteristics, the occurrence of resource identification misjudgment can be reduced. As a possible implementation method, if the entity word annotation result and the resource field label of the voice command text are consistent, the consistent result will be output as the final resource field; if the entity word annotation result and the resource field label of the voice command text are inconsistent, the final resource field will be output according to the preset priority of the entity word annotation result and the resource field label.

[0105] Compared with the training method of the existing model, in the training process of the resource identification model, the present invention first uses the first training sample to perform entity labeling training on the pre-trained model, so that the trained entity labeling model can have entity labeling characteristics and can accurately identify entity category features in sentences. Afterwards, the second training sample is used to further perform resource classification training on the entity labeling model, so that it has resource classification characteristics, so that the resource identification model finally trained can have the ability to recognize voice commands based on sentence features and entity features at the same time. When using the resource identification model to classify instructions of the media resource class, by combining the two feature dimensions of sentence features and entity features to comprehensively analyze voice commands, the accuracy of voice command recognition can be improved, and the user experience can be enhanced.

[0106] In an embodiment of the present disclosure, as a possible implementation method, before inputting the instruction text into the resource identification model, natural language processing technology (NLP) can be used to identify the sentence features and / or text semantic features of the instruction text, and the identified text sentence features and / or text semantic features are input into the resource identification model for resource identification to obtain the first resource field corresponding to the voice instruction.

[0107] Step 103: perform entity word tagging on the instruction text to determine the second resource domain indicated by the voice instruction.

[0108] Among them, the entity word annotation processing is used to extract the entity words contained in the instruction text, and to determine the second resource field that matches the resource annotation result of the entity word; the second resource field is a vertical field under the feature resource field (i.e., a preset resource field). For example, the feature resource field is a pre-set resource field that requires accurate instruction recognition, which can be set according to the actual application scenario. For example, in the in-vehicle voice recognition scenario, the voice instruction recognition should have the ability to understand the user instructions of the media resource type. When the in-vehicle user wants to listen to a song or watch a movie or TV series, the voice assistant should be able to understand the resource category field corresponding to the user instruction and send it to the corresponding third-party application for processing. Therefore, the feature resource field can be set to the media resource field at this time. When the feature resource field is the media resource field, the second resource field can correspond to the vertical field under the media resource field, such as the video field, the music field, the audiobook field, etc. In the following embodiment steps in the present disclosure, the technical solution in the present disclosure is described by taking the feature resource field as the media resource field as an example, but it does not constitute a specific limitation.

[0109] For the embodiments of the present disclosure, as a possible implementation method, a hidden Markov model, a conditional random field model, etc. can be used to perform entity word tagging on the instruction text to obtain multiple entity words and corresponding preset resource fields. As a possible implementation method, a decision tree, a multi-layer perceptron, a naive Bayesian, a logistic regression, a support vector machine, a linear classifier, a feedforward neural network, etc. can be used to cluster and divide the feature values ​​of multiple entity words and corresponding preset resource fields, and determine the preset resource field corresponding to the highest feature value as the second resource field.

[0110] It should be noted that, as a possible implementation method, step 102 of the embodiment and step 103 of the embodiment may be executed in sequence, such as executing step 102 of the embodiment first and then executing step 103 of the embodiment; or executing step 103 of the embodiment first and then executing step 102 of the embodiment. The execution order is not specifically limited here; as a possible implementation method, step 102 and step 103 may be executed in parallel. In this way, the calculation time in the recognition process can be reduced and the user experience can be improved.

[0111] Step 104: Perform resource domain arbitration on the first resource domain and the second resource domain according to a preset arbitration strategy to determine the target resource domain indicated by the voice instruction.

[0112] The preset arbitration strategy is a strategy that determines whether the first resource domain is a specific resource domain and, based on the determination, utilizes the first resource domain and / or the second resource domain to determine the final resource domain. Specifically, the preset arbitration strategy can be used to determine whether the first resource domain is a specific resource domain and to select a target resource domain from the first resource domain and the second resource domain that matches the identification result; the target resource domain is the resource domain indicated by the voice instruction, as determined based on the first resource domain and / or the second resource domain.

[0113] For the embodiments of the present disclosure, the first resource field can be any general resource field. The present disclosure aims to identify whether the resource field indicated by the voice instruction is a characteristic resource field, and when the first resource field is identified as a characteristic resource field, further use the recognition result of the second resource field to verify the accuracy of the first resource field, so as to achieve accurate identification of the characteristic resource field.

[0114] In summary, according to the voice command recognition method, device, electronic device and vehicle provided by the present disclosure, compared with the existing voice command recognition method, the present disclosure can first respond to the receipt of a voice command and identify the command text corresponding to the voice command; input the command text into the resource recognition model to determine the first resource field indicated by the voice command; perform entity word annotation processing on the command text to determine the second resource field indicated by the voice command; perform resource field arbitration processing on the first resource field and the second resource field according to the preset arbitration strategy to determine the target resource indicated by the voice command. In the technical solution of the present disclosure, two methods of voice command recognition are provided. By performing resource recognition model recognition and entity word annotation recognition, resource field recognition results under two recognition dimensions can be obtained, which can enrich the recognition dimension of the voice command. And by performing resource field arbitration processing on the resource field recognition results under the two feature recognition dimensions to determine the target resource field indicated by the voice command, the accuracy of the recognition result can be improved, thereby creating a good voice command recognition experience for the user.

[0115] Based on the embodiment shown in FIG1 , as a refinement and extension of the above embodiment, in order to fully illustrate the specific implementation process of the method of this embodiment, this embodiment provides a specific method as shown in FIG2 , which includes:

[0116] Step 201: In response to receiving a voice instruction, identify the instruction text corresponding to the voice instruction.

[0117] For the embodiment of the present disclosure, the specific implementation process can be found in the relevant description of step 101 of the embodiment, which will not be repeated here.

[0118] Step 202: extract text features of the instruction text, input the text features into a resource recognition model, obtain a domain prediction result corresponding to the text features, and determine the domain prediction result as the first resource domain indicated by the voice instruction.

[0119] Among them, the text feature is a sentence feature and / or text semantic feature obtained after the feature conversion processing of the instruction text, which is used to reflect the resource field to which the instruction text corresponds. For example, if the instruction text is "I want to watch The King of Comedy", the "King of Comedy" in the instruction text is a text feature, which can directly reflect that the resource field of the instruction text is the media video field. By extracting the text features of the instruction text and inputting the text features into the resource recognition model, the first resource field indicated by the voice instruction can be more accurately identified. For the embodiment of the present disclosure, the text features of the instruction text can be extracted by supervised learning, semi-supervised learning, unsupervised learning and other methods. It can be understood that there can be many methods for extracting the text features of the instruction text, which are not specifically limited here.

[0120] In an embodiment of the present disclosure, after obtaining the text features of the instruction text, the text features can be input into a resource identification model, and the prediction scores of the text features corresponding to different preset resource fields are determined in the resource identification model. The preset resource field corresponding to the highest preset score is determined as the field prediction result, that is, the first resource field.

[0121] Step 203: Determine multiple entity words contained in the instruction text based on the n-gram, use a preset vocabulary to mark the preset resource field of each of the multiple entity words, and determine the preset resource field with the highest priority among the preset resource fields obtained by marking the multiple entity words as the second resource field indicated by the voice instruction.

[0122] Among them, n-grams are n words that appear consecutively in the instruction text; the preset word list contains multiple preset resource fields, and for each preset resource field, corresponding feature words and corresponding preset priorities are configured. Feature words include at least one of entity feature words and action feature words; the preset resource field is a vertical field under a pre-set specific resource field. For example, when the specific resource field is the media resource field, the preset resource field may include the video field, the music field, the audiobook field, etc.; entity feature words are specific entity words that can reflect the preset resource field. For example, the "ending song" in the instruction text "Play the ending song of the Lotus Lantern" belongs to the specific entity in the music field. When this word appears, it is obviously considered to belong to the music field. Action feature words are specific action words that can reflect the preset resource field. For example, the "play" in the instruction text "play Peppa Pig" indicates that this action is likely in the video field.

[0123] In a specific application scenario, multiple entity words can be labeled to obtain the same preset resource field. In this case, the unique preset resource field can be determined as the second resource field corresponding to the voice instruction; or, multiple entity words can be labeled to obtain multiple preset resource fields, such as different entity words are labeled as different preset resource fields. In this case, the multiple preset resource fields obtained by labeling can be selected according to the preset priority among the multiple preset resource fields, and the preset resource field with the highest priority can be selected as the second resource field corresponding to the voice instruction. Among them, the preset priority can be set according to the user needs in the specific application scenario, such as setting a higher priority for the preset resource field to which the user issues instructions more frequently, and setting a lower priority for the preset resource field to which the user issues instructions less frequently, etc., which are not exhaustively listed here.

[0124] In a specific application scenario, when using n-gram grammar to determine multiple entity words contained in the instruction text, for example, if the received instruction text is "I want to listen to blue and white porcelain", it can be divided into six-gram grammar "I want to listen to blue and white porcelain"; five-gram grammar "I want to listen to blue and white porcelain", "want to listen to blue and white porcelain"; four-gram grammar "I want to listen to blue", "want to listen to blue and white porcelain", "listen to blue and white porcelain"; three-gram grammar "I want to listen", "want to listen to blue", "listen to blue and white porcelain", "blue and white porcelain"; two-gram grammar "I want", "want to listen", "listen to blue", "blue and white porcelain", "flower porcelain"; one-gram grammar "I", "want", "listen", "blue", "flower", "porcelain", and the entity words corresponding to the above-mentioned six grammars are matched with the feature words of the preset vocabulary and the corresponding annotated preset resource fields to obtain the preset resource fields corresponding to each entity word. If the preset resource fields corresponding to each entity word are consistent, the consistent preset resource fields are determined as the second resource fields; if the preset resource fields corresponding to each entity word are inconsistent, they are sorted according to the preset priority corresponding to each preset resource field, and the preset resource field with the highest priority is determined as the second resource field corresponding to the voice instruction.

[0125] In a specific application scenario, the preset vocabulary includes multiple preset resource domains, and corresponding feature words are configured for each preset resource domain. The feature words include at least one of entity feature words and action feature words. Accordingly, when using the preset vocabulary to annotate the preset resource domain of each entity word in the multiple entity words, the embodiment steps may include: calculating the feature similarity between each entity word in the multiple entity words and the feature words; and annotating the preset resource domain represented by the feature word with the highest feature similarity as the preset resource domain of the entity word.

[0126] In the embodiments of the present disclosure, to calculate the feature similarity between each entity word and a feature word in multiple entity words, as a possible implementation method, the preset word list can be a synonym dictionary containing multiple feature words, which is used to calculate the word distance between the entity word and the feature word. The synonym dictionary is a word list that organizes all words into a tree structure based on their relevance, and pre-labels the feature words and corresponding preset resource fields. The word distance is a real number between [0,∞). When calculating the word distance between an entity word and a feature word, the entity word can be mapped to the corresponding word position in the synonym dictionary, and the word distance is calculated by the path length between the entity word and the feature word. The greater the word distance between the entity word and the feature word, the lower the feature similarity, that is, the lower the probability that the entity word is a feature word; conversely, the smaller the word distance between the entity word and the feature word, the higher the feature similarity, that is, the greater the probability that the entity word is a feature word. In the embodiments of the present disclosure, for each entity word in the multiple entity words, the feature word with the smallest corresponding word distance can be selected, and the preset resource field represented by the feature word is marked as the preset resource field of the entity word. For example, when determining the preset resource field corresponding to entity word A, by calculating the feature similarity between entity word A and multiple feature words contained in the preset vocabulary, the feature word a with the highest feature similarity to the corresponding feature of entity word A is screened out from multiple feature words, then the preset resource field corresponding to feature word a can be marked as the preset resource field of entity word A.

[0127] Step 204: If it is determined that the first resource field is a specific resource field, verify whether the second resource field belongs to a vertical field under the first resource field, and determine the target resource field indicated by the voice instruction that matches the verification result of the vertical field; if it is determined that the first resource field is not a specific resource field, determine the first resource field as the target resource field indicated by the voice instruction.

[0128] The target resource field is the resource field indicated by the voice instruction that is finally determined based on the first resource field and / or the second resource field; the specific resource field may be a media resource field.

[0129] For the embodiments of the present disclosure, the present disclosure aims to identify whether the resource field indicated by the voice instruction is a characteristic resource field, and when the first resource field is identified as a characteristic resource field, further use the recognition result of the second resource field to verify the accuracy of the first resource field, so as to achieve accurate identification of the characteristic resource field. As a possible implementation method, it is possible to identify whether the resource field indicated by the voice instruction is a characteristic resource field, and when the first resource field does not correspond to a specific resource field, directly output the corresponding recognition result without continuing to execute subsequent steps; when the first resource field is identified as a characteristic resource field, further verify whether the second resource field belongs to a vertical field under the first resource field, and determine the target resource field indicated by the voice instruction that matches the verification result of the vertical field, so as to achieve accurate identification of the characteristic resource field.

[0130] Accordingly, methods such as decision trees, multilayer perceptrons, naive Bayes, logistic regression, support vector machines, linear classifiers, and feedforward neural networks can be used to cluster and divide the domain results of the first resource domain. When the first resource domain does not have the characteristics of a specific resource domain, the first resource domain can be directly determined as the target resource domain indicated by the voice instruction, and the identification of the second resource domain and subsequent steps will not be performed. When the first resource domain belongs to a specific resource domain, in order to achieve accurate identification of the characteristic resource domain, the second resource domain can be further used to determine whether the first resource domain is correct. If the second resource domain is a vertical domain under the first resource domain, it means that the first resource domain is correctly judged, and the lower-level second resource domain can be determined as the target resource domain. If the second resource domain is not a vertical domain under the first resource domain, it can be indicated that there is a recognition error in the first resource domain and the second resource domain. As a possible implementation method, a prompt message indicating that the voice instruction recognition is abnormal can be further output to indicate that the target resource domain cannot be accurately identified. As a possible implementation method, the first resource domain or the second resource domain with the highest recognition priority can be determined as the target resource domain indicated by the voice instruction. In specific application scenarios, different recognition priorities can be set in advance for two or more resource recognition methods based on recognition characteristics (such as recognition accuracy, etc.). This allows for the identification of specific resource domains, and when the resource domain recognition results obtained by multiple resource recognition methods do not match, the resource domain recognition result obtained by the recognition method with the highest recognition priority will be determined as the target resource domain. For example, if the recognition priority of the entity word tagging method is higher than the recognition priority of the resource recognition model, and for the same voice command, the first resource domain determined to be resource domain A and the second resource domain determined to be resource domain B, resource domain B can be determined as the target resource domain based on the recognition priority.

[0131] Accordingly, when using the second resource field to verify the first resource field and determining the target resource field corresponding to the voice instruction based on the verification result, the specific implementation process may include: in response to the vertical field verification result that the second resource field belongs to the vertical field under the first resource field, determining the second resource field as the target resource field corresponding to the voice instruction; in response to the vertical field verification result that the second resource field does not belong to the vertical field under the first resource field, determining the first resource field or the second resource field configured with the highest recognition priority as the target resource field corresponding to the voice instruction.

[0132] In summary, according to the voice command recognition method, device, electronic device and vehicle provided by the present disclosure, compared with the existing voice command recognition method, the present disclosure can first respond to the receipt of a voice command and identify the command text corresponding to the voice command; input the command text into the resource recognition model to determine the first resource field indicated by the voice command; perform entity word annotation processing on the command text to determine the second resource field indicated by the voice command; perform resource field arbitration processing on the first resource field and the second resource field according to the preset arbitration strategy to determine the target resource indicated by the voice command. In the technical solution of the present disclosure, two methods of voice command recognition are provided. By performing resource recognition model recognition and entity word annotation recognition, resource field recognition results under two recognition dimensions can be obtained, which can enrich the recognition dimensions of voice commands. And by performing resource field arbitration processing on the resource field recognition results under two feature recognition dimensions to determine the target resource field indicated by the voice command, the accuracy of the recognition results can be improved, thereby creating a good voice command recognition experience for users.

[0133] Based on the embodiments shown in FIG1 and FIG2 , as a refinement and extension of the above embodiments, in order to fully illustrate the specific implementation process of training the resource identification model in the method of this embodiment, this embodiment provides a specific method as shown in FIG3 , which includes:

[0134] Step 301: Obtain a preset number of entity texts, insert the entity texts into a preset position of a text construction template, and splice them with the fixed text in the text construction template to generate a first training sample, and configure an entity feature label that matches the entity category for each character in the first training sample.

[0135] The preset number is a number of pre-set values, which can be set according to actual conditions and are not specifically limited.

[0136] For the embodiments of the present disclosure, crawler technology or other technical means can be used to obtain a number of entity texts, which can be entity titles, entity locations, entity names, entity times, etc. In the embodiments of the present disclosure, the entity text is taken as an entity title as an example to illustrate the technical solution in the present disclosure, but it does not constitute a specific limitation on the technical solution in the present disclosure. A number of entity texts are inserted into the preset position of the text construction template, and spliced ​​with the fixed text in the text construction template to generate a first training sample, wherein the preset annotation template is a pre-set template of adjustable fixed text that can be set according to actual conditions, and each fixed text template has a preset position where the entity text can be inserted, and the preset position can be the left position of the fixed text and the right position of the fixed text. In the embodiments of the present disclosure, the right position of the fixed text is taken as the preset position of the text construction template as an example to illustrate the technical solution in the present disclosure, but it does not constitute a specific limitation on the technical solution in the present disclosure.

[0137] For example, the entity text obtained is "Peppa Pig", and the text construction template is play <title>,Open< / title> <title> I want to listen< / title> <title> ,in,"< / title> <title> " represents the entity text that needs to be filled in. "Peppa Pig" is filled in the text construction template in sequence and spliced ​​with the fixed text in the text construction template to generate the first training samples of "Play <Peppa Pig>", "Open <Peppa Pig>", and "I want to listen to <Peppa Pig>". After obtaining the first training sample, BIO-Beginning Inside Outside annotation, BIOSE-Beginning Inside Outside End Single annotation, IOB-Inside Outside Begin annotation and other methods can be used to annotate each character in the first training sample with an entity feature label that matches the entity category, wherein the entity feature label includes at least one of a non-entity label, an entity label, and an entity position label. The entity position label can be of three types: an entity start position label, an entity middle position label, and an entity end position label. The label representation of the entity feature label can be multiple, and this embodiment does not specifically limit this.< / title>

[0138] For the embodiments of the present disclosure, the annotation method is taken as the BIOSE annotation method to illustrate the technical solution in the present disclosure, but it does not constitute a specific limitation on the technical solution in the present disclosure. For example, the first training sample is "I want to see Peppa Pig", and the entity feature label is annotated for the first training sample, and the annotation result is "O, O, O, VB, VI, VI, VE", where the abbreviation of "O-outside" indicates a non-entity label; the abbreviation of "V-video" indicates that the entity label is a video label; the abbreviation of "B-begin" represents the entity start position label; "I-inside" represents the entity middle position label; "E-end" represents the entity end position label, VB represents the video start label, VI represents the video middle label, and VE represents the video end label. Since there is no single character Single in this training sample, the S character is not displayed in this annotation result.

[0139] Step 302: Input the first training sample into the pre-training model, perform entity labeling training on the pre-training model, and obtain an entity labeling model that has learned entity labeling characteristics after the entity labeling training is completed.

[0140] Among them, the pre-trained model is any model that can be used to perform model training using the first training sample, such as a pre-trained language representation (Bidirectional Encoder Representation from Transformers, BERT) model, and this embodiment does not make specific limitations on this. For the disclosed embodiment, the pre-trained model is configured with model parameters. During the entity labeling training process, the instruction text in the first training sample is used as the training sample, and the entity feature label of the labeling result corresponding to the instruction text is used as the training label. The model parameters of the pre-trained model for entity labeling processing are updated until the accuracy of the pre-trained model for entity labeling is greater than the first preset threshold, and the entity labeling training is judged to be completed. Among them, the first preset threshold can be a value greater than 0 and less than 1. The closer the setting value of the first preset threshold is to 1, the higher the accuracy of the entity labeling of the pre-trained model. The specific value can be set according to the actual application scenario and is not specifically limited here.

[0141] Step 303: Obtain a preset number of sample instruction texts, where the sample instruction texts at least contain resource indication information, and annotate the sample instruction texts with sentence feature labels that match the resource indication information to obtain second training samples.

[0142] The preset number is a number of pre-set values, which can be set according to actual conditions and are not specifically limited.

[0143] For the embodiments of the present disclosure, crawler technology or other technical means can be used to obtain a number of sample instruction texts. The resource indication information contained in the sample instruction text is at least a sentence feature label indicating the sample instruction text. The resource indication information can be a specific expression sentence, and different resource indication information corresponds to different sentence feature labels. The sample instruction text and the corresponding sentence feature label are used as the second training sample. For example, the corresponding sentence feature label of "I want to watch" in "I want to watch SpongeBob SquarePants" is a video field label. The sentence feature label is a sample sentence feature based on the training sample that reflects the corresponding resource field label. "I want to watch SpongeBob SquarePants" and the video field label are used as the second training sample.

[0144] Step 304: input the second training sample into the entity annotation model, perform resource classification training on the entity annotation model, and obtain a resource recognition model with resource classification characteristics after the resource classification training is completed.

[0145] Among them, the resource identification model can also be called a resource classification model. The resource identification model is a model obtained by training the entity annotation model using the second training sample, and is used to divide the input voice text instructions into resources.

[0146] For the embodiment of the present disclosure, the entity annotation model is configured with model parameters. During the resource classification training process, the sample instruction text in the second training sample is used as the training sample, and the sentence feature label corresponding to the sample instruction text is used as the training label. The model parameters of the entity annotation model for resource classification processing are updated until the accuracy of the entity annotation model for resource classification is greater than the second preset threshold. The training of the entity annotation model is determined to be completed, and the trained entity annotation model is saved and added to the classification layer with classification characteristics to obtain a resource identification model with resource classification characteristics. Among them, the second preset threshold can be a value greater than 0 and less than 1. The closer the setting value of the second preset threshold is to 1, the higher the accuracy of the entity annotation model for resource classification. The specific value can be set according to the actual application scenario and is not specifically limited here. The classification layer with classification characteristics can be a variety of methods such as decision trees, multi-layer perceptrons, naive Bayes, logistic regression, support vector machines, linear classifiers, feedforward neural networks, etc. This embodiment does not make specific limitations on this.

[0147] For the embodiment of the present disclosure, in the resource identification model, the final classification result is determined by combining the sentence feature labels and entity feature labels of the voice text instructions and classifying the two feature labels. As a possible implementation method, if the two feature labels are consistent, the consistent result is output as the final resource field. If the two feature labels are inconsistent, it means that there is a recognition error in the sentence feature label or the entity feature label. A prompt message of the voice instruction recognition abnormality can be further output to prompt that the final resource field cannot be accurately identified. This method can reduce the occurrence of resource identification misjudgments.

[0148] In summary, according to the training method of the resource identification model provided by the present disclosure, compared with the training method of the existing model, the present disclosure can first generate a first training sample and a second training sample, the first training sample is a training sample configured with an entity feature label, and the second training sample is a training sample configured with a sentence feature label; the first training sample is used to perform entity labeling training on the pre-trained model, and after the entity labeling training is completed, an entity labeling model that has learned entity labeling characteristics is obtained; the second training sample is used to perform resource classification training on the entity labeling model, and after the resource classification training is completed, a resource identification model that has learned resource classification characteristics is obtained, and the resource identification model is used to perform resource domain identification on the voice instruction text based on the entity labeling characteristics and resource classification characteristics. In the technical solution of the present disclosure, the first training sample is first used to perform entity labeling training on the pre-trained model, so that the trained entity labeling model has entity labeling characteristics and can accurately identify entity category features in sentences. Afterwards, the second training sample is used to further perform resource classification training on the entity labeling model, so that it has resource classification characteristics, so that the resource identification model finally trained can simultaneously have the ability to recognize voice instructions based on sentence features and entity features. When using the resource recognition model to classify media resource instructions, comprehensive voice command analysis based on both sentence features and entity features can improve the accuracy of voice command recognition and enhance the user experience.

[0149] As shown in FIG4 , an embodiment of the present disclosure further provides a method for training a resource classification model, the method comprising:

[0150] Step 401: Generate a first training sample and a second training sample.

[0151] In the embodiment of the present disclosure, when training a resource classification model, it is first necessary to generate a first training sample and a second training sample. The first training sample is a training sample configured with an entity feature label. The entity feature label includes at least one of a non-entity label, an entity label, and an entity position label. The entity position label can be of three types: an entity start position label, an entity middle position label, and an entity end position label. The label representation of the entity feature label can be multiple, and this embodiment does not specifically limit this. For example, the format of the first training sample is "I, want, see, little, pig, Pei, Qi - O, O, O, VB, VI, VI, VE", where "O-outside" is the abbreviation for a non-entity label; "V-video" is the abbreviation for a video label; "B-begin" is the abbreviation for an entity start position label; "I-inside" is the abbreviation for an entity middle position label; and "E-end" is the entity end position label.

[0152] The second training sample is a training sample configured with a sentence feature label, wherein the sentence feature label is a label of the resource field corresponding to the sample sentence feature of the training sample, and the resource field label is a pre-set relevant vertical field under the resource field that requires accurate command recognition, which can be set according to the actual application scenario. For example, in the in-vehicle voice recognition scenario, voice command recognition should have the ability to understand user commands of the media resource type. When the in-vehicle user wants to listen to a song or watch a movie or TV series, the voice assistant should be able to understand the resource category field corresponding to the user command and send it to the corresponding third-party application for processing. Therefore, the resource field can be set to the media resource field at this time. When the resource field is the media resource field, the resource field label can correspond to the vertical field under the media resource field, such as the video field, music field, audiobook field, etc. In the following embodiment steps in the present disclosure, the resource field is taken as the media resource field as an example to illustrate the technical solution in the present disclosure, but it does not constitute a specific limitation. For example, if the training sample is “I want to watch The King of Comedy”, the “I want to watch” in the training sample is a sample sentence feature, which can directly reflect that the resource domain label of the training sample is the video domain label.

[0153] Step 402: Utilize the first training sample to perform entity labeling training on the pre-trained model, and obtain an entity labeling model having learned entity labeling characteristics after the entity labeling training is completed.

[0154] Wherein, the pre-trained model is any model that can be used for model training using the first training sample, such as a pre-trained language representation (Bidirectional Encoder Representation from Transformers, BERT) model, which is not specifically limited in this embodiment; the entity labeling training is to use the instruction text in the first training sample as the training sample, and the labeling result corresponding to the instruction text as the entity feature label, and iteratively train the pre-trained model until the loss function of the pre-trained model is less than a preset threshold, and the pre-trained model training is determined to be completed. Wherein, the preset threshold is a value greater than 0 and less than 1. The closer the set value of the preset threshold is to 0, the higher the recognition accuracy of the pre-trained model. The specific value can be set according to the actual application scenario and is not specifically limited here. For the embodiment of the present disclosure, after the entity labeling training of the pre-trained model is completed using the first training sample, the trained pre-trained model is saved to obtain an entity labeling model that has learned entity labeling characteristics, wherein the entity labeling model is any model that can perform entity labeling on the instruction text obtained after the pre-training model is trained. This embodiment does not specifically limit this.

[0155] Step 403: Use the second training sample to perform resource classification training on the entity labeling model. After the resource classification training is completed, a resource classification model with resource classification characteristics is obtained.

[0156] Resource classification training involves using the voice command text in the second training sample as the training sample, using the resource domain labels reflected in the voice command text as sentence feature labels, and iteratively training the entity annotation model until the entity annotation model's loss function is less than a preset threshold. The entity annotation model training is then determined to be complete. The trained entity annotation model is then saved and added to a classification layer with classification characteristics to obtain a resource classification model with resource classification characteristics. The preset threshold is a value greater than 0 and less than 1. The closer the preset threshold is to 0, the higher the recognition accuracy of the entity annotation model. The specific value can be set based on the actual application scenario and is not specifically limited here. The classification layer with classification characteristics can be a variety of methods such as decision trees, multilayer perceptrons, naive Bayes, logistic regression, support vector machines, linear classifiers, and feedforward neural networks, and this embodiment does not specifically limit this. The resource classification model is used to identify the resource domain of the voice command text based on the entity annotation characteristics and resource classification characteristics. The resource classification model is any model that can be obtained after completing model training of the entity annotation model using the second training sample, and this embodiment does not specifically limit this.

[0157] For the embodiment of the present disclosure, compared with the prior art, when using the resource classification model to recognize the voice instruction text, combined with step 402 of the embodiment, the voice instruction text can be first annotated with entity words, the voice instruction text and the annotated result can be input into the resource classification model, and annotated based on the sentence features of the voice instruction text. The annotated result is the resource domain label to which the voice instruction text belongs, and the final resource domain to which it belongs is determined by combining the entity word annotated result and the resource domain label to which the voice instruction text belongs. Taking "Play Peppa Pig" and "Play Qilixiang" as examples, both contain the keyword "play", so they both belong to the vertical domain related to media resources; however, "Peppa Pig" is a cartoon, and "Qilixiang" is a song, so they belong to the video and music categories respectively. The distinction between the two categories depends on the title in the instruction. By combining the two characteristics, the occurrence of resource identification misjudgment can be reduced. As a possible implementation method, if the entity word annotation result and the resource field label of the voice command text are consistent, the consistent result will be output as the final resource field; if the entity word annotation result and the resource field label of the voice command text are inconsistent, the final resource field will be output according to the preset priority of the entity word annotation result and the resource field label.

[0158] In summary, according to the training method of the resource classification model provided by the present disclosure, compared with the training method of the existing model, the present disclosure can first generate a first training sample and a second training sample, the first training sample is a training sample configured with an entity feature label, and the second training sample is a training sample configured with a sentence feature label; the first training sample is used to perform entity labeling training on the pre-trained model, and after the entity labeling training is completed, an entity labeling model that has learned entity labeling characteristics is obtained; the second training sample is used to perform resource classification training on the entity labeling model, and after the resource classification training is completed, a resource classification model that has learned resource classification characteristics is obtained, and the resource classification model is used to perform resource domain recognition on the voice instruction text based on the entity labeling characteristics and the resource classification characteristics. In the technical solution of the present disclosure, the first training sample is first used to perform entity labeling training on the pre-trained model, so that the trained entity labeling model has entity labeling characteristics and can accurately identify entity category features in sentences. Afterwards, the second training sample is used to further perform resource classification training on the entity labeling model, so that it has resource classification characteristics, so that the resource classification model finally trained can simultaneously have the ability to recognize voice instructions based on sentence features and entity features. When using the resource classification model to classify media resource instructions, comprehensive voice command analysis based on both sentence features and entity features can improve the accuracy of voice command recognition and enhance the user experience.

[0159] Based on the embodiment shown in FIG4 , as a refinement and extension of the above embodiment, in order to fully illustrate the specific implementation process of the method of this embodiment, this embodiment provides a specific method as shown in FIG5 , which includes:

[0160] Step 501: Obtain a preset number of entity texts, insert the entity texts into a preset position of a text construction template, and splice them with the fixed text in the text construction template to generate a first training sample, and configure an entity feature label that matches the entity category for each character in the first training sample.

[0161] The preset number is a number of pre-set values, which can be set according to actual conditions and are not specifically limited.

[0162] For the embodiments of the present disclosure, crawler technology or other technical means can be used to obtain a number of entity texts, which can be entity titles, entity locations, entity names, entity times, etc. In the embodiments of the present disclosure, the entity text is taken as an entity title as an example to illustrate the technical solution in the present disclosure, but it does not constitute a specific limitation on the technical solution in the present disclosure. A number of entity texts are inserted into the preset position of the text construction template, and spliced ​​with the fixed text in the text construction template to generate a first training sample, wherein the preset annotation template is a pre-set template of adjustable fixed text that can be set according to actual conditions, and each fixed text template has a preset position where the entity text can be inserted, and the preset position can be the left position of the fixed text and the right position of the fixed text. In the embodiments of the present disclosure, the right position of the fixed text is taken as the preset position of the text construction template as an example to illustrate the technical solution in the present disclosure, but it does not constitute a specific limitation on the technical solution in the present disclosure.

[0163] For example, the entity text obtained is "Peppa Pig", and the text construction template is play <title> ,Open< / title> <title> I want to listen< / title> <title> ,in,"< / title> <title> " represents the entity text that needs to be filled in. "Peppa Pig" is filled in the text construction template in sequence and spliced ​​with the fixed text in the text construction template to generate the first training samples of "Play <Peppa Pig>", "Open <Peppa Pig>", and "I want to listen to <Peppa Pig>". After obtaining the first training sample, BIO-Beginning Inside Outside annotation, BIOSE-Beginning Inside Outside End Single annotation, IOB-Inside Outside Begin annotation and other methods can be used to annotate each character in the first training sample with an entity feature label that matches the entity category, wherein the entity feature label includes at least one of a non-entity label, an entity label, and an entity position label. The entity position label can be of three types: an entity start position label, an entity middle position label, and an entity end position label. The label representation of the entity feature label can be multiple, and this embodiment does not specifically limit this.< / title>

[0164] For the embodiments of the present disclosure, the annotation method is taken as the BIOSE annotation method to illustrate the technical solution in the present disclosure, but it does not constitute a specific limitation on the technical solution in the present disclosure. For example, the first training sample is "I want to see Peppa Pig", and the entity feature label is annotated for the first training sample, and the annotation result is "O, O, O, VB, VI, VI, VE", where the abbreviation of "O-outside" indicates a non-entity label; the abbreviation of "V-video" indicates that the entity label is a video label; the abbreviation of "B-begin" represents the entity start position label; "I-inside" represents the entity middle position label; "E-end" represents the entity end position label, VB represents the video start label, VI represents the video middle label, and VE represents the video end label. Since there is no single character Single in this training sample, the S character is not displayed in this annotation result.

[0165] Step 502: Input the first training sample into the pre-training model, perform entity labeling training on the pre-training model, and obtain an entity labeling model that has learned entity labeling characteristics after the entity labeling training is completed.

[0166] Among them, the pre-trained model is any model that can be used to perform model training using the first training sample, such as a pre-trained language representation (Bidirectional Encoder Representation from Transformers, BERT) model, and this embodiment does not make specific limitations on this. For the disclosed embodiment, the pre-trained model is configured with model parameters. During the entity labeling training process, the instruction text in the first training sample is used as the training sample, and the entity feature label of the labeling result corresponding to the instruction text is used as the training label. The model parameters of the pre-trained model for entity labeling processing are updated until the accuracy of the pre-trained model for entity labeling is greater than the first preset threshold, and the entity labeling training is judged to be completed. Among them, the first preset threshold can be a value greater than 0 and less than 1. The closer the setting value of the first preset threshold is to 1, the higher the accuracy of the entity labeling of the pre-trained model. The specific value can be set according to the actual application scenario and is not specifically limited here.

[0167] Step 503: Obtain a preset number of sample instruction texts, where the sample instruction texts at least contain resource indication information, and annotate the sample instruction texts with sentence feature labels that match the resource indication information to obtain second training samples.

[0168] The preset number is a number of pre-set values, which can be set according to actual conditions and are not specifically limited.

[0169] For the embodiments of the present disclosure, crawler technology or other technical means can be used to obtain a number of sample instruction texts. The resource indication information contained in the sample instruction text is at least a sentence feature label indicating the sample instruction text. The resource indication information can be a specific expression sentence, and different resource indication information corresponds to different sentence feature labels. The sample instruction text and the corresponding sentence feature label are used as the second training sample. For example, the corresponding sentence feature label of "I want to watch" in "I want to watch SpongeBob SquarePants" is a video field label. The sentence feature label is a sample sentence feature based on the training sample that reflects the corresponding resource field label. "I want to watch SpongeBob SquarePants" and the video field label are used as the second training sample.

[0170] Step 504: Input the second training sample into the entity labeling model, perform resource classification training on the entity labeling model, and obtain a resource classification model with resource classification characteristics after the resource classification training is completed.

[0171] The resource classification model is a model obtained by training the entity annotation model using the second training sample, and is used to divide the input voice text instructions into resources.

[0172] For the embodiment of the present disclosure, the entity annotation model is configured with model parameters. During the resource classification training process, the sample instruction text in the second training sample is used as the training sample, and the sentence feature label corresponding to the sample instruction text is used as the training label. The model parameters of the entity annotation model for resource classification processing are updated until the accuracy of the entity annotation model for resource classification is greater than the second preset threshold. The entity annotation model training is determined to be completed, and the trained entity annotation model is saved and added to the classification layer with classification characteristics to obtain a resource classification model with resource classification characteristics. Among them, the second preset threshold can be a value greater than 0 and less than 1. The closer the set value of the second preset threshold is to 1, the higher the accuracy of the entity annotation model for resource classification. The specific value can be set according to the actual application scenario and is not specifically limited here. The classification layer with classification characteristics can be a variety of methods such as decision trees, multi-layer perceptrons, naive Bayes, logistic regression, support vector machines, linear classifiers, feedforward neural networks, etc. This embodiment does not make specific limitations on this.

[0173] For the embodiments of the present disclosure, in the resource classification model, the final classification result is determined by combining the sentence feature labels and entity feature labels of the voice text instructions and classifying the two feature labels. As a possible implementation method, if the two feature labels are consistent, the consistent result is output as the final resource field. If the two feature labels are inconsistent, it means that there is a recognition error in the sentence feature label or the entity feature label. A prompt message of voice instruction recognition abnormality can be further output to prompt that the final resource field cannot be accurately identified. This method can reduce the occurrence of resource identification misjudgment.

[0174] In some embodiments of the present disclosure, after the resource classification model is trained, the resource classification model can be used with reference to the use of a normal deep learning model to perform voice command recognition.

[0175] Specifically, in response to receiving a voice instruction, a voice instruction text corresponding to the voice instruction is identified; and the voice instruction text is input into a resource classification model to obtain a target resource field indicated by the voice instruction.

[0176] For the embodiment of the present disclosure, after receiving the voice instruction, the voice instruction can be converted into the form of instruction text, so as to facilitate the subsequent analysis of the instruction text to determine the target resource field indicated by the voice instruction. As a possible implementation method, a speech recognition system (Automatic Speech Recognition, ASR) can be used to analyze the received voice instruction and convert it into the corresponding instruction text. The speech recognition system may include trained acoustic models and language models, and the acoustic model may be a temporal connection classification model, a convolutional recurrent neural network, etc. When the speech recognition system is used to identify the instruction text corresponding to the voice instruction, the acoustic model in the speech recognition system can be used to convert the voice instruction into an acoustically represented pronunciation sequence. And the language model can also be used to resolve polyphones. After the acoustic model gives the pronunciation sequence, the character string sequence with the highest probability is found from the candidate text sequence as the instruction text corresponding to the voice instruction.

[0177] The resource classification model is used to determine the target resource domain based on entity labeling characteristics and resource classification characteristics. In the disclosed embodiment, when a voice command text is input into the resource classification model, the voice command text can first be annotated with entity words to obtain the voice command text and entity feature labels. The sentence features of the voice command text are then annotated, and the annotated result is the resource domain label to which the voice command text belongs. The final resource domain to which the voice command belongs is determined by combining the entity feature label and the resource domain label. As one possible implementation method, if the entity feature label and the resource domain label are consistent, the consistent result is output as the final resource domain to which the voice command belongs. If the entity feature label and the resource domain label are inconsistent, the final resource domain to which the voice command belongs is output according to the preset priority of the entity feature label and the resource domain label. As another possible implementation method, if the entity feature label and the resource domain label are consistent, the consistent result is output as the final resource domain to which the voice command belongs. If the entity feature label and the resource domain label are inconsistent, it indicates that there is a recognition error in the entity feature label or the resource domain. A prompt message indicating a voice command recognition error can be further output to indicate that the final resource domain to which the voice command belongs cannot be accurately identified. By combining these two characteristics, the occurrence of resource recognition errors can be reduced.

[0178] The technical solution of the present disclosure is fully described here in conjunction with Figure 6: the pre-trained model receives the voice command text "I want to see Peppa Pig", and uses the sequence annotation layer to perform sequence annotation on "I want to see Peppa Pig", and the sequence annotation result is to configure an entity feature label that matches the entity category for each character, such as O, O, O, VB, VI, VI, where "O-outside" is the abbreviation for a non-entity label, "V-video" is the abbreviation for a video label, and "B-begin" is the abbreviation for the entity start position label; "I-inside" represents the entity middle position and the entity end position label. VB represents the video start label, the first VI represents the video middle label, and the second VI represents the video end label. The sequence annotation layer performs entity annotation training for the pre-trained model, and after the entity annotation training is completed, an entity annotation model with entity annotation characteristics is obtained. Input "I want to watch Peppa Pig" into the pre-trained model to label the sentence feature labels. The pre-trained model here is a model obtained after training the entity labeling model, which can label the sentence feature labels according to the sentence features of the voice instruction text. Finally, the linear classification layer can be used to classify the entity feature labels and sentence feature labels of "I want to watch Peppa Pig", and the final resource field to which it belongs is output as the video field according to the classification result. In the technical solution disclosed in the present invention, the voice instruction text corresponding to the voice instruction can be input into the resource classification model to determine the target resource field indicated by the voice instruction. In the technical solution disclosed in the present invention, since the resource classification model is a model obtained after entity labeling training and resource classification training, when using the resource classification model to classify instructions of the media resource class, the voice instruction analysis can be carried out by combining the two feature dimensions of entity features and sentence features, which can improve the accuracy of voice instruction recognition and enhance user experience.

[0179] In summary, according to the training method of the resource classification model provided by the present disclosure, compared with the training method of the existing model, the present disclosure can first generate a first training sample and a second training sample, the first training sample is a training sample configured with an entity feature label, and the second training sample is a training sample configured with a sentence feature label; the first training sample is used to perform entity labeling training on the pre-trained model, and after the entity labeling training is completed, an entity labeling model that has learned entity labeling characteristics is obtained; the second training sample is used to perform resource classification training on the entity labeling model, and after the resource classification training is completed, a resource classification model that has learned resource classification characteristics is obtained, and the resource classification model is used to perform resource domain recognition on the voice instruction text based on the entity labeling characteristics and the resource classification characteristics. In the technical solution of the present disclosure, the first training sample is first used to perform entity labeling training on the pre-trained model, so that the trained entity labeling model has entity labeling characteristics and can accurately identify entity category features in sentences. Afterwards, the second training sample is used to further perform resource classification training on the entity labeling model, so that it has resource classification characteristics, so that the resource classification model finally trained can simultaneously have the ability to recognize voice instructions based on sentence features and entity features. When using the resource classification model to classify media resource instructions, comprehensive voice command analysis based on both sentence features and entity features can improve the accuracy of voice command recognition and enhance the user experience.

[0180] Based on the specific implementation of the method shown in Figures 1, 2 and 3 above, this embodiment provides a voice command recognition device, as shown in Figure 7, which includes: a recognition module 31, an input module 32, a labeling module 33, and an arbitration module 34;

[0181] The recognition module 31 is configured to recognize the instruction text corresponding to the voice instruction in response to receiving the voice instruction;

[0182] An input module 32 is configured to input the instruction text into a resource recognition model to obtain a first resource domain indicated by the voice instruction, wherein the resource recognition model is configured to determine a domain prediction result corresponding to the instruction text, and determine the domain prediction result as the first resource domain;

[0183] The tagging module 33 may be configured to perform entity word tagging on the instruction text and determine a second resource domain that corresponds to the voice instruction, wherein the entity word tagging is configured to extract entity words contained in the instruction text and determine a second resource domain that matches the resource tagging result of the entity words;

[0184] The arbitration module 34 can be used to perform resource domain arbitration on the first resource domain and the second resource domain according to a preset arbitration strategy to determine the target resource domain indicated by the voice instruction, wherein the preset arbitration strategy is used to obtain an identification result of whether the first resource domain is a specific resource domain, and to select one of the first resource domain and the second resource domain to determine the target resource domain that matches the identification result.

[0185] In a specific application scenario, the input module 32 obtains preset text features configured with resource domain labels, the resource domain labels include sentence feature labels and entity feature labels, and the preset text features include a first training sample configured with an entity feature label and a second training sample configured with a sentence feature label; the first training sample and the second training sample are used as input features, and the sentence feature labels and the entity feature labels are used as training labels, and the resource identification model is iteratively trained until the loss function of the resource identification model is less than a preset threshold, and it is determined that the resource identification model training is completed.

[0186] In a specific application scenario, the input module 32 uses the first training sample to perform entity labeling training on the pre-trained model, and after the entity labeling training is completed, an entity labeling model that has learned entity labeling characteristics is obtained; the second training sample is used to perform resource classification training on the entity labeling model, and after the resource classification training is completed, a resource identification model that has learned resource classification characteristics is obtained. The resource identification model is used to perform resource domain recognition on the voice command text based on the entity labeling characteristics and resource classification characteristics.

[0187] In a specific application scenario, the input module 32 can be used to extract text features of the instruction text; input the text features into the resource recognition model to obtain the field prediction results corresponding to the text features, and determine the field prediction results as the first resource field corresponding to the voice instruction.

[0188] In a specific application scenario, the annotation module 33 can be used to determine multiple entity words contained in the instruction text based on n-gram grammar; use a preset vocabulary to annotate the preset resource field of each entity word in the multiple entity words; and determine the preset resource field with the highest priority among the preset resource fields obtained by annotating the multiple entity words as the second resource field corresponding to the voice instruction.

[0189] In a specific application scenario, the preset vocabulary includes multiple preset resource fields, and corresponding feature words are configured for each preset resource field. The feature words include at least one of entity feature words and action feature words. The annotation module 33 can be used to calculate the feature similarity between each entity word and the feature word in multiple entity words; the preset resource field corresponding to the highest feature similarity is marked as the preset resource field of the entity word.

[0190] In a specific application scenario, the arbitration module 34 can be used to verify whether the second resource field belongs to a vertical field under the first resource field if it is determined that the first resource field is a specific resource field, and determine the target resource field indicated by the voice instruction that matches the verification result of the vertical field; if it is determined that the first resource field is not a specific resource field, the first resource field is determined as the target resource field indicated by the voice instruction.

[0191] In a specific application scenario, the arbitration module 34 can be specifically used to determine the target resource field indicated by the voice instruction that matches the verification result of the vertical field, including: in response to the verification result of the vertical field that the second resource field belongs to the vertical field under the first resource field, the second resource field is determined as the target resource field corresponding to the indication of the voice instruction; in response to the verification result of the vertical field that the second resource field does not belong to the vertical field under the first resource field, the first resource field or the second resource field configured with the highest recognition priority is determined as the target resource field corresponding to the indication of the voice instruction.

[0192] In a specific application scenario, the input module 32 obtains a preset number of entity texts; the entity texts are inserted into a preset position of a text construction template and spliced ​​with the fixed text in the text construction template to generate a first training sample; and an entity feature label that matches the entity category is configured for each character in the first training sample, and the entity feature label includes at least one of a non-entity label, an entity label, and an entity position label.

[0193] In a specific application scenario, the input module 32 inputs the first training sample into the pre-trained model and performs entity labeling training on the pre-trained model; wherein, during the entity labeling training process, the entity feature label is used as the training label, and the model parameters of the pre-trained model for entity labeling processing are updated until the accuracy of the pre-trained model for entity labeling is greater than the first preset threshold, and the entity labeling training is judged to be completed.

[0194] In a specific application scenario, the input module 32 obtains a preset number of sample instruction texts, which contain at least resource indication information; the sample instruction texts are annotated with sentence feature labels that match the resource indication information to obtain a second training sample, wherein different resource indication information corresponds to different sentence feature labels.

[0195] In a specific application scenario, the input module 32 inputs the second training sample into the entity annotation model to perform resource classification training on the entity annotation model; wherein, during the resource classification training process, the sentence feature label is used as the training label, and the model parameters of the entity annotation model for resource classification processing are updated until the accuracy of the entity annotation model for resource classification is greater than the second preset threshold, and the resource classification training is judged to be completed.

[0196] Based on the specific implementation of the resource classification model training method shown in Figures 4 and 5 above, this embodiment provides a resource classification model training device, as shown in Figure 8, the device includes: a generation module 41, a labeling module 42, and a classification module 43;

[0197] A generating module 41 may be used to generate a first training sample and a second training sample, wherein the first training sample is a training sample configured with an entity feature label, and the second training sample is a training sample configured with a sentence feature label;

[0198] The labeling module 42 can be used to perform entity labeling training on the pre-trained model using the first training sample, and obtain an entity labeling model with entity labeling characteristics after the entity labeling training is completed;

[0199] The classification module 43 can be used to use the second training sample to perform resource classification training on the entity annotation model. After the resource classification training is completed, a resource classification model with resource classification characteristics is obtained. The resource classification model is used to perform resource domain recognition on the voice instruction text based on the entity annotation characteristics and resource classification characteristics.

[0200] In a specific application scenario, the generation module 41 can be used to obtain a preset number of entity texts; insert the entity texts into a preset position of a text construction template, and splice them with the fixed text in the text construction template to generate a first training sample; configure an entity feature label that matches the entity category for each character in the first training sample, and the entity feature label includes at least one of a non-entity label, an entity label, and an entity position label.

[0201] In a specific application scenario, the labeling module 42 can be used to input the first training sample into the pre-training model and perform entity labeling training on the pre-training model; wherein, during the entity labeling training process, the entity feature label is used as the training label to update the model parameters of the pre-training model for entity labeling processing until the accuracy of the pre-training model for entity labeling is greater than the first preset threshold, and the entity labeling training is judged to be completed.

[0202] In a specific application scenario, the generation module 41 can be used to obtain a preset number of sample instruction texts, where the sample instruction texts contain at least resource indication information; the sample instruction texts are labeled with sentence feature labels that match the resource indication information to obtain a second training sample, where different resource indication information corresponds to different sentence feature labels.

[0203] In a specific application scenario, the classification module 43 can be used to input the second training sample into the entity annotation model to perform resource classification training on the entity annotation model; wherein, during the resource classification training process, the sentence feature label is used as the training label to update the model parameters of the entity annotation model for resource classification processing until the accuracy of the entity annotation model for resource classification is greater than the second preset threshold, and the resource classification training is judged to be completed.

[0204] It should be noted that for other corresponding descriptions of the functional units involved in the vehicle braking device provided in this embodiment, reference can be made to the corresponding descriptions in the methods shown in Figures 1, 2, 3, 4 and 5, and will not be repeated here.

[0205] Based on the above methods shown in Figures 1, 2, 3, 4, and 5, this embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the above methods shown in Figures 1, 2, 3, 4, and 5.

[0206] Based on this understanding, the technical solution of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present disclosure.

[0207] Based on the above-mentioned methods shown in Figures 1, 2, 3, 4 and 5, and the virtual device embodiments shown in Figures 7 and 8, in order to achieve the above-mentioned purposes, the embodiments of the present disclosure also provide an electronic device that can be configured on the vehicle (such as an electric car) side, and the device includes a storage medium and a processor; the storage medium is used to store computer programs; the processor is used to execute computer programs to implement the above-mentioned methods shown in Figures 1, 2, 3, 4 and 5.

[0208] Optionally, the physical device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a Wi-Fi module, and the like. The user interface may include a display, an input unit such as a keyboard, and the like. The optional user interface may also include a USB interface, a card reader interface, and the like. The network interface may optionally include a standard wired interface, a wireless interface (such as a Wi-Fi interface), and the like.

[0209] Those skilled in the art will understand that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different component arrangements.

[0210] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the physical device, supporting the execution of information processing programs and other software and / or programs. The network communication module is used to enable communication between components within the storage medium, as well as with other hardware and software within the physical information processing device.

[0211] Based on the above electronic device, the embodiment of the present disclosure further provides a vehicle, which may specifically include: the above electronic device. The vehicle may specifically be an electric car, etc.

[0212] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present disclosure can be implemented by means of software plus the necessary general hardware platform, or by hardware. The technical solution in the present disclosure can first respond to receiving a voice instruction and identify the instruction text corresponding to the voice instruction; input the instruction text into the resource recognition model to determine the first resource field indicated by the voice instruction; perform entity word annotation processing on the instruction text to determine the second resource field indicated by the voice instruction; perform resource field arbitration processing on the first resource field and the second resource field according to the preset arbitration strategy to determine the target resource indicated by the voice instruction. In the technical solution of the present disclosure, two methods for voice instruction recognition are provided. By performing recognition of the resource recognition model and recognition of the entity word annotation, resource field recognition results under two recognition dimensions can be obtained, which can enrich the recognition dimension of the voice instruction. And by performing resource field arbitration processing on the resource field recognition results under the two feature recognition dimensions to determine the target resource field indicated by the voice instruction, the accuracy of the recognition result can be improved, thereby creating a good voice instruction recognition experience for the user.

[0213] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article or device. In the absence of further limitations, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device that includes the element.

[0214] The foregoing are merely specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not to be limited to these embodiments, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for voice command recognition, comprising: In response to receiving a voice command, identifying a command text corresponding to the voice command; Inputting the instruction text into a resource recognition model to obtain a first resource domain indicated by the voice instruction, wherein the resource recognition model is used to determine a domain prediction result corresponding to the instruction text, and determining the domain prediction result as the first resource domain; Performing entity word annotation processing on the instruction text to determine a second resource domain indicated by the voice instruction, wherein the entity word annotation processing is used to extract entity words contained in the instruction text and determine a second resource domain that matches the resource annotation result of the entity words; The first resource field and the second resource field are subjected to resource field arbitration processing according to a preset arbitration strategy to determine a target resource field indicated by the voice instruction, wherein the preset arbitration strategy is used to obtain a recognition result of whether the first resource field is a specific resource field, and to select one of the first resource field and the second resource field to determine a target resource field that matches the recognition result.

2. According to the method of claim 1, the training process of the resource identification model comprises: Acquire a preset text feature configured with a resource domain label, wherein the resource domain label includes a sentence feature label and an entity feature label, and the preset text feature includes a first training sample configured with the entity feature label and a second training sample configured with the sentence feature label; The first training sample and the second training sample are used as input features, and the sentence feature label and the entity feature label are used as training labels, and the resource identification model is iteratively trained until the loss function of the resource identification model is less than a preset threshold, and it is determined that the resource identification model training is completed.

3. According to the method of claim 2, the first training sample and the second training sample are used as input features, and the sentence feature label and the entity feature label are used as training labels, and the resource identification model is iteratively trained until the loss function of the resource identification model is less than a preset threshold, and determining that the resource identification model training is completed includes: Performing entity labeling training on the pre-trained model using the first training sample, and obtaining an entity labeling model having learned entity labeling characteristics after the entity labeling training is completed; The entity annotation model is trained for resource classification using the second training sample. After the resource classification training is completed, a resource identification model having learned resource classification characteristics is obtained. The resource identification model is used to perform resource domain identification on the voice instruction text based on the entity annotation characteristics and the resource classification characteristics.

4. The method according to any one of claims 1 to 3, wherein inputting the instruction text into a resource recognition model to obtain the first resource field indicated by the voice instruction comprises: Extracting text features of the instruction text; The text feature is input into a resource recognition model to obtain a domain prediction result corresponding to the text feature, and the domain prediction result is determined as the first resource domain corresponding to the voice instruction.

5. According to the method of any one of claims 1 to 3, the step of performing entity word tagging on the instruction text to determine the second resource domain indicated by the voice instruction comprises: Determining a plurality of entity words contained in the instruction text based on n-grams; Using a preset vocabulary to mark the preset resource domain of each entity word in the plurality of entity words; Among the preset resource domains obtained by correspondingly marking the multiple entity words, the preset resource domain with the highest priority is determined as the second resource domain corresponding to the indication of the voice instruction.

6. The method according to claim 5, wherein the preset word list includes a plurality of preset resource fields, and a corresponding feature word is configured for each preset resource field, wherein the feature word includes at least one of an entity feature word and an action feature word; The step of using a preset vocabulary to mark the preset resource domain of each entity word in the plurality of entity words includes: Calculating the feature similarity between each entity word in the plurality of entity words and the feature word; The preset resource domain represented by the feature word corresponding to the highest feature similarity is marked as the preset resource domain of the entity word.

7. The method according to any one of claims 1 to 3, wherein the performing resource domain arbitration processing on the first resource domain and the second resource domain according to a preset arbitration strategy to determine the target resource domain indicated by the voice instruction comprises: If it is determined that the first resource field is a specific resource field, verify whether the second resource field belongs to a vertical field under the first resource field, and determine a target resource field indicated by the voice instruction that matches the verification result of the vertical field; If it is determined that the first resource domain is not a specific resource domain, the first resource domain is determined as the target resource domain indicated by the voice instruction.

8. The method according to claim 7, wherein determining the target resource domain indicated by the voice instruction that matches the verification result of the vertical domain comprises: In response to the verification result of the vertical field being that the second resource field belongs to the vertical field under the first resource field, domain, determining the second resource domain as the target resource domain indicated by the voice instruction; In response to the verification result of the vertical field being that the second resource field does not belong to the vertical field under the first resource field, the first resource field or the second resource field configured with the highest recognition priority is determined as the target resource field indicated by the voice instruction.

9. According to the method of claim 2 or 3, the step of obtaining a preset text feature configured with a resource domain tag comprises: Get a preset number of entity texts; Inserting the entity text into a preset position of a text construction template and splicing it with the fixed text in the text construction template to generate a first training sample; An entity feature label matching the entity category is configured for each character in the first training sample, wherein the entity feature label includes at least one of a non-entity label, an entity label, and an entity position label.

10. The method according to claim 3, wherein the step of performing entity labeling training on the pre-training model using the first training sample comprises: Inputting the first training sample into a pre-training model, and performing entity labeling training on the pre-training model; Among them, during the entity labeling training process, the entity feature label is used as the training label to update the model parameters of the pre-trained model for entity labeling processing until the accuracy of the pre-trained model for entity labeling is greater than a first preset threshold, and the entity labeling training is judged to be completed.

11. According to the method of claim 2 or 3, the step of obtaining a preset text feature configured with a resource domain tag comprises: Obtaining a preset number of sample instruction texts, wherein the sample instruction texts at least include resource indication information; The sample instruction text is labeled with a sentence feature label that matches the resource indication information to obtain the second training sample, wherein different resource indication information corresponds to different sentence feature labels.

12. The method according to claim 3, wherein the using the second training sample to perform resource classification training on the entity annotation model comprises: Inputting the second training sample into the entity annotation model to perform resource classification training on the entity annotation model; Among them, during the resource classification training process, the sentence feature label is used as a training label to update the model parameters of the entity annotation model for resource classification processing until the accuracy of the entity annotation model for resource classification is greater than a second preset threshold, and the resource classification training is judged to be completed.

13. A method for training a resource classification model, comprising: Generate a first training sample and a second training sample, wherein the first training sample is a training sample configured with an entity feature label, and the second training sample is a training sample configured with a sentence feature label; Performing entity labeling training on the pre-trained model using the first training sample, and obtaining an entity labeling model having learned entity labeling characteristics after the entity labeling training is completed; The entity annotation model is trained for resource classification using the second training sample. After the resource classification training is completed, a resource classification model having learned resource classification characteristics is obtained. The resource classification model is used to perform resource domain recognition on the voice instruction text based on the entity annotation characteristics and the resource classification characteristics.

14. The method according to claim 13, wherein the process of generating the first training sample comprises: Get a preset number of entity texts; Inserting the entity text into a preset position of a text construction template and splicing it with the fixed text in the text construction template to generate a first training sample; An entity feature label matching the entity category is configured for each character in the first training sample, wherein the entity feature label includes at least one of a non-entity label, an entity label, and an entity position label.

15. The method according to claim 13, wherein the using the first training sample to perform entity labeling training on the pre-training model comprises: Inputting the first training sample into a pre-training model, and performing entity labeling training on the pre-training model; Among them, during the entity labeling training process, the entity feature label is used as the training label to update the model parameters of the pre-trained model for entity labeling processing until the accuracy of the pre-trained model for entity labeling is greater than a first preset threshold, and the entity labeling training is judged to be completed.

16. The method according to claim 13, wherein the process of generating the second training sample comprises: Obtaining a preset number of sample instruction texts, wherein the sample instruction texts at least include resource indication information; The sample instruction text is labeled with a sentence feature label that matches the resource indication information to obtain the second training sample, wherein different resource indication information corresponds to different sentence feature labels.

17. The method according to claim 13, wherein the using the second training sample to perform resource classification training on the entity annotation model comprises: Inputting the second training sample into the entity annotation model to perform resource classification training on the entity annotation model; Among them, during the resource classification training process, the sentence feature label is used as a training label to update the model parameters of the entity annotation model for resource classification processing until the accuracy of the entity annotation model for resource classification is greater than a second preset threshold, and the resource classification training is judged to be completed.

18. A voice command recognition device, comprising: A recognition module, configured to recognize, in response to receiving a voice command, a command text corresponding to the voice command; An input module, used for inputting the instruction text into a resource identification model to obtain a first resource field indicated by the voice instruction, wherein the resource identification model is used to determine the predicted scores of different preset resource fields corresponding to the instruction text, and determine the preset resource field corresponding to the highest preset score as the first resource field; A tagging module, used to perform entity word tagging processing on the instruction text to determine a second resource domain indicated by the voice instruction, wherein the entity word tagging processing is used to extract entity words contained in the instruction text and determine a second resource domain that matches the resource tagging result of the entity words; An arbitration module is used to perform resource field arbitration processing on the first resource field and the second resource field according to a preset arbitration strategy, and determine the target resource field corresponding to the voice instruction, wherein the preset arbitration strategy is used to obtain an identification result of whether the first resource field is a specific resource field, and to select one of the first resource field and the second resource field to determine a target resource field that matches the identification result.

19. A training device for a resource classification model, comprising: A generating module, used to generate a first training sample and a second training sample, wherein the first training sample is a training sample configured with an entity feature label, and the second training sample is a training sample configured with a sentence feature label; A first training module is used to perform entity labeling training on the pre-trained model using the first training sample, and obtain an entity labeling model with entity labeling characteristics after the entity labeling training is completed; The second training module is used to use the second training sample to perform resource classification training on the entity annotation model, and after the resource classification training is completed, a resource classification model with resource classification characteristics is obtained. The resource classification model is used to perform resource field recognition on the voice instruction text based on the entity annotation characteristics and the resource classification characteristics.

20. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 12 or 13 to 17.

21. An electronic device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the method of any one of claims 1 to 12 or 13 to 17 when executing the computer program.

22. A vehicle comprising: The electronic device as claimed in claim 21.

Citation Information

Patent Citations

  • Resource acquisition method and device

    CN111159535A

  • Voice instruction recognition method and device, electronic equipment and storage medium

    CN113128228A

  • Voice instruction recognition method and electronic equipment

    CN113284499A

  • Voice instruction recognition method, electronic equipment and non-transient computer readable storage medium

    CN115039169A

  • Display apparatus and semantic understanding method

    CN115146652A

Cited By

  • Voice instruction recognition method and device, electronic equipment and vehicle

    CN116913279A