Customer service mail generation method and system based on slot state machine and storage medium
Patent Information
- Application Number
- CN202611324291.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]现有的客服邮件生成系统中,直接采用大语言模型单轮生成客服回复,信息收集流程容易跳步或者重复,遗漏必要信息,另一方面,当客户在同一会话中切换到新问题时,旧问题的处理进度会被错误继承,容易造成信息串扰和进程错乱,无法实现高效协调的人机交互
[0015]本申请提出的一个或多个技术方案,至少具有以下技术效果:通过接收用户请求,得到意图信息和输入内容,通过输入内容确定第一问题标识和历史记录确定第二问题标识,在第一问题标识和第二问题标识匹配时,将历史会话状态继承到用户请求,既能保证不会遗漏前序轮次已收集的信息,又能避免不同问题之间错误地共享处理状态,另外,从用户会话状态和用户请求提取并归一化处理为槽位标准值,通过槽位标准值与槽位预设值的比对结果,确定步骤信息,系统通过槽位标准值和槽位预设值的对齐状态,确定信息收集流程的步骤,减少重复询问的同时防止关键信息缺失,最后生成客服邮件;通过这种客服邮件生成方法,达到了相关的历史信息能跨问题复用和防止关键信息缺失的效果,实现了高效协调的人机交互。
Smart Images

Figure CN122970064A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, system and storage medium for generating customer service emails based on a slot state machine. Background Technology
[0002] With the deepening application of artificial intelligence in the field of human-computer interaction, task-oriented dialogue systems have been widely deployed in all aspects of society. Their core demand is to achieve specific business goals efficiently through human-computer collaboration, while taking into account the convenience and naturalness of the interaction process, thus becoming a key technical support for improving service efficiency and user experience.
[0003] In existing customer service email generation systems, customer service replies are generated in a single round using a large language model. This can lead to skipping or repetitive steps in the information collection process, resulting in the omission of necessary information. Furthermore, when a customer switches to a new question within the same conversation, the processing progress of the old question is incorrectly inherited, which can easily cause information interference and process disorder, making it impossible to achieve efficient and coordinated human-computer interaction. Summary of the Invention
[0004] The main purpose of this application is to provide a customer service email generation method, system, and storage medium based on slot state machine, so as to achieve efficient and coordinated human-computer interaction.
[0005] In a first aspect, embodiments of this application provide a customer service email generation method based on a slot state machine, comprising: Receive a user request and parse the user request to obtain intent information and input content; Obtain the session identifier associated with the user request, and load the history record and historical session status based on the session identifier; wherein, the historical session status includes processing status information associated with a specific issue; A first problem identifier is determined based on the input content, and a second problem identifier is determined based on the historical records. When the first problem identifier and the second problem identifier match, the processing status information is inherited to the user request to obtain the current session status. The corresponding target processing flow device is determined based on the intent information; The target processing flow controller extracts slot information from the current session state and the user request. The slot information is normalized to obtain the slot standard value, and the step information is determined based on the comparison result between the slot standard value and the slot preset value. The customer service email is generated by combining the step information, the slot information, and the user request with the prompt word template of the target processing flow device and inputting them into the language model.
[0006] In some embodiments, the historical session state further includes historical general state information, and before determining the first issue identifier based on the input content, it further includes: Based on the input, determine the current general status information; When the current general status information is empty, the historical general status information is inherited to the user general status information requested by the user. Update the current session state based on the user's general status information.
[0007] In some embodiments, after the steps of determining a first problem identifier based on the input content and determining a second problem identifier based on the historical records, the method further includes: When the first issue identifier and the second issue identifier do not match, reset the history record and the history session state.
[0008] In some embodiments, determining the corresponding target processing flow unit based on the intent information includes: The business process is determined using the intent information and the relationship mapping table; Based on the business process, determine the target processing flow unit corresponding to the business process.
[0009] In some embodiments, determining the step information based on the comparison result between the slot standard value and the slot preset value includes: The step information is obtained based on the comparison between the standard value of the slot and the preset value of the slot; Based on the step information, output an instruction to request the user to supplement the missing information; In response to missing information input by the user, update the step information.
[0010] In some embodiments, the step of combining the step information, the slot information, and the user request with the prompt word template of the target processor and inputting them into a language model to generate a customer service email includes: The target prompt word is obtained by combining the step information, the slot information, and the user request with the prompt word template of the target processing flow device; The target prompt word is input into the language model so that the language model can infer the email content based on the target prompt word and generate the customer service email.
[0011] In some embodiments, the method further includes: The language model is updated based on the intent information and the target cue words.
[0012] In some embodiments, the target processing flow includes a manual processing module, and after generating the customer service email, it further includes: When the customer service email is parsed and a transfer-to-human identifier is obtained, a request instruction indicating that transfer to human service is required is sent to the human processing module. Once the decision to transfer to human assistance is approved according to the rules, a request instruction indicating that a transfer to human assistance is required is sent to the human assistance processing module.
[0013] Secondly, embodiments of this application provide a customer service email generation system based on a slot state machine, comprising: a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.
[0014] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.
[0015] The one or more technical solutions proposed in this application have at least the following technical effects: By receiving user requests, obtaining intent information and input content, determining a first question identifier and a second question identifier based on the input content and historical records, and inheriting the historical session state to the user request when the first and second question identifiers match, it ensures that information collected in previous rounds is not missed and avoids erroneous sharing of processing states between different questions. In addition, the user session state and user request are extracted and normalized into slot standard values. By comparing the slot standard values with the slot preset values, the step information is determined. The system determines the steps of the information collection process based on the alignment of the slot standard values and the slot preset values, reducing repeated inquiries and preventing the loss of key information. Finally, a customer service email is generated. Through this customer service email generation method, the relevant historical information can be reused across questions and the loss of key information is prevented, achieving efficient and coordinated human-computer interaction.
[0016] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the description, claims and drawings. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the first embodiment of the customer service email generation method based on a slot state machine in this application. Figure 2This is an optional flowchart in the first embodiment of the customer service email generation method based on slot state machine of this application, before determining the first issue identifier based on the input content; Figure 3 This is an optional flowchart in the first embodiment of the customer service email generation method based on slot state machine of this application, after determining the first problem identifier based on the input content and the second problem identifier based on the historical record; Figure 4 This is an optional flowchart of step S104 in the first embodiment of the customer service email generation method based on slot state machine of this application; Figure 5 This is an optional flowchart of step S106 in the first embodiment of the customer service email generation method based on slot state machine of this application; Figure 6 This is an optional flowchart of step S107 in the first embodiment of the customer service email generation method based on slot state machine of this application; Figure 7 This is an optional flowchart in the first embodiment of the customer service email generation method based on slot state machine of this application, after the language model performs email content reasoning on target prompt words to generate customer service emails; Figure 8 This is an optional flowchart after generating a customer service email in the first embodiment of the slot state machine-based customer service email generation method of this application; Figure 9 This is a schematic diagram of the customer service email generation system based on a slot state machine, as described in an embodiment of this application. Figure 10 This is a schematic diagram of the device structure of the hardware operating environment involved in the customer service email generation method based on slot state machine in the embodiments of this application. Detailed Implementation
[0018] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0019] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0020] The main solution of this application embodiment is as follows: By receiving a user request, intent information and input content are obtained. A first problem identifier is determined based on the input content, and a second problem identifier is determined based on historical records. When the first and second problem identifiers match, the historical session state is inherited into the user request. This ensures that information collected in previous rounds is not missed and avoids incorrect sharing of processing states between different problems. In addition, the user session state and user request are extracted and normalized into slot standard values. The step information is determined by comparing the slot standard values with the slot preset values. The system determines the steps of the information collection process based on the alignment of the slot standard values and the slot preset values, reducing repeated inquiries and preventing the loss of key information. Finally, a customer service email is generated. Through this customer service email generation method, the relevant historical information can be reused across problems and the loss of key information is prevented, achieving efficient and coordinated human-computer interaction.
[0021] With the deepening application of artificial intelligence in the field of human-computer interaction, task-oriented dialogue systems have been widely deployed in all aspects of society. Their core demand is to achieve specific business goals efficiently through human-computer collaboration, while taking into account the convenience and naturalness of the interaction process, thus becoming a key technical support for improving service efficiency and user experience.
[0022] Because existing customer service email generation systems directly use large language models to generate customer service replies in a single round, the information collection process is prone to skipping steps or repeating, resulting in the omission of necessary information. On the other hand, when a customer switches to a new question in the same session, the processing progress of the old question will be incorrectly inherited, which can easily cause information interference and process disorder, making it impossible to achieve efficient and coordinated human-computer interaction.
[0023] Therefore, this application provides a solution that receives user requests, obtains intent information and input content, determines a first problem identifier based on the input content and a second problem identifier based on historical records, inherits the historical session state to the user request when the first and second problem identifiers match, extracts and normalizes the user session state and user request into slot standard values, determines step information based on the comparison between the slot standard values and slot preset values, determines the steps of the information collection process based on the alignment status of the slot standard values and slot preset values, and finally generates a customer service email. This customer service email generation method achieves the effect of reusing relevant historical information across problems and preventing the loss of key information, realizing efficient and coordinated human-computer interaction.
[0024] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of implementing the above functions, such as a customer service email generation system based on a slot state machine. The following description uses a customer service email generation system based on a slot state machine as an example to illustrate this embodiment and the subsequent embodiments.
[0025] Based on this, the present application provides a customer service email generation method, system and storage medium based on slot state machine, which will be specifically described through the following embodiments.
[0026] Reference Figure 1 As shown, Figure 1 The flowchart provided in the first embodiment of the customer service email generation method based on slot state machine in this application may include, but is not limited to, steps S101 to S107.
[0027] Step S101: Receive user request, parse user request to obtain intent information and input content.
[0028] Specifically, the customer service email generation system receives user requests through front-end interactive interfaces such as web chat windows, email client plugins, and ticket system entry points. User input has no fixed format restrictions and can include explicit intent commands or vague expressions. The system then parses the user's input using a large language model to obtain relevant fields such as intent information, model number, content, language, and session identifiers.
[0029] The input content obtained from the parsing step is not limited to a simple truncation of the customer's original message; it can also be text that has undergone slight normalization. Slight normalization includes removing irrelevant interjections, standardizing full-width and half-width punctuation, and merging consecutive spaces, while preserving the original expression of core semantic information and key entities such as model numbers and order numbers.
[0030] Step S102: Obtain the session identifier associated with the user request, and load the history record and historical session status according to the session identifier; wherein, the historical session status includes the processing status information associated with the specific issue.
[0031] Specifically, the user request received by the customer service email generation system may or may not contain a session identifier field. When the request contains a valid session identifier, the system directly adopts that value. After determining the session identifier, the system uses that identifier as the query key to retrieve historical data associated with that session from the session storage layer.
[0032] In some embodiments of this application, when the session identifier field in the request is in a default state, such as missing, empty string, or null, the system generates a globally unique session number for the request. This number can be generated based on a UUID algorithm, a timestamp plus a random number, an auto-incrementing sequence in the database, or any other numbering mechanism that guarantees global uniqueness. This ensures that each request can be assigned to a specific session context, allowing the first round of requests and subsequent rounds of requests to share a unified data structure within the system.
[0033] It should be noted that the session number is generated based on the UUID algorithm. The system calls a cryptographically secure random number generator or an entropy source provided by the operating system to generate 128 bits of random data. The version number and variant bits are inserted into the 128 bits of random data, and then it is formatted into a standard string to finally form the UUID string. The random space of UUID provides about 2^122 (about 5.3 × 10^36) possible values, making the probability of two independently generated UUIDs colliding mathematically negligible.
[0034] It's important to note that there's a fundamental difference between processing status information associated with specific issues and general information in historical session states. General information, such as model number and order number, is reusable across issues; the model number usually remains the same even when the same customer inquires about different issues within the same session. However, processing status information, such as whether troubleshooting was performed and the results, is strongly issue-specific. For example, if a customer has received troubleshooting guidance for a paper jam issue with model X30, it doesn't mean they've received guidance for a black line printing issue with model Y50.
[0035] Step S103: Determine the first problem identifier based on the input content, determine the second problem identifier based on the history record, and when the first problem identifier and the second problem identifier match, inherit the processing status information to the user request to obtain the current session status.
[0036] It should be noted that the system calculates an identifier that can uniquely identify the "specific problem currently being processed" based on the input content of the current round, and uses it as the first problem identifier.
[0037] In some embodiments of this application, the first problem identifier is formed by concatenating intent information and product model. For example, if the intent information is "quality troubleshooting" and the product model is X30, then the first problem identifier is "quality troubleshooting_X30". In another specific implementation, if the product model is missing, the first problem identifier consists only of intent information, or a placeholder is used to replace the missing model part, such as "quality troubleshooting_not provided".
[0038] It should be noted that the system extracts the problem identifiers that have been processed in previous rounds from the loaded history records and uses them as the second problem identifier.
[0039] In some embodiments of this application, if the historical session state records the problem identifier of the previous round of processing as "Quality Troubleshooting_X30", then this value is extracted as the second problem identifier. In another specific implementation, the system traverses a longer historical interaction record, collects all problem identifiers that have appeared, and forms a historical problem identifier set to support cross-round repetition suppression determination.
[0040] Specifically, the system matches the first issue identifier with the second issue identifier. This matching can be an exact string equality comparison or a normalized comparison. When a match is successful, it indicates that the issue addressed by the current request is consistent with the issues handled in the past. Therefore, the processing state information from the historical session state can be safely inherited into the current request, merging to form the current session state.
[0041] Step S104: Determine the corresponding target processing flow device based on the intent information.
[0042] In some embodiments of this application, after determining the target business process, the system selects the corresponding process processor through a mapping table of business process names to process processor instances. The corresponding process processor instance is retrieved from the mapping table, and the current session state and user request are passed to that processor.
[0043] Step S105: Extract slot information from the current session state and user request through the target processing flow controller.
[0044] It's important to note that slot extraction doesn't blindly scrape every possible field from user requests; instead, it strictly adheres to the slot configuration of the target processing flow. Each process processor declares all the slots and their attributes required for the process in its definition, including slot name, slot type, whether it's required, normalization rules, and alignment of preset conditions. The slot configuration is statically maintained as part of the process processor, and the slot name and controlled values are defined by a unified slot constant as a single data source, ensuring consistency in the value criteria used for judgments at each stage.
[0045] It should be noted that the system uses the merged current session state and user requests as data sources to extract the original value of each slot declared in the slot configuration one by one. The extraction process follows this priority order: first, extract the original value of the slot from the user requests of the current round; if no value is provided in the current round or the value is invalid, then read the inherited value of the slot from the current session state; if neither has a valid value, the original value of the slot is marked as empty. In the specific implementation, the extraction action can be completed through information extraction from a large language model, or through regular expressions, rule parsers, or direct mapping of front-end structured fields.
[0046] Step S106: Normalize the slot information to obtain the slot standard value, and determine the step information based on the comparison result between the slot standard value and the slot preset value.
[0047] It should be noted that the extracted slot information is the raw slot value, which may vary significantly in format, expression, and granularity. For example, user inputs such as "yes," "correct," "not bad," and "right" all express affirmative semantics, but they are not the same at the string level; user inputs such as "X30," "x30," "X 30," and "model is X30" all point to the same product model, but their formats differ. If the system directly uses these raw values for step transition determination, the same semantic state will trigger different transition paths due to different expressions, thus compromising the determinism of the state machine.
[0048] It should be noted that the normalization rule uses a unified slot constant definition as a single data source, which is strictly aligned with the target value mapped to the request parameters.
[0049] In some embodiments of this application, the normalization process follows these rules: When the original value of a slot is empty, missing, null, or an invalid placeholder such as "unknown", "don't know", or "none", it is uniformly normalized to "not provided". When the original value of the slot belongs to the set of affirmative semantics such as "yes", "true", "yes", "1", "correct", "yes", "have", "provided", etc., it is normalized to a Boolean truth value or a unified affirmative standard value. When the original value of the slot belongs to the set of negative semantics such as "no", "false", "no", "0", "incorrect", "not available", "not provided", etc., it is normalized to a Boolean false value or a unified negative standard value. For non-Boolean slots such as model number and order number, the full-width characters in the original value are converted to half-width characters, the case is unified, extra spaces and prefix modifiers are removed, and the core value is extracted and retained as a controlled enumeration value. For example, "X 30" is normalized to "X30", and "order number: 20231015001" is normalized to "20231015001".
[0050] In some embodiments of this application, after obtaining the standard value of each slot, the system compares the standard value with the preset value of the slot in the process processor to determine the current step information. The step information is the current step node identifier in the finite state machine, which determines what operation the system will perform next.
[0051] Step S107: Combine the step information, slot information, and user request with the prompt word template of the target processing flow device and input them into the language model to generate a customer service email.
[0052] It should be noted that after determining the step information, the system selects the corresponding prompt word template from the template configuration of the target processing flow controller and assembles it. The assembly process involves filling the above data sources according to the placeholder layout of the template to form a complete prompt word text. During the filling process, the slot information is injected in the form of standard values to ensure that the information received by the language model is consistent and unambiguous.
[0053] In some embodiments of this application, if the current step triggers a knowledge retrieval action, such as providing troubleshooting guidance triggering a troubleshooting knowledge base retrieval, the retrieved reference template content is also used as one of the data sources and appended to the user prompt word area, enabling the language model to generate response content based on the structure and terminology of the reference template. If the current step does not trigger knowledge retrieval, the reference template content is empty, and the system does not inject any redundant context.
[0054] In some embodiments of this application, the assembled complete prompt words are submitted as input to the language model. The language model generates the customer service email body that meets business requirements based on the system instructions and user data context in the prompt words. The content generated by the language model can be directly used as the final email output, or it can undergo post-processing steps such as sensitive word filtering, format validation, and character count control before being sent.
[0055] It is important to emphasize that step-by-step information ensures consistency between email content and business progress stages; slot information ensures accurate referencing of customer information within the email; original content from user requests ensures the email aligns with customer needs; and reference templates ensure the accuracy and standardization of professional guidance content within the email. Through the unified assembly of prompt word templates, multi-source information enables the language model to generate emails with both contextual coherence and accurate expression under business rule constraints.
[0056] Reference Figure 2 As shown, Figure 2 This is an optional flowchart in the first embodiment of the customer service email generation method based on slot state machine of this application, before determining the first problem identifier according to the input content. The method for inheriting historical general state information may include, but is not limited to, steps S201 to S203.
[0057] Step S201: Determine the current general status information based on the input content; It should be noted that the slot value of the general status information corresponding to the general slot refers to context information that is unrelated to the specific problem intent and can be reused across problems in the same session.
[0058] In some embodiments of this application, the general slots include at least: product model, order number, image / video evidence, purchase date, and shipping address. A common characteristic of this information is that once a customer provides this information during a session, its validity remains unchanged regardless of subsequent changes in the questions asked.
[0059] It should be noted that the process of determining the current general state information can be performed based on the semantic understanding of a large language model, or it can be performed based on regular expressions, dictionary matching, or direct mapping of front-end structured fields.
[0060] Step S202: When the current general state information is empty, inherit the historical general state information to the user general state information requested by the user; It should be noted that after extracting the general status information for the current round, the system checks the current value of each general slot one by one. When the current value of a general slot is empty, meaning the customer did not provide information for that slot in the current round's message, the slot meets the inheritance trigger condition. At this time, the system searches for the historical valid value of that slot in the historical session state. If a valid value exists, it is inherited into the user's general status information for the current round.
[0061] In some embodiments of this application, when the current value of a general slot is not empty, meaning the customer actively provided the information in the current round, inheritance is not performed, and the latest value provided by the customer in the current round is used. Furthermore, when the value of the slot is also empty or does not exist in the historical session state, there is no content to inherit, and the slot remains empty in the final merge state, and will be marked as "not provided" during subsequent normalization processing.
[0062] Step S203: Update the current session state based on the user's general state information.
[0063] It should be noted that the user general state information refers to the merged result formed after the aforementioned extraction and inheritance operations. This merged result contains general slot values from two sources: one is the new value directly extracted from the user input in the current round; the other is the old value that is missing in the current round but has been inherited from the historical session state.
[0064] In some embodiments of this application, the system iterates through each general slot involved in the current round and writes the value of the slot in the user's general state information into the corresponding slot in the current session state; for general slots that are not provided in the current round but have been inherited from the historical state, the value in the current session state is consistent with the historical value; for general slots that are not provided in the current round and have no inherited value in the history, the slot in the current session state remains empty.
[0065] It should be noted that when the same customer asks different questions in the same session, the model information provided in an earlier round remains valid in subsequent rounds, and the customer should not be required to enter it again. This inheritance mechanism is designed based on this semantic feature, automatically completing the missing general information in the current round within the system, reducing the customer's input burden, while ensuring the integrity of the slot status on which subsequent steps depend.
[0066] In some embodiments, the first problem identifier and the second problem identifier do not match, see reference Figure 3 As shown, Figure 3 This is an optional flowchart in the first embodiment of the customer service email generation method based on slot state machine of this application, after determining the first problem identifier based on the input content and determining the second problem identifier based on the historical record. The method may include, but is not limited to, steps S301 to S302.
[0067] Step S301: Determine the first problem identifier based on the input content, and determine the second problem identifier based on the historical records.
[0068] It should be noted that the system calculates an identifier that can uniquely identify the "specific problem currently being processed" based on the input content of the current round, and uses it as the first problem identifier.
[0069] In some embodiments of this application, the first problem identifier is formed by concatenating intent information and product model. For example, if the intent information is "quality troubleshooting" and the product model is X30, then the first problem identifier is "quality troubleshooting_X30". In another specific implementation, if the product model is missing, the first problem identifier consists only of intent information, or a placeholder is used to replace the missing model part, such as "quality troubleshooting_not provided".
[0070] It should be noted that the system extracts the problem identifiers that have been processed in previous rounds from the loaded history records and uses them as the second problem identifier.
[0071] In some embodiments of this application, if the historical session state records the problem identifier of the previous round of processing as "Quality Troubleshooting_X30", then this value is extracted as the second problem identifier. In another specific implementation, the system traverses a longer historical interaction record, collects all problem identifiers that have appeared, and forms a historical problem identifier set to support cross-round repetition suppression determination.
[0072] Step S302: When the first problem identifier and the second problem identifier do not match, reset the history and history session state.
[0073] It should be noted that after determining the first issue identifier and extracting the second issue identifier, the system performs a matching comparison between the two. The matching comparison can be based on equality checks of normalized strings or on inclusion checks of the issue identifier set. When the comparison result is a mismatch, it indicates that the issue inquired by the customer in the current round is not the same issue addressed in a previous session.
[0074] In some embodiments of this application, the customer's initial inquiry is "X30 has black lines printed," and the second issue is identified as "Quality Troubleshooting_X30." However, in subsequent inquiries, the customer may inquire about "Y50 failing to power on," in which case the first issue is identified as "Quality Troubleshooting_Y50." The two issue identifiers are mismatched due to the different model numbers, triggering a reset operation.
[0075] It's important to emphasize that this reset operation is not a complete clear. The reset operation targets both historical records and historical session states. For historical records, the system removes them from the current round's valid context, preventing them from being injected into the current round's prompt word assembly and thus avoiding confusion for the language model due to outdated dialogue contexts. For historical session states, the system clears all processing status information bound to old questions—that is, the slot values of the question slots—restoring the current round's question slots to their initial default state.
[0076] It should be noted that when a problem switch occurs, the progress of handling the old problem, such as whether troubleshooting has been guided or failure has been confirmed, should not be incorrectly applied to the new problem. If a reset is not performed, the system may mistakenly assume that the customer has already received troubleshooting guidance for the Y50 problem, thus skipping the step of providing troubleshooting guidance and directly proceeding to the step of confirming the troubleshooting results, leading to confusion in business logic and a deterioration in customer experience.
[0077] Reference Figure 4 As shown, Figure 4 This is an optional flowchart of step S104 in the first embodiment of the customer service email generation method based on slot state machine of this application. The method may include, but is not limited to, steps S401 to S402.
[0078] Step S401: Determine the business process through intent information and relationship mapping table.
[0079] In some embodiments of this application, the relationship mapping table covers hundreds of secondary intents, mapping each secondary intent to one of the primary business processes such as quality troubleshooting, quality without troubleshooting, returns, logistics, invoice request / modification, address modification, order cancellation, price promotion, transfer to human assistance, and general consultation.
[0080] In some embodiments of this application, the system uses intent information as the query key and performs a lookup operation in the relational mapping table. The lookup operation follows a hierarchical matching strategy: the first priority is exact matching, which compares the intent information with each key in the mapping table for complete string equality; when an exact match fails, an inclusive fuzzy match is performed to determine whether there is a substring inclusion relationship between the intent information and the mapping table key; when the inclusive fuzzy match still fails, the system uses "general consultation" as a fallback business process. Once the target business process is determined, the system completes the routing decision from "intent" to "process," and subsequent steps will select the corresponding process processor to perform processing based on this decision.
[0081] Step S402: Based on the business process, determine the target processing flow device corresponding to the business process.
[0082] In some embodiments of this application, after determining the target business process, the system selects the corresponding process processor through a unified scheduler. The scheduler maintains a mapping table between business process names and process processor instances. Each process processor is an independently deployed processing module, internally encapsulating the finite state machine definition, slot configuration, prompt word template, and knowledge base binding relationship specific to that business process. Based on the routing results, the scheduler retrieves the corresponding process processor instance from the mapping table and passes the current session state and user request to the processor, which then performs subsequent slot extraction, normalization, and step determination operations.
[0083] Reference Figure 5 As shown, Figure 5 This is an optional flowchart of step S106 in the first embodiment of the customer service email generation method based on slot state machine of this application. The method may include, but is not limited to, steps S501 to S503.
[0084] Step S501: Obtain step information based on the comparison results between the standard value and the preset value of the slot.
[0085] It should be noted that the system iterates through the set of step migration rules for the current process processor, compares the set of standard values for the slots in the current round with the preset value conditions for the slots in each rule, and when all the conditions of a rule are met, the target step corresponding to that rule is the current step information.
[0086] It should be noted that the comparison is a deterministic equivalence judgment and does not involve fuzzy matching or similarity calculation. When all the conditions of a rule are met, the target step corresponding to that rule is the information for the current step.
[0087] Step S502: Based on the step information, output an instruction to request the user to supplement the missing information.
[0088] In some embodiments of this application, when the system determines that the current step is a "request type" step, it means that the step migration rule has detected that the standard value of one or more slots is "not provided", and the business logic requires the system to request this missing information from the user in order to continue the process.
[0089] In some embodiments of this application, when the step information is "request product model", the system needs to ask the user to supplement the product model; when the step information is "request order number and image / video evidence", the system needs to ask the user to supplement the order number and evidence materials at the same time.
[0090] It should be noted that the output instruction can be in a structured form, such as a data object containing a list of missing slots, or in natural language form, such as a short instruction text. This output instruction is passed to the prompt assembly stage as the filling content for placeholders such as "current step goal" or "information to be requested from the customer" in the prompt template, guiding the language model to generate a customer service email body that conforms to the semantics of the step.
[0091] Step S503: In response to missing information input by the user, update the step information.
[0092] In some embodiments of this application, the system determines, through step-by-step analysis, that it is currently in a "request type" step, such as "requesting product model" or "requesting order number and image / video evidence," and sends an email to the customer requesting supplementary information. After receiving the email, the customer replies with the requested missing information in subsequent rounds. At this point, the system needs to re-evaluate the current step based on the newly provided information from the customer, updating the step information from a "request type" step to the next target step in the business process.
[0093] In some embodiments of this application, the original value of the corresponding slot is extracted from the missing information input by the customer in the current round, and the original value is updated to the corresponding slot in the current session state; the updated slot value is normalized to obtain the slot standard value; the updated slot standard value set is compared with the step migration rule set of the current process processor; the new step information is determined according to the comparison result, and the step update is completed.
[0094] Reference Figure 6 As shown, Figure 6 This is an optional flowchart of step S107 in the first embodiment of the customer service email generation method based on slot state machine of this application. The method may include, but is not limited to, steps S601 to S602.
[0095] Step S601: Combine the step information, slot information, and user request with the prompt word template of the target processing flow to obtain the target prompt word.
[0096] It should be noted that the prompt template consists of two parts: a system prompt template and a user prompt template. The system prompt template carries control instructions such as role positioning, step objectives, and output specifications; the user prompt template carries the specific data context, which the language model uses to generate the email body. Placeholders in the template mark the injection locations of each data source; the assembly operation is the process of replacing these placeholders with actual data.
[0097] Step S602: Input the target prompt words into the language model so that the language model can infer the email content based on the target prompt words and generate a customer service email.
[0098] It should be noted that email content reasoning refers to the cognitive process in which the language model does not mechanically fill in the template during the generation process, but rather understands, selects, and organizes based on the semantic information in the prompt words.
[0099] In some embodiments of this application, the language model needs to understand the business intent of the current step, extract key facts related to the email content such as model number, order number, troubleshooting status, etc. from the slot information, combine the original request in the user request, and generate a customer service email that meets the requirements of the current business stage in terms of tone, structure and content based on the professional expressions in the reference template.
[0100] Reference Figure 7 As shown, Figure 7 This is an optional flowchart in the first embodiment of the customer service email generation method based on slot state machine of this application, after the language model performs email content reasoning on target prompt words to generate customer service emails. The method may include, but is not limited to, steps S701 to S702.
[0101] Step S701: Record intent information and target cue words.
[0102] Step S702: Update the language model.
[0103] It should be noted that during each round of dialogue processing, the system generates intent information during the parsing phase. This intent information, after routing matching, determines the target business process and drives slot extraction and step determination in subsequent steps. The system records this intent information as part of the labeled data, forming a complete training sample along with the corresponding input content, target prompts, and the final generated email content. Recording the intent information allows the system to retrospectively analyze the semantic classification decisions of each round of dialogue, providing data support for subsequent optimization of intent recognition capabilities.
[0104] It should be noted that the target prompt word is the product of the prompt word assembly process. It is a complete text fused with multi-source data step information, slot information, user requests, reference templates, etc., and the prompt word template. The system records this target prompt word and uses it as input in the training samples. Since the target prompt word already contains the complete context and task instructions of the current step, it forms an "input-output" mapping relationship with the corresponding email generation result, making it an ideal data pair in supervised learning scenarios.
[0105] Reference Figure 8 As shown, Figure 8 This is an optional flowchart after generating a customer service email in the first embodiment of the customer service email generation method based on a slot state machine in this application. The method may include, but is not limited to, steps S801 to S802.
[0106] Step S801: When the customer service email is parsed and a transfer to human agent identifier is obtained, a request instruction indicating that transfer to human agent service is required is sent to the human agent processing module.
[0107] It should be noted that after generating a customer service email, the system checks whether it carries a transfer-to-human identifier. When the transfer-to-human identifier is detected, the system determines that the transfer-to-human process needs to be triggered. At this time, the email content may contain a notification message such as "You have been transferred to a human agent".
[0108] Step S802: When the decision to transfer to human assistance is approved according to the rules, a request instruction indicating that the transfer to human assistance is required is sent to the human assistance processing module.
[0109] It should be noted that the "transfer to human intervention" rule is a set of conditional rules in the finite state machine of the target processing flow specifically used to identify situations where "human intervention is required." Unlike ordinary slot-driven step migration rules, the conclusion of the "transfer to human intervention" rule does not point to a specific email generation step, but rather to an inter-system action—sending a "transfer to human intervention" request instruction.
[0110] In some embodiments of this application, the system makes a determination based on the process type and current step information, the input content in which the customer explicitly states that they cannot provide information, and keywords for transferring to human intervention.
[0111] It should be noted that after confirming the need for a manual transfer, the system constructs a request instruction representing the need for manual service and sends this instruction to the manual processing module. The request instruction is an inter-system communication message, and its format can be a structured JSON object, an event in a message queue, a remote procedure call request, or any other communication format suitable for system integration.
[0112] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the customer service email generation method based on slot state machine in this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0113] This application provides a customer service email generation system based on a slot state machine. The customer service email generation system based on a slot state machine includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the customer service email generation method based on a slot state machine in the above embodiment 1.
[0114] The following is for reference. Figure 9 It shows a schematic diagram of a module suitable for implementing a slot-based state machine-based customer service email generation system according to the embodiments of this application.
[0115] A customer service email generation system based on slot state machines includes: Interaction module 10 is used to generate human-computer interaction sessions and collect information; The scheduling service module 20 is used to parse user intent routing, inherit and isolate slot information, and also includes a manual processing module, which performs dual-channel transfer to manual judgment through the manual processing module; The process processing module 30 is used to extract and normalize slot information, judge step information and assemble target prompt words for the email body based on the slot standard value; Core module 40 is used to parse user requests and retrieve troubleshooting knowledge base data through a large language model; data storage module 50 is used to store historical interaction records, historical interaction states, and troubleshooting templates.
[0116] The customer service email generation system based on slot state machines provided in this application, employing the slot state machine-based customer service email generation method described in the above embodiments, ensures that information collected in previous rounds is not missed, avoids erroneous sharing of processing status between different questions, reduces duplicate inquiries, and prevents the loss of key information. This achieves the effect of reusing relevant historical information across questions and preventing the loss of key information, realizing efficient and coordinated human-computer interaction. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the slot state machine-based customer service email generation method provided in the above embodiments, and will not be elaborated upon here.
[0117] The following is for reference. Figure 10This document illustrates a structural schematic diagram of a slot-based state machine-based customer service email generation device suitable for implementing embodiments of this application. The slot-based state machine-based customer service email generation device in this application embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 10 The customer service email generation device based on slot state machine shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0118] like Figure 10 As shown, the slot-based state machine-based customer service email generation device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the slot-based state machine-based customer service email generation device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows the slot-based state machine-based customer service email generation device to communicate wirelessly or wiredly with other devices to exchange data. While the figures show slot-based state machine-based customer service email generation devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0119] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0120] The customer service email generation device based on a slot state machine provided in this application, employing the customer service email generation method based on a slot state machine in the above embodiments, ensures that information collected in previous rounds is not missed, avoids erroneous sharing of processing status between different questions, reduces duplicate inquiries, and prevents the loss of key information. This achieves the effect of reusing relevant historical information across questions and preventing the loss of key information, realizing efficient and coordinated human-computer interaction. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the customer service email generation method based on a slot state machine provided in the above embodiments, and will not be elaborated upon here.
[0121] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0122] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0123] In addition, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the customer service email generation method based on the slot state machine described above.
[0124] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0125] The aforementioned computer-readable storage medium may be included in a slot-based state machine-based customer service email generation system; or it may exist independently and not be assembled into a slot-based state machine-based customer service email generation system.
[0126] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by a slot-based customer service email generation system, the system performs the following actions: receives a user request, parses the user request to obtain intent information and input content; acquires a session identifier associated with the user request, and loads historical records and historical session states based on the session identifier; wherein the historical session states include processing status information associated with a specific issue; determines a first issue identifier based on the input content, determines a second issue identifier based on the historical records, and when the first issue identifier and the second issue identifier match, inherits the processing status information to the user request to obtain the current session state; determines the corresponding target processing flow based on the intent information; extracts slot information from the current session state and the user request through the target processing flow; normalizes the slot information to obtain a slot standard value, and determines step information based on the comparison result between the slot standard value and the slot preset value; and generates a customer service email by combining the step information, the slot information, and the user request with the prompt word template of the target processing flow and inputting it into a language model.
[0127] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed 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 remote computers, the remote computer can 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 can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0128] 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 this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated 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, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0129] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0130] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., computer programs) for executing the above-described slot-based state machine-based customer service email generation method. This ensures that information collected in previous rounds is not missed, avoids erroneous sharing of processing states between different questions, reduces repeated inquiries, and prevents the loss of key information. It achieves the effect of reusing relevant historical information across questions and preventing the loss of key information, thus realizing efficient and coordinated human-computer interaction. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the slot-based state machine-based customer service email generation method provided in the above embodiments, and will not be repeated here.
[0131] The one or more technical solutions proposed in this application have at least the following technical effects: By receiving user requests, obtaining intent information and input content, determining a first question identifier and a second question identifier based on the input content and historical records, and inheriting the historical session state to the user request when the first and second question identifiers match, it ensures that information collected in previous rounds is not missed and avoids erroneous sharing of processing states between different questions. In addition, the user session state and user request are extracted and normalized into slot standard values. By comparing the slot standard values with the slot preset values, the step information is determined. The system determines the steps of the information collection process based on the alignment of the slot standard values and the slot preset values, reducing repeated inquiries and preventing the loss of key information. Finally, a customer service email is generated. Through this customer service email generation method, the relevant historical information can be reused across questions and the loss of key information is prevented, achieving efficient and coordinated human-computer interaction.
[0132] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for generating customer service emails based on a slot state machine, characterized in that, include: Receive a user request and parse the user request to obtain intent information and input content; Obtain the session identifier associated with the user request, and load the history record and historical session status based on the session identifier; wherein, the historical session status includes processing status information associated with a specific issue; A first problem identifier is determined based on the input content, and a second problem identifier is determined based on the historical records. When the first problem identifier and the second problem identifier match, the processing status information is inherited to the user request to obtain the current session status. The corresponding target processing flow device is determined based on the intent information; The target processing flow controller extracts slot information from the current session state and the user request. The slot information is normalized to obtain the slot standard value, and the step information is determined based on the comparison result between the slot standard value and the slot preset value. The customer service email is generated by combining the step information, the slot information, and the user request with the prompt word template of the target processing flow device and inputting them into the language model.
2. The customer service email generation method based on slot state machine according to claim 1, characterized in that, The historical session state also includes historical general state information, and before determining the first question identifier based on the input content, it also includes: Based on the input, determine the current general status information; When the current general status information is empty, the historical general status information is inherited to the user general status information requested by the user. Update the current session state based on the user's general status information.
3. The customer service email generation method based on slot state machine according to claim 1, characterized in that, After the steps of determining the first problem identifier based on the input content and determining the second problem identifier based on the historical records, the method further includes: When the first issue identifier and the second issue identifier do not match, reset the history record and the history session state.
4. The customer service email generation method based on slot state machine according to claim 1, characterized in that, The step of determining the corresponding target processing flow unit based on the intent information includes: The business process is determined using the intent information and the relationship mapping table; Based on the business process, determine the target processing flow unit corresponding to the business process.
5. The customer service email generation method based on slot state machine according to claim 1, characterized in that, The step information for determining the information based on the comparison result between the standard value and the preset value of the slot includes: The step information is obtained based on the comparison between the standard value of the slot and the preset value of the slot; Based on the step information, output an instruction to request the user to supplement the missing information; In response to missing information input by the user, update the step information.
6. The customer service email generation method based on slot state machine according to claim 1, characterized in that, The step involves combining the step information, the slot information, and the user request with the prompt word template of the target processing flow device and inputting them into a language model to generate a customer service email, including: The target prompt word is obtained by combining the step information, the slot information, and the user request with the prompt word template of the target processing flow device; The target prompt word is input into the language model so that the language model can infer the email content based on the target prompt word and generate the customer service email.
7. The customer service email generation method based on slot state machine according to claim 6, characterized in that, The method further includes: The language model is updated based on the intent information and the target cue words.
8. The customer service email generation method based on slot state machine according to claim 1, characterized in that, The target processing flow includes a manual processing module, and after generating the customer service email, it also includes: When the customer service email is parsed and a transfer-to-human identifier is obtained, a request instruction indicating that transfer to human service is required is sent to the human processing module. Once the decision to transfer to human assistance is approved according to the rules, a request instruction indicating that a transfer to human assistance is required is sent to the human assistance processing module.
9. A customer service email generation system based on a slot state machine, characterized in that, include: A processor and a memory, the memory storing a computer program, the processor executing the computer program to implement the method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the method as described in any one of claims 1 to 8.