A command collection method, device and intelligent device
By incorporating command specifications in smart devices and performing semantic comparison and syntax analysis, the problem of users using flexible command expression is solved, accurate command collection and redundant storage are achieved, and the control accuracy and user experience of the device are improved.
Patent Information
- Application Number
- CN202210087459.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-25
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2042-01-25
AI Technical Summary
The prior art is difficult to accurately collect users' use of more flexible and diverse command expression forms, resulting in the intent recognition algorithm that cannot recognize the user's command intentions, resulting in control errors.
By incorporating multiple command specifications on smart devices, it displays them to users and performs semantic comparisons, judges the matching degree between command description and specifications, and notifies the user to re-enter when they do not match, and combines syntax fluency analysis to ensure that the command description meets the specifications and stores it according to the specifications. .
It realizes command collection for the same semantics and different expressions, avoids user input errors and data redundancy, and improves the command collection efficiency and accuracy of smart devices.
Smart Images

Figure CN114611523B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data collection, and in particular to a command collection method, device and intelligent equipment. Background Art
[0002] At present, when voice control is used for smart devices such as lighting, air conditioning, television, curtains, etc., it is usually implemented based on a fixed device command vocabulary, that is, the user reads out the command words contained in the device command vocabulary, and the intention recognition algorithm recognizes the intention and executes the command. If the user's command description exceeds the scope of the vocabulary, the intention recognition algorithm cannot recognize the command intention and cannot execute the command. For example: there is a command "turn on the air conditioner" in the vocabulary. The user can turn on the air conditioner by saying "turn on the air conditioner", but it cannot be turned on by saying "turn on the air conditioner".
[0003] In order to avoid requiring users to memorize command vocabularies and to use more flexible and diverse command expressions, the intent recognition algorithm needs to learn enough device command data sets with the same semantics but different expressions. Therefore, how to accurately collect device commands with the same semantics but different expressions is a problem that needs to be solved. Summary of the invention
[0004] In view of this, the embodiments of the present invention provide a command collection method, apparatus and intelligent device, thereby realizing the function of accurately collecting intelligent device commands with the same semantics but different expressions.
[0005] According to a first aspect, the present invention provides a command collection method, which is applied to a smart device, wherein the smart device has multiple built-in command specifications, and the command specifications are used to characterize the functions supported by the smart device. The method includes: displaying the current command specification to a user; receiving a command description input by the user according to the current command specification; comparing the command description with the semantics specified by the current command specification, and if the command description matches the semantics specified by the current command specification, storing the command description in a command data set corresponding to the current command specification.
[0006] Optionally, the method further includes: if the command description does not match the semantics specified by the current command specification, notifying the user to re-enter the command description.
[0007] Optionally, before comparing the command description with the semantics specified by the current command specification, the method also includes: determining whether the command description exists in the command data set; if the command description does not exist in the command data set, storing the command description in the command data set; if the command description exists in the command data set, notifying the user to re-enter the command description.
[0008] Optionally, comparing the command description with the semantics specified in the current command specification includes: respectively obtaining vector expressions of the command description and the semantics specified in the current command specification; calculating the similarity between the command description and the vector expressions of the semantics specified in the current command specification to obtain the degree of matching between the command description and the semantics specified in the current command specification.
[0009] Optionally, before storing the command description in the command data set corresponding to the current command specification, the method further includes: calculating the grammatical fluency of the command description, the grammatical fluency being used to characterize the degree of grammatical matching between the command description and the language to which the command description belongs; if the grammatical fluency is less than a second preset threshold, returning to the step of storing the command description in the command data set corresponding to the current command specification; if the grammatical fluency is greater than the second preset threshold, notifying the user to re-enter the command description.
[0010] Optionally, calculating the grammatical fluency of the command description includes: removing each word in the command description in turn, and predicting the words removed in the command description in turn based on a preset algorithm to obtain multiple predicted words; generating the grammatical fluency based on a loss parameter between the multiple predicted words and the corresponding removed words, the loss parameter being used to characterize the degree of difference between the predicted words and the corresponding removed words.
[0011] Optionally, the method further includes: if the number of times the user is notified to re-enter the command description reaches a preset number, skipping the command description collection step of the current command specification.
[0012] According to the second aspect, the present invention provides a command collection device, which is applied to an intelligent device, wherein the intelligent device has multiple command specifications built in, and the command specifications are used to characterize the functions supported by the intelligent device. The device includes: a specification display module, which is used to display the current command specification to a user; a command receiving module, which is used to receive a command description input by the user according to the current command specification; and a semantic screening module, which is used to compare the command description with the semantics specified in the current command specification. If the command description matches the semantics specified in the current command specification, the command description is stored in a command data set corresponding to the current command specification.
[0013] According to the third aspect, an embodiment of the present invention provides an intelligent device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method described in the first aspect or any optional implementation manner of the first aspect by executing the computer instructions.
[0014] According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method described in the first aspect or any optional implementation manner of the first aspect.
[0015] The technical solution provided by this application has the following advantages:
[0016] The technical solution provided by the present application, when collecting user commands, first displays the command specifications preset in the device to the user one by one, so as to guide the user to fill in the command description that satisfies the function of the smart device through the command specifications, and avoids the command description filled in by the user being a statement that does not belong to the current command vocabulary and is a function that cannot be realized by the current smart device. Afterwards, a semantic analysis is performed on the command description filled in by the user, and when the command description successfully matches the semantics specified by the current command specification, the command description is stored in the command data set corresponding to the current command specification. Further avoid the semantic difference between the command description entered by the user and the semantics specified by the command specification, thereby avoiding the user from controlling the wrong function when issuing a command.
[0017] In addition, when the command description entered by the user already exists in the command data set, the user is notified to re-enter the command, and the current command is not stored to avoid data redundancy. Before storing the command description in the command data set, the command description is also parsed. If the command description does not conform to the grammatical convention, it is not stored to avoid generating commands that cannot be used due to the user's personal incorrect grammatical convention, further avoiding data redundancy. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:
[0019] Figure 1 A schematic diagram showing the steps of a command collection method in one embodiment of the present invention is shown;
[0020] Figure 2 A schematic flow chart of a command collection method in one embodiment of the present invention is shown;
[0021] Figure 3 An example diagram of a command specification in one embodiment of the present invention is shown;
[0022] Figure 4 A schematic diagram of the structure of a command collection device in one embodiment of the present invention is shown;
[0023] Figure 5 A schematic structural diagram of an intelligent device in one embodiment of the present invention is shown. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0025] See also Figure 1 and Figure 2 In one embodiment, a command collection method is applied to a smart device, wherein the smart device has multiple built-in command specifications, and the command specifications are used to characterize functions supported by the smart device. The method specifically includes the following steps:
[0026] Step S101: Display the current command specification to the user.
[0027] Step S102: receiving a command description input by a user according to the current command specification.
[0028] Step S103: Compare the command description with the semantics specified in the current command specification. If the command description matches the semantics specified in the current command specification, store the command description in the command data set corresponding to the current command specification.
[0029] Specifically, in actual application scenarios, the traditional command collection method is often that multiple developers associate and collect commands, and then place the commands in the command data set of the smart device from the background. When collecting user commands on a large scale, this embodiment first displays the command specifications preset in the device to the user one by one, such as Figure 3As shown, the command specification is to formulate specific specifications for a certain type of specific equipment, make clear definitions and examples, so that the collection personnel can accurately understand the command. The specification clarifies the term definition, task definition, device command type, command name, command definition, and scenario description. Thus, the command specification guides the user to fill in the command description that meets the function of the smart device, avoiding the command description filled in by the user being a statement that does not belong to the current command vocabulary and a function that cannot be realized by the current smart device. Afterwards, the command description filled in by the user is semantically analyzed, and when the command description successfully matches the semantics specified in the current command specification, the command description is stored in the command data set corresponding to the current command specification. Further avoid the semantic difference between the command description entered by the user and the semantics specified in the command specification, thereby avoiding the control of the wrong function when the user issues a command. In this embodiment, the matching of the command description and the specified semantics is realized based on text similarity. After the current command specification collects the command, the smart device switches to the next command specification, thereby continuing to collect command descriptions that control other functions of the smart device.
[0030] If the command description does not match the semantics specified by the current command specification, it indicates that the command currently entered by the user is quite different from the specified semantics. For example, the specification specifies that the command to turn on the air conditioner function should be filled in, but the user enters the command to turn off the air conditioner. If the command is stored in the command data set, the air conditioner will be turned on when the user says the command to turn off the air conditioner. Therefore, the command description is not stored in the command data set, and the user is notified to re-enter the command description.
[0031] Specifically, in one embodiment, before the above step S103, a command collection method provided by an embodiment of the present invention further includes the following steps:
[0032] Step 1: Determine whether the command description exists in the command data set.
[0033] Step 2: If the command description does not exist in the command data set, store the command description into the command data set.
[0034] Step 3: If the command description exists in the command data set, notify the user to re-enter the command description.
[0035] Specifically, in order to avoid the generation of consistent command descriptions due to the uncontrollable ideas of most users, thereby increasing the number of redundant commands in the smart device, the command description entered by the user is compared word for word with the command description in the command data set. When the command entered by the user already exists in the command data set corresponding to the current command specification, the command storage operation is not performed this time, and the user is informed to re-enter the command description.
[0036] Specifically, in one embodiment, the above step S103 specifically includes the following steps:
[0037] Step 4: Obtain the command description and the vector expression of the semantics specified by the current command specification respectively.
[0038] Step 5: Calculate the similarity between the vector expression of the command description and the semantics specified in the current command specification to obtain the matching degree between the command description and the semantics specified in the current command specification.
[0039] Specifically, in this embodiment, a semantic matching operation between the command description and the current command specification is performed based on the text vector similarity. First, the digital vector of the semantics specified in the command description and the current command specification is calculated. The semantics specified in the current command specification can adopt the naming name in the current command specification. For example, the command description entered by the user is "turn on the air conditioner", and the naming name in the current command specification is "turn on the air conditioner". The method for generating a text semantic vector can be implemented by a coding model based on natural language processing. For example, the vector representations A and B are calculated by the BERT pre-trained language model. Assuming A and B are two n-dimensional vectors, A is [A1, A2, ..., An], and B is [B1, B2, ..., Bn]. Then, the text similarity can be obtained by methods including but not limited to vector distance, cosine similarity, etc. For example, the cosine similarity of the angle θ between A and B is calculated to obtain the text similarity. Through this step, the similarity of the two texts can be accurately obtained, and an accurate semantic matching operation can be achieved.
[0040] Specifically, in one embodiment, before storing the command description into the command data set corresponding to the current command specification, a command collection method provided by an embodiment of the present invention further includes the following steps:
[0041] Step 6: Calculate the grammatical fluency of the command description. The grammatical fluency is used to characterize the degree of grammatical matching between the command description and the language to which the command description belongs.
[0042] Step 7: If the grammatical fluency is less than the second preset threshold, return to the step of storing the command description in the command data set corresponding to the current command specification.
[0043] Step 8: If the grammatical fluency is greater than a second preset threshold, the user is notified to re-enter the command description.
[0044] Specifically, in this embodiment, in order to avoid the problem that the command description input by the user is not grammatically consistent, resulting in the command being almost unusable (for example, the user issues a command "turn on the air conditioner in the room"), the command description input by the user is further parsed. In this embodiment, the grammatical fluency is obtained based on the negative log-likelihood function value of each word in the command description, thereby measuring the degree of grammatical matching between the command description and the language to which the command description belongs.
[0045] The steps to calculate the syntax fluency of a command description are as follows:
[0046] 1. Remove each word in the command description in turn, and predict the words removed in the command description in turn based on a preset algorithm to obtain multiple predicted words.
[0047] 2. Generate grammatical fluency based on loss parameters between multiple predicted words and corresponding removed words, where the loss parameters are used to characterize the degree of difference between the predicted words and the corresponding removed words.
[0048] In this embodiment, for a given sentence, a word is removed in sequence, and the removed word is used as the word to be predicted. Then, a pre-trained language model including but not limited to BERT is used to predict the removed word. The BERT pre-trained language model is a model that has been trained and learned in advance for human natural language knowledge, and then substituted into a specific task for optimization. Therefore, the removed word is predicted by the BERT pre-trained language model, and the analysis is performed based on the predicted result, which is itself a process of determining whether the given sentence is grammatical. After that, this embodiment calculates the negative log-likelihood function value of the predicted word and the real word as the loss parameter. This embodiment uses the negative log-likelihood function as a loss function to characterize the difference between the predicted word and the corresponding removed word. While ensuring the accuracy of the loss parameter as much as possible, the complexity of selecting the loss function is reduced, thereby improving the calculation speed. Finally, the loss parameters of all words are summed and averaged to obtain a measurement standard for characterizing the degree of matching between the command description and the preset grammar, that is, grammatical fluency.
[0049] Since the characteristic of the negative log-likelihood function is that the smaller the value, the smaller the representation loss, when the grammatical fluency is less than the second preset threshold, it is determined that the current command description conforms to the grammatical rules to which the command belongs, and is stored in the command data set. If the grammatical fluency is greater than the second preset threshold, the user is notified to re-enter the command.
[0050] Specifically, in one embodiment, a command collection method provided by an embodiment of the present invention further includes the following steps:
[0051] Step nine: If the number of times the user is notified to re-enter the command description reaches a preset number, the command description collection step of the current command specification is skipped.
[0052] Since the user's thoughts are uncontrollable, the existing technology usually causes the command collection function to fall into an infinite loop because a user cannot think of a suitable command description, and the user is constantly prompted to enter a command. Therefore, in this implementation, for any command specification, if the number of times the user re-enters the command reaches a preset number, such as 3 times, it will automatically jump to the input of the next command specification. This improves the efficiency of command collection.
[0053] Specifically, in an actual application scenario, an example of a system integrated by the command collection method is as follows:
[0054] The system server consists of the following units:
[0055] Database unit: The system uses SQL database for storage, which has fields formulated according to command specifications. The main fields are shown above.
[0056] Specification reading unit: reads the device command collection specifications stored in Excel.
[0057] Difference judgment unit: According to the command statement input by the user, the command statement is searched in the database and whether it exists is returned.
[0058] Similarity calculation unit: Based on the command statement entered by the user, the Bert pre-trained language model is called to calculate the similarity between the command statement and the command name, and the similarity is returned.
[0059] Fluency calculation unit: Based on the command expression input by the user, the BERT pre-trained language model is called to calculate the fluency of the command expression.
[0060] Control logic unit. Call the specification reading unit, read a command specification, and display it on the client interface; receive the command statement filled in by the user, determine whether there is a difference, if not, store it in the database, and ask the user to fill it in again; if there is a difference, call the similarity module to calculate the similarity, if the similarity is not greater than the threshold, ask to fill it in again; if the similarity reaches the threshold, continue to calculate the fluency, if the fluency is lower than the threshold, store it in the database, otherwise ask the user to continue to enter. The number of times each command statement is re-entered shall not exceed three times. Continue the above cycle until the user enters all command statements.
[0061] The system client consists of the following interfaces:
[0062] User login interface: The user fills in the user name and password and logs into the system.
[0063] Command description filling interface: Displays the specifications of each command and a text box for filling in the command description.
[0064] Threshold filling interface: Administrator users can fill in the similarity threshold and fluency threshold.
[0065] Through the above steps, the technical solution provided by the present application, when collecting user commands, first displays the command specifications preset in the device to the user one by one, so as to guide the user to fill in the command description that satisfies the function of the smart device through the command specifications, and avoids the command description filled in by the user being a statement that does not belong to the current command vocabulary and is a function that cannot be realized by the current smart device. Afterwards, a semantic analysis is performed on the command description filled in by the user, and when the command description successfully matches the semantics specified by the current command specification, the command description is stored in the command data set corresponding to the current command specification. Further avoid the semantic difference between the command description entered by the user and the semantics specified by the command specification, thereby avoiding the user from controlling the wrong function when issuing a command.
[0066] In addition, when the command description entered by the user already exists in the command data set, the user is notified to re-enter the command, and the current command is not stored to avoid data redundancy. Before storing the command description in the command data set, the command description is also parsed. If the command description does not conform to the grammatical convention, it is not stored to avoid generating commands that cannot be used due to the user's personal incorrect grammatical convention, further avoiding data redundancy.
[0067] like Figure 4 As shown, this embodiment also provides a command collection device, which is applied to a smart device. The smart device has multiple built-in command specifications, and the command specifications are used to characterize the functions supported by the smart device. The device includes:
[0068] The specification display module 101 is used to display the current command specification to the user. For details, please refer to the relevant description of step S101 in the above method embodiment, which will not be repeated here.
[0069] The command receiving module 102 is used to receive the command description input by the user according to the current command specification. For details, please refer to the relevant description of step S102 in the above method embodiment, which will not be repeated here.
[0070] The semantic screening module 103 is used to compare the command description with the semantics specified in the current command specification. If the command description matches the semantics specified in the current command specification, the command description is stored in the command data set corresponding to the current command specification. For details, please refer to the relevant description of step S103 in the above method embodiment, which will not be repeated here.
[0071] The command collection device provided in the embodiment of the present invention is used to execute the command collection method provided in the above embodiment. Its implementation method and principle are the same. For details, please refer to the relevant description of the above method embodiment, which will not be repeated here.
[0072] Through the collaborative cooperation of the above-mentioned components, the technical solution provided by this application, when collecting user commands, first displays the command specifications preset in the device to the user one by one, so as to guide the user to fill in the command description that satisfies the functions of the smart device through the command specifications, and avoids the command description filled in by the user being an expression that does not belong to the current command vocabulary and is a function that cannot be realized by the current smart device. Afterwards, a semantic analysis is performed on the command description filled in by the user, and when the command description successfully matches the semantics specified by the current command specification, the command description is stored in the command data set corresponding to the current command specification. Further avoid the semantic difference between the command description entered by the user and the semantics specified by the command specification, thereby avoiding the user from controlling the wrong function when issuing a command.
[0073] In addition, when the command description entered by the user already exists in the command data set, the user is notified to re-enter the command, and the current command is not stored to avoid data redundancy. Before storing the command description in the command data set, the command description is also parsed. If the command description does not conform to the grammatical convention, it is not stored to avoid generating commands that cannot be used due to the user's personal incorrect grammatical convention, further avoiding data redundancy.
[0074] Figure 5 An intelligent device according to an embodiment of the present invention is shown, the device includes a processor 901 and a memory 902, which can be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0075] The processor 901 may be a central processing unit (CPU). The processor 901 may also be 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, or a combination of the above chips.
[0076] The memory 902 is a non-transitory computer-readable storage medium that can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the methods in the above method embodiments. The processor 901 executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory 902, that is, implementing the methods in the above method embodiments.
[0077] The memory 902 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by the processor 901, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 902 may optionally include a memory remotely arranged relative to the processor 901, and these remote memories may be connected to the processor 901 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0078] One or more modules are stored in the memory 902 , and when executed by the processor 901 , the method in the above method embodiment is executed.
[0079] The specific details of the above-mentioned smart device can be understood by referring to the corresponding related descriptions and effects in the above-mentioned method embodiment, and will not be repeated here.
[0080] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the implemented program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0081] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A command collection method, characterized in that: Applied to a smart device, the smart device has multiple built-in command specifications, the command specifications are used to characterize the functions supported by the smart device, the method includes: Display the current command specification to the user; receiving a command description input by the user according to the current command specification; Comparing the command description with the semantics specified in the current command specification, if the command description matches the semantics specified in the current command specification, storing the command description in a command data set corresponding to the current command specification; Before storing the command description in the command data set corresponding to the current command specification, the method further includes: calculating the grammatical fluency of the command description, the grammatical fluency being used to characterize the degree of grammatical matching between the command description and the language to which the command description belongs; if the grammatical fluency is less than a second preset threshold, returning to the step of storing the command description in the command data set corresponding to the current command specification; if the grammatical fluency is greater than the second preset threshold, notifying the user to re-enter the command description; The method for calculating the grammatical fluency of the command description includes: removing each word in the command description in turn, and predicting the words removed in the command description in turn based on a preset algorithm to obtain a plurality of predicted words; generating the grammatical fluency based on loss parameters between the plurality of predicted words and the corresponding removed words, wherein the loss parameters are used to characterize the degree of difference between the predicted words and the corresponding removed words; and summing up the loss parameters of all words and then taking the average value to obtain a measurement standard for characterizing the degree of match between the command description and the preset grammar, namely, the grammatical fluency.
2. The method according to claim 1, characterized in that The method further comprises: If the command description does not match the semantics specified by the current command specification, the user is notified to re-enter the command description.
3. The method according to claim 1, characterized in that Before comparing the command description with the semantics specified by the current command specification, the method further includes: Determining whether the command description exists in the command data set; If the command description does not exist in the command data set, storing the command description in the command data set; If the command description exists in the command data set, the user is notified to re-enter the command description.
4. The method according to claim 1, characterized in that: The comparing the command description with the semantics specified by the current command specification includes: Respectively obtaining the command description and the vector expression of the semantics specified by the current command specification; The similarity between the command description and the vector expression of the semantics specified in the current command specification is calculated to obtain the matching degree between the command description and the semantics specified in the current command specification.
5. The method according to any one of claims 1, 2 and 3, characterized in that: The method further comprises: If the number of times the user is notified to re-enter the command description reaches a preset number, the command description collection step of the current command specification is skipped.
6. A command collection device, characterized in that: Applied to a smart device, the smart device has multiple built-in command specifications, the command specifications are used to characterize the functions supported by the smart device, and the device includes: A specification display module is used to display the current command specification to the user; A command receiving module, used for receiving a command description input by the user according to the current command specification; A semantic screening module is used to compare the command description with the semantics specified in the current command specification. If the command description matches the semantics specified in the current command specification, the command description is stored in the command data set corresponding to the current command specification; before storing the command description in the command data set corresponding to the current command specification, it also includes: calculating the grammatical fluency of the command description, the grammatical fluency is used to characterize the degree of grammatical matching between the command description and the language to which the command description belongs; if the grammatical fluency is less than a second preset threshold, returning to store the command description in the command data set corresponding to the current command specification. Steps; if the grammatical fluency is greater than a second preset threshold, the user is notified to re-enter the command description; the calculation of the grammatical fluency of the command description includes: removing each word in the command description in turn, and predicting the words removed in the command description in turn based on a preset algorithm to obtain a plurality of predicted words; generating the grammatical fluency based on loss parameters between the plurality of predicted words and the corresponding removed words, the loss parameters being used to characterize the degree of difference between the predicted words and the corresponding removed words; summing up the loss parameters of all words and then taking the average value, a measurement standard for characterizing the degree of matching between the command description and the preset grammar, namely, grammatical fluency, is obtained.
7. A smart device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 5 by executing the computer instructions.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method according to any one of claims 1 to 5.
