A method, device, equipment and system for engineering natural semantic processing

By performing text classification and naming entity recognition model processing on the text information after speech recognition, the applicability of the speech recognition solution between different models and engines is solved, and the accurate execution of voice commands is achieved.

CN115171686BActive Publication Date: 2025-08-26HUMAN HORIZONS (SHANGHAI) CLOUD COMPUTING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210765141.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-30
Publication Date
2025-08-26
Estimated Expiration
2042-06-30

AI Technical Summary

Technical Problem

Existing voice recognition solutions are usually only applicable to specific models or specific engines, and the accuracy of voice command execution results between different models or engines cannot be guaranteed.

Method used

By obtaining the text information of the voice command to be executed issued by the user after speech recognition, using the trained text classification model and named entity recognition model for processing, the first field information, intention information and slot information are obtained, and normalized mapping is carried out to generate the second field information, intention information and slot information, and finally the voice command is executed according to the context information, which is suitable for different vehicle models and engines.

Benefits of technology

It realizes the adaptability of voice commands between different models and engines, and improves the accuracy of voice command execution results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115171686B_ABST
    Figure CN115171686B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and system for engineering natural semantic processing, the method comprising: obtaining text information of a voice command to be executed issued by a user after voice recognition; processing the text information according to a trained text classification model and a trained named entity recognition model to obtain first domain information, first intent information and first slot information of the voice command to be executed; performing normalized mapping processing on the first domain information, first intent information and first slot information to obtain second domain information, second intent information and second slot information; executing the voice command to be executed according to the second domain information, second intent information and second slot information and utilizing the context information of the voice command to be executed to obtain the command execution result. The technical solution of the present invention can be applied to different vehicle models and different engines, improves the adaptability of the solution and ensures the accuracy of the voice command execution result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of speech technology, and in particular to a method, device, terminal equipment and system for engineering natural semantic processing. Background Art

[0002] With the rapid development of automotive technology, the human-computer interaction method between users and cars based on natural voice communication has also been continuously developed. This human-computer voice interaction method allows users to easily complete various controls and operations without manual operation, thereby improving driving safety and driving pleasure.

[0003] Voice recognition of user commands to the car's voice assistant or AI assistant is a crucial step in human-machine voice interaction, as the results determine whether these commands are accurately executed. However, existing voice recognition solutions are generally only applicable to specific vehicle models or engines. When applied to other vehicle models or engines, the accuracy of voice command execution may not be guaranteed. Summary of the Invention

[0004] The purpose of the embodiments of the present invention is to provide a method, device, terminal device and system for engineering natural semantic processing, which can be applied to different vehicle models and different engines, improve the adaptability of the solution, and ensure the accuracy of the results of voice command execution.

[0005] To achieve the above objectives, an embodiment of the present invention provides a method for engineering natural semantic processing, including:

[0006] Obtain the text information of the voice command to be executed issued by the user after voice recognition;

[0007] Processing the text information according to the trained text classification model and the trained named entity recognition model to obtain first domain information, first intent information, and first slot information corresponding to the voice command to be executed;

[0008] Performing normalized mapping processing on the first domain information, the first intent information, and the first slot information to correspondingly obtain second domain information, second intent information, and second slot information;

[0009] According to the second domain information, the second intent information and the second slot information, and using the context information corresponding to the voice instruction to be executed, the voice instruction to be executed is executed to obtain an instruction execution result.

[0010] Furthermore, the method obtains the trained text classification model and the trained named entity recognition model by the following steps:

[0011] Generate text classification corpus, named entity recognition corpus, word vector files, target vector files and stop word files;

[0012] Training a preset text classification model according to the text classification corpus, the word vector file, and the stop word file to obtain the trained text classification model;

[0013] A preset named entity recognition model is trained according to the named entity recognition corpus, the target vector file and the stop word file to obtain a trained named entity recognition model.

[0014] Furthermore, the method generates the text classification corpus and the named entity recognition corpus through the following steps:

[0015] Based on JSGF rules, add Rule references, Grammar references and several basic rules to form HGF rules;

[0016] The HGF grammatical expression based on the HGF rule is parsed to obtain the text classification corpus and the named entity recognition corpus; wherein the text classification corpus includes at least one instruction corresponding to at least one HGF grammatical expression, and the named entity recognition corpus includes at least one instruction corresponding to at least one HGF grammatical expression.

[0017] Furthermore, the method further comprises:

[0018] For each HGF syntax expression, when the number of instructions corresponding to the same HGF syntax expression exceeds the preset threshold, the instructions corresponding to the same HGF syntax expression are added to the training set, test set, and development set of the model training in a ratio of 8:1:1;

[0019] For each HGF grammar expression, when the number of instructions corresponding to the same HGF grammar expression is not greater than a preset number threshold, all instructions corresponding to the same HGF grammar expression are added to the training set of the model training.

[0020] Furthermore, the training of a preset text classification model based on the text classification corpus, the word vector file, and the stop word file to obtain the trained text classification model specifically includes:

[0021] Dividing the text classification corpus, the word vector file, and the stop word file into a training set, a development set, and a test set;

[0022] Training the preset text classification model according to the training set, the development set, and the test set to obtain a first text classification model;

[0023] Obtaining the model file generated during the training process, and performing model prediction based on the model file to obtain a prediction result;

[0024] When there is an abnormal prediction result in the prediction results, the abnormal prediction result is added to the training set to obtain an added training set;

[0025] The first text classification model is trained and iterated according to the added training set, the development set, and the test set to obtain the trained text classification model.

[0026] Furthermore, each corpus includes at least one fixed-format instruction obtained by mapping based on a preset vector mapping rule; wherein the corpus includes the training set, the development set and the test set; each fixed-format instruction consists of a target part and a content part, the target part contains the domain information, intent information and confidence of the user voice instruction, and the content part contains the instruction information of the user voice instruction.

[0027] Furthermore, the method further comprises:

[0028] Manage different versions of different models based on milestones;

[0029] When a new model version is built in a milestone, the domain and intent corresponding to the new model version are set;

[0030] When the user voice instruction contains version information, the model corresponding to the version information is searched, and the user voice instruction is predicted based on the found model to obtain an instruction prediction result.

[0031] To achieve the above objectives, an embodiment of the present invention further provides a device for engineering natural semantic processing, which is used to implement any of the above methods for engineering natural semantic processing, and the device includes:

[0032] A text information acquisition module is used to obtain the text information of the voice command to be executed issued by the user after voice recognition;

[0033] a text semantic understanding module, configured to process the text information according to the trained text classification model and the trained named entity recognition model to obtain first domain information, first intent information, and first slot information corresponding to the voice command to be executed;

[0034] a normalization processing module, configured to perform normalization mapping processing on the first domain information, the first intent information, and the first slot information to correspondingly obtain second domain information, second intent information, and second slot information;

[0035] A voice instruction execution module is used to execute the voice instruction to be executed according to the second domain information, the second intent information and the second slot information, and to obtain an instruction execution result by utilizing the context information corresponding to the voice instruction to be executed.

[0036] An embodiment of the present invention also provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements any of the above-mentioned methods for engineering natural semantic processing when executing the computer program.

[0037] The embodiment of the present invention further provides a system for engineering natural semantic processing, the system comprising a vehicle side and a cloud side; wherein,

[0038] The vehicle side is used to receive a voice command to be executed issued by a user, perform voice recognition on the voice command to be executed, obtain text information, and upload the text information to the cloud;

[0039] The cloud is configured to implement any of the above-mentioned engineering methods for natural semantic processing according to the text information, obtain a command execution result, and send the command execution result to the vehicle end;

[0040] The vehicle end is further used to form voice information according to the execution result of the instruction and broadcast the voice information.

[0041] Compared with the prior art, the embodiments of the present invention provide a method, apparatus, terminal device and system for engineering natural semantic processing, which obtains the text information of the voice command to be executed issued by the user after voice recognition, and processes the text information according to the trained text classification model and the trained named entity recognition model to obtain the first field information, first intention information and first slot information corresponding to the voice command to be executed, and performs normalization mapping processing on the first field information, the first intention information and the first slot information to obtain the second field information, the second intention information and the second slot information accordingly, and executes the voice command to be executed according to the second field information, the second intention information and the second slot information, and utilizes the context information corresponding to the voice command to be executed to obtain the command execution result, so that it can be applicable to the natural semantic processing of different models and different engines, improve the adaptability of the solution, and ensure the accuracy of the voice command execution result. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 This is a flow chart of a preferred embodiment of a method for engineering natural semantic processing provided by the present invention;

[0043] Figure 2 This is an example diagram of generating text classification corpus and named entity recognition corpus provided by an embodiment of the present invention;

[0044] Figure 3 This is an example diagram of a corpus segmentation provided by an embodiment of the present invention;

[0045] Figure 4 This is an example diagram of vector mapping of corpus provided by an embodiment of the present invention;

[0046] Figure 5 This is a structural block diagram of a preferred embodiment of an engineering device for implementing natural semantic processing provided by the present invention;

[0047] Figure 6 This is a structural block diagram of a preferred embodiment of a terminal device provided by the present invention;

[0048] Figure 7 This is a structural block diagram of a preferred embodiment of a system for engineering natural semantic processing provided by the present invention. DETAILED DESCRIPTION

[0049] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this technical field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0050] The embodiment of the present invention provides a method for engineering natural semantic processing, see Figure 1 FIG. 1 is a flow chart of a preferred embodiment of a method for engineering natural semantic processing provided by the present invention, wherein the method includes steps S11 to S14:

[0051] Step S11: obtaining text information of the voice command to be executed issued by the user after voice recognition;

[0052] Step S12: Processing the text information according to the trained text classification model and the trained named entity recognition model to obtain first domain information, first intent information, and first slot information corresponding to the voice command to be executed;

[0053] Step S13: performing normalization mapping processing on the first domain information, the first intent information, and the first slot information to obtain second domain information, second intent information, and second slot information accordingly;

[0054] Step S14: Execute the voice instruction to be executed based on the second domain information, the second intent information, and the second slot information, and use the context information corresponding to the voice instruction to be executed to obtain an instruction execution result.

[0055] After the user issues a voice instruction to be executed, the voice instruction to be executed can be recognized as specific text information by performing voice recognition processing on the voice instruction to be executed. Therefore, when the embodiment of the present invention is implemented, first, the text information corresponding to the voice instruction to be executed issued by the user is obtained, so that the text information can be directly processed later; then, the obtained text information is used as a model input for semantic recognition, and accordingly, the obtained text information can be recognized and processed according to the trained text classification model to obtain the first domain information and the first intention information corresponding to the voice instruction to be executed, and the obtained text information can be extracted according to the trained named entity recognition model to obtain the voice instruction to be executed. The first slot information corresponding to the instruction; then, the first field information, first intention information and first slot information corresponding to the obtained voice instruction to be executed are normalized and mapped, and the second field information, second intention information and second slot information are correspondingly obtained, so as to map the first field information, first intention information and first slot information into uniformly defined second field information, second intention information and second slot information through normalized Mapping script processing, so as to achieve the purpose of adapting to multiple models and multiple engines; finally, according to the second field information, second intention information and second slot information obtained by mapping, and using the voice instruction to be executed and its corresponding context information, the voice instruction to be executed is executed, and the corresponding instruction execution result is obtained.

[0056] It should be noted that the semantic recognition results generally include information such as domain, intent and slot. By performing semantic recognition on user voice commands, the user intention can be accurately analyzed based on information such as domain, intent and slot, so as to better control the execution of user voice commands. By using text classification models and named entity recognition models to achieve semantic recognition, the prediction response can be faster and slot extraction can be optimized.

[0057] An embodiment of the present invention provides an engineering method for implementing natural semantic processing, which obtains text information of a voice command to be executed issued by a user after voice recognition, and processes the text information according to a trained text classification model and a trained named entity recognition model to obtain first domain information, first intent information and first slot information corresponding to the voice command to be executed, performs normalization mapping processing on the first domain information, first intent information and first slot information to obtain second domain information, second intent information and second slot information accordingly, and executes the voice command to be executed according to the second domain information, second intent information and second slot information and utilizes the context information corresponding to the voice command to be executed to obtain the command execution result, thereby being applicable to natural semantic processing of different vehicle models and different engines, improving the adaptability of the solution and ensuring the accuracy of the voice command execution result.

[0058] In another preferred embodiment, the method obtains the trained text classification model and the trained named entity recognition model by the following steps:

[0059] Generate text classification corpus, named entity recognition corpus, word vector files, target vector files and stop word files;

[0060] Training a preset text classification model according to the text classification corpus, the word vector file, and the stop word file to obtain the trained text classification model;

[0061] A preset named entity recognition model is trained according to the named entity recognition corpus, the target vector file and the stop word file to obtain a trained named entity recognition model.

[0062] Specifically, in combination with the above embodiments, when semantic recognition processing is performed on the obtained text information according to the text classification model and the named entity recognition model, the model used is a pre-trained model, and when obtaining the trained text classification model and the trained named entity recognition model, text classification corpus, named entity recognition corpus (i.e., NER corpus), word vector file, target vector file and stop word file are first generated; then, based on the generated text classification corpus, word vector file and stop word file, the preset text classification model (i.e., untrained text classification model) is trained to obtain the trained text classification model accordingly; and, based on the generated named entity recognition corpus, target vector file and stop word file, the preset named entity recognition model (i.e., untrained named entity recognition model) is trained to obtain the trained named entity recognition model accordingly.

[0063] It should be noted that the word vector file and the target vector file can be generated using a vector file generator. The pre-prepared word vector and target vector are input into the vector file generator, and the vector file generator can generate the corresponding word vector file and target vector file; the stop word file can be generated using a stop word file generator. The pre-prepared stop words are input into the stop word file generator, and the stop word file generator can generate the corresponding stop word file.

[0064] As an improvement to the above solution, the method generates the text classification corpus and the named entity recognition corpus through the following steps:

[0065] Based on JSGF rules, add Rule references, Grammar references and several basic rules to form HGF rules;

[0066] The HGF grammatical expression based on the HGF rule is parsed to obtain the text classification corpus and the named entity recognition corpus; wherein the text classification corpus includes at least one instruction corresponding to at least one HGF grammatical expression, and the named entity recognition corpus includes at least one instruction corresponding to at least one HGF grammatical expression.

[0067] Specifically, in combination with the above embodiments, when obtaining text classification corpus and named entity recognition corpus, we can first optimize and expand on the basis of JSGF (Java Speech Grammar Format) rules, add customized Rule references, recursive Grammar references and several basic rules (for example, [] optional, () required, {@} annotation and other basic rules), and form HGF (Hierarchical Grammar Format) grammar rules accordingly; then, based on the HGF grammar rules, prepare HGF grammar expressions corresponding to each field, and obtain text classification corpus and named entity recognition corpus by performing grammatical parsing on the HGF grammar expressions; wherein, each intent under each field contains at least one HGF grammar expression, the obtained text classification corpus includes at least one instruction corresponding to at least one HGF grammar expression, and the obtained named entity recognition corpus includes at least one instruction corresponding to at least one HGF grammar expression.

[0068] It should be noted that the text classification corpus and named entity recognition corpus can be generated using the HGF syntax parser. By inputting the pre-prepared HGF syntax expression into the HGF syntax parser, the HGF syntax parser can generate the text classification corpus and named entity recognition corpus accordingly. Among them, after the HGF syntax expression passes through the HGF syntax parser, all the instructions corresponding to the HGF syntax expression will be fully enumerated, and after generating the corpus file and binding the HGF syntax expression, it will be stored in the file system.

[0069] In addition, the reverse corpus query engine can be used to query the HGF grammatical expression corresponding to any instruction to locate the field, intent, and milestone information corresponding to the instruction, which can be used to troubleshoot problems with the corpus during model training.

[0070] For example, see Figure 2 , which is an example diagram of generating text classification corpus and named entity recognition corpus provided by an embodiment of the present invention. Figure 2 The left side shows an HGF syntax expression. After being parsed by the HGF syntax parser, all instructions (all combinations) corresponding to the HGF syntax expression are enumerated, and the corresponding generated Figure 2 The text classification corpus and NER corpus corresponding to the HGF grammar expression shown on the right.

[0071] The embodiment of the present invention provides an engineering method for natural semantic processing, which generates text classification corpus and named entity recognition corpus in batches based on HGF rules, can automatically generate corpus and better train the generalization ability of the model.

[0072] As an improvement to the above solution, the method further includes:

[0073] For each HGF syntax expression, when the number of instructions corresponding to the same HGF syntax expression exceeds the preset threshold, the instructions corresponding to the same HGF syntax expression are added to the training set, test set, and development set of the model training in a ratio of 8:1:1;

[0074] For each HGF grammar expression, when the number of instructions corresponding to the same HGF grammar expression is not greater than a preset number threshold, all instructions corresponding to the same HGF grammar expression are added to the training set of the model training.

[0075] Specifically, in combination with the above embodiments, when each HGF grammatical expression generates a corpus through grammatical parsing, the number of instructions corresponding to the same HGF grammatical expression is at least one, and when using the generated corpus for model training, it is necessary to provide a training set, a test set and a development set for model training. The ratio of the number of corpora in these three corpora is generally 8:1:1. Therefore, for each HGF grammatical expression, if the number of instructions corresponding to the same HGF grammatical expression is greater than the preset number threshold, the instructions corresponding to the same HGF grammatical expression are added to the training set, test set and development set of the model training in a ratio of 8:1:1; if the number of instructions corresponding to the same HGF grammatical expression is not greater than the preset number threshold, all the instructions corresponding to the same HGF grammatical expression are added to the training set of the model training.

[0076] For example, see Figure 3 As shown in FIG. 1 , an example diagram of corpus segmentation provided by an embodiment of the present invention is shown. Assuming that the number of instructions corresponding to HGF expression A is sufficient, specifically including instruction n+1, instruction n+2, instruction n+3, instruction n+4, instruction n+5, instruction n+6, instruction n+7, instruction n+8, instruction n+9 and instruction n+10, the corpus segmentation is performed in a ratio of 8:1:1, and instruction n+1, instruction n+2, instruction n+3, instruction n+4, instruction n+5, instruction n+6, instruction n+7 and instruction n+8 are added to the training set accordingly. In the training set, instruction n+9 is added to the test set, and instruction n+10 is added to the development set. Assuming that the number of instructions corresponding to HGF expression B is small, including instruction n+1, instruction n+2, instruction n+3, instruction n+4, instruction n+5, instruction n+6, instruction n+7, instruction n+8 and instruction n+9, then instruction n+1, instruction n+2, instruction n+3, instruction n+4, instruction n+5, instruction n+6, instruction n+7, instruction n+8 and instruction n+9 are directly added to the training set first.

[0077] In another preferred embodiment, the training of a preset text classification model based on the text classification corpus, the word vector file, and the stop word file to obtain the trained text classification model specifically includes:

[0078] Dividing the text classification corpus, the word vector file, and the stop word file into a training set, a development set, and a test set;

[0079] Training the preset text classification model according to the training set, the development set, and the test set to obtain a first text classification model;

[0080] Obtaining the model file generated during the training process, and performing model prediction based on the model file to obtain a prediction result;

[0081] When there is an abnormal prediction result in the prediction results, the abnormal prediction result is added to the training set to obtain an added training set;

[0082] The first text classification model is trained and iterated according to the added training set, the development set, and the test set to obtain the trained text classification model.

[0083] Specifically, in combination with the above embodiments, when training a preset text classification model (i.e., an untrained text classification model) based on the generated text classification corpus, word vector file, and stop word file, the generated text classification corpus, word vector file, and stop word file can be first divided into a training set, a development set, and a test set, and the preset text classification model is trained based on the training set, the development set, and the test set to obtain a first text classification model accordingly; then, the model file generated during the model training process is obtained, and the model file is loaded to perform model prediction based on the model file to obtain a prediction result accordingly. When there is an abnormal prediction result in the obtained prediction result (for example, an incorrectly recognized voice instruction), the abnormal prediction result is added to the training set as a training corpus to obtain a corresponding added training set, and the obtained first text classification model is trained and iterated again based on the added training set, development set, and test set to obtain a trained text classification model accordingly.

[0084] It can be understood that when the preset named entity recognition model (i.e., the untrained named entity recognition model) is trained based on the generated named entity recognition corpus, target vector file, and stop word file, and the trained named entity recognition model is obtained accordingly, the specific training process is the same as the training process principle of the text classification model, and will not be repeated here.

[0085] An embodiment of the present invention provides an engineering method for natural semantic processing, which automatically incorporates the quality of recognized errors into model training and iteration by providing exception handling logic, thereby optimizing the model and improving the accuracy of model prediction.

[0086] As an improvement to the above scheme, each corpus includes at least one fixed-format instruction obtained by mapping based on a preset vector mapping rule; wherein, the corpus includes the training set, the development set and the test set; each fixed-format instruction consists of a target part and a content part, the target part contains domain information, intent information and confidence of the user voice instruction, and the content part contains instruction information of the user voice instruction.

[0087] Specifically, in combination with the above embodiments, when the generated corpus (i.e., training set, development set, and test set) is used to train the text classification model, each corpus (i.e., each instruction) in each corpus is a fixed-format instruction obtained by mapping based on a preset vector mapping rule. That is to say, each corpus contains multiple fixed-format instructions, and the fixed-format instructions are separated by the Enter key.

[0088] Each fixed-format instruction consists of two parts: the target part and the content part, and the target Target and the content Contents are separated by a space. The target Target contains the domain information, intent information and confidence of the user's voice instruction, and the content Contents contains the instruction information of the user's voice instruction.

[0089] It should be noted that the length of the target Target is 13 bytes, which consists of a 6-byte domain code, a 6-byte intent code and a 1-byte confidence flag. For the confidence flag, when the corpus to which the fixed-format instruction belongs is a training set or a test set, since the instructions in the training set and the test set are manually confirmed domains and intents, the confidence flag of the fixed-format instruction can be set to 1, indicating that it is credible. When the corpus to which the fixed-format instruction belongs is a prediction set, the confidence flag of the fixed-format instruction defaults to 0, indicating that it is untrustworthy, and the corresponding result credibility is returned after model prediction. If the credibility reaches a certain credibility threshold, the confidence flag of the fixed-format instruction is modified to 1.

[0090] For example, see Figure 4 As shown in FIG. 1 , an example diagram of vector mapping of corpus provided by an embodiment of the present invention is shown. The length of the target Target is 13 bytes, including a 6-byte domain (e.g., 000001: multimedia domain), a 6-byte intent Intent (e.g., 000001: play singer's songs), and a 1-byte confidence level (1: trusted, 0: untrusted). The length of the content Contents is not fixed and can be set according to the actual content of the user's voice command. Then, an example of a fixed-format instruction obtained through vector mapping can be:

[0091] 0000010000010 Play Zhou Moumou's songs

[0092] 0000010000020 Play Zhou Moumou's album

[0093] An embodiment of the present invention provides an engineered method for natural semantic processing, which facilitates model training and analysis of model prediction results during the model training process by performing customized vector mapping on the corpus in the corpus set.

[0094] In another preferred embodiment, the method further comprises:

[0095] Manage different versions of different models based on milestones;

[0096] When a new model version is built in a milestone, the domain and intent corresponding to the new model version are set;

[0097] When the user voice instruction contains version information, the model corresponding to the version information is searched, and the user voice instruction is predicted based on the found model to obtain an instruction prediction result.

[0098] Specifically, in combination with the above embodiments, the embodiments of the present invention also use milestones to manage different versions of different models, and each model has a corresponding domain and intention (for example, domain: vehicle-air domain, intention: open the door, open the window,...; domain: multimedia domain, intention: play the song name, play the singer name,...); when constructing a new model version in a milestone, the domain and intention corresponding to the new model version can be specified. Accordingly, when training the new model version, all HGF grammatical expressions under the domain and intention corresponding to the new model version can be obtained first, and corpora such as training sets and test sets can be generated based on these HGF grammatical expressions, and then the new model version can be trained based on the corpus; when predicting user voice commands based on the model, if the user voice commands contain version information, the corresponding model can be searched based on the version information. After finding the model corresponding to the version information, the model is loaded to predict the user voice commands based on the model, and the corresponding command prediction results are obtained and output.

[0099] An embodiment of the present invention provides an engineering method for natural semantic processing, which can achieve rapid iteration and rapid model verification based on a milestone management multi-version model.

[0100] The embodiment of the present invention further provides a device for engineering natural semantic processing, which is used to implement the method for engineering natural semantic processing described in any of the above embodiments, see Figure 5 FIG. 1 is a block diagram of a preferred embodiment of an apparatus for engineering natural semantic processing provided by the present invention, wherein the apparatus comprises:

[0101] The text information acquisition module 11 is used to obtain the text information of the voice command to be executed issued by the user after voice recognition;

[0102] a text semantic understanding module 12, configured to process the text information according to the trained text classification model and the trained named entity recognition model to obtain first domain information, first intent information, and first slot information corresponding to the voice instruction to be executed;

[0103] a normalization processing module 13, configured to perform normalization mapping processing on the first domain information, the first intent information, and the first slot information to correspondingly obtain second domain information, second intent information, and second slot information;

[0104] The voice instruction execution module 14 is used to execute the voice instruction to be executed according to the second domain information, the second intent information and the second slot information, and to obtain the instruction execution result by utilizing the context information corresponding to the voice instruction to be executed.

[0105] Preferably, the device further comprises a model acquisition module, configured to obtain the trained text classification model and the trained named entity recognition model through the following steps:

[0106] Generate text classification corpus, named entity recognition corpus, word vector files, target vector files and stop word files;

[0107] Training a preset text classification model according to the text classification corpus, the word vector file, and the stop word file to obtain the trained text classification model;

[0108] A preset named entity recognition model is trained according to the named entity recognition corpus, the target vector file and the stop word file to obtain a trained named entity recognition model.

[0109] Preferably, the model acquisition module is used to generate the text classification corpus and the named entity recognition corpus through the following steps:

[0110] Based on JSGF rules, add Rule references, Grammar references and several basic rules to form HGF rules;

[0111] The HGF grammatical expression based on the HGF rule is parsed to obtain the text classification corpus and the named entity recognition corpus; wherein the text classification corpus includes at least one instruction corresponding to at least one HGF grammatical expression, and the named entity recognition corpus includes at least one instruction corresponding to at least one HGF grammatical expression.

[0112] Preferably, the device further includes a corpus segmentation module, configured to:

[0113] For each HGF syntax expression, when the number of instructions corresponding to the same HGF syntax expression exceeds the preset threshold, the instructions corresponding to the same HGF syntax expression are added to the training set, test set, and development set of the model training in a ratio of 8:1:1;

[0114] For each HGF grammar expression, when the number of instructions corresponding to the same HGF grammar expression is not greater than a preset number threshold, all instructions corresponding to the same HGF grammar expression are added to the training set of the model training.

[0115] Preferably, the model acquisition module trains a preset text classification model according to the text classification corpus, the word vector file, and the stop word file to obtain the trained text classification model, specifically including:

[0116] Dividing the text classification corpus, the word vector file, and the stop word file into a training set, a development set, and a test set;

[0117] Training the preset text classification model according to the training set, the development set, and the test set to obtain a first text classification model;

[0118] Obtaining the model file generated during the training process, and performing model prediction based on the model file to obtain a prediction result;

[0119] When there is an abnormal prediction result in the prediction results, the abnormal prediction result is added to the training set to obtain an added training set;

[0120] The first text classification model is trained and iterated according to the added training set, the development set, and the test set to obtain the trained text classification model.

[0121] Preferably, each corpus includes at least one fixed-format instruction obtained by mapping based on a preset vector mapping rule; wherein the corpus includes the training set, the development set and the test set; each fixed-format instruction consists of a target part and a content part, the target part contains the domain information, intent information and confidence of the user voice instruction, and the content part contains the instruction information of the user voice instruction.

[0122] Preferably, the device further comprises a milestone management module, configured to:

[0123] Manage different versions of different models based on milestones;

[0124] When a new model version is built in a milestone, the domain and intent corresponding to the new model version are set;

[0125] When the user voice instruction contains version information, the model corresponding to the version information is searched, and the user voice instruction is predicted based on the found model to obtain an instruction prediction result.

[0126] It should be noted that the device for engineering natural semantic processing provided by an embodiment of the present invention can implement all the processes of the method for engineering natural semantic processing described in any of the above embodiments. The functions of each module in the device and the technical effects achieved are respectively the same as the functions and technical effects achieved by the method for engineering natural semantic processing described in the above embodiments, and will not be repeated here.

[0127] The embodiment of the present invention also provides a terminal device, see Figure 6 As shown, it is a structural block diagram of a preferred embodiment of a terminal device provided by the present invention, wherein the terminal device includes a processor 10, a memory 20, and a computer program stored in the memory 20 and configured to be executed by the processor 10, and the processor 10 implements the method of engineering natural semantic processing described in any of the above embodiments when executing the computer program.

[0128] Preferably, the computer program can be divided into one or more modules / units (e.g., computer program 1, computer program 2, ...), which are stored in the memory 20 and executed by the processor 10 to implement the present invention. The one or more modules / units can be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.

[0129] The processor 10 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor, or the processor 10 can be any conventional processor. The processor 10 is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the terminal device.

[0130] The memory 20 mainly includes a program storage area and a data storage area. The program storage area can store an operating system, at least one application required for a function, and the data storage area can store related data. In addition, the memory 20 can be a high-speed random access memory or a non-volatile memory, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, and a flash card. Alternatively, the memory 20 can be other volatile solid-state memory devices.

[0131] It should be noted that the above terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that Figure 6 The structural block diagram is merely an example of the terminal device and does not limit the terminal device. The terminal device may include more or fewer components than shown in the figure, or a combination of certain components, or different components.

[0132] The embodiment of the present invention also provides a system for engineering natural semantic processing, see Figure 7 , which is a structural block diagram of a preferred embodiment of a system for engineering natural semantic processing provided by the present invention, wherein the system includes a vehicle side and a cloud side; wherein,

[0133] The vehicle side is used to receive a voice command to be executed issued by a user, perform voice recognition on the voice command to be executed, obtain text information, and upload the text information to the cloud;

[0134] The cloud is configured to implement the method for engineering natural semantic processing described in any of the above embodiments according to the text information, obtain a command execution result, and send the command execution result to the vehicle end;

[0135] The vehicle end is further used to form voice information according to the execution result of the instruction and broadcast the voice information.

[0136] Specifically, the vehicle side is used to receive the voice commands to be executed issued by the user, and after receiving the voice commands to be executed, perform voice recognition processing on the voice commands to be executed, and correspondingly obtain the text information corresponding to the voice commands to be executed, and upload the text information corresponding to the voice commands to be executed to the cloud; the cloud side is used to receive the text information corresponding to the voice commands to be executed uploaded by the vehicle side, and after obtaining the text information corresponding to the voice commands to be executed, first perform recognition processing on the obtained text information according to the trained text classification model, and correspondingly obtain the first domain information and first intent information corresponding to the voice commands to be executed, and, perform name entity extraction on the obtained text information according to the trained named entity recognition model. The first slot information corresponding to the voice instruction to be executed is obtained, and the first field information, first intention information and first slot information corresponding to the obtained voice instruction to be executed are normalized and mapped to obtain the second field information, second intention information and second slot information respectively. Then, according to the second field information, second intention information and second slot information obtained by mapping, the voice instruction to be executed is executed in combination with the voice instruction to be executed and its corresponding context information, and the instruction execution result is obtained accordingly, and the instruction execution result is sent to the vehicle end; the vehicle end is used to receive the instruction execution result sent by the cloud, and after receiving the instruction execution result, it forms a voice message according to the instruction execution result and broadcasts the voice message.

[0137] It should be noted that after the vehicle receives the voice command to be executed issued by the user, it can perform voice recognition processing on the voice command to be executed through the ASR (Automatic Speech Recognition) module, and obtain the text information corresponding to the voice command to be executed, and upload the text information corresponding to the voice command to be executed to the cloud through the voice multi-engine gateway module on the cloud; the cloud routes the text information to the designated NLU (Natural Language Understanding) module for semantic recognition based on information such as vehicle model and version information, and obtains the first field information, first intent information and first slot information corresponding to the voice command to be executed. After that, the first field information, first intent information and first slot information are normalized and mapped through the normalization Mapping module, and the mapped second field information, second intent information and second slot information enter the DM (Dialog The DM module contains the context information of the user conversation. The voice command to be executed is executed according to the voice command to be executed and the context information, and the corresponding command execution result is obtained. The cloud sends the command execution result to the vehicle through the voice multi-engine gateway module; after receiving the command execution result sent by the cloud, the vehicle converts the command execution result into voice information through the TTS (Text To Speech) module and broadcasts it.

[0138] In summary, the embodiments of the present invention provide a method, apparatus, terminal device and system for engineering natural semantic processing, which obtains the text information of the voice command to be executed issued by the user after voice recognition, and processes the text information according to the trained text classification model and the trained named entity recognition model to obtain the first field information, first intention information and first slot information corresponding to the voice command to be executed, and performs normalization mapping processing on the first field information, first intention information and first slot information to obtain the second field information, second intention information and second slot information accordingly, and executes the voice command to be executed according to the second field information, second intention information and second slot information, and utilizes the context information corresponding to the voice command to be executed to obtain the command execution result, so that it can be applicable to natural semantic processing of different models and different engines, improve the adaptability of the solution, and ensure the accuracy of the voice command execution result.

[0139] In addition, the embodiment of the present invention takes an engineering approach and batch generates text classification corpus and named entity recognition corpus based on HGF rules, which can automatically generate corpus and better train the generalization ability of the model; by providing exception handling logic, the quality of recognition errors is automatically entered into model training and iterated, thereby optimizing the model and improving the accuracy of model prediction; by performing customized vector mapping on the corpus in the corpus set, it is possible to facilitate model training and analyze the model prediction results during the model training process; by managing multiple versions of models based on milestones, rapid iteration and rapid verification of the model can be achieved; thereby, complex model algorithms are optimized and solved with an engineering approach, and ultimately a holistic engineered natural semantic recognition solution from semantic rules to instruction prediction is provided.

[0140] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for engineering natural semantic processing, characterized in that: include: Obtain the text information of the voice command to be executed issued by the user after voice recognition; Processing the text information according to the trained text classification model and the trained named entity recognition model to obtain first domain information, first intent information, and first slot information corresponding to the voice command to be executed; Performing normalized mapping processing on the first domain information, the first intent information, and the first slot information to correspondingly obtain second domain information, second intent information, and second slot information; According to the second domain information, the second intent information and the second slot information, and using the context information corresponding to the voice instruction to be executed, the voice instruction to be executed is executed to obtain an instruction execution result.

2. The method for engineering natural semantic processing according to claim 1, characterized in that: The method obtains the trained text classification model and the trained named entity recognition model by the following steps: Generate text classification corpus, named entity recognition corpus, word vector files, target vector files and stop word files; Training a preset text classification model according to the text classification corpus, the word vector file, and the stop word file to obtain the trained text classification model; A preset named entity recognition model is trained according to the named entity recognition corpus, the target vector file and the stop word file to obtain a trained named entity recognition model.

3. The method for engineering natural semantic processing according to claim 2, characterized in that: The method generates the text classification corpus and the named entity recognition corpus by the following steps: Based on JSGF rules, Rule references, Grammar references and several basic rules are added to form HGF rules; the basic rules include but are not limited to the following rule types: optional rules ([]); mandatory rules (()) and annotation rules ({@}); the HGF grammatical expressions based on HGF rules are parsed to obtain the text classification corpus and the named entity recognition corpus; wherein, the text classification corpus includes at least one instruction corresponding to at least one HGF grammatical expression, and the named entity recognition corpus includes at least one instruction corresponding to at least one HGF grammatical expression.

4. The method for engineering natural semantic processing according to claim 3, characterized in that: The method further comprises: For each HGF syntax expression, when the number of instructions corresponding to the same HGF syntax expression exceeds the preset threshold, the instructions corresponding to the same HGF syntax expression are added to the training set, test set, and development set of the model training in a ratio of 8:1:1; For each HGF grammar expression, when the number of instructions corresponding to the same HGF grammar expression is not greater than a preset number threshold, all instructions corresponding to the same HGF grammar expression are added to the training set of the model training.

5. The method for engineering natural semantic processing according to claim 2, wherein: The step of training a preset text classification model according to the text classification corpus, the word vector file, and the stop word file to obtain the trained text classification model specifically includes: Dividing the text classification corpus, the word vector file, and the stop word file into a training set, a development set, and a test set; Training the preset text classification model according to the training set, the development set, and the test set to obtain a first text classification model; Obtaining the model file generated during the training process, and performing model prediction based on the model file to obtain a prediction result; When there is an abnormal prediction result in the prediction results, the abnormal prediction result is added to the training set to obtain an added training set; The first text classification model is trained and iterated according to the added training set, the development set, and the test set to obtain the trained text classification model.

6. The method for engineering natural semantic processing according to claim 5, characterized in that: Each corpus includes at least one fixed-format instruction obtained by mapping based on a preset vector mapping rule; wherein the corpus includes the training set, the development set and the test set; each fixed-format instruction consists of a target part and a content part, the target part contains the domain information, intent information and confidence of the user voice instruction, and the content part contains the instruction information of the user voice instruction.

7. The method for engineering natural semantic processing according to any one of claims 1 to 6, characterized in that: The method further comprises: Manage different versions of different models based on milestones; When a new model version is built in a milestone, the domain and intent corresponding to the new model version are set; When the user voice instruction contains version information, the model corresponding to the version information is searched, and the user voice instruction is predicted based on the found model to obtain an instruction prediction result.

8. A device for engineering natural semantic processing, characterized in that: The method for implementing the engineering implementation of natural semantic processing according to any one of claims 1 to 7, the device comprising: A text information acquisition module is used to obtain the text information of the voice command to be executed issued by the user after voice recognition; a text semantic understanding module, configured to process the text information according to the trained text classification model and the trained named entity recognition model to obtain first domain information, first intent information, and first slot information corresponding to the voice command to be executed; a normalization processing module, configured to perform normalization mapping processing on the first domain information, the first intent information, and the first slot information to correspondingly obtain second domain information, second intent information, and second slot information; A voice instruction execution module is used to execute the voice instruction to be executed according to the second domain information, the second intent information and the second slot information, and to obtain an instruction execution result by utilizing the context information corresponding to the voice instruction to be executed.

9. A terminal device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the method for engineering natural semantic processing according to any one of claims 1 to 7 when executing the computer program.

10. A system for engineering natural semantic processing, characterized in that: The system includes a vehicle side and a cloud side; wherein, The vehicle side is used to receive a voice command to be executed issued by a user, perform voice recognition on the voice command to be executed, obtain text information, and upload the text information to the cloud; The cloud is configured to implement the method for engineering natural semantic processing according to any one of claims 1 to 7 according to the text information, obtain a command execution result, and send the command execution result to the vehicle end; The vehicle end is further used to form voice information according to the execution result of the instruction and broadcast the voice information.

Citation Information

Patent Citations

  • Method for integrating PMML file, operation environment thereof and industrial software

    CN112363695A

  • Intention-based network service configuration method and device, and storage medium

    CN113055206A