Instruction identification method, apparatus and device, readable storage medium and program product

By identifying the target index word in natural language text and calculating the similarity between it and candidate instructions in the instruction library, the problem of insufficient accuracy and scalability of instruction recognition in the prior art is solved, and a more efficient and economical instruction recognition effect is achieved.

CN120045663APending Publication Date: 2025-05-27HANGZHOU ELECTRONICS SOUL NETWORK TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510097462.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In the prior art, in human-computer interaction scenarios, the accuracy and scalability of instruction recognition are limited, and it is difficult to effectively identify natural language texts containing instructions.

Method used

By obtaining the target natural language text and the target instruction library set, identifying the target index word and determining candidate instructions from the instruction library, computing the similarity between the natural language text and the candidate instructions, and determining the target instruction based on the similarity.

Benefits of technology

It improves the accuracy and scalability of instruction recognition, reduces dependence on AI models, reduces operating costs, and reduces the consumption of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045663A_ABST
    Figure CN120045663A_ABST
Patent Text Reader

Abstract

The invention relates to an instruction identification method and device, equipment, a readable storage medium and a program product. The method comprises the steps of obtaining a target natural language text and a target instruction library set; identifying a target index word of the target natural language text, and if the target index word is a preset index word, determining at least one candidate instruction from a target instruction library set according to the target index word; determining a conversion operand for converting the target natural language text into each candidate instruction, and determining the similarity between the target natural language text and the corresponding candidate instruction according to each conversion operand; and determining a target instruction of which the similarity is within a preset threshold range from the at least one candidate instruction according to the similarity. By adopting the method, the accuracy of instruction identification can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an instruction recognition method, apparatus, device, readable storage medium and program product. Background Art

[0002] With the development of artificial intelligence technology, human-computer interaction is becoming more frequent, and a large amount of information in human-computer interaction exists in the form of natural language. Natural language refers to a language that evolves naturally with culture and is the main tool for human communication and thinking. In human-computer interaction scenarios, it is very important to accurately identify instructions to determine the user's intention.

[0003] In the related art, a matching command is performed by judging whether the input content contains a target character to determine a corresponding matching instruction. However, this matching method has certain limitations in accuracy. Summary of the invention

[0004] Based on this, it is necessary to provide an instruction recognition method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the accuracy and scalability of instruction recognition in order to address the above technical problems.

[0005] In a first aspect, the present application provides an instruction recognition method, comprising:

[0006] Obtaining a target natural language text and a target instruction library set;

[0007] Identifying a target index word of the target natural language text, and if the target index word is a preset index word, determining at least one candidate instruction from the target instruction library according to the target index word;

[0008] Determine a conversion operand for converting the target natural language text into each of the candidate instructions, and determine a similarity between the target natural language text and the corresponding candidate instruction according to each of the conversion operands;

[0009] A target instruction whose similarity is within a preset threshold range is determined from at least one of the candidate instructions according to the similarity.

[0010] In one embodiment, the identifying a target index word of the target natural language text, if the target index word is a preset index word, then determining at least one candidate instruction from the target instruction library according to the target index word, comprises:

[0011] Identify a target index word of the target natural language text. If the target index word is a preset index word, determine a scenario instruction corresponding to the preset index word in the target instruction library as a candidate instruction of the target index word, wherein the scenario instruction includes at least a plurality of instructions.

[0012] In one embodiment, obtaining the conversion operand of converting each candidate instruction from the target natural language text, and determining the similarity between the target natural language text and the corresponding candidate instruction according to each conversion operand, includes:

[0013] Determining a scene identifier corresponding to the target index term;

[0014] Calling a searcher management object, determining a target searcher matching the target index term according to a preset mapping relationship, and distributing the target natural language text to the target searcher; the preset mapping relationship includes a correspondence between a scene instruction of a scene identifier and a searcher;

[0015] The target searcher performs a search to determine the conversion operands for converting the target natural language text into each of the candidate instructions, determines the similarity between the target natural language text and the corresponding candidate instructions based on each of the conversion operands, and summarizes each of the similarities and the corresponding candidate instructions via the searcher management object.

[0016] In one embodiment, performing the search by the target searcher to determine the conversion operands of converting the target natural language text into each of the candidate instructions, and determining the similarity between the target natural language text and the corresponding candidate instructions according to each of the conversion operands, comprises:

[0017] Performing format conversion on the target natural language text to obtain a text to be matched including identification information parameters, and extracting parameter data matching the identification information parameters from the target natural language text;

[0018] The target searcher searches based on the text to be matched to determine the conversion operands of each candidate instruction converted from the text to be matched, and determines the similarity between the target natural language text and the corresponding candidate instructions according to each conversion operand.

[0019] In one embodiment, obtaining the target natural language text includes:

[0020] Obtaining original natural language text;

[0021] The original natural language text is preprocessed to obtain a target natural language text that meets a preset format; the preprocessing at least includes useless word removal and similar word replacement.

[0022] In one embodiment, the method further comprises:

[0023] A game driving event is generated according to the target instruction and the parameter data; the game driving event is used to drive the game operation.

[0024] In a second aspect, the present application further provides an instruction recognition device, comprising:

[0025] A data acquisition module, used to acquire a target natural language text and a target instruction library set;

[0026] A recognition module, used for recognizing a target index word of the target natural language text;

[0027] A search module is configured to, if the target index word is a preset index word, determine at least one candidate instruction from the target instruction library according to the target index word; determine a conversion operand for converting the target natural language text into each of the candidate instructions, and determine a similarity between the target natural language text and the corresponding candidate instruction according to each of the conversion operands;

[0028] The instruction determination module is used to determine a target instruction whose similarity is within a preset threshold range from at least one of the candidate instructions according to the similarity.

[0029] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0030] Obtaining a target natural language text and a target instruction library set;

[0031] Identifying a target index word of the target natural language text, and if the target index word is a preset index word, determining at least one candidate instruction from the target instruction library according to the target index word;

[0032] Determine a conversion operand for converting the target natural language text into each of the candidate instructions, and determine a similarity between the target natural language text and the corresponding candidate instruction according to each of the conversion operands;

[0033] A target instruction whose similarity is within a preset threshold range is determined from at least one of the candidate instructions according to the similarity.

[0034] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0035] Obtaining a target natural language text and a target instruction library set;

[0036] Identifying a target index word of the target natural language text, and if the target index word is a preset index word, determining at least one candidate instruction from the target instruction library according to the target index word;

[0037] Determine a conversion operand for converting the target natural language text into each of the candidate instructions, and determine a similarity between the target natural language text and the corresponding candidate instruction according to each of the conversion operands;

[0038] A target instruction whose similarity is within a preset threshold range is determined from at least one of the candidate instructions according to the similarity.

[0039] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0040] Obtaining a target natural language text and a target instruction library set;

[0041] Identifying a target index word of the target natural language text, and if the target index word is a preset index word, determining at least one candidate instruction from the target instruction library according to the target index word;

[0042] Determine a conversion operand for converting the target natural language text into each of the candidate instructions, and determine a similarity between the target natural language text and the corresponding candidate instruction according to each of the conversion operands;

[0043] A target instruction whose similarity is within a preset threshold range is determined from at least one of the candidate instructions according to the similarity.

[0044] The above-mentioned instruction recognition method, device, computer equipment, computer-readable storage medium and computer program product, for any target natural language text obtained, only need to identify the target index word of the target natural language text, and determine at least one candidate instruction from the target instruction library set according to the target index word; determine the conversion operands for converting the target natural language text into each candidate instruction, and determine the similarity between the target natural language text and the corresponding candidate instructions according to each conversion operand; determine the target instruction with a similarity within a preset threshold range from at least one candidate instruction according to the similarity. This method can adapt to all natural language texts and has strong scalability. It determines the target instruction from the target instruction library set according to the target word index based on the input natural language text, and does not determine the target instruction through AI model recognition, thereby reducing dependence on the AI ​​model, further reducing the consumption of computing resources for running the AI ​​model, reducing costs, and improving the accuracy of instruction recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1 is a flow chart of an instruction recognition method in one embodiment;

[0047] Figure 2 A schematic diagram of a flow chart of a method for determining instruction matching in one embodiment;

[0048] Figure 3 A flowchart of the language instruction matching logic and process method of an AI game under the Unity engine in one embodiment;

[0049] Figure 4 A structural block diagram of an instruction recognition method device in an embodiment;

[0050] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0052] In the era of artificial intelligence, as game developers are enthusiastic about AI-enabled games, users are increasingly demanding game interactions, for example, they want to implement input natural language to drive game operations. In related technologies, one way is to use the inclusion method, which is simple and crude. By judging whether the input content contains a certain character to match the command, it can implement simple instructions with fast speed. The disadvantage is poor scalability and high coupling. Due to the complexity of human language, the same word often has different meanings, so the development of complex instructions is extremely difficult and the accuracy is low. Another way is the AI ​​model recognition method. We train the instruction library into AI, input text and let AI calculate and return the instruction results. We only need to execute the method according to the corresponding instruction. The advantages of this solution are intuitive operation and simple and scalable interface. The disadvantage is that the larger the corpus instruction library, the more difficult it is to maintain and train, and the results are unstable, which is devastating for us who need accurate instructions. In addition, it also requires third-party server support, relies on GPU computing power, has high cost, and has a certain delay.

[0053] Aiming at the problem of certain accuracy limitations in related technologies, a command recognition method is proposed.

[0054] In one embodiment, Figure 1 As shown, a command recognition method is provided. This embodiment takes the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0055] Step 102, obtaining a target natural language text and a target instruction library set.

[0056] Among them, the target natural language text can be generated for the target game to be interacted with, and the language here can be different language types, such as Chinese, English, etc. For example, the target natural language text of Chinese type is obtained. The target natural language text can be obtained by inputting through the terminal interface, or by collecting voice data of a voice device, and then identifying and converting the voice data. The target instruction set is predetermined, and the target instruction set can be determined by identifying the configuration data in an EXCEL table, integrating and processing the configuration data, and on this basis, the target instruction library set can be generated in combination with an AI model to greatly improve the efficiency of instruction set improvement.

[0057] The target instruction set may be a game instruction, including operation instructions, interaction instructions, and system instructions, etc. For example, the operation instructions may include at least one of a move instruction and a jump instruction. The system instructions may include at least one of a menu instruction, a perspective switching instruction, and a map instruction.

[0058] Exemplarily, based on the natural language text inputted into the terminal interface, a target natural language text is determined, and a predetermined target instruction set is acquired.

[0059] Step 104, identifying a target index word of the target natural language text, and if the target index word is a preset index word, determining at least one candidate instruction from a target instruction library according to the target index word.

[0060] Among them, the method of determining the target index words may include but is not limited to: extracting based on preset keyword extraction rules, the extraction rules may be but are not limited to factors such as word frequency, word position, word collocation relationship, etc.; constructing a specific pattern template to match the target index words, the pattern template may be but is not limited to a word sequence pattern, a grammatical structure pattern, etc.; part-of-speech tagging method, first tagging the text with parts of speech, and identifying it according to the common parts of speech of the target index words. There is a corresponding relationship between the instructions in the target instruction library and the preset index words. The number of target index words can be one or more.

[0061] It is understandable that, based on the specified keywords, a certain type of instructions in the instruction library is indexed, and the instructions can be segmented into scenes and functions. For example, by specifying a keyword, a certain type of instruction related to the keyword can be quickly located in the instruction library without traversing the entire instruction library, which greatly improves the retrieval efficiency. When searching based on keywords, it is only necessary to search in the scene or function subset corresponding to the keyword, which further narrows the search scope and speeds up the instruction search. Optionally, in an exemplary embodiment, a target index word of the target natural language text is identified. If the target index word is a preset index word, at least one candidate instruction is determined from the target instruction library according to the target index word, including:

[0062] A target index word of a target natural language text is identified. If the target index word is a preset index word, a scene instruction corresponding to the preset index word in a target instruction library is determined as a candidate instruction of the target index word. The scene instruction includes at least a plurality of instructions.

[0063] Step 106, determining the conversion operands for converting the target natural language text into each candidate instruction, and determining the similarity between the target natural language text and the corresponding candidate instruction according to each conversion operand.

[0064] The number of conversion operations of the target natural language text into the candidate instructions can be determined based on the core idea of ​​Damerau-Levenshtein distance, which can be used to measure the degree of difference between two strings. It determines the distance between two strings by calculating the minimum number of four basic operations (i.e., the number of conversion operations) such as insertion, deletion, replacement, and adjacent character exchange, and determines the similarity between the target natural language text and the corresponding candidate instructions according to the minimum edit distance.

[0065] The similarity can be determined by dividing the edit distance by the maximum length and normalizing the similarity to between [0, 1]. A similarity of 1 indicates that the two strings are exactly the same, and a similarity of 0 indicates that the two strings are completely different. The method of determining the similarity based on the edit distance is not limited here.

[0066] Step 108: Determine a target instruction whose similarity is within a preset threshold range from at least one candidate instruction according to the similarity.

[0067] The preset threshold range may be determined according to actual needs and is not limited here.

[0068] In the above instruction recognition method, for any target natural language text obtained, it is only necessary to identify the target index word of the target natural language text, and determine at least one candidate instruction from the target instruction library set according to the target index word; determine the conversion operands for converting the target natural language text into each candidate instruction, and determine the similarity between the target natural language text and the corresponding candidate instructions according to each conversion operand; determine the target instruction with a similarity within a preset threshold range from at least one candidate instruction according to the similarity. This method can adapt to all natural language texts and has strong scalability. It determines the target instruction from the target instruction library set based on the input natural language text according to the target word index, and does not determine the target instruction through AI model recognition, thereby reducing dependence on the AI ​​model, further reducing the consumption of computing resources for running the AI ​​model, reducing costs, and improving the accuracy of instruction recognition.

[0069] It is understandable that the method of this embodiment can be implemented based on the Unity engine. The integrated software development environment is Rider. In this environment, the first function to be implemented is the matching algorithm, which is implemented based on the core idea of ​​Damerau-Levenshtein distance, and revolves around the minimum edit distance (for example, a sentence can be changed to another sentence at least a few times), so that the similarity of two paragraphs of text can be accurately calculated. In the application scenario, the function of determining instructions similar to the target natural language text is packaged into a functional object as FuzzySearcher. A FuzzySearcher corresponds to a searcher for a scene instruction, and FuzzyManager is defined as the manager of all searchers. As the central circulator of instruction flow, the instruction manager assumes the role of data processing and instruction output, and can realize the following functions: First, it is responsible for input text parsing and classification, preprocessing text, and doing some useless word removal, similar word replacement and other operations. Second, integrate the data queue, use FuzzyManager to sort by similarity to obtain the instruction results, and exclude those with particularly low similarity. Third, the instruction results are accurately connected to the implementation interface, and the relevant instruction logic details can be decoupled for implementation.

[0070] It can be understood that as long as we match the instruction, we have already regarded it as triggering the event attached to the instruction. In Unity, the program end can directly receive such events, and then inject them into the game operation system as parameters, and respond according to the specific logic of the game design. Optionally, based on the underlying algorithm implementation and the instruction manager functional structure, this system has increased freedom, and logic development can be carried out at any stage of the process, thereby solving the matching needs of complex instructions.

[0071] In an exemplary embodiment, Figure 2 As shown, a method for determining instruction matching is provided, including steps 202 to 206, wherein:

[0072] Step 202: Determine the scene identifier corresponding to the target index term.

[0073] Step 204, calling the searcher management object, determining the target searcher matching the target index term according to a preset mapping relationship, and distributing the target natural language text to the target searcher; the preset mapping relationship includes the correspondence between the scene instructions of the scene identifier and the searcher.

[0074] Among them, FuzzyManager is defined as the manager of all searchers, that is, the searcher management object, and FuzzyManager is called to determine the target searcher that matches the target index term according to the preset mapping relationship, and distribute the target natural language text to the target searcher.

[0075] Furthermore, obtaining the target natural language text includes: obtaining the original natural language text; preprocessing the original natural language text to obtain the target natural language text that meets the preset format; the preprocessing at least includes removing useless words and replacing similar words. This method normalizes the input original natural language text to ensure the accuracy and reliability of instruction extraction, and further ensures the reliability of matching.

[0076] Step 206, performing a search through the target searcher to determine the conversion operands for converting the target natural language text into each candidate instruction, determining the similarity between the target natural language text and the corresponding candidate instructions based on each conversion operand, and summarizing each similarity and the corresponding candidate instructions through the searcher management object.

[0077] It can be understood that each similarity and the corresponding candidate instructions are summarized through the searcher management object, and each summarized candidate instruction and the parameter data matching the identification information parameters in each candidate instruction can be sent to the game system.

[0078] Further, in an exemplary embodiment, performing a search by a target searcher to determine a conversion operand for converting a target natural language text into each candidate instruction, and determining a similarity between the target natural language text and the corresponding candidate instruction according to each conversion operand, comprises:

[0079] The target natural language text is formatted and obtained to be matched text including identification information parameters, and parameter data matching the identification information parameters are extracted from the target natural language text; a target searcher is used to search based on the text to be matched to determine the conversion operands for converting the text to be matched into each candidate instruction, and the similarity between the target natural language text and the corresponding candidate instructions is determined based on each conversion operand.

[0080] The identification information parameters are preset according to actual needs. For example, the identification information parameters include a time parameter and an address parameter. Then, the parameter data corresponding to the time parameter and the address parameter are time and address, respectively.

[0081] For example, if the input target natural language text is "I will go to work in ten minutes", the instruction library contains (#xx# identification information parameter), and the target natural language text is converted into a format to obtain the text to be matched including the identification information parameter "I#time parameter#go to work", "I#time parameter#go to play chess", "I#time parameter#go for a walk", etc. Among them, before determining the target natural text, the non-intentional word replacements involved are: just-want, past-go. Preprocessing result: I will go to work after #time parameter#; extract information: #time parameter#=>ten minutes later. Calculate the matching degree and output the results in order: 1. I#time parameter#go to work. 2. I#time parameter#go for a walk. 3. I#time parameter#go to play chess. Parameter: Get the result after ten minutes and send it to drive the game event operation.

[0082] It should be noted that for multi-language similarity calculations such as English, one word equals one character, rather than one letter. For example, "I go work" is three characters. Other specific implementation methods can be achieved through the processing methods of the target natural language text of Chinese type, which will not be elaborated here.

[0083] In this embodiment, at least one candidate instruction is determined from the target instruction library according to the target index term; the conversion operands for converting the target natural language text into each candidate instruction are determined, and the similarity between the target natural language text and the respective corresponding candidate instructions is determined according to each conversion operand; and the target instruction whose similarity is within a preset threshold range is determined from at least one candidate instruction according to the similarity. This method is highly efficient and can provide real-time effects. AI is not required in the instruction matching process, which solves the cost consumption problem of the third-party AI GPU server.

[0084] Optionally, in an exemplary embodiment, after extracting parameter data matching the identification information parameters from the target natural language text, and determining the similarity between the target natural language text and the corresponding candidate instructions according to each conversion operand, a game-driven event can also be generated based on the determined target instructions and the parameter data corresponding to each target instruction; the game-driven event is used to drive the operation of the game to meet the user's needs for game interaction.

[0085] With respect to the target instruction library, instruction information, instruction keywords and instruction matching in the above embodiment, in order to open up to configuration personnel for configuration and make iterative and modifiable, the configuration is performed in Excel in the form of a sub-table. The specific configuration may include:

[0086] The instruction library set configuration determines the target instruction library and all instruction libraries that match the instruction. The instruction can only be executed if the corresponding entry is found in the target instruction library set. The instruction keyword configuration (i.e. the target index word configuration) configures the keyword index. When the specified keyword appears, it indexes to a certain type of instruction in the instruction library, which can perform scene segmentation and function segmentation on the instructions. The instruction information configuration configures the pronoun information, such as the #location# category. There is a place name configuration for the game scene. In the matching, such place names will be replaced with #location# for generalized matching, and the input key information will be extracted as the instruction input parameter. The instruction invalid / similar word replacement configuration normalizes some special words in the text pre-processing, such as take a look, take a look, understand, take a look, etc., which are all changed to "view". The function is to normalize the input.

[0087] Based on the above instruction recognition method, such as Figure 3 As shown, a language instruction matching logic and process method for AI games under the Unity engine is provided, involving software such as Excel and Unity3D, the implementation logic language is C#, and the integrated software development environment is Rider. Based on the integration of EXCEL manual configuration data and AI large models, the instruction configuration data is completed, and the target instruction library is provided to the instruction manager CmdManager. The instruction manager CmdManager provides the instruction set to the manager FuzzyManager of all searchers. FuzzyManager manages multiple FuzzySearchers, that is, the fuzzy search function is encapsulated into a class called FuzzySearcher. Each FuzzySearcher instance corresponds to a searcher in a specific scenario, which is used to perform the fuzzy search task in the scenario and determine the target instruction similar to the target natural language text based on Damerau–Levenshtein distance. FuzzyManager is a manager class responsible for managing and coordinating all FuzzySearcher instances so as to uniformly manage and operate different searchers.

[0088] The core module CmdManager (command manager), as the central circulator of command flow, plays the role of data processing and command output. It can implement input text parsing and classification, preprocess text, remove useless words, replace similar words, and other operations. Integrate the data queue, use FuzzyManager to sort by similarity to get the command results, and exclude those with particularly low similarity. Accurately connect the command results to the implementation interface, and decouple the implementation of related command logic details. After implementing in this order, we have completed the core logic, and can realize the process of converting natural language into game commands, obtain the target command, and send the target command and corresponding parameters to the game system by calling the command interface to make the game work.

[0089] Compared with the prior art method of directly judging whether the user input text completely contains the text of the instruction, this method determines at least one candidate instruction from the target instruction library according to the target index term; determines the conversion operand for converting the target natural language text into each candidate instruction, and determines the similarity between the target natural language text and the corresponding candidate instructions according to each conversion operand; determines the target instruction with a similarity within a preset threshold range from at least one candidate instruction according to the similarity, which improves scalability and reduces coupling, and can support complex instructions. Compared with AI model recognition, this method sends the user input text directly to the Tansformer model and directly returns the final result, which improves the stability of the result, reduces the dependence on GPU computing power, reduces costs, and alleviates delays to a certain extent.

[0090] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0091] Based on the same inventive concept, the embodiment of the present application also provides an instruction recognition device for implementing the instruction recognition method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more instruction recognition device embodiments provided below can refer to the limitations of the instruction recognition method above, and will not be repeated here.

[0092] In an exemplary embodiment, Figure 4 As shown, an instruction recognition device is provided, including: a data acquisition module 402, an identification module 404, a search module 406 and an instruction determination module 408, wherein:

[0093] The data acquisition module 402 is used to acquire the target natural language text and the target instruction library set.

[0094] The recognition module 404 is used to recognize the target index words of the target natural language text.

[0095] Search module 406 is used to determine at least one candidate instruction from the target instruction library according to the target index word if the target index word is a preset index word; determine the conversion operands for converting the target natural language text into each candidate instruction, and determine the similarity between the target natural language text and the corresponding candidate instructions according to each conversion operand.

[0096] The instruction determination module 408 is used to determine a target instruction whose similarity is within a preset threshold range from at least one candidate instruction according to the similarity.

[0097] The above-mentioned instruction recognition device, for any target natural language text obtained, only needs to identify the target index word of the target natural language text, and determine at least one candidate instruction from the target instruction library set according to the target index word; determine the conversion operands for converting the target natural language text into each candidate instruction, and determine the similarity between the target natural language text and the corresponding candidate instructions according to each conversion operand; determine the target instruction with a similarity within a preset threshold range from at least one candidate instruction according to the similarity. This method can adapt to all natural language texts and has strong scalability. It determines the target instruction from the target instruction library set according to the target word index based on the input natural language text, and does not determine the target instruction through AI model recognition, thereby reducing dependence on the AI ​​model, further reducing the consumption of computing resources for running the AI ​​model, reducing costs, and improving the accuracy of instruction recognition.

[0098] In an exemplary embodiment, the search module 406 is also used to identify a target index word of a target natural language text. If the target index word is a preset index word, the scene instruction corresponding to the preset index word in the target instruction library is determined as a candidate instruction of the target index word. The scene instruction includes at least multiple instructions.

[0099] In an exemplary embodiment, the search module 406 is further configured to determine a scene identifier corresponding to the target index term;

[0100] Calling the searcher management object, determining the target searcher matching the target index term according to a preset mapping relationship, and distributing the target natural language text to the target searcher; the preset mapping relationship includes the correspondence between the scene instruction of the scene identifier and the searcher;

[0101] The search is performed through the target searcher to determine the conversion operands for converting the target natural language text into each candidate instruction, and the similarity between the target natural language text and the corresponding candidate instructions is determined based on each conversion operand. Each similarity and the corresponding candidate instructions are summarized through the searcher management object.

[0102] In an exemplary embodiment, the search module 406 is further used to perform format conversion on the target natural language text to obtain a text to be matched including the identification information parameter, and to extract parameter data matching the identification information parameter from the target natural language text;

[0103] The target searcher searches based on the text to be matched, determines the conversion operands of each candidate instruction converted from the text to be matched, and determines the similarity between the target natural language text and the corresponding candidate instructions according to each conversion operand.

[0104] In an exemplary embodiment, the data acquisition module 402 is also used to acquire original natural language text;

[0105] The original natural language text is preprocessed to obtain a target natural language text that meets a preset format; the preprocessing at least includes useless word removal and similar word replacement.

[0106] In an exemplary embodiment, the instruction recognition device further includes an event generation module for generating a game driving event according to the target instruction and parameter data; the game driving event is used to drive the operation of the game.

[0107] Each module in the above instruction recognition device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0108] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, an instruction recognition method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0109] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0110] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0111] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program implements the steps in the above-mentioned method embodiments when executed by a processor. In one embodiment, a computer program product is provided, including a computer program, and the computer program implements the steps in the above-mentioned method embodiments when executed by a processor. It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant regulations.

[0112] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0113] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0114] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for instruction recognition, characterized in that: The method comprises: Obtaining a target natural language text and a target instruction library set; Identifying a target index word of the target natural language text, and if the target index word is a preset index word, determining at least one candidate instruction from the target instruction library according to the target index word; Determine a conversion operand for converting the target natural language text into each of the candidate instructions, and determine a similarity between the target natural language text and the corresponding candidate instruction according to each of the conversion operands; A target instruction whose similarity is within a preset threshold range is determined from at least one of the candidate instructions according to the similarity.

2. The method according to claim 1, characterized in that The identifying a target index word of the target natural language text, and if the target index word is a preset index word, determining at least one candidate instruction from the target instruction library according to the target index word, comprises: Identify a target index word of the target natural language text. If the target index word is a preset index word, determine a scenario instruction corresponding to the preset index word in the target instruction library as a candidate instruction of the target index word, wherein the scenario instruction includes at least a plurality of instructions.

3. The method according to claim 2, characterized in that The step of obtaining a conversion operand for converting each candidate instruction from the target natural language text, and determining a similarity between the target natural language text and the corresponding candidate instruction according to each conversion operand, includes: Determining a scene identifier corresponding to the target index term; Calling a searcher management object, determining a target searcher matching the target index term according to a preset mapping relationship, and distributing the target natural language text to the target searcher; the preset mapping relationship includes a correspondence between a scene instruction of a scene identifier and a searcher; The target searcher performs a search to determine the conversion operands for converting the target natural language text into each of the candidate instructions, determines the similarity between the target natural language text and the corresponding candidate instructions based on each of the conversion operands, and summarizes each of the similarities and the corresponding candidate instructions via the searcher management object.

4. The method according to claim 3, characterized in that The step of performing a search by the target searcher to determine a conversion operand for converting the target natural language text into each of the candidate instructions, and determining a similarity between the target natural language text and the corresponding candidate instructions according to each of the conversion operands, comprises: Performing format conversion on the target natural language text to obtain a text to be matched including identification information parameters, and extracting parameter data matching the identification information parameters from the target natural language text; The target searcher searches based on the text to be matched to determine the conversion operands of each candidate instruction converted from the text to be matched, and determines the similarity between the target natural language text and the corresponding candidate instructions according to each conversion operand.

5. The method according to any one of claims 1 to 4, characterized in that: The step of obtaining the target natural language text includes: Obtaining original natural language text; The original natural language text is preprocessed to obtain a target natural language text that meets a preset format; the preprocessing at least includes useless word removal and similar word replacement.

6. The method according to claim 4, characterized in that The method further comprises: A game driving event is generated according to the target instruction and the parameter data; the game driving event is used to drive the game operation.

7. A command recognition device, characterized in that: The device comprises: A data acquisition module, used to acquire a target natural language text and a target instruction library set; A recognition module, used for recognizing a target index word of the target natural language text; A search module is configured to, if the target index word is a preset index word, determine at least one candidate instruction from the target instruction library according to the target index word; determine a conversion operand for converting the target natural language text into each of the candidate instructions, and determine a similarity between the target natural language text and the corresponding candidate instruction according to each of the conversion operands; The instruction determination module is used to determine a target instruction whose similarity is within a preset threshold range from at least one of the candidate instructions according to the similarity.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Music playing method and device, electronic equipment and computer readable storage medium

    CN122548002A

  • Music playing method and device, electronic equipment and computer readable storage medium

    CN122548002B