Reply content processing method and apparatus, electronic device, and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MOORE THREADS TECH CO LTD
- Filing Date
- 2023-08-31
- Publication Date
- 2026-07-03
AI Technical Summary
Existing task-oriented dialogue systems struggle to effectively construct logical order and store traceability of response content when generating it, resulting in insufficient accuracy and traceability of the response content.
By generating a directed acyclic graph corresponding to the code sequence, code elements are used to represent response requests, and the logical processing order between nodes is connected in a directed manner. The response content is stored and managed to achieve traceability.
It improves the accuracy and traceability of response content generation and enhances the response content management capabilities of task-oriented dialogue systems.
Smart Images

Figure CN117077790B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of information processing technology, and in particular to a method, apparatus, electronic device, and storage medium for processing response content. Background Technology
[0002] Task-oriented dialogue systems can generate appropriate responses to complete a user-defined task. These systems typically consist of four modules: Natural Language Understanding (NLU), Dialogue Management (DM), and Natural Language Generation (NLG). Responses are generated by sequentially calling these modules. Task-oriented dialogue systems are widely used in human-computer interaction scenarios. Therefore, how to better construct task-oriented dialogue systems and enable them to generate more effective responses is a crucial technical problem that developers urgently need to solve. Summary of the Invention
[0003] This disclosure proposes a technical solution for processing response content.
[0004] According to one aspect of this disclosure, a method for processing response content is provided, the method comprising: acquiring text to be recognized; wherein the text to be recognized is received through speech-to-speech conversion or an electronic device, and is used to represent a current response request; generating a code sequence corresponding to the text to be recognized; wherein the code sequence is a sequence representing the current response request through code elements, the code elements including one or more of categories, functions, and operators; generating and storing a directed acyclic graph corresponding to the code sequence; wherein the directed acyclic graph is used to represent the response content of the current response request corresponding to the text to be recognized.
[0005] In one possible implementation, generating the directed acyclic graph corresponding to the code sequence includes: generating a node corresponding to each category and a node corresponding to each function based on each category and each function in the code sequence; and connecting the corresponding nodes in a directed manner according to the logical processing order between categories and functions, functions and functions, and categories in the code sequence to form the directed acyclic graph corresponding to the code sequence; wherein the connections between nodes in the directed acyclic graph correspond to input parameters passed between nodes.
[0006] In one possible implementation, the node includes: a root node, leaf nodes, and ordinary nodes; wherein, the root node is the node corresponding to the first function in the logical processing order; the leaf node is the node corresponding to the last function in the logical processing order; and the ordinary nodes are all nodes other than the root node and leaf nodes.
[0007] In one possible implementation, generating the directed acyclic graph corresponding to the code sequence further includes: calling the function corresponding to each node from the root node to the leaf node; using the call result corresponding to the leaf node as the result subgraph corresponding to the leaf node; wherein the result subgraph is used to store the generation process of the attribute value of the category corresponding to the leaf node; and saving the result subgraph to the directed acyclic graph.
[0008] In one possible implementation, between the first node and the second node connected in the directed acyclic graph, the first node transmits the target attribute value corresponding to the target category to the second node; wherein, the target attribute value is the attribute value that the first node has not changed in value among at least one attribute value of the target category; and the first node points to the second node.
[0009] In one possible implementation, the processing method further includes: when performing a contextual response content query on the text to be identified, querying the directed acyclic graph corresponding to each text before or after the text to be identified, and using it as the contextual response content corresponding to the text to be identified.
[0010] In one possible implementation, the processing method further includes: when the text to be identified is an update of the target nodes in the target directed acyclic graph, obtaining the target directed acyclic graph and performing any one of the following operations: updating the target nodes in the target directed acyclic graph; or copying the target directed acyclic graph, updating the target nodes in the copied target directed acyclic graph, and using the updated target directed acyclic graph as the directed acyclic graph corresponding to the text to be identified.
[0011] In one possible implementation, the processing method further includes: deleting the directed acyclic graph according to a preset rule if the total number of generated directed acyclic graphs is greater than a preset total number, or if the storage space occupied by the generated directed acyclic graphs is greater than a preset space size.
[0012] In one possible implementation, the text to be identified includes at least one phrase, and the phrase includes at least one entity information; the code sequence corresponding to the text to be identified includes: a function corresponding to each phrase in the at least one phrase, and the function corresponding to each phrase includes a category corresponding to each entity information in the phrase; wherein, the same entity information in different phrases corresponds to the same category, and the phrases in different texts to be identified correspond to the same or different functions.
[0013] In one possible implementation, the processing method further includes: for each function in the code sequence, determining an instance corresponding to at least one category in the function through the application programming interface corresponding to each function or the entity information corresponding to the text to be identified; wherein the instance is a category with at least one attribute value set; and sequentially executing the functions with instances in the code sequence to generate the response content of the current response request.
[0014] In one possible implementation, the category is used to represent the type of entity information in the text, the function is used to represent an operation on the category, and the operator is used to represent a constraint on the category.
[0015] In one possible implementation, generating the code sequence corresponding to the text to be identified includes: obtaining the code sequence corresponding to the text to be identified based on the text to be identified and the trained generative model; wherein the trained generative model is obtained by training the training text and the training code sequence corresponding to the training text, or by training the training text and the training translated text corresponding to the training text; the training translated text is used to represent the content description of the training code sequence corresponding to the training text.
[0016] According to one aspect of this disclosure, a processing apparatus for reply content is provided, the processing apparatus comprising: a text acquisition module for acquiring text to be recognized; wherein the text to be recognized is received through speech-to-speech conversion or an electronic device, and is used to represent a current reply request; a code sequence generation module for generating a code sequence corresponding to the text to be recognized; wherein the code sequence is a sequence representing the current reply request through code elements, the code elements including one or more of categories, functions, and operators; and a graph generation module for generating and storing a directed acyclic graph corresponding to the code sequence; wherein the directed acyclic graph is used to represent the reply content of the current reply request corresponding to the text to be recognized.
[0017] According to one aspect of this disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to perform the method described above.
[0018] According to one aspect of this disclosure, a computer-readable storage medium is provided that stores computer program instructions thereon, which, when executed by a processor, implement the above-described method.
[0019] In this embodiment, the text to be identified can be obtained, and then a code sequence corresponding to the text to be identified can be generated based on the text to be identified. Finally, a directed acyclic graph corresponding to the code sequence is generated and stored. The method for processing response content provided in this embodiment can record the code sequence based on the directed acyclic graph, which is beneficial for tracing the source of the response content.
[0020] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the specification, serve to illustrate the technical solutions of this disclosure.
[0022] Figure 1 A flowchart illustrating a method for processing response content provided in an embodiment of this disclosure is shown.
[0023] Figure 2 A block diagram of a response content processing apparatus provided according to an embodiment of the present disclosure is shown.
[0024] Figure 3 A block diagram of an electronic device provided according to an embodiment of the present disclosure is shown. Detailed Implementation
[0025] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0026] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0027] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0028] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.
[0029] See Figure 1 , Figure 1 A flowchart illustrating a method for processing response content provided in an embodiment of this disclosure is shown, in conjunction with... Figure 1 The processing method includes:
[0030] Step S100: Obtain the text to be recognized. The text to be recognized is obtained through speech conversion or received by an electronic device, and is used to represent the current response request. In one example, the text to be recognized can be manually entered by the user. In another example, step S100 may include: obtaining the speech to be recognized, and then converting the speech to be recognized into text to be recognized. This disclosure supports application scenarios for both text input and voice input. The text to be recognized can be obtained through user input in a text box on the display interface. The speech to be recognized can be obtained through the voice acquisition device of an electronic device in related technologies, and the speech to be recognized can be converted into text to be recognized through recognition models and algorithms in related technologies; this disclosure will not elaborate on these details here.
[0031] Step S200: Generate a code sequence corresponding to the text to be identified. The code sequence is a sequence representing the current response request through code elements, which include one or more of categories (or classes), functions, and operators. In one possible implementation, the text to be identified includes at least one phrase, and each phrase includes at least one entity information. The code sequence corresponding to the text to be identified includes: a function corresponding to each phrase in the at least one phrase, and the function corresponding to each phrase includes a category corresponding to each entity information in that phrase. Different phrases may have the same entity information corresponding to the same category, and different texts may have the same or different functions corresponding to phrases. For example, phrase 1 could be "create a meeting," and phrase 2 could be "change a meeting," so the category corresponding to "meeting" could be the same. Furthermore, different texts to be identified can reuse the same function to achieve a long-tail representation of a large amount of text information with a small number of code elements. In one example, the category represents the type of entity information in the text (the definition of entity information can be found in related technologies), the function represents the operation on the category, and the operator represents the constraint on the category. In other words, the operator gives the category specific content (e.g., attribute values), making it an instance. For example, the above category can be represented as a person category, a datetime category, an event category, etc., corresponding to the types of entity information that may appear in the text. For example, the attributes of the person category may include: surname, given name, contact number, email, etc. By assigning values to each attribute through operators, a specific person instance can be obtained. For example, surname: Li, given name: Er, contact number: 11111, email: 11.com can be a specific person instance, equivalent to entity information in the text. Functions can represent different operations performed on various categories. For example, they can make a phone call to a specific person instance (e.g., by accessing the person instance "Li Er" to obtain "Li Er's" contact number 11111, and then calling the electronic device's call-related API to dial 11111; where API stands for Application Programming Interface), retrieve information about a specific person instance, or retrieve the year of a specific datetime instance. The specific details can be set by the developers according to the actual situation. It should be understood that functions can also be nested to form a complex processing logic. It should be understood that the aforementioned categories, functions, and operators are pre-defined by the developers based on different application scenarios, and the specific structure can be determined by the developers.Taking personal schedule management as an example, in this application scenario, categories can include: `Event` category, representing a schedule, with attributes such as start time, end time, duration, location, and meeting topic; `Person` category, representing attendees, with attributes such as name, email, and phone number; `DateTime` category, representing the start and end times of a schedule, with attributes such as year, month, day, hour, and minute (the start and end times in the `Event` category can be represented by the `DateTime` category; in other words, categories can be nested to achieve multi-level data representation); `Duration` category, representing the duration of a schedule, with attributes such as duration measured in seconds (the duration in the `Event` category can be represented by the `Duration` category); and `Location` category, representing the location of a schedule, with attributes such as location and location description (the location in the `Event` category can be represented by the `Location` category). In this application scenario, functions can include: `CreateEvent` function, used to create a schedule; and `DeleteEvent` function, used to delete a schedule. The `UpdateEvent` function updates the schedule (for an already created schedule). The `RemindEvent` function reminds the user of the schedule. Operators can be used to determine the magnitude of specific parameter values for an instance, the type of attributes within an instance, etc. It should be understood that functions can process categories through operators to achieve their functionality. For example, the `CreateEvent` function can include Event categories (this is just an example; the number of categories that each function can call is determined by the developer based on the actual situation). Then, through constraints in the text to be recognized (such as the `Constraint[Category]` function, which can restrict the attribute values in the category or restrict what category the object to be processed is), values are assigned to the attributes in the Event category (e.g., through operator assignment) to obtain a specific Event instance, which is the schedule created by the `CreateEvent` function. By combining functions, categories, and operators, the code sequence described above can be obtained. For example, if the text to be recognized is "The regular meeting will be held at 8:00 AM today," then the value of the start time attribute in the Event instance of the generated code sequence will be restricted to "8:00 AM," and the value of the meeting topic attribute in the Event instance will be restricted to "regular meeting." It should be understood that the attribute value for each attribute corresponding to each category does not necessarily have a specific numerical value. If there is no restriction description for that attribute in the text to be recognized, then the attribute value can be set to empty.In other words, when users input text to be recognized, they don't need to describe each attribute. For example, "We have a meeting at 8 AM today" doesn't need to be described as "We have a two-hour meeting from 8 AM to 10 AM on the eighth floor." This aligns with users' natural language habits. In other words, users don't need to focus on the specific structure of each instance when inputting text in a real-world scenario. Although the information content of these two statements differs, both can be represented as a code sequence that can be executed correctly. For another example, if the text to be recognized is "Is it hot today?", the corresponding code sequence could include the following function: the IsHot (Is it hot?) function. This function compares the input temperature value with a temperature threshold to determine whether the input temperature is hot or cold. The temperature threshold can be set by the developers according to the actual situation. The temperature value required for the IsHot function is obtained through the WeatherQueryApi (weather query API) function. The WeatherQueryApi function is used to call an external API to input a location instance and a time instance, and output a temperature instance (i.e., the temperature value mentioned above). The location instance required by the WeatherQueryApi function is obtained through the AtPlace (get location) function, and the time instance is obtained through the Today (today) function. The AtPlace function retrieves the location instance mentioned above, such as the current location of the electronic device. The Today function retrieves the time instance mentioned above, such as the current time of the electronic device. The location and time instances called in the functions are the instances corresponding to the location and time categories, and the process of assigning values to these instances is represented by operators.
[0032] In one possible implementation, step S200 may include: obtaining the code sequence corresponding to the text to be recognized based on the text to be recognized and the trained generative model. The trained generative model is obtained by training the training text and the training code sequence corresponding to the training text. In this case, step S200 may include: inputting the text to be recognized into the trained generative model to obtain the code sequence corresponding to the text to be recognized. For example, the training code sequence corresponding to the training text is obtained through annotation by the developer, and the generative model is trained based on this to obtain a generative model that can convert the text to be recognized into a code sequence. It should be understood that the specific model structure and parameter settings of the above-mentioned generative model can be determined according to the actual needs of the developer, and this disclosure embodiment does not impose any limitations. For example, the loss function of the generative model can also be set by the developer. For example, the loss value can be determined based on the difference between the training code sequence and the predicted code sequence generated from the training text. The generative model can use reducing this loss value as its training objective and continuously adjust its model parameters to obtain the trained generative model. The above-mentioned training text may include historical chat information from several real-world scenarios, enabling the life model to generate corresponding code sequences for the text to be recognized in these several real-world scenarios.
[0033] In one possible implementation, the trained generative model is obtained through training text and the corresponding training translated text. The training translated text is used to represent the content description of the training code sequence corresponding to the training text. For example, the training text is human-oriented natural language, the training code sequence is machine-oriented modular language, and the training translated text is a modular natural language that is between the two, both human-oriented and machine-oriented, to establish a connection between the training text and the code sequence. For instance, modular natural language can be represented by translating functions in the code sequence into their natural language representations; for example, the training translated text corresponding to the CreateEvent function is "create schedule," and the training translated text corresponding to the DeleteEvent function is "delete schedule." The training text corresponding to the training translated text "create schedule" could be "meeting," "appointment," etc. Step S200 may include: inputting the text to be recognized into the trained generative model to obtain the translated text corresponding to the text to be recognized. Then, based on the preset correspondence between the code sequence and the translated text, the code sequence corresponding to the translated text is determined as the code sequence corresponding to the text to be identified. For example, the above correspondence can be set by developers according to actual circumstances, and the corresponding code sequence can be determined based on the translated text; this disclosure does not impose any limitations here. In practical scenarios, the naming of functions and classes is usually set by developers and has a certain degree of subjectivity, often including English abbreviations with poor semantic expression. In this case, if the generation model directly predicts the code sequence, the training difficulty will be higher and the accuracy cannot be guaranteed. Therefore, this disclosure establishes a correspondence between the training translated text and the training code sequence (this correspondence can also be understood as a correspondence between the translated text and the code sequence; furthermore, this correspondence can be changed according to actual circumstances. For example, after a function name changes, only the original function name in the correspondence needs to be changed to re-establish the correspondence without retraining the generation model itself, making it more modifiable). The generation model is trained with the goal of predicting the translated text, which not only reduces the training difficulty but also improves the generation accuracy of the final code sequence.
[0034] Continue reading Figure 1 Step S300: Generate and store the directed acyclic graph corresponding to the code sequence. The directed acyclic graph represents the response content of the current response request corresponding to the text to be identified.
[0035] In one possible implementation, the code sequence includes: categories and functions. Step S300 may include: generating a node corresponding to each category and a node corresponding to each function based on each category and each function in the code sequence. Then, according to the logical processing order between categories and functions, functions and functions, and categories in the code sequence, the corresponding nodes are connected in a directed manner to form a directed acyclic graph corresponding to the code sequence. The connections between nodes in the directed acyclic graph correspond to input parameters passed between nodes. For example, the logical processing order can be determined by the nesting relationships between functions, categories, and functions and categories in the code sequence. For instance, the Yield function (the function used to output the result) obtains a cold or hot result through the IsHot function and outputs the response content. The IsHot function obtains the table parameter through the WeatherQueryApi function, compares the temperature value in the table parameter with a temperature threshold, and obtains the cold or hot result. The `WeatherQueryApi` function obtains the `place` parameter through the `AtPlace` function and the `time` parameter through the `Constraint[DateTime]` function. Using the location indicated by the `place` parameter and the time indicated by the `time` parameter, a `table` parameter can be retrieved from the weather-related API. This `table` parameter represents information such as temperature, humidity, and air pollution levels at that location and time. The `Constraint[DateTime]` function generates a time instance for the `Today` category using the `Today` function. If the text to be recognized is "Is today's weather hot?", then the time instance is "Today". The `AtPlace` function generates a location instance for the `Here` category. If the text to be recognized is "Is today's weather hot?", then the location instance is the current location of the electronic device, for example, Shanghai. In this example, each function and each category corresponds to a node. By performing directed connections according to the above logical processing sequence, a directed acyclic graph corresponding to the code sequence can be obtained. The `table`, `place`, and `time` parameters passed between the functions are the input parameters, driving the functions to generate the calculation results sequentially.
[0036] In one possible implementation, the nodes include: a root node, leaf nodes, and ordinary nodes. The root node is the node corresponding to the first function in the logical processing order, the leaf nodes are the nodes corresponding to the last function in the logical processing order, and the ordinary nodes are all nodes except the root node and leaf nodes. Continuing the previous example, if the node corresponding to the Yield function is the first to be called in the logical processing order, then the node corresponding to the Yield function is the root node in the previous example. If the nodes corresponding to the Today and Here functions are the last to be called in the logical processing order, then the Today and Here functions are both leaf nodes. The nodes corresponding to the IsHot, WeatherQueryApi, AtPlace, and Constraint[DateTime] functions are not the first or last called nodes, i.e., they are the other nodes in the previous example. In this case, step S300 may include: calling the function corresponding to each node from the root node to the leaf node, and then using the call result corresponding to the leaf node as the result subgraph corresponding to the leaf node. The result subgraph is used to store the generation process of the attribute values of the category corresponding to the leaf node. Finally, the resulting subgraph is saved to the directed acyclic graph (DAG). Continuing the previous example, the leaf nodes corresponding to the Today and Here functions need to create a "Today" time instance based on the time category and a "Shanghai" location instance based on the location category, respectively. The process of obtaining each instance is as follows: create a category, obtain the specific value of the attribute corresponding to the category, and assign the specific value to the category to obtain the instance corresponding to that category. This embodiment of the disclosure saves the generation process of the attribute value of the category corresponding to the leaf node as a resulting subgraph to the DAG, which can improve the data storage breadth of the DAG and make the functions executed according to the DAG traceable. In one possible implementation, between the first node and the second node connected in the DAG, the first node passes the target attribute value corresponding to the target category to the second node. The target attribute value is the attribute value that the first node has not changed in at least one attribute value for the target category. The first node points to the second node. For example, the node corresponding to the Yield function in the above text can be regarded as the second node, and the node corresponding to the IsHot function can be regarded as the first node. The IsHot function obtains the specific result of "hot" or "not hot" and passes it through to the Yield function to generate the response content. For example, the Yield function can generate answers that are more in line with natural language, such as "not hot today" or "hot today".It should be understood that in this example, the IsHot function can also serve as a second node, with its corresponding first node being the node corresponding to the WeatherQueryApi function. WeatherQueryApi retrieves the table parameter and passes it through to the node corresponding to the IsHot function. The IsHot function compares the temperature value in the table parameter with a temperature threshold to obtain the aforementioned cold or hot result. In other words, a single node can serve as either a first or second node, depending on the connections between nodes; this embodiment does not impose any limitations on this.
[0037] In one possible implementation, the processing method further includes: when performing a contextual response content query on the text to be identified, querying the directed acyclic graph corresponding to each text before or after the text to be identified, and using this as the contextual response content corresponding to the text to be identified. This embodiment of the disclosure can store the response content using a directed acyclic graph, and by saving the directed acyclic graph corresponding to each text, the response content corresponding to each text is traceable. The above-mentioned contextual response content query can be invoked through existing task dialogue systems, which will not be elaborated upon here. For example, it can be used to assist in understanding the text to be identified, modifying the contextual response content, etc.
[0038] In one possible implementation, the processing method further includes: when the text to be identified updates target nodes in a target directed acyclic graph, obtaining the target directed acyclic graph and performing any of the following operations: updating the target nodes in the target directed acyclic graph, or copying the target directed acyclic graph, updating the target nodes in the copied target directed acyclic graph, and using the updated target directed acyclic graph as the directed acyclic graph corresponding to the text to be identified. For example, if it is determined that the text to be identified contains a request to modify the target directed acyclic graph (e.g., determined by a trained machine learning model or by detecting keywords), the target nodes in the target directed acyclic graph can be updated. This method is simpler and faster to implement and does not increase the total number of directed acyclic graphs. Alternatively, the target directed acyclic graph (DAG) can be copied, and the target nodes of the copied DAG can be updated. The updated DAG can then be used as the DAG corresponding to the text to be identified. This method allows for the traceability of each modification. For example, if the first text to be identified is "Going to Shanghai for a meeting today," the second text is "No, still going to Suzhou," and the third text is "No, not going to Suzhou, still the original location," and the meeting location has been modified multiple times in this example, if the changes are made directly on the DAG corresponding to the first text, subsequent modifications by users based on the first text will actually be made on the DAG corresponding to the second text. The "original location" will be discarded when generating the DAG for the second text, resulting in information loss. However, copying the text before modification ensures that information is not lost, improving the traceability of the response content.
[0039] In one possible implementation, before step S100, the processing method may include: acquiring initial recognition text. The initial recognition text represents an initial reply request. The initial recognition text is obtained through speech conversion or received by an electronic device and is used to represent the initial reply request. In one example, the initial recognition text may be manually input by the user. In another example, it may include: acquiring initial recognition speech. Then, the initial recognition speech is converted into initial recognition text. This disclosure supports application scenarios for both text input and voice input. The initial recognition text can be acquired through user input in a text box on the display interface. The initial recognition speech can be acquired through the voice acquisition device of an electronic device in related technologies, and the initial recognition speech can be converted into initial recognition text through recognition models and recognition algorithms in related technologies, which will not be elaborated upon here. Then, a first directed acyclic graph corresponding to the initial recognition text is acquired. The first directed acyclic graph is used to represent the reply content of the reply request corresponding to the initial recognition text and is generated through the code sequence corresponding to the initial recognition text.
[0040] The directed acyclic graph (DAG) is used to represent the response content to a reply request corresponding to the text. The association category represents a category that is related to the initially identified text, which is the text preceding the text to be identified. Exemplarily, the DAG consists of several nodes connected in a logical processing order, with each node corresponding to a function or category. The specific generation method of the association category is not limited in this embodiment. In one example, the association category is a category existing in the code sequence corresponding to the initially identified text, and the processing method further includes any one of the following: using text in the text to be identified that is identical to a preset field as the association category; inputting the text to be identified into an association category detection model; and using the output field as the association category. For example, a rule-based matching algorithm can be used to identify specific text as an associated category when it appears. For example, texts that reference the preceding text, such as "that day" or "that place" (i.e., the reference operation described later), can be identified as an associated category. Alternatively, texts that modify the preceding text, such as "modify to" (i.e., the modification operation described later), can be identified as an associated category. The text after "modify to" can be identified as an associated category (e.g., "10 o'clock" in "modify to 10 o'clock" is an associated category). The associated categories in the text to be identified can also be output by the model (the process of the model outputting associated categories will be described in detail later). This disclosure does not impose any limitations on the embodiments.
[0041] In one possible implementation, step S300 may further include: determining a second directed acyclic graph corresponding to the text to be identified based on the association category between the initial identified text and the text to be identified, and the first directed acyclic graph. The second directed acyclic graph is used to represent the response content of the current response request.
[0042] In one possible implementation, the association category is a category without a defined attribute value. Step S400 may include: matching the association category with each node in the first directed acyclic graph. In one example, matching the association category with each node in the first directed acyclic graph includes: comparing the association category with each node using a preset operator; if the association category and the target node are in the same category, the target node is taken as the successfully matched node. The preset operator may be "=" or "?=" in related technologies. If any node is successfully matched and the operation corresponding to the text to be identified is determined to be a reference operation, the attribute value corresponding to the successfully matched node is taken as the attribute value corresponding to the association category. Here, the reference operation indicates that the text to be identified references the initial identified text. For example, if the text to be identified entered by the user is "How was the weather that day?", and the initial identified text is "Going to a meeting on June 2nd", then the association category in the text to be identified is "that day". If only the text to be recognized is referenced, "that day" is merely a time category, not a time instance; that is, it has no specific attribute value. In other words, the electronic device cannot obtain the specific date of "that day" (i.e., the associated category has no attribute value set, and the operation corresponding to the text to be recognized is a reference operation). In this case, a node query for a time category can be performed on the first directed acyclic graph. If a node corresponding to a time category is found, the attribute value corresponding to that node is used as the attribute value of "that day" in the above text. For example, in the directed acyclic graph corresponding to "going to a meeting on June 2nd," there is a node corresponding to "June 2nd." In this example, "June 2nd" is the node corresponding to the time category, so "June 2nd" can be used as "that day." Exemplarily, the above successful matching can be manifested as the associated category being the same as or having a corresponding relationship with the category corresponding to a node. For example, matching can be performed through input parameters between nodes and / or the category corresponding to the node. As another example, if the associated category is the "person" category, then by searching the nodes in the first directed acyclic graph until a node corresponding to the "person" category is found, it is considered a successful match. The searched "person" category is considered a successfully matched related category. The attribute values corresponding to the searched "person" category (which can be attribute values of the "person" instance corresponding to that category) are assigned to the related category to visualize it, thus completing the referencing operation of the text to be recognized. In another example, if a match fails, a prompt can be generated to inform the user that they need to enter some or all of the attribute values corresponding to the related category. Finally, based on the attribute values corresponding to the related categories and the first code sequence corresponding to the text to be recognized, a second directed acyclic graph is obtained.
[0043] In one possible implementation, the association category is a category with pre-defined attribute values. Obtaining the second directed acyclic graph (DAG) based on at least one initial identified text includes: matching the association category with each node in at least one DAG corresponding to at least one initial identified text; then, if the association category successfully matches any node and the operation corresponding to the text to be identified is determined to be a modification operation, copying the target DAG corresponding to the successfully matched target node in the at least one DAG, where the modification operation indicates that the text to be identified modifies the initial identified text. The attribute values corresponding to the target nodes in the copied target DAG are set to the attribute values corresponding to the association category, thus forming the second DAG. For example, the text to be identified is "Still going to location B" (in this example, "location B" is the association category and is a location category with pre-defined attribute values), the initial identified text is "Going to location A today," and the initial identified text corresponds to a DAG a (i.e., the target DAG mentioned above). The directed acyclic graph (DAG) 'a' is copied to obtain DAG 'b'. The attribute values of the nodes corresponding to "Location A" (i.e., the attribute values corresponding to the target nodes) in DAG 'b' are updated to "Location B" to form the DAG 'Go to Location B'. In this embodiment, when the operation corresponding to the text to be identified is a modification operation, the copied DAG can be modified without changing the corresponding DAG, ensuring that the modification operation does not cause information loss. For example, the information "Location A" in the above example will still be retained. When the user inputs new text to be identified, such as "Never mind, let's go to the previous place," the new text can still find "Location A" and a DAG can be generated based on it. The matching process can be referred to above, and will not be repeated here.
[0044] In one possible implementation, determining the operation corresponding to the text to be identified includes: inputting the text to be identified and the initial identified text into a trained classification model to obtain an operation identifier corresponding to the text to be identified. The trained classification model is trained using the training text and the text preceding it, along with the operation identifier corresponding to the training text. The operation identifier can be any of the following: a reference operation, a modification operation, not a reference operation, not a modification operation, not a reference operation, and a modification operation. Finally, the operation corresponding to the text to be identified is determined based on the operation identifier. Exemplarily, the operation identifier can be obtained by developers through labeling. This disclosure does not limit the model structure or training method of the classification model; developers can set it according to actual conditions. For example, the training text and the text preceding it can be input into the classification model to obtain a predicted operation identifier, and the training objective can be used to reduce the difference between the predicted and predicted operation identifiers to obtain the trained classification model. This disclosure can improve the accuracy of determining the operation corresponding to the text to be identified by using the trained classification model.
[0045] In one possible implementation, the processing method further includes: deleting directed acyclic graphs (DAGs) according to preset rules when the total number of generated DAGs exceeds a preset total number or the storage space occupied by the generated DAGs exceeds a preset space size. For example, the preset rules may include: prioritizing the deletion of DAGs with the earliest generation time after sorting by generation time, or prioritizing the deletion of DAGs with the lowest application frequency after sorting by application frequency, etc. This embodiment does not impose limitations and can be determined by the developer according to actual needs. The specific values of the preset total number and preset space size can also be determined by the developer according to actual needs.
[0046] In one possible implementation, step S300 may include: for each function in the code sequence, determining an instance corresponding to at least one category in the function through the application programming interface corresponding to each function or the entity information corresponding to the text to be identified. The instance is a category with at least one attribute value set. Functions with instances in the code sequence are executed sequentially to generate response content. For example, functions with instances can guide electronic devices to accurately perform corresponding operations so that the functions can achieve the functions predetermined by the developers. For example, "Meeting at 10:00 today" is a function to create a meeting. This function includes a function to query the time "today" (which can call a time query-related application programming interface to generate an instance corresponding to "today" (category is time, attribute values may include year, month, day, hour, etc.)). Here, taking "today" as October 13, 2020 as an example, the function to create a meeting can realize the function of establishing a meeting at 10:00 on October 13, 2020.
[0047] It is understood that the various method embodiments mentioned above in this disclosure can be combined with each other to form combined embodiments without violating the principle and logic. Due to space limitations, this disclosure will not elaborate further. Those skilled in the art will understand that in the above methods of specific implementation, the specific execution order of each step should be determined by its function and possible internal logic.
[0048] In addition, this disclosure also provides electronic devices, computer-readable storage media, and programs, all of which can be used to implement any of the response content processing methods provided in this disclosure. The corresponding technical solutions and descriptions are described in the corresponding descriptions in the method section, and will not be repeated here.
[0049] See Figure 2 , Figure 2 A block diagram of a response content processing apparatus provided according to an embodiment of the present disclosure is shown, in conjunction with... Figure 2 The processing device 100 includes: a text acquisition module 110 for acquiring text to be recognized; wherein the text to be recognized is received through speech conversion or an electronic device and is used to represent a current reply request; a code sequence generation module 120 for generating a code sequence corresponding to the text to be recognized; wherein the code sequence is a sequence representing the current reply request through code elements, and the code elements include one or more of categories, functions, and operators; and a graph generation module 130 for generating and storing a directed acyclic graph corresponding to the code sequence; wherein the directed acyclic graph is used to represent the reply content of the current reply request corresponding to the text to be recognized.
[0050] In one possible implementation, generating the directed acyclic graph corresponding to the code sequence includes: generating a node corresponding to each category and a node corresponding to each function based on each category and each function in the code sequence; and connecting the corresponding nodes in a directed manner according to the logical processing order between categories and functions, functions and functions, and categories in the code sequence to form the directed acyclic graph corresponding to the code sequence; wherein the connections between nodes in the directed acyclic graph correspond to input parameters passed between nodes.
[0051] In one possible implementation, the node includes: a root node, leaf nodes, and ordinary nodes; wherein, the root node is the node corresponding to the first function in the logical processing order; the leaf node is the node corresponding to the last function in the logical processing order; and the ordinary nodes are all nodes other than the root node and leaf nodes.
[0052] In one possible implementation, generating the directed acyclic graph corresponding to the code sequence further includes: calling the function corresponding to each node from the root node to the leaf node; using the call result corresponding to the leaf node as the result subgraph corresponding to the leaf node; wherein the result subgraph is used to store the generation process of the attribute value of the category corresponding to the leaf node; and saving the result subgraph to the directed acyclic graph.
[0053] In one possible implementation, between the first node and the second node connected in the directed acyclic graph, the first node transmits the target attribute value corresponding to the target category to the second node; wherein, the target attribute value is the attribute value that the first node has not changed in value among at least one attribute value of the target category; and the first node points to the second node.
[0054] In one possible implementation, the processing device is further configured to: when performing a contextual response content query on the text to be identified, query the directed acyclic graph corresponding to each text before or after the text to be identified, and use it as the contextual response content corresponding to the text to be identified.
[0055] In one possible implementation, the processing device is further configured to: when the text to be identified is an update of target nodes in a target directed acyclic graph, acquire the target directed acyclic graph and perform any one of the following operations: update the target nodes in the target directed acyclic graph; or copy the target directed acyclic graph, update the target nodes in the copied target directed acyclic graph, and use the updated target directed acyclic graph as the directed acyclic graph corresponding to the text to be identified.
[0056] In one possible implementation, the processing device is further configured to: delete the directed acyclic graph according to a preset rule if the total number of generated directed acyclic graphs is greater than a preset total number, or if the storage space occupied by the generated directed acyclic graphs is greater than a preset space size.
[0057] In one possible implementation, the text to be identified includes at least one phrase, and the phrase includes at least one entity information; the code sequence corresponding to the text to be identified includes: a function corresponding to each phrase in the at least one phrase, and the function corresponding to each phrase includes a category corresponding to each entity information in the phrase; wherein, the same entity information in different phrases corresponds to the same category, and the phrases in different texts to be identified correspond to the same or different functions.
[0058] In one possible implementation, the processing device is further configured to: for each function in the code sequence, determine an instance corresponding to at least one category in the function through the application programming interface corresponding to each function or the entity information corresponding to the text to be identified; wherein the instance is a category with at least one attribute value set; and sequentially execute the functions with instances in the code sequence to generate the response content of the current response request.
[0059] In one possible implementation, the category is used to represent the type of entity information in the text, the function is used to represent an operation on the category, and the operator is used to represent a constraint on the category.
[0060] In one possible implementation, generating the code sequence corresponding to the text to be identified includes: obtaining the code sequence corresponding to the text to be identified based on the text to be identified and the trained generative model; wherein the trained generative model is obtained by training the training text and the training code sequence corresponding to the training text, or by training the training text and the training translated text corresponding to the training text; the training translated text is used to represent the content description of the training code sequence corresponding to the training text.
[0061] This method has a specific technical connection with the internal structure of computer systems and can solve technical problems of how to improve hardware computing efficiency or execution performance (including reducing data storage, reducing data transmission, and increasing hardware processing speed), thereby achieving technical effects that improve the internal performance of computer systems in accordance with natural laws.
[0062] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0063] This disclosure also proposes a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the above-described method. The computer-readable storage medium can be volatile or non-volatile.
[0064] This disclosure also proposes an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the above-described method.
[0065] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the above-described method.
[0066] Electronic devices can be provided as terminal devices, servers, or other forms of devices.
[0067] See Figure 3 As shown, Figure 3 A block diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. For example, the electronic device 1900 may be provided as a server or a terminal device. (Refer to...) Figure 3 The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the methods described above.
[0068] Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input / output interface 1958. Electronic device 1900 can operate on an operating system stored in memory 1932, such as Microsoft Server operating system (Windows Server). TM Apple's graphical user interface-based operating system (Mac OS X) TM ), a multi-user, multi-process computer operating system (Unix) TM Linux is a free and open-source Unix-like operating system. TM ), the open-source Unix-like operating system (FreeBSD) TM (or similar.)
[0069] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions that can be executed by a processing component 1922 of an electronic device 1900 to perform the above-described method.
[0070] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.
[0071] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example, (but not limited to) electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0072] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0073] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0074] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0075] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0076] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0077] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0078] The computer program product can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0079] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0080] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0081] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.
[0082] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for processing reply content, characterized in that, The processing method includes: Obtain the text to be recognized; wherein, the text to be recognized is obtained through speech conversion or received by an electronic device, and is used to represent the current response request; Based on the text to be identified, a code sequence corresponding to the text to be identified is generated; wherein, the code sequence is a sequence that represents the current response request through code elements, and the code elements include one or more of categories, functions, and operators; the category is used to represent the type of entity information in the text, the function is used to represent the operation for the category, and the operator is used to represent the constraint for the category; Generate and store a directed acyclic graph (DAG) corresponding to the code sequence; wherein the DAG is used to represent the response content of the current response request corresponding to the text to be identified; the DAG is constructed by directed connections between categories and functions, functions and functions, and categories in the code sequence according to their logical processing order; the response content of the current response request is generated by sequentially executing functions with instances in the code sequence, wherein the instance is a category with at least one attribute value set.
2. The processing method as described in claim 1, characterized in that, The generation of the directed acyclic graph corresponding to the code sequence includes: Based on each category and each function in the code sequence, generate a node corresponding to each category and a node corresponding to each function; Based on the logical processing order between categories and functions, functions and functions, and categories in the code sequence, the corresponding nodes are connected in a directed manner to form a directed acyclic graph corresponding to the code sequence; wherein, the connections between nodes in the directed acyclic graph correspond to the input parameters passed between the nodes.
3. The processing method as described in claim 2, characterized in that, The nodes include: root node, leaf node, and ordinary node; wherein, the root node is the node corresponding to the first function in the logical processing order; the leaf node is the node corresponding to the last function in the logical processing order; and the ordinary node is the other node excluding the root node and leaf node.
4. The processing method as described in claim 3, characterized in that, The process of generating the directed acyclic graph corresponding to the code sequence further includes: From the root node to the leaf node, call the function corresponding to each node; The call result corresponding to the leaf node is used as the result subgraph corresponding to the leaf node; wherein, the result subgraph is used to store the generation process of the attribute value of the category corresponding to the leaf node; Save the resulting subgraph to the directed acyclic graph.
5. The processing method as described in claim 1, characterized in that, In the directed acyclic graph, between the first node and the second node, the first node transmits the target attribute value corresponding to the target category to the second node; wherein, the target attribute value is the attribute value that the first node has not changed in value among at least one attribute value of the target category; the first node points to the second node.
6. The processing method as described in claim 1, characterized in that, The processing method further includes: when performing a contextual response content query on the text to be identified, querying the directed acyclic graph corresponding to each text before or after the text to be identified, and using it as the contextual response content corresponding to the text to be identified.
7. The processing method as described in claim 1, characterized in that, The processing method further includes: when the text to be identified is an update of the target nodes in the target directed acyclic graph, obtaining the target directed acyclic graph and performing any one of the following operations: updating the target nodes in the target directed acyclic graph; or copying the target directed acyclic graph, updating the target nodes in the copied target directed acyclic graph, and using the updated target directed acyclic graph as the directed acyclic graph corresponding to the text to be identified.
8. The processing method as described in claim 1, characterized in that, The processing method further includes: deleting the directed acyclic graph according to preset rules when the total number of generated directed acyclic graphs is greater than a preset total number, or the storage space occupied by the generated directed acyclic graphs is greater than a preset space size.
9. The processing method as described in claim 1, characterized in that, The text to be identified includes at least one phrase, and the phrase includes at least one entity information; the code sequence corresponding to the text to be identified includes: a function corresponding to each phrase in the at least one phrase, and the function corresponding to each phrase includes a category corresponding to each entity information in the phrase; wherein, the same entity information in different phrases corresponds to the same category, and the phrases in different texts to be identified correspond to the same or different functions.
10. The processing method as described in claim 1, characterized in that, The processing method further includes: For each function in the code sequence, an instance corresponding to at least one category in the function is determined by using the application programming interface corresponding to each function or the entity information corresponding to the text to be identified.
11. The processing method according to any one of claims 1 to 10, characterized in that, The step of generating a code sequence corresponding to the text to be identified includes: obtaining a code sequence corresponding to the text to be identified based on the text to be identified and a trained generative model; wherein the trained generative model is obtained by training the training text and the training code sequence corresponding to the training text, or by training the training text and the training translated text corresponding to the training text; the training translated text is used to represent the content description of the training code sequence corresponding to the training text.
12. A device for processing response content, characterized in that, The processing device includes: The text acquisition module is used to acquire the text to be recognized; wherein, the text to be recognized is obtained through speech conversion or received by an electronic device, and is used to represent the current response request; A code sequence generation module is used to generate a code sequence corresponding to the text to be identified based on the text to be identified; wherein, the code sequence is a sequence that represents the current response request through code elements, and the code elements include one or more of categories, functions, and operators; the categories are used to represent the types of entity information in the text, the functions are used to represent operations on the categories, and the operators are used to represent constraints on the categories; The graph generation module is used to generate and store the directed acyclic graph corresponding to the code sequence; wherein, the directed acyclic graph is used to represent the response content of the current response request corresponding to the text to be identified; the directed acyclic graph is constructed by directed connections between categories and functions, functions and functions, and categories in the code sequence according to the logical processing order; the response content of the current response request is generated by sequentially executing functions with instances in the code sequence, wherein the instance is a category with at least one attribute value set.
13. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method for processing the response content as described in any one of claims 1 to 11.
14. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method for processing the response content as described in any one of claims 1 to 11.
Citation Information
Patent Citations
Code generation method and device
CN112306502A
Automated exchanges of job flow objects between federated area and external storage space
US20190369974A1