A method for generating a structured language recognizable by an agent

By using an agent-recognizable structured language generation method, a large model is used to concatenate natural language task requirements with external environmental state parameters to generate structured text. This solves the problems of high accuracy and cost in agent task planning in dynamic environments, and achieves more efficient task execution.

CN121145798BActive Publication Date: 2026-05-01HUAZHONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAZHONG UNIV OF SCI & TECH
Filing Date
2025-08-13
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing intelligent agent task planning techniques struggle to accurately plan user natural language needs tasks. Traditional methods are unstable in dynamic environments, and data-driven models suffer from high training costs, insufficient generalization, and poor interpretability.

Method used

A method for generating structured language that can be recognized by intelligent agents is adopted. By concatenating the natural language task requirements input by the user with the external environment state parameters through a large model, and using prompt word module, decomposition planning agent module, modification and rewriting agent module, atomic event classifier and atomic event extraction module, structured text is generated to guide intelligent agent devices to perform tasks.

Benefits of technology

It improves the accuracy and flexibility of task planning, enabling better execution of user-required tasks in dynamic environments, and reduces the error rate and training cost of large models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121145798B_ABST
    Figure CN121145798B_ABST
Patent Text Reader

Abstract

The application discloses a method for generating an intelligent body recognizable structured language, and belongs to the technical field of intelligent body control. The method inputs a natural language task demand input by a current user and an external environment state parameter related to the natural language task demand collected by an external environment detection module into a large model, and finally obtains a structured text, so that an intelligent body device corresponding to the natural language task demand reads and executes a corresponding user demand task. The method for generating the intelligent body recognizable structured language fully utilizes a prompt word module splicing and context learning, adopts a language large model and an event extraction combination mode, generates an atomic event sequence and automatically modifies the atomic event sequence, effectively realizes intelligent task planning, and improves planning accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent agent control technology, and more specifically, relates to a method for generating intelligent agent-recognizable structured language. Background Technology

[0002] With the rapid development of artificial intelligence and large language models, intelligent agents (such as autonomous robots, drones, and intelligent vehicles) are increasingly being used in industrial automation, smart logistics, and smart cities. The core capability of intelligent agents relies on efficient and flexible task planning techniques, aiming to achieve autonomous task execution under multiple objectives and constraints through dynamic environmental perception, resource allocation, and decision optimization. However, with the increasing complexity and scale of application scenarios, traditional task planning methods face significant challenges in terms of real-time performance, robustness, and collaborative efficiency, urgently requiring technological innovation to overcome existing bottlenecks.

[0003] Currently, intelligent agent task planning technology is mainly based on two types of methods: traditional rule-driven algorithms and data-driven models.

[0004] Traditional methods, such as state machines and heuristic search, plan task steps through path optimization. These methods rely on manually pre-defined rules and, while stable in structured environments, struggle to adapt to dynamic, open scenarios, such as unexpected obstacles or changes in task objectives. Furthermore, they handle continuous values ​​poorly, ultimately leading to inaccurate task planning. Data-driven models, through deep learning and reinforcement learning, possess environmental adaptability, but suffer from high training costs, insufficient generalization, and poor interpretability, also resulting in low planning accuracy. Summary of the Invention

[0005] In view of the above-mentioned defects or improvement needs of the existing technology, the present invention provides a method for generating intelligent agent-recognizable structured language, the purpose of which is to solve the technical problem that existing intelligent agent task planning technology is difficult to accurately plan user natural language demand tasks.

[0006] To achieve the above objectives, according to one aspect of the present invention, a method for generating intelligent agent-recognizable structured language is provided, comprising: inputting the natural language task requirements input by the current user and external environment state parameters related to the natural language task requirements collected by an external environment detection module into a large model;

[0007] The large model comprises, in sequence: a prompt word concatenation module, a decomposition and planning proxy module, a modification and rewriting proxy module, an atomic event classifier, and an atomic event extraction module; wherein:

[0008] The prompt word splicing module is used to splice the built-in decomposed prompt word template with the natural language task requirements and the external environment state parameters to obtain the initial task prompt word;

[0009] The decomposition planning agent module is used to parse the initial task prompt words to obtain the initial atomic event sequence;

[0010] The modification and rewrite proxy module is used to adjust the initial atomic event sequence according to the built-in modification prompt word template to obtain the rewritten atomic event sequence, and to determine whether the rewritten atomic event sequence meets the preset requirements. If it does not meet the preset requirements, the module continues to adjust the rewritten atomic event sequence according to the modification prompt word template until the final atomic event sequence that meets the preset requirements is obtained.

[0011] The atomic event classifier is used to classify the final atomic event sequence to obtain a classification result;

[0012] The atomic event extraction module is used to extract corresponding event parameters from each atomic event in the final atomic event sequence according to the event template matched by the classification result and convert them into structured text, so that the intelligent agent device corresponding to the natural language task requirement can read and execute the corresponding user requirement task.

[0013] In one embodiment, the prompt word splicing module is used to splice the received natural language task requirements and the external environment state parameters transmitted by the external environment detection module into the corresponding empty parts of the decomposed prompt word template to obtain the initial task prompt word.

[0014] In one embodiment, the decomposition planning agent module is used to decompose the initial task prompt word into a task and plan a sequence of candidate atomic events with a number of samples that meets the preset number of samples, and to verify and select multiple initial atomic events from the candidate atomic event sequences to construct the initial atomic event sequence.

[0015] In one embodiment, the requirements for the final atomic event sequence include: conforming to the atomic event types and parameters specified by the task decomposition prompt, conforming to the natural language description requirements for atomic events specified by the task decomposition prompt, conforming to the triggering conditions for atomic events specified by the task decomposition prompt, and conforming to the requirement of completing user needs or user tasks by satisfying the shortest planning path specified by the decomposition prompt.

[0016] In one embodiment, the final sequence of atomic events includes a series of atomic events {E1, E2, E3, E4…E…} n The atomic event classifier includes a BERT-based encoding layer and a Softmax-based linear classification layer.

[0017] Each event E i The input is fed into a BERT-based coding layer to make it responsive to E. iEach token in (i=1,2,…,n) is encoded, and the encoded result is input into the linear classifier layer to obtain the classification result {C1,C2,C3,C4…C…}. n}

[0018] In one embodiment, the atomic event extraction module is used to extract data from the classification results {C1, C2, C3, C4…C…} n Match the corresponding event template {S1, S2, S3, S4…S} n}, each event template S i Including the event category C corresponding to the template i and parameter sequence P i ; for each atomic event E in the event sequence i and the corresponding event template S i The event template S is input into the atomic event extraction module. i Able to expose atomic events E i The event category, number of parameters, and type, thus from the atomic event E i Extract the corresponding event parameters and convert them into structured text.

[0019] In one embodiment, the event parameters include continuous parameters and discrete parameters;

[0020] The continuous parameters are parameters with continuous values, which are converted into pure numbers and have unified units using the cn2an library; the discrete parameters are parameters with discrete values ​​and a finite number of values, which are classified and quantified using a Bert encoder and a linear classifier.

[0021] According to another aspect of the present invention, a method for executing a user-required task is provided, comprising:

[0022] Structured text is generated using the aforementioned method for generating structured language that can be recognized by an intelligent agent;

[0023] The structured text is input into the intelligent agent device corresponding to the natural language task requirements, so that it can read and execute the corresponding user-required task.

[0024] According to another aspect of the present invention, an electronic device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method for generating an agent-recognizable structured language.

[0025] According to another aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for generating an agent-recognizable structured language.

[0026] In summary, compared with the prior art, the above-described technical solutions conceived by this invention can achieve the following beneficial effects:

[0027] (1) This invention provides a method for generating structured language that can be recognized by an intelligent agent. By inputting the natural language task requirements input by the current user and the external environment state parameters related to the natural language task requirements collected by the external environment detection module into a large model, structured text is finally obtained, which can be read and executed by the intelligent agent device corresponding to the natural language task requirements. It makes full use of prompt word module splicing and context learning, and adopts a combination of large language model and event extraction to generate atomic event sequences and automatically modify them, effectively realizing intelligent task planning and improving the accuracy of task planning.

[0028] (2) The prompt word splicing module of this solution splices the received natural language task requirements and external environment status parameters into the corresponding empty parts of the decomposed prompt word template. This design takes into account that the same task can have different execution steps for different external environment conditions. The advantage is that it can more flexibly refer to the current external environment status and give a more accurate decomposition result in combination with the user's natural language task.

[0029] (3) The decomposition planning agent module described in this scheme decomposes the initial task prompt words and transforms them into candidate atomic event sequences with a number of samples that meet the preset number of samples. It then verifies and selects the initial atomic event sequence from the candidate atomic event sequences. This design takes into account the "illusion" problem of large models. The task decomposition results of a single inference process often have many errors. The advantage is that it can comprehensively consider the results of multiple inferences, so that the generated initial atomic event sequence has fewer errors and can also reduce the burden of subsequent modification and rewriting processes.

[0030] (4) The requirements for the final atomic event sequence described in this scheme include a variety of factors. This design takes into account the "illusion" problem and long context problem of the large model, which makes it difficult for the large model to take into account various precautions, especially the precautions that are not explained in the prompt words. The advantage is that the task requirements and precautions can be clearly defined, which makes the modification and rewriting process of the large model less error-prone.

[0031] (5) The atomic event classifier described in this scheme includes a BERT-based encoding layer and a Softmax-based linear classification layer. This design takes into account that this is the most commonly used and effective classification method at present, and its advantage is to reduce the complexity of task decomposition planning.

[0032] (6) This scheme will divide each atomic event E in the event sequence i and the corresponding event template S iThe event template S is input into the atomic event extraction module. i Able to expose atomic events E i The event category, number of parameters, and type, thus from the atomic event E i Extract the corresponding event parameters and convert them into structured text. This design aims to improve the accuracy of extracting atomic event parameters. The advantage is that the event type of the atomic event is exposed in advance to match the event template, which can improve the accuracy of parameter extraction.

[0033] (7) This scheme converts the parameters into pure numbers and unifies the units by using the cn2an library; the discrete parameters are parameters with discrete values ​​and a limited number of values. The discrete parameters are classified and quantified by using a Bert encoder and a linear classifier; this design takes into account the different processing methods of continuous parameters and discrete parameters. The advantage is that continuous parameters only need to be extracted and converted into pure numbers, without classification, and the processing cost is lower. Attached Figure Description

[0034] Figure 1 This is a logical schematic diagram of a method for generating an agent-recognizable structured language, provided in Embodiment 1 of the present invention. Detailed Implementation

[0035] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0036] Example 1

[0037] This embodiment provides a method for generating structured language recognizable by an intelligent agent, including: inputting the current user's input of a natural language task requirement and external environment state parameters related to the natural language task requirement collected by an external environment detection module into a large model. The large model includes, in sequence, a prompt word concatenation module, a decomposition and planning proxy module, a modification and rewriting proxy module, an atomic event classifier, and an atomic event extraction module. Specifically, the prompt word concatenation module concatenates a built-in decomposition prompt word template with the natural language task requirement and external environment state parameters to obtain initial task prompt words. The decomposition and planning proxy module parses the initial task prompt words to obtain an initial atomic event sequence. The modification and rewriting proxy module adjusts the initial atomic event sequence according to a built-in modification prompt word template to obtain a rewritten atomic event sequence, and determines whether the rewritten atomic event sequence meets preset requirements. If not, it continues to adjust the rewritten atomic event sequence according to the modification prompt word template until a final atomic event sequence that meets the preset requirements is obtained. The atomic event classifier classifies the final atomic event sequence to obtain classification results. The atomic event extraction module is used to extract the corresponding event parameters from each atomic event in the final atomic event sequence according to the event template matched by the classification results and convert them into structured text, so that the intelligent agent device corresponding to the natural language task requirements can read and execute the corresponding user requirement task.

[0038] For example, taking the aforementioned intelligent device as a cooking machine, the corresponding natural language task requirement input by the current user could be "Please make scrambled eggs with tomatoes." The external environment state parameters collected by the external environment detection module could be "Current location: kitchen, ingredients: tomatoes, eggs, equipment: pot, bowl...". The prompt word concatenation module concatenates the built-in decomposed prompt word template with the natural language task requirement and the external environment state parameters to obtain the initial task prompt word, specifically referring to "You are a cooking machine, the recipes you can make are... the precautions for making these dishes are... the current external environment state is... the current user requirement is: Please make scrambled eggs with tomatoes." The decomposed planning proxy module parses the initial task prompt word to obtain the initial atomic event sequence, specifically referring to "1. Wash tomatoes 2. Cut tomatoes 3. Beat eggs 4. Heat oil in a pan 5. Add tomatoes 6. Add eggs 7. Stir-fry 8. Add salt 9. Remove from heat." The modification and rewriting proxy module specifically works by iteratively checking the initial atomic event sequence and performing operations such as insertion, modification, deletion, reordering, and rewriting. The atomic event classifier classifies the final atomic event sequence to obtain a classification result; specifically, it classifies each step of the final atomic event sequence, such as: washing a certain type, putting into a certain type, etc. The atomic event extraction module specifically works by extracting parameters for each atomic event. For example, the classification result of "1. Washing tomatoes" is "washing a certain type" event, and the corresponding event template is matched as "Event category: washing a certain type, parameter: thing". By inputting the atomic event template and atomic event into the atomic event extraction module, the parameters can be extracted, that is, "1. Washing tomatoes" is transformed into "Event category: washing a certain type, thing: tomato".

[0039] For example, the intelligent device can also be a household robot. The corresponding natural language task requirement input by the current user could be "Please wash the dirty clothes." The external environment detection module can collect external environment state parameters such as "Washing machine status: off, clothes status: dirty, clothes location: sofa, your location: coffee table...". The prompt word concatenation module concatenates the built-in decomposed prompt word template with the natural language task requirement and external environment state parameters to obtain the initial task prompt word, specifically "You are a household robot, and the chores you can do are... The precautions for doing these chores are... The current external environment state is... The current user requirement is: Please wash the dirty clothes." The decomposed planning agent module parses the initial task prompt word to obtain the initial atomic event sequence, specifically "1. Move to the sofa 2. Pick up the dirty clothes 3. Move to the washing machine 4. Put down the dirty clothes 5. Move the washing machine 6. Wait for the washing machine to finish 7. Pick up the clean clothes 8. Move to the balcony 9. Hang the clothes to dry." The modification and rewriting agent module specifically works by iteratively checking the initial atomic event sequence and performing operations such as insertion, modification, deletion, reordering, and rewriting. The atomic event classifier classifies the final atomic event sequence to obtain classification results; specifically, it classifies each step of the final atomic event sequence, such as moving to a certain location, picking up a certain type, etc. The atomic event extraction module's specific working process includes extracting parameters for each atomic event. For example, the classification result of "1. Move to the sofa" is "Move to a certain location" event, and the corresponding event template is matched as "Event Category: Move to a certain location, Parameter: Location". By inputting the atomic event template and atomic event into the atomic event extraction module, the parameters can be extracted, thus transforming "1. Move to the sofa" into "Event Category: Move to a certain location, Location: Sofa".

[0040] Figure 1 A flowchart illustrating a method for generating structured language recognizable by an intelligent agent, provided in an embodiment of the present invention. (See also...) Figure 1 The method for generating structured language that can be recognized by intelligent agents includes the following operations: concatenation of prompt words - generation of initial atomic event sequences - rewriting of atomic event sequences - extraction of events to generate structured text.

[0041] In a preferred embodiment, the prompt word splicing module is used to splice the received natural language task requirements and the external environment status parameters transmitted by the external environment detection module into the corresponding empty parts of the decomposed prompt word template to obtain the initial task prompt word.

[0042] In the cue word concatenation operation, the cue word mainly consists of five parts: instruction, global information, initial observation, in-context examples, and user task.

[0043] The guidance information provides an overall description of the scope and domains involved in the planning task, enabling better utilization of the inherent knowledge of the large model. To better generate atomic event sequences, the guidance information specifies the categories of generated atomic events and their matching with the classification categories of subsequent atomic event classifiers. Global information describes the template for each type of atomic event, reducing the diversity of descriptions for the same event and improving the accuracy of subsequent atomic event classification and parameter extraction. In the atomic event template, the position of parameters is marked with "<>", and the text within the brackets describes the parameter type, facilitating the large model to fill in the corresponding parameters when generating atomic events using the event template. Following the atomic event template, the value range of each type of parameter is described. For discrete parameters, parameter options are listed; for continuous parameters, the value range is specified. In addition, the global information describes the triggering conditions for each type of atomic event, especially for atomic events with sequential execution requirements, further reducing the randomness of the large model's generation of atomic event sequences and improving the accuracy of the initial atomic event sequence. The initial environmental state represents the initial external environmental information. Information collected by an external perception module is converted into a dictionary for model task planning, generating atomic event sequences adapted to the external environment. Contextual learning examples demonstrate the application of all atomic event templates through practical cases. By providing different user task examples and the optimal atomic event sequence (Golden Plan), contextual learning examples effectively enable the large model to learn the key points mentioned earlier, including generating atomic events with natural language descriptions using atomic event templates, filling in the required parameters for atomic events with content from user tasks, and the triggering conditions and precautions for each type of atomic event. User tasks are marked with "Task:", and the generated steps are marked with sequence numbers.

[0044] It's worth noting that the context learning examples are also the optimal plan for providing example tasks under a specific initial environmental state. To maintain input simplicity, the initial environmental state of the context learning examples will be consistent with the aforementioned initial environmental state section. The user task will be directly concatenated from the user input. To fully leverage the advantages of context learning, the input user task will be directly concatenated after the new "Task:", facilitating the large model's direct output of the initial atomic event sequence, reducing the generation of other irrelevant content, and improving output simplicity.

[0045] In a preferred embodiment, the decomposition planning agent module is used to decompose the initial task prompt words and transform them into a sequence of candidate atomic events with a number that meets the preset number of samples, and to verify and select multiple initial atomic events from the candidate atomic event sequences to construct the initial atomic event sequence.

[0046] In the initial atomic event sequence generation operation, a decomposition programming proxy module is formed by selecting a base language model and setting its temperature, top-p kernel sampling, and number of samples (N). The proxy model takes the concatenated prompt words as input, outputs N candidate atomic event sequences, and selects the best sequence as the initial atomic event sequence.

[0047] The choice of the base language model affects the knowledge contained in the model itself, which in turn affects the accuracy of subsequent task decomposition and planning. In this method, the GPT-4o model developed by OpenAI is used as the base language model.

[0048] The temperature parameter controls the randomness and creativity of the text. At low temperatures (0.1~0.5), the model generates more conservative and deterministic results, suitable for scenarios requiring factual accuracy and rigorous structure. At high temperatures (0.7~1.0), the model generates more random and creative results, suitable for scenarios requiring creativity. Since the task has been thoroughly described in the prompt word concatenation process, reducing the illusion phenomenon of the proxy model, and considering the possibility of unclear user task parameter descriptions requiring the proxy model to fill in default parameters, the temperature parameter is set to 0.8 in this method.

[0049] Kernel sampling is used to dynamically control the range of subsequent words, balancing diversity and rationality. By setting a probability threshold p, the model samples only from the smallest set of words with a cumulative probability exceeding p, avoiding irrelevant words with low probabilities while preserving diversity. In this method, kernel sampling is set to 0.95.

[0050] The number of samples is used to control the number of times the surrogate model outputs for a single input. By generating and integrating outputs through multiple iterations, the randomness and illusion problems of a single output can be effectively reduced, resulting in a more accurate sequence of initial atomic events. In this method, the number of samples is set to 25, i.e., N=25.

[0051] After configuring the proxy model parameters, the proxy model generates N candidate sequences of initial atomic task sequences by inputting the concatenated prompt words. Since each candidate atomic sequence only meets the requirements to a certain extent—namely, meeting the atomic event types and parameters specified by the task decomposition prompt words, the natural language description requirements for atomic events specified by the task decomposition prompt words, the triggering conditions for atomic events specified by the task decomposition prompt words, and the requirement to complete the user's needs or tasks by following the shortest planning path specified by the task decomposition prompt words—to obtain the optimal sequence by combining the compliant parts of the N candidate atomic sequences, the N candidate atomic sequences are integrated using a multi-way tree, with identical steps at the same level represented by the same node. The proxy model then selects the optimal path from the integrated multi-way tree, which becomes the initial atomic event sequence L0.

[0052] As a preferred implementation, the requirements for the final atomic event sequence include: conforming to the atomic event types and parameters specified in the task decomposition prompts, conforming to the natural language description requirements for atomic events specified in the task decomposition prompts, conforming to the triggering conditions for atomic events specified in the task decomposition prompts, and conforming to the requirement of completing user needs or user tasks by satisfying the shortest planning path specified in the decomposition prompts.

[0053] In the atomic event sequence rewriting operation, the initial atomic event sequence L0 is input into the modification and rewriting agent module. Task sequence modification prompts guide the agent model to modify and rewrite, resulting in a rewritten atomic event sequence. This process is repeated iteratively to obtain new rewritten atomic event sequences until a termination condition is met: either the agent model deems further rewriting unnecessary, or the iteration count reaches a preset value, at which point iteration stops. The last generated rewritten atomic event sequence is taken as the final atomic event sequence L1. The task sequence modification prompts refer to the aforementioned task decomposition prompts and consist of guidance information, global information, initial environment state, user task, and initial atomic sequence. Due to different tasks, the guidance and global information portions of the task sequence modification prompts are modified compared to the task decomposition prompts. The parameter settings of the atomic event modification agent model are consistent with those of the aforementioned decomposition planning agent module.

[0054] In a preferred embodiment, the final atomic event sequence includes a series of atomic events {E1, E2, E3, E4…E...} n The atomic event classifier consists of a BERT-based encoding layer and a Softmax-based linear classification layer. Each event E... i The input is fed into a BERT-based coding layer to make it responsive to E. i Each token in (i=1,2,…,n) is encoded, and the encoded result is input into a linear classifier layer to obtain the classification result {C1,C2,C3,C4…C…}. nFurthermore, the atomic event extraction module is used to extract data from the classification results {C1, C2, C3, C4…C…}. n Match the corresponding event template {S1, S2, S3, S4…S} n}, each event template S i Including the event category C corresponding to the template i and parameter sequence P i Each atomic event E in the event sequence i and the corresponding event template S i Input into the atomic event extraction module. Event template S i Able to expose atomic events E i The event category, number of parameters, and type, thus from the atomic event E i Extract the corresponding event parameters and convert them into structured text.

[0055] In the process of extracting events to generate structured text, the final atomic event sequence L1 includes a series of events {E1, E2, E3, E4…E… n The input is fed into the atomic event classifier to obtain the classification result sequence {C1, C2, C3, C4…C…} n Then, through the classification result sequence {C1, C2, C3, C4…C…} n Match the corresponding event template sequence {S1, S2, S3, S4…S} n}, and combine (E) i ,S i The data is input into the atomic event extraction module, and the output is structured, resulting in the final result R, which includes the event classification result and extraction parameters. i Let i = 1, 2, ..., n. The final result is the structured atomic event types and parameter sequence {R1, R2, R3, R4…R...}. n The atomic event classifier consists of a BERT-based text encoding module and a Softmax-based classification layer, fine-tuned and trained using a training set. The BERT encoder converts the text sequence E of atomic events into... i ={x1…x n Encode it into a context representation vector H, and take the vector h at the [CLS] position. [CLS] As a sentence representation, it is then input into the Softmax classification layer to calculate the category probability distribution, i.e. The category with the highest probability is selected as the classification result C. i , i=1,2,…,n.

[0056] The atomic event extraction module is based on the UIE model fine-tuned after training, and extracts (E) events. i , S iThe UIE uses a structured pattern hint mechanism to first present the event type and its parameter structure S. i Convert to a linearized suggestion template and append it to the input text E i The preceding text serves as the context for the decoder, explicitly guiding the decoding process and improving the accuracy and generalization ability of event parameter extraction.

[0057] The structuring of the extracted results is determined by the properties of the parameters. For continuous parameters, the cn2an library converts them into pure numbers and standardizes the units. For discrete parameters, a BERT encoder combined with a linear classifier is used for classification and quantization. The final result is structured text that the agent can recognize.

[0058] In a preferred implementation, the event parameters include continuous parameters and discrete parameters. Continuous parameters are parameters with a continuous value range, which are converted into pure numbers and standardized in units using the cn2an library. Discrete parameters are parameters with a discrete value range and a finite number of values, which are classified and quantified using a BERT encoder and a linear classifier.

[0059] Example 2

[0060] This embodiment provides a method for executing a user-required task, including: generating structured text using the method for generating structured language recognizable by an agent in Embodiment 1; and inputting the structured text into an agent device corresponding to the natural language task requirement, so that the agent device can read and execute the corresponding user-required task.

[0061] Example 3

[0062] This embodiment provides an electronic device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the method for generating intelligent agent-recognizable structured language in Embodiment 1.

[0063] Example 4

[0064] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the method for generating an agent-recognizable structured language in Embodiment 1.

[0065] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for generating structured language that an intelligent agent can recognize, characterized in that, include: Input the current user's input of the natural language task requirements and the external environment state parameters related to the natural language task requirements collected by the external environment detection module into the large model; The large model comprises, in sequence: a prompt word concatenation module, a decomposition and planning proxy module, a modification and rewriting proxy module, an atomic event classifier, and an atomic event extraction module; wherein: The prompt word splicing module is used to splice the built-in decomposed prompt word template with the natural language task requirements and the external environment state parameters to obtain the initial task prompt word; The decomposition planning agent module is used to parse the initial task prompt words to obtain the initial atomic event sequence; The modification and rewrite proxy module is used to adjust the initial atomic event sequence according to the built-in modification prompt word template to obtain the rewritten atomic event sequence, and to determine whether the rewritten atomic event sequence meets the preset requirements. If it does not meet the preset requirements, the module continues to adjust the rewritten atomic event sequence according to the modification prompt word template until the final atomic event sequence that meets the preset requirements is obtained. The atomic event classifier is used to classify the final atomic event sequence to obtain a classification result; The atomic event extraction module is used to extract corresponding event parameters from each atomic event in the final atomic event sequence according to the event template matched by the classification result and convert them into structured text, so that the intelligent agent device corresponding to the natural language task requirement can read and execute the corresponding user requirement task. The final atomic event sequence includes a series of atomic events {E1, E2, E3, E4…E}. n The atomic event classifier includes a BERT-based encoding layer and a Softmax-based linear classification layer. Each atomic event E i The input is fed into a BERT-based coding layer to make it responsive to atomic events E. i Each token in the algorithm is encoded, and the encoded result is input into the linear classification layer to obtain the classification result {C1, C2, C3, C4…C}. n }; The atomic event extraction module is used to extract data from the classification results {C1, C2, C3, C4…C…}. n Match the corresponding event template {S1, S2, S3, S4…S} n }, each event template S i Including event category C corresponding to the event template i and parameter sequence P i ; for each atomic event E in the event sequence i and the corresponding event template S i The event template S is input into the atomic event extraction module. i Able to expose atomic events E i The event category, number of parameters, and type, thus from the atomic event E i Extract the corresponding event parameters and convert them into structured text.

2. The method for generating intelligent agent-recognizable structured language as described in claim 1, characterized in that, The prompt word splicing module is used to splice the received natural language task requirements and the external environment status parameters transmitted by the external environment detection module into the corresponding empty parts of the decomposed prompt word template to obtain the initial task prompt word.

3. The method for generating intelligent agent-recognizable structured language as described in claim 1, characterized in that, The decomposition planning agent module is used to decompose the initial task prompt words into a task and plan a sequence of candidate atomic events with a number that meets the preset sampling number, and to verify and select multiple initial atomic events from the candidate atomic event sequences to construct the initial atomic event sequence.

4. The method for generating intelligent agent-recognizable structured language as described in claim 3, characterized in that, The preset requirements corresponding to the final atomic event sequence include: conforming to the atomic event types and parameters specified by the task decomposition prompts, conforming to the natural language description requirements for atomic events specified by the task decomposition prompts, conforming to the triggering conditions for atomic events specified by the task decomposition prompts, and conforming to the requirement of completing user needs or user tasks by satisfying the shortest planning path specified by the task decomposition prompts.

5. The method for generating intelligent agent-recognizable structured language as described in claim 1, characterized in that, The event parameters include continuous parameters and discrete parameters; The continuous parameters are parameters with continuous values, which are converted into pure numbers and have unified units using the cn2an library; the discrete parameters are parameters with discrete values ​​and a finite number of values, which are classified and quantified using a Bert encoder and a linear classifier.

6. A method for executing a user-required task, characterized in that, include: Structured text is generated using the method for generating intelligent agent-recognizable structured language as described in any one of claims 1-5; The structured text is input into the intelligent agent device corresponding to the natural language task requirements, so that it can read and execute the corresponding user-required task.

7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method for generating an agent-recognizable structured language according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for generating an agent-recognizable structured language as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Text structuring method and system based on large language model

    CN117349275A

  • Method and device for training biological language model

    CN118898270A