Conversational information processing method, system, device, and medium
By segmenting the configuration text of the dialogue flow information and parsing the markup language, the conflict of answer rendering symbols in complex dialogue flows is resolved, realizing a flexible and scalable answer rendering method and improving the user experience.
Patent Information
- Application Number
- CN202210412453.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-19
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-04-19
AI Technical Summary
In existing technologies, the use of special markers in answer rendering in complex dialogue processes leads to symbol conflicts, making it difficult to extend and affecting user experience.
By acquiring the configuration text of the dialogue flow information, segmenting it according to the tags, parsing the information to be rendered, using the parsing results in a markup language to render the answer, and generating the rendering result information.
The symbol conflict issue has been resolved, improving the flexibility and scalability of answer rendering and enhancing the user experience.
Smart Images

Figure CN114780699B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and particularly relates to a dialogue information processing method, system, device and medium. BACKGROUND
[0002] Dialogue answer rendering refers to that in the process of human-computer interaction, part of dialogue process information is referenced to automatically generate the reply information of the robot, and personalized information service is provided for the user. For example, in the dialogue of the robot, the reply of the robot will inevitably involve the reference of some dialogue process information.
[0003] At present, dialogue answer rendering is mainly realized by using special mark symbols, such as special mark symbols such as @, # and %, so as to perform different answer rendering according to the answer rendering mode corresponding to the special mark symbol. However, in a complex dialogue, the sources of dialogue process information are various, such as word slot information and the return result of an external application programming interface (API), and if one special mark symbol is used according to the existing answer rendering mode, it is difficult to realize the answer rendering of different dialogue process information, and the symbol conflict problem is prone to occur. Specifically, the special mark symbol is limited and has poor expandability, and when some characters such as web links and characters other than text forms appear in the rendered answer, the existing symbols are prone to conflict, that is, the symbol conflict problem occurs, the answer rendering cannot be realized, the effect of dialogue answer rendering is affected, and the user experience is reduced. SUMMARY
[0004] Therefore, the present application provides a dialogue information processing method, system, device and medium to solve the problem of answer rendering in a complex dialogue process and improve the flexibility of dialogue answer rendering.
[0005] In a first aspect, an embodiment of the present application provides a dialogue information processing method, comprising:
[0006] obtaining configuration text information corresponding to dialogue process information;
[0007] performing segmentation according to the mark tags in the configuration text information to obtain an information segmentation result;
[0008] if the information segmentation result contains to-be-rendered information, performing analysis on the to-be-rendered information to obtain a markup language analysis result;
[0009] performing answer rendering according to the markup language analysis result to obtain rendering result information corresponding to the information segmentation result;
[0010] based on the rendering result information, outputting an answer rendering result corresponding to the dialogue process information.
[0011] Optionally, the segmentation result based on the obtained information includes:
[0012] If the information segmentation result contains a rendering root node label, then the rendering node label attribute information is extracted from the information segmentation result;
[0013] If the rendering node label attribute information includes rendering type attribute information, then the information segmentation result is determined to include the information to be rendered.
[0014] Optionally, based on the tags in the configured text information, the information segmentation result is obtained, including:
[0015] Determine the tag in the configuration text information;
[0016] If the tag in the configuration text information is the rendering root node tag, then the information is segmented based on the rendering root node tag to obtain at least two information segmentation results.
[0017] Optionally, after obtaining at least two information segmentation results as described above, the method further includes:
[0018] For each information segmentation result, determine whether the information segmentation result contains a rendering root node label;
[0019] If the information segmentation result does not contain the rendering root node label, then the information segmentation result is determined as the result information to be spliced.
[0020] If the information segmentation result contains a rendering root node label, and the rendering node label attribute information extracted from the information segmentation result is text type attribute information, then the string information corresponding to the text type attribute information is extracted from the information segmentation result.
[0021] Specifically, the step of outputting the answer rendering result corresponding to the dialogue flow information based on the rendering result information includes: combining the result information to be concatenated and / or the string information to concatenate the results to obtain a concatenated result; and outputting the concatenated result as the answer rendering result corresponding to the dialogue flow information.
[0022] Optionally, the parsing of the information to be rendered to obtain the markup language parsing result includes:
[0023] Determine the markup language format corresponding to the configuration text information;
[0024] The information to be rendered is parsed according to the markup language format to obtain the markup language parsing result.
[0025] Optionally, according to the answer rendering according to the mark-up language analysis result, the rendering result information corresponding to the information segmentation result is obtained, comprising:
[0026] extracting the to-be-rendered string information corresponding to the target identifier from the mark-up language analysis result;
[0027] extracting the target word slot parameter information corresponding to the to-be-rendered string information from the dialogue flow information;
[0028] performing answer rendering according to the target word slot parameter information in the rendering mode corresponding to the to-be-rendered string information, to obtain an answer rendering result;
[0029] determining the rendering result information corresponding to the information segmentation result based on the answer rendering result.
[0030] In a second aspect, an embodiment of the present application provides a dialogue information processing system, comprising:
[0031] a configuration text information acquisition module configured to acquire configuration text information corresponding to dialogue flow information;
[0032] a text information segmentation module configured to segment according to mark-up tags in the configuration text information to obtain information segmentation result;
[0033] a to-be-rendered information analysis module configured to, when the information segmentation result contains to-be-rendered information, analyze the to-be-rendered information to obtain a mark-up language analysis result;
[0034] an answer rendering module configured to perform answer rendering according to the mark-up language analysis result to obtain rendering result information corresponding to the information segmentation result;
[0035] an answer rendering result output module configured to output an answer rendering result corresponding to the dialogue flow information based on the rendering result information.
[0036] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; the memory is used to store a computer program; the processor is used to execute the program stored on the memory to implement the steps of the dialogue information processing method according to any one of the first aspect.
[0037] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the dialogue information processing method according to any one of the first aspect.
[0038] The embodiment of the application obtains configuration text information corresponding to the dialogue process information, and splits the information according to a mark tag in the configuration text information to obtain an information split result. If the information split result contains to-be-rendered information, the to-be-rendered information is parsed, and then answer rendering is performed according to a mark language parsing result to obtain rendering result information corresponding to the information split result. Therefore, the answer rendering result corresponding to the dialogue process information can be output based on the rendering result information, the answer rendering mode based on semi-structured text is realized, the symbol conflict problem existing in the answer rendering of the prior art using special mark symbols is solved, the symbol conflict can be effectively prevented, the answer rendering flexibility is improved, and the scalability is strong. BRIEF DESCRIPTION OF DRAWINGS
[0039] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative labor.
[0041] Figure 1 is a step flowchart of a dialogue information processing method provided by the embodiment of the application;
[0042] Figure 2 is a step flowchart of a dialogue information processing method provided by an optional embodiment of the application;
[0043] Figure 3 is a schematic diagram of a mark language parsing result in an optional example of the application;
[0044] Figure 4 is a structural block diagram of a dialogue information processing system provided by the embodiment of the application. DETAILED DESCRIPTION
[0045] To make the objectives, technical solutions and advantages of the embodiments of the application clearer, the technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only a part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the protection scope of the application.
[0046] REFERENCE Figure 1, a step flowchart of a dialogue information processing method provided in an embodiment of the present application is shown. Specifically, the dialogue information processing method provided in the present application can specifically include the following steps:
[0047] In step 110, configuration text information corresponding to dialogue flow information is obtained.
[0048] The dialogue flow information can include various dialogue state information in the dialogue flow. For example, in a task-oriented dialogue system, a lot of information such as word slots and parameters can be collected, and the collected information can be displayed to the user as dialogue flow information, so that the user can obtain the dialogue flow information. The configuration text information corresponding to the dialogue flow information can be text information configured according to a preset markup language format. Specifically, the configuration text information can include dialogue information corresponding to different types of markup tags, such as word slot information and parameter information corresponding to a rendering root node tag. The present application does not make specific limitations in this regard.
[0049] In step 120, the information segmentation result is obtained by segmenting the markup tags in the configuration text information.
[0050] Specifically, after obtaining the configuration text information corresponding to the dialogue flow information, the present application can segment the configuration text information according to the markup tags contained in the configuration text information, such as segmenting the configuration text information according to the rendering root node tag in the configuration text information. Thus, two or more information segmentation results can be obtained, so that it can be determined whether answer rendering is needed according to the information segmentation result in the subsequent step, so that it can be determined that answer rendering is needed when the information segmentation result contains to-be-rendered information, i.e., step 130 is executed.
[0051] In step 130, if the information segmentation result contains to-be-rendered information, the to-be-rendered information is parsed to obtain a markup language parsing result.
[0052] Specifically, after determining that a certain information segmentation result contains to-be-rendered information, the present application can parse the to-be-rendered information, such as parsing the to-be-rendered information according to a preset markup language format to obtain a markup language parsing result, so that answer rendering can be performed according to the markup language parsing result in the subsequent step, thereby solving the symbol conflict problem caused by using special markup symbols for answer rendering.
[0053] In step 140, answer rendering is performed according to the markup language parsing result to obtain rendering result information corresponding to the information segmentation result.
[0054] Specifically, in this embodiment of the application, after obtaining the markup language parsing result, the answer can be rendered according to the markup language parsing result. For example, the answer can be rendered according to the rendering method corresponding to the string to be rendered in the markup language parsing result, so that the rendered answer information can be used as the rendering result information corresponding to the information segmentation result, so that the answer rendering result corresponding to the dialogue flow information can be generated according to the rendering result information in the future.
[0055] Step 150: Based on the rendering result information, output the answer rendering result corresponding to the dialogue flow information.
[0056] Specifically, in this embodiment of the application, after obtaining the rendering result information corresponding to each information segmentation result, the results can be spliced together according to the rendering result information corresponding to each information segmentation result to generate the answer rendering result corresponding to the dialogue flow information. Then, the answer rendering result can be output to the user, so that the user can obtain the answer rendering result, realize human-computer interaction, and improve the user experience.
[0057] As an example of this application, the configuration text information corresponding to the obtained dialogue flow information is the input string "Hello, <text> <p case="slot"> <str>name< / str> < / text> In the case of "Mr.", preset tags can be used. <text>< / text> Perform segmentation to include the tags. <text>< / text> The information in this section is determined to be the string to be rendered. For example, after splitting the input string information into 3 segments, that is, after rendering the input string "Hello, <text> <p case="slot"> <str>name< / str> < / text> "Sir" is divided into "Hello," "..." <text><pcase="slot"> <str>name< / str> < / text> After “Sir.”, you can add “ <text><pcase="slot"> <str>name< / str> < / text> This part is determined to be the string to be rendered. If the slot information collected in the dialogue is "name: Zhang San", then according to " <text> <p case="slot"> <str>name< / str> < / text> "This part renders the answer. The rendered answer information "Zhang San" can be used as the rendering result of the second segment after segmentation. Then, the results of each segment can be connected by splicing to get the spliced result "Hello, Mr. Zhang San". The spliced result "Hello, Mr. Zhang San" can be used as the final rendered answer result and output to the user.
[0058] It can be seen that, by acquiring the configuration text information corresponding to the dialogue process information, and performing segmentation according to the mark tags in the configuration text information, the embodiment of the present application can determine the to-be-rendered information according to the information segmentation result, so that when the information segmentation result contains the to-be-rendered information, the to-be-rendered information can be parsed, the answer rendering is performed according to the mark language parsing result, the rendering result information corresponding to the information segmentation result is obtained, and then the answer rendering result corresponding to the dialogue process information can be output based on the rendering result information, human-computer interaction is realized, the answer rendering problem in the complex dialogue process is solved, the symbol conflict problem existing in the answer rendering using special mark symbols in the prior art is solved, the symbol conflict can be effectively prevented, the answer rendering flexibility is improved, and the scalability is strong.
[0059] In actual processing, different dialogue state information can be obtained using a mark language, for example, Extensible Markup Language (XML) can be used to mark different types of dialogue state information in different mark formats. Optionally, based on the above embodiment, the dialogue information processing method provided by the embodiment of the present application can further include, before acquiring the configuration text information corresponding to the dialogue process information, acquiring the dialogue process information, and generating the configuration text information corresponding to the dialogue process information according to a preset mark language format, wherein the configuration text information contains mark tags corresponding to each slot parameter information in the dialogue process information.
[0060] As an example of the embodiment of the present application, the data information collected in the dialogue process can be used as the dialogue process information, and the configuration text information corresponding to the dialogue process information can be generated according to a preset XML. For example, the collected data information is as follows:
[0061] Slot data: name: Zhang San,
[0062] Json format http response data:
[0063]
[0064] By using the dialogue information processing method provided by the present application, the corresponding XML format text information can be generated according to the XML format configured by the user in advance, as follows:
[0065] <text>
[0066] <p case="text"> <str>Hello,< / str>
[0067] <p case="slot"> <str>name< / str> <str>name< / str>
[0068] <p case="text"> <str>The balance is:< / str>
[0069] <p case="params">
[0070] <str>phone / money< / str>
[0071]
[0072] <p case="text"> <str>The last 6 digits of the phone number are:< / str>
[0073] <p case="params">
[0074] <str>phone / num / 1< / str>
[0075] <regex> [0-9]{6}$< / regex>
[0076]
[0077] < / text>
[0078] Subsequently, the generated XML format text information can be determined as the configuration text information corresponding to the dialogue process information, so that the mark tags in the configuration text information can be used for subsequent information segmentation. <text>< / text>The segmentation is performed, and then XML parsing can be performed according to the to-be-rendered information contained in the information segmentation result, so as to perform answer rendering according to a markup language parsing result, so that the rendered result "Hello, Zhang San's balance is: 25.9. The last 6 digits of the mobile phone number are: 567214" is output to the user as the answer rendering result corresponding to the dialogue process information, so that the user can obtain the answer rendering result.
[0079] Specifically, after obtaining the configuration text information corresponding to the dialogue process information, the embodiment of the application can combine the XML tag description in the dialogue scenario, and segment the configuration text information using a preset rendering root node tag to obtain at least two information segmentation results. Further, on the basis of the above embodiment, the embodiment of the application segments the configuration text information according to the markup tag in the configuration text information to obtain the information segmentation result, which can specifically include: determining the markup tag in the configuration text information, and if the markup tag in the configuration text information is a rendering root node tag, segmenting based on the rendering root node tag to obtain at least two information segmentation results. The configuration text information can contain various markup tags in the dialogue scenario, such as various XML tags in the dialogue scenario, and can specifically contain <text>Labels, tag, <str>tag, <regex>The application embodiments are not limited to the tags, and the like. After the configuration text information is acquired, the application embodiments can determine the mark tags in the configuration text information, determine whether each mark tag in the configuration text information is a rendering root node tag, and perform splitting based on the rendering root node tag when the mark tag in the configuration text information is the rendering root node tag. For example, the rendering root node tag is preset as <text>The label time can use the rendering root node <text>The label is cut, and specifically, a cutter can be used <text>< / text> The cutting is performed, and thus two or more information cutting results can be obtained.
[0080] It should be noted that <text>The label can be a root node of all supported answer rendering in this example, and all text that needs to be rendered can be contained in <text>< / text> and <text>The following tags can be contained under the tag:< / text> < / text> < / text> < / text> < / regex> < / str> tag, <str>tag, <regex>The present application is not limited to the above-mentioned examples, and can be applied to various kinds of information recording media such as a label, etc.
[0081] < / regex> < / str> The tag can be used to represent the type and rendering method of a piece of text. Each piece of data configured can contain attribute information in the tag. The case attribute information can be used to determine the text type and rendering method. For example, when the attribute information case is the text attribute information "text", that is, when case="text", it can represent pure text and does not need to be rendered. When the attribute information is the slot attribute information "slot", that is, when case="slot", it can represent that the collected word slot value (such as the word slot value can come from the user query) needs to be replaced, that is, the corresponding word slot key value needs to be configured. When the attribute information is the slot function attribute information "slotNorm", that is, when case="slotNorm", it can represent that the collected normalized word slot (the normalized word slot can come from the word slot normalization result) needs to be replaced, and the corresponding word slot key value needs to be configured. When the attribute information is the parameter attribute information "params", that is, when case="params", it can represent that the received parameter information needs to be replaced, and the parameter path needs to be configured according to the parameter json response format and separated by the symbol " / ". In actual processing, In some embodiments, and The attribute information of the tag can be extended according to specific scenarios, and the tag can be used to replace the string information configured in the tag according to the corresponding word slot key value. The string information configured in the tag can be pure text information; the string information configured in the tag can be word slot key information; the string information configured in the tag can be parameter information; the string information configured in the tag can be a function call result; the string information configured in the tag can be a function call result of a function call result; the string information configured in the tag can be a function call result of a function call result of a function call result; the string information configured in the tag can be a function call result of a function call result of a function call result of a function call result; the string information configured in the tag can be a function call result of a function call result of a function call result of a function call result of a function call result; the string information configured in the tag can be a function call result of a function call result of a function call result of a function call result of a function call result of a function call result; the string information configured in the tag can be a function call result of a function call result of a function call result of a function call result of a function call result of a function call result of a function call result; the string information configured in the tag can be a function call result of a function call result of a function call result of a function call result of a function call result of a function call result of a function call result of a function call result; the string information configured in the tag can be a function call result of a function call result of a function call result of a function call result of a function call result of a function call result of a function call result of a function call result; the string information configured in the tag can be a function call result of a function call result of a function call result of a function call result of a function call result of a function call result of a function call result of a function call result; the string information configured in the tag can be a function call result of a function call result of a function call result of a function call result of a function call result of The following tags can be included under the tag: <str>tag, <regex>The present application is not limited to the above-mentioned examples, and can be applied to various kinds of information recording media such as a label, etc.
[0082] <str>< / str> < / regex> < / str> Different values of the attribute of the tag represent different information, and each piece of data configured can be contained in <str>< / str> for example, in When the attribute value of the tag is a text attribute value, i.e. when case=text, <str>< / str> When the attribute value of the tag is a slot attribute value or a slot function attribute value, i.e. when case = slot or slotNorm, <str>< / str> When the attribute value of the tag is a parameter attribute value, i.e. in case=params, the string information configured in the str> tag can be parameter information in json format, etc., and the present example does not make specific limitation thereto.
[0083] <regex>The tag can be used to support regular extraction of word slots and parameters, and a configured regular expression can be contained in <regex>< / regex>
[0084] In a specific implementation, after a string in XML format is acquired for a dialogue flow, the acquired string can be taken as configuration text information corresponding to the dialogue flow information, and then the configuration text information can be split according to a marker. For example, in combination with the above example, the configuration text information can be split according to <text>The label is cut, and then the cut part to be rendered can be parsed by XML, that is, it is judged in a loop whether each cut result information needs to be rendered, and the part that needs to be rendered can be parsed according to the XML format. When each information cut result contains information to be rendered, the information to be rendered contained in the information cut result is parsed by XML to obtain a markup language parsing result, so that subsequent answer rendering can be performed according to the markup language parsing result.
[0085] Further, the dialogue information processing method provided by the embodiment of the application can further include: judging whether each information cut result contains a preset rendering root node label; if the information cut result contains the rendering root node label, extracting rendering node label attribute information from the information cut result; and if the rendering node label attribute information contains rendering type attribute information, determining that the information cut result contains the information to be rendered.
[0086] Specifically, after cutting based on the preset rendering root node label, the embodiment of the application can judge, for each information cut result, whether the information cut result contains the rendering root node label; so that when a certain information cut result does not contain the rendering root node label, the information cut result is determined as the result information to be spliced, so that the final answer rendering result can be generated by combining the result information to be spliced subsequently; and when the information cut result contains the rendering root node label, the rendering node label attribute information can be extracted from the information cut result, so as to determine the information to be rendered according to the rendering node label attribute information. For example, when the rendering node label attribute information contains the rendering type attribute information, the information cut result is determined to contain the information to be rendered based on the rendering type attribute information; and when the rendering node label attribute information does not contain the rendering type attribute information, such as when the rendering node label attribute information is text type attribute information, it is determined that the information cut result does not contain the information to be rendered, and the string information corresponding to the text type attribute information can be extracted from the information cut result based on the text type attribute information, so that the final answer rendering result can be generated by combining the string information subsequently.
[0087] Further, the dialogue information processing method provided by the embodiment of the present application can further include: determining, for each information segmentation result, whether the information segmentation result contains the rendering root node label; if the information segmentation result does not contain the rendering root node label, determining the information segmentation result as the to-be-spliced result information; if the information segmentation result contains the rendering root node label and the rendering node label attribute information extracted from the information segmentation result is text type attribute information, extracting the string information corresponding to the text type attribute information from the information segmentation result. Optionally, the embodiment of the present application outputs the answer rendering result corresponding to the dialogue flow information based on the rendering result information, and specifically can include: performing result splicing based on the rendering result information, in combination with the to-be-spliced result information and / or the string information, to obtain a splicing result; and outputting the splicing result as the answer rendering result corresponding to the dialogue flow information.
[0088] Referring to , a step flowchart of a dialogue information processing method provided by an optional embodiment of the present application is shown. In actual processing, the dialogue information processing method provided by the embodiment of the present application can be applied in a dialogue scene, for example, can be applied in a dialogue scene of human-computer interaction, and specifically can include the following steps:
[0089] Step 201, obtaining dialogue flow information;
[0090] Step 202, generating configuration text information corresponding to the dialogue flow information according to a preset markup language format, the configuration text information containing markup labels corresponding to various word slot parameter information in the dialogue flow information;
[0091] Step 203, obtaining configuration text information corresponding to the dialogue flow information;
[0092] Step 204, determining markup labels in the configuration text information;
[0093] Step 205, if the markup label in the configuration text information is the rendering root node label, performing segmentation based on the rendering root node label to obtain at least two information segmentation results;
[0094] Step 206, determining, for each information segmentation result, whether the information segmentation result contains the rendering root node label;
[0095] Step 207, if the information segmentation result does not contain the rendering root node label, determining the information segmentation result as to-be-spliced result information;
[0096] Step 208, if the information segmentation result contains a rendering root node label, extracting rendering node label attribute information from the information segmentation result;
[0097] Step 209, if the rendering node label attribute information extracted from the information segmentation result is text type attribute information, extracting string information corresponding to the text type attribute information from the information segmentation result;
[0098] Step 210, if the rendering node label attribute information contains rendering type attribute information, determining that the information segmentation result contains the information to be rendered;
[0099] Step 211, parsing the information to be rendered according to a preset markup language format to obtain a markup language parsing result;
[0100] Step 212, rendering an answer according to the markup language parsing result to obtain rendering result information corresponding to the information segmentation result;
[0101] Step 213, based on the rendering result information, combining the result splicing information and / or the string information to obtain a splicing result;
[0102] Step 214, outputting the splicing result as an answer rendering result corresponding to the dialogue flow information.
[0103] Specifically, after obtaining the dialogue flow information, the embodiment of the present application can generate configuration text information corresponding to the dialogue flow information according to a preset markup language format, such as generating XML format text information corresponding to the dialogue flow information according to the preset markup language format, so as to serve as configuration text information corresponding to the dialogue flow information, so that the configuration text information can contain markup labels corresponding to each word slot parameter information in the dialogue flow information, such as containing <text>< / text> < / text> < / regex> tag, <str>tag, <regex>The application is not limited to tags and the like.
[0104] Subsequently, the marked tags in the configuration text information corresponding to the dialogue flow information can be segmented, and it can be determined through a loop whether each information segmentation result contains a rendering root node tag, to determine whether the information segmentation result needs to be rendered, and to analyze the part that needs to be rendered, so that the rendering of the answer can be performed based on the analysis result, and the answer rendering mode based on semi-structured text is realized.
[0105] Specifically, after obtaining the configuration text information corresponding to the dialogue flow information, the application can determine the marked tags in the configuration text information, determine whether each marked tag in the configuration text information is a rendering root node tag, so that when the marked tag in the configuration text information is a rendering root node tag, step 205 is executed to segment based on the rendering root node tag to obtain an information segmentation result. For example, the rendering root node tag in the preset XML format is <text>In the case of the tag, the tag <text>< / text> In the case of the tag, the tag <text>< / text> < / text> < / regex> < / str> <p case="slot"> <str>< / str> < / text> The three segments "Hello," "Mr." and "Sir" are segmented, that is, three information segmentation results are obtained. <text> <p case="slot"> <str>< / str> < / text>
[0106] Then, for each information segmentation result, step 206 is performed to determine whether the rendering root node tag is contained in each information segmentation result, so that when it is determined that the rendering root node tag is not contained in a certain information segmentation result, step 207 is performed to determine the information segmentation result as to-be-spliced result information. For example, in combination with the above example, the first information segmentation result "Hello," and the third information segmentation result "Sir" do not contain the rendering root node tag <text>< / text> Therefore, the first information segmentation result "Hello," and the third information segmentation result "Sir" can be determined as to-be-spliced result information. When it is determined that the rendering root node is contained in a certain information segmentation result, step 208 is performed to extract the rendering node tag attribute information from the information segmentation result. For example, in combination with the above example, when it is determined that the second information segmentation result "Mr." <text> <p case="slot"> <str>< / str> < / text> contains the rendering root node tag <text>< / text> Therefore, the first information segmentation result "Hello," and the third information segmentation result "Sir" can be determined as to-be-spliced result information. When it is determined that the rendering root node is contained in a certain information segmentation result, step 208 is performed to extract the rendering node tag attribute information from the information segmentation result. For example, in combination with the above example, when it is determined that the second information segmentation result "Mr." <text> <p case="slot"> <str>< / str> < / text> extract the case attribute information as the rendering node label attribute information, and then determine whether the extracted rendering node label attribute information is text type attribute information to further determine whether the information segmentation result contains the information to be rendered. If the label attribute information of the rendering node is text type attribute information, that is, when the information segmentation result contains the rendering root node label and the label attribute information of the rendering node is text type attribute information, such as when case = "text", step 209 can be performed to extract the string information corresponding to the text type attribute information from the information segmentation result, and the information segmentation result does not need to be rendered. If the rendering node attribute information is not text type attribute information, such as when case = "slotNorm" or case = "params", it can be determined that the rendering node attribute information contains rendering type attribute information, and then step 210 can be performed to determine that the information segmentation result contains information to be rendered, and then steps 211 and 212 are performed to parse the information to be rendered in the information segmentation result according to the preset markup language format, and render the answer according to the markup language parsing result to obtain the rendering result information corresponding to the information segmentation result.
[0107] After obtaining the rendering result information corresponding to all information segmentation results, step 213 can be performed using all the rendering result information to combine the result splicing information determined in step 207 and / or the string information extracted in step 209 to perform result splicing, so that the splicing result can be obtained, and the splicing result can be output to the user as the answer rendering result corresponding to the current obtained dialogue flow information, that is, step 214 is performed to realize human-computer interaction.
[0108] It can be seen that, after obtaining at least two segmentation results, the application embodiment can determine whether information contained in the rendering root node label exists in each information segmentation result. If the information contained in the rendering root node label exists, the rendering node label attribute information in the information segmentation result is extracted, and it is determined whether the extracted rendering node label attribute information is text type attribute information, so as to determine whether the rendering node label attribute information contains rendering type attribute information, so that when the rendering node label attribute information contains rendering type attribute information such as slot attribute information "slot", slot function attribute information "slotNorm", parameter attribute information "params", etc., such as when case="slot", case="slotNorm", or case="params", it is determined that the information segmentation result is determined as the information to be rendered. Subsequently, the information to be rendered can be parsed to perform answer rendering according to the markup language parsing result, thereby realizing an answer rendering mode based on semi-structured text, thereby solving the symbol conflict problem caused by the limitation of special mark symbols in the prior art, effectively preventing symbol conflict, improving answer rendering flexibility, and having strong expansibility.
[0109] Further, the application embodiment performs answer rendering according to the markup language parsing result to obtain the rendering result information corresponding to the information segmentation result, which can specifically include the following sub-steps:
[0110] Sub-step 2121, extracting the to-be-rendered string information corresponding to the target identifier from the markup language parsing result;
[0111] Sub-step 2122, extracting the target slot parameter information corresponding to the to-be-rendered string information from the dialogue flow information;
[0112] Sub-step 2123, performing answer rendering using the target slot parameter information according to the rendering mode corresponding to the to-be-rendered string information to obtain an answer rendering result;
[0113] Sub-step 2124, determining the rendering result information corresponding to the information segmentation result based on the answer rendering result.
[0114] In a specific implementation, the character corresponding to the rendering type attribute information can be used as a target identifier. After obtaining the markup language parsing result, the string information corresponding to the target identifier is extracted from the markup language parsing result according to the target identifier, so as to be used as to-be-rendered string information. As an optional example of the application, when the markup language parsing result is as follows In the case shown, the character "slot" and the character "params" can be taken as target identifiers, so that the string "name" can be extracted from the markup language parsing result as the to-be-rendered string information corresponding to the target identifier "slot" based on the target identifier "slot", and the string "phone / money" can be extracted from the markup language parsing result as the to-be-rendered string information corresponding to the target identifier "params" based on the target identifier "params".
[0115] After the target slot parameter information corresponding to the to-be-rendered string information is extracted from the dialogue flow information, the rendering mode corresponding to the to-be-rendered string information can be determined based on the target identifier, so that the answer is rendered using the target slot parameter information in accordance with the rendering mode corresponding to the to-be-rendered string information, so that the rendering result information corresponding to the information segmentation result can be determined based on the answer rendering result. For example, in combination with the above optional example, in the case where the target slot parameter information corresponding to the to-be-rendered string "name" extracted from the dialogue flow information is "name": "Zhang San", and the target slot parameter information corresponding to the to-be-rendered string "phone / money" is "money": 25.9, the rendering mode corresponding to the to-be-rendered string "name" can be determined based on the target identifier "slot", so that the answer is rendered using the target slot parameter information "name": "Zhang San" in accordance with the rendering mode corresponding to the to-be-rendered string "name", and the rendering mode corresponding to the to-be-rendered string "phone / money" is determined based on the target identifier "params", so that the answer is rendered using the target slot parameter information "money": 25.9 in accordance with the rendering mode corresponding to the to-be-rendered string "phone / money", so that the first answer rendering result "Zhang San" and the second rendering answer result "25.9" are combined with the string information "Hello," and the string information "The balance is:" to obtain the splicing result "Hello, Zhang San's balance is: 25.9", and output to the user, so that the user can know that the balance of Zhang San is 25.9.
[0116] In summary, the embodiment of the present application obtains configuration text information corresponding to the dialogue process information, and judges whether the configuration text information contains a rendering root node label, so as to split the configuration text information according to the rendering root node label. Then, the information splitting result can be judged, so that when the information splitting result does not contain the rendering root node, it is directly determined as the result to be spliced, and when the information splitting result contains the rendering root node, the attribute information of the rendering root node label is judged. Thus, when the attribute information of the rendering root node label in the information splitting result is text type attribute information, the string information corresponding to the text type attribute information can be extracted, so that the string information can be combined for result splicing in the subsequent process, and the string information does not need to be rendered. When the attribute information of the rendering root node label in the information splitting result contains rendering type attribute information, it can be determined that the information splitting result contains information to be rendered. Then, the information to be rendered can be parsed according to the mark language format, so that the answer rendering is performed according to the mark language parsing result. Then, based on the rendering result information, the result to be spliced and / or the extracted string information can be combined for result splicing, and the answer rendering result corresponding to the dialogue process information is output, so as to realize the answer rendering mode based on semi-structured text, solve the symbol conflict problem existing in the answer rendering of the prior art using special mark symbols, effectively prevent symbol conflict, improve the answer rendering flexibility, and have strong scalability.
[0117] Further, the embodiment of the present application also provides a dialogue information processing system, as shown in the following table: As shown in the table, the dialogue information processing system 400 provided by the embodiment of the present application can include the following modules:
[0118] The configuration text information obtaining module 410 is configured to obtain configuration text information corresponding to the dialogue process information.
[0119] The text information splitting module 420 is configured to split according to the mark label in the configuration text information to obtain an information splitting result.
[0120] The information to be rendered parsing module 430 is configured to parse the information to be rendered to obtain a mark language parsing result when the information splitting result contains the information to be rendered.
[0121] The answer rendering module 440 is configured to perform answer rendering according to the mark language parsing result to obtain rendering result information corresponding to the information splitting result.
[0122] The answer rendering result output module 450 is configured to output the answer rendering result corresponding to the dialogue process information based on the rendering result information.
[0123] Optionally, the text information splitting module 420 includes the following sub-modules:
[0124] marker tag determination submodule: configured to determine a marker tag in the configuration text information;
[0125] information segmentation result acquisition submodule: configured to, when the marker tag in the configuration text information is the rendering root node tag, perform segmentation based on the rendering root node tag to obtain at least two information segmentation results.
[0126] Optionally, the text information segmentation module 420 further includes the following submodules:
[0127] rendering node tag attribute information extraction submodule: configured to, when the information segmentation result contains the rendering root node tag, extract rendering node tag attribute information from the information segmentation result;
[0128] to-be-rendered information determination submodule: configured to, when the rendering node tag attribute information contains the rendering type attribute information, determine that the information segmentation result contains the to-be-rendered information.
[0129] Optionally, the text information segmentation module 420 further includes the following submodules:
[0130] rendering root node tag determination submodule: configured to, for each information segmentation result, determine whether the information segmentation result contains the rendering root node tag;
[0131] to-be-spliced result information determination submodule: configured to, when the information segmentation result does not contain the rendering root node tag, determine the information segmentation result as to-be-spliced result information;
[0132] string information determination submodule: configured to, when the information segmentation result contains the rendering root node tag and the rendering node tag attribute information extracted from the information segmentation result is text type attribute information, extract string information corresponding to the text type attribute information from the information segmentation result;
[0133] Optionally, the to-be-rendered information analysis module 430 includes the following submodules:
[0134] language analysis submodule: configured to analyze the to-be-rendered information according to the markup language format to obtain the markup language analysis result.
[0135] Optionally, the answer rendering module 440 includes the following submodules:
[0136] to-be-rendered string information extraction submodule: configured to extract to-be-rendered string information corresponding to a target identifier from the markup language analysis result;
[0137] The target word slot parameter information extraction submodule is configured to extract target word slot parameter information corresponding to the to-be-rendered string information from the dialogue flow information.
[0138] The answer rendering result obtaining submodule is configured to perform answer rendering on the target word slot parameter information according to a rendering mode corresponding to the to-be-rendered string information, to obtain an answer rendering result.
[0139] The rendering result information determination submodule is configured to determine rendering result information corresponding to the information segmentation result based on the answer rendering result.
[0140] Optionally, the answer rendering result output module 450 can include the following submodules:
[0141] The splicing submodule is configured to perform result splicing based on the rendering result information, in combination with the to-be-spliced result information and / or the string information, to obtain a splicing result.
[0142] The output submodule is configured to output the splicing result as an answer rendering result corresponding to the dialogue flow information.
[0143] It should be noted that the dialogue information processing system provided in the foregoing embodiments can perform the dialogue information processing method provided in any of the embodiments of the present application, and has the corresponding functions and advantages of performing the method.
[0144] Further, the embodiments of the present application also provide an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; the memory is used to store a computer program; the processor is used to execute the program stored on the memory, to implement the steps of the dialogue information processing method provided in any one of the method embodiments.
[0145] In addition, the embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the dialogue information processing method provided in any one of the method embodiments.
[0146] It should be noted that each of the embodiments in the present specification adopts a progressive description manner, and each embodiment mainly describes the differences from other embodiments, and the same and similar parts of each embodiment can be referred to each other. For the system, device and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
[0147] In this document, relational terms such as "first" and "second", and the like can be used solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0148] The preceding description is considered that of the preferred embodiments only, modifications of which will occur to those skilled in the art upon reading this disclosure without departing from the spirit or scope of the application. Therefore, it is understood that this application is not to be limited to the specific examples set forth herein as the embodiments, but rather only by the claims and their equivalents.
Claims
1. A method for processing dialogue information, characterized in that, include: Retrieve the configuration text information corresponding to the dialogue flow information; The information is segmented based on the tags in the configured text information to obtain the information segmentation result; If the information segmentation result contains information to be rendered, then the information to be rendered is parsed to obtain the markup language parsing result; The answer is rendered based on the parsing results of the markup language to obtain the rendering result information corresponding to the information segmentation result; Based on the rendering result information, output the answer rendering result corresponding to the dialogue flow information; The step of parsing the information to be rendered to obtain the markup language parsing result includes: The information to be rendered is parsed according to a preset markup language format to obtain the markup language parsing result; The step of rendering the answer based on the parsing result of the markup language to obtain the rendering result information corresponding to the information segmentation result includes: Extract the string information to be rendered corresponding to the target identifier from the markup language parsing results; Extract the target slot parameter information corresponding to the string information to be rendered from the dialogue flow information; According to the rendering method corresponding to the string information to be rendered, the answer is rendered using the target slot parameter information to obtain the answer rendering result; Based on the answer rendering result, determine the rendering result information corresponding to the information segmentation result; After obtaining the information segmentation results, the process also includes: If the information segmentation result contains a rendering root node label, then the rendering node label attribute information is extracted from the information segmentation result; If the rendering node label attribute information includes rendering type attribute information, then it is determined that the information segmentation result includes the information to be rendered; The segmentation based on the tags in the configured text information to obtain the information segmentation result includes: Determine the tag in the configuration text information; If the tag in the configuration text information is the rendering root node tag, then the information is segmented based on the rendering root node tag to obtain at least two information segmentation results; After obtaining at least two information segmentation results, the process also includes: For each information segmentation result, determine whether the information segmentation result contains a rendering root node label; If the information segmentation result does not contain the rendering root node label, then the information segmentation result is determined as the result information to be spliced. If the information segmentation result contains a rendering root node label, and the rendering node label attribute information extracted from the information segmentation result is text type attribute information, then the string information corresponding to the text type attribute information is extracted from the information segmentation result. Specifically, the step of outputting the answer rendering result corresponding to the dialogue flow information based on the rendering result information includes: combining the result information to be concatenated and / or the string information to concatenate the results to obtain a concatenated result; and outputting the concatenated result as the answer rendering result corresponding to the dialogue flow information.
2. The dialogue information processing method according to claim 1, characterized in that, Before obtaining the configuration text information corresponding to the dialogue flow information, the method further includes: Obtain dialogue flow information; Based on a preset markup language format, configuration text information corresponding to the dialogue flow information is generated, and the configuration text information includes tag labels corresponding to each slot parameter information in the dialogue flow information.
3. A dialogue information processing system, characterized in that, include: The configuration text information acquisition module is used to acquire the configuration text information corresponding to the dialogue flow information; The text information segmentation module is used to segment the text information according to the tags in the configured text information to obtain the information segmentation result; The information to be rendered parsing module is used to parse the information to be rendered when the information segmentation result contains information to be rendered, and obtain the markup language parsing result; The answer rendering module is used to render the answer based on the parsing result of the markup language, and obtain the rendering result information corresponding to the information segmentation result; The answer rendering result output module is used to output the answer rendering result corresponding to the dialogue flow information based on the rendering result information; The step of parsing the information to be rendered to obtain the markup language parsing result includes: The information to be rendered is parsed according to a preset markup language format to obtain the markup language parsing result; The step of rendering the answer based on the parsing result of the markup language to obtain the rendering result information corresponding to the information segmentation result includes: Extract the string information to be rendered corresponding to the target identifier from the markup language parsing results; Extract the target slot parameter information corresponding to the string information to be rendered from the dialogue flow information; According to the rendering method corresponding to the string information to be rendered, the answer is rendered using the target slot parameter information to obtain the answer rendering result; Based on the answer rendering result, determine the rendering result information corresponding to the information segmentation result; After obtaining the information segmentation result, if the information segmentation result contains a rendering root node label, then the rendering node label attribute information is extracted from the information segmentation result. If the rendering node label attribute information includes rendering type attribute information, then it is determined that the information segmentation result includes the information to be rendered; The segmentation based on the tags in the configured text information to obtain the information segmentation result includes: Determine the tag in the configuration text information; If the tag in the configuration text information is the rendering root node tag, then the information is segmented based on the rendering root node tag to obtain at least two information segmentation results; After obtaining at least two information segmentation results, for each information segmentation result, it is determined whether the information segmentation result contains a rendering root node label; If the information segmentation result does not contain the rendering root node label, then the information segmentation result is determined as the result information to be spliced. If the information segmentation result contains a rendering root node label, and the rendering node label attribute information extracted from the information segmentation result is text type attribute information, then the string information corresponding to the text type attribute information is extracted from the information segmentation result. Specifically, the step of outputting the answer rendering result corresponding to the dialogue flow information based on the rendering result information includes: combining the result information to be concatenated and / or the string information to concatenate the results to obtain a concatenated result; and outputting the concatenated result as the answer rendering result corresponding to the dialogue flow information.
4. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the steps of the dialogue information processing method according to any one of claims 1-2.
5. 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 dialogue information processing method as described in any one of claims 1-2.
Citation Information
Patent Citations
Answer monitoring method and device
CN113742462A