A question and answer generation method, device and equipment facing a target scene

CN122964238APending Publication Date: 2026-10-23NANJING LINGXING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611437525.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-16
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0004]本申请实施例提供一种面对目标场景的问答生成方法、装置及设备,解决无标准化流程节点约束而导致容易偏离目标或者固定脚本驱动对话而导致对话僵硬的问题,提高了对话效率

Benefits of technology

[0004]本申请实施例提供一种面对目标场景的问答生成方法、装置及设备,解决无标准化流程节点约束而导致容易偏离目标或者固定脚本驱动对话而导致对话僵硬的问题,提高了对话效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122964238A_ABST
    Figure CN122964238A_ABST
Patent Text Reader

Abstract

The application relates to the technical field, in particular to a question and answer generation method, device and equipment for a target scene, which are used for solving the problems that a standardization process node constraint is easy to deviate from a target or a fixed script driven dialogue is easy to cause dialogue stiffness. The method comprises the following steps: in a dialogue process with a user, monitoring whether dialogue content meets start conditions and end conditions of any one dialogue stage corresponding to a target scene; generating reply information according to task description information of a dialogue stage corresponding to a monitoring result; and displaying the reply information to the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent question answering technology, specifically to a question answering method, apparatus, and device for a target scenario. Background Technology

[0002] With the advancement of intelligent technology, existing platforms are using various methods to recruit ride-hailing drivers. For example, telemarketing robots can contact drivers by phone or app, with their permission, to ask if they would like to apply to the ride-hailing platform and become a contracted driver.

[0003] Existing telemarketing robots use rigid, fixed SOPs (Standard Operating Procedures) to drive dialogue, solidifying the entire conversation script, interaction path, and response logic into a fixed script. This can easily lead to irrelevant answers and stuttering when the dialogue deviates from the script. Alternatively, existing telemarketing robots use large language models trained on historical conversations for dialogue output. Since the dialogue output by these models lacks standardized process constraints, it can easily stray from the core driver recruitment objective, engaging in idle chatter and prolonging the call duration. Both of these approaches reduce recruitment efficiency in recruitment scenarios. Summary of the Invention

[0004] This application provides a question-and-answer generation method, apparatus, and device for a target scenario, which solves the problems of deviation from the target due to the lack of standardized process node constraints or rigid dialogue caused by fixed script-driven dialogue, thereby improving dialogue efficiency.

[0005] Firstly, this application provides a question-and-answer generation method for a target scenario, including: During the dialogue with the user, monitor whether the dialogue content meets the start and end conditions of any dialogue stage corresponding to the target scenario; Based on the task description information of the corresponding dialogue stage in the monitoring results, generate response information; The response information will be displayed to the user.

[0006] The above method can monitor whether the dialogue content meets the start and end conditions of any dialogue stage corresponding to the target scenario during the user dialogue process. Based on the task description information of the corresponding dialogue stage, the method generates response information. This divides the dialogue into stages and makes the dialogue proceed in an orderly manner, thereby solving the problem of deviating from the target due to the lack of standardized process node constraints. At the same time, there is no fixed dialogue mode within the dialogue stage. Instead, the response content is generated through task description information, which can solve the problem of dialogue rigidity caused by fixed script-driven dialogue and improve dialogue efficiency.

[0007] In one possible embodiment, monitoring whether the dialogue content meets the start and end conditions of any dialogue stage corresponding to the target scenario includes: Determine the current dialogue stage corresponding to the target scenario; Read the pre-stored structured metadata corresponding to the current dialogue stage, and combine it with the dialogue content to construct a structured event; The structured events and the dialogue content are input into a finite state machine, which monitors whether the dialogue content meets the start conditions of the next dialogue phase and the end conditions of the current dialogue phase. If the monitoring result shows that the start condition of the next dialogue phase is met and the end condition of the current dialogue phase is met, then the next dialogue phase is determined as the dialogue phase to be switched, and the control instruction to execute the dialogue phase to be switched is output through the finite state machine. If the monitoring result indicates that the start condition for the next dialogue phase is not met and / or the end condition for the current dialogue phase is not met, then the current dialogue phase is maintained, and the control instructions for the current dialogue phase are continued to be executed through the output of the finite state machine.

[0008] In one possible embodiment, the start and end conditions of any dialogue phase corresponding to the target scenario are determined by the following methods: Obtain multiple historical dialogue contents of the target scene; Extract the dialogue template of the target scene from multiple historical dialogue contents of the target scene; Based on the shift in user intent within the dialogue template, the dialogue template for the target scenario is segmented. Based on each segmented sub-dialogue template, a dialogue phase and the start and end conditions of that dialogue phase are determined.

[0009] In one possible embodiment, response information is generated based on the task description information of the dialogue stage corresponding to the monitoring results, including: If the finite state machine outputs a control instruction to execute the dialogue phase to be switched, then the task description information for the next dialogue phase is determined. Generate a response based on the task description information for the next dialogue phase; or If the finite state machine outputs that it will continue to execute the control instructions for the current dialogue phase, then it will continue to generate response information based on the task description information of the current dialogue phase.

[0010] In one possible embodiment, response information is generated based on the task description information of the dialogue stage corresponding to the monitoring results, including: For each user input, the task description information of the corresponding dialogue stage and the content of the current user input are used as prompt words and input into the dialogue model to output the response information.

[0011] In one possible embodiment, response information is generated based on the task description information of the dialogue stage corresponding to the monitoring results, including: Obtain control parameters for the dialogue phase corresponding to the monitoring results; wherein, the control parameters include at least: business rule data of the target scenario, a preset information authenticity verification list, and compliant response constraints; For each piece of content entered by the user, retrieve the historical dialogue content of the current conversation; The task description information of the dialogue stage corresponding to the monitoring result, the content of the current user input, the historical dialogue content of the current dialogue, and the control parameters of the dialogue stage corresponding to the monitoring result are used as the prompt words; The prompt words are input into the dialogue model, and the response information is output.

[0012] In one possible embodiment, before displaying the response information to the user, the method further includes: For each user input, the response information output by the dialogue model is compared with the dialogue content to determine whether there are any output responses whose expression repetition exceeds a preset threshold. If they exist, multiple candidate response templates with the same semantic intent as the response information are obtained. These multiple candidate response templates have the same semantic content but different expression forms. Select a target response template from the plurality of candidate response templates; The response information is rewritten based on the expression structure of the target response template.

[0013] In one possible embodiment, before displaying the response information to the user, the method further includes: Detect whether the response information contains any illegal keywords corresponding to the target scenario; If so, the task description information of the dialogue stage corresponding to the monitoring result and the content of the user's input this time will be used as prompt words and re-inputted into the dialogue model to output new response information.

[0014] Secondly, this application provides a question-and-answer generation device for a target scenario, comprising: The monitoring module is used to monitor whether the dialogue content meets the start and end conditions of any dialogue stage corresponding to the target scenario during the dialogue with the user. The dialogue module is used to generate response information based on the task description information of the corresponding dialogue stage in the monitoring results; The display module is used to show the response information to the user.

[0015] Thirdly, this application provides an electronic device, comprising: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the steps of the method described in any one of the first aspects according to the obtained program instructions.

[0016] Fourthly, this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the method described in any one of the first aspects.

[0017] Fifthly, this application provides a computer program product comprising: computer program code, which, when run on a computer, causes the computer to perform the method described in any one of the first aspects. Attached Figure Description

[0018] Figure 1 A flowchart illustrating a question-and-answer generation method for a target scenario, provided in an embodiment of this application; Figure 2 A schematic diagram illustrating a possible sequence of actions in an embodiment of this application; Figure 3 A flowchart illustrating a method for monitoring whether dialogue content meets the start or end conditions of a dialogue phase, as provided in this application embodiment; Figure 4 A flowchart illustrating a method for determining a dialogue phase and its start and end conditions, as provided in an embodiment of this application; Figure 5 A flowchart illustrating a method for generating response information provided in an embodiment of this application; Figure 6 A flowchart illustrating another question-and-answer generation method for a recruitment scenario provided in this application embodiment; Figure 7 A structural diagram of a question-and-answer generation device for a target scenario provided in an embodiment of this application; Figure 8 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0020] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more; this application does not impose limitations on its embodiments.

[0021] This invention provides a solution for generating questions and answers in a specific scenario, such as a recruitment scenario. In the ride-hailing industry, a telemarketing robot can be used to ask drivers, with their permission, whether they wish to apply to the ride-hailing platform and become a contracted driver.

[0022] Existing telemarketing robots use rigid, fixed SOPs (Standard Operating Procedures) to drive dialogue, solidifying the entire conversation script, interaction path, and response logic into a fixed script. Specifically, firstly, each type of user intent is matched with only a single, fixed response text, resulting in repetitive and mechanical voice interaction lacking diverse expressive capabilities. They cannot perceive user emotions or the focus of questions within the context, and can only mechanically jump to preset scripts, making them easily perceived as machine calls by users, leading to high hang-up and resistance rates. Secondly, when drivers inquire about personalized questions such as salaries, dispatch rules, vehicle rentals, and arrival procedures, the fixed SOPs offer no flexibility for expansion. Going beyond the preset branches results in response stuttering, irrelevant answers, and an inability to handle free-flowing questions. Thirdly, adding recruitment policies, adjusting driver communication processes, or introducing new business scenarios requires full manual modification and the addition of new SOP branch scripts, resulting in long iteration cycles and extremely high manpower maintenance costs.

[0023] Alternatively, existing telemarketing robots use large language models for dialogue output. However, these models are trained solely on historical conversations and lack standardized process nodes, making it difficult to systematically advance the recruitment process. This can easily lead to straying from the core driver recruitment objective, engaging in idle chatter, and prolonging call durations. For example, the lack of specific recruitment information nodes to obtain basic driver information makes it impossible to accurately obtain crucial details such as driver contact information, driving experience, and vehicle qualifications. Similarly, the lack of specific recruitment agreement nodes makes it difficult to accurately obtain key business information such as intended arrival times.

[0024] Therefore, both of the above methods will lead to a decrease in recruitment efficiency in recruitment scenarios.

[0025] To address the aforementioned issues, this invention proposes a question-and-answer generation method, apparatus, and device for target scenarios. During user dialogue, it monitors whether the dialogue content meets the start and end conditions of any dialogue stage corresponding to the target scenario. Based on the task description information of the corresponding dialogue stage, it generates response information. This divides the dialogue into stages, ensuring an orderly process and resolving the issue of deviation from the target due to the lack of standardized process node constraints. Furthermore, since there is no fixed dialogue mode within each stage, but rather response content is generated based on task description information, it avoids the rigidity of dialogue caused by fixed scripts, thus improving dialogue efficiency.

[0026] Combination Figure 1 The present invention provides a question-and-answer generation method for a target scenario, comprising: S100: During a conversation with a user, monitor whether the conversation content meets the start and end conditions of any conversation stage corresponding to the target scenario.

[0027] For example, when the target scenario is a recruitment scenario, the dialogue stages corresponding to the recruitment scenario include some or all of the following: platform business introduction stage, driver qualification inquiry stage, platform advantage explanation stage, user objection answering stage, intention confirmation stage, invitation to store to sign contract stage, and end of hanging up stage.

[0028] The conditions for starting the platform business introduction phase are as follows: after the opening pleasantries, it is confirmed that the user's intention is to continue the conversation. For example, a typical approach is to start with "I called you today mainly to introduce..." and the user responds with "And then, please elaborate," etc. This indicates the user's intention to continue the conversation, thus satisfying the conditions for starting the platform business introduction phase, and the phase can proceed. If the user responds with "No need," indicating no intention to continue the conversation, the conditions for starting the platform business introduction phase are not met, and the phase will not proceed.

[0029] For example, the content of the user's initial dialogue can be input into the intent model, and the intent model outputs the user's intent. The user intent that the intent model can output includes several main intents such as direct rejection, hesitation, intention, and others. If the intent model shows an intention to continue the dialogue, that is, an intention, then the conditions for starting the platform business introduction stage are met, and the platform business introduction stage can be entered. Based on the task description information of the platform business introduction stage, the response information during the dialogue with the user is generated.

[0030] The platform's business introduction phase ends when the driver has a basic understanding of "what the platform does" and shows a willingness to continue listening, such as responding with "uh-huh," "go on," or "how exactly do you drive?" and there is no interruption or questioning of the platform's authenticity.

[0031] The driver qualification inquiry stage begins when the dialogue meets the end conditions of the platform's business introduction stage, meaning the business introduction is complete, and the process naturally transitions to the screening stage. The typical transition phrase is, "To see if you're a good fit for our project, I'd like to verify a few things..."

[0032] The driver qualification inquiry phase ends when: core hard indicators are obtained and the driver is determined to be qualified based on these indicators. Core hard indicators include, for example, detecting driver qualification information such as driving experience, age, criminal record, and vehicle condition within the dialogue content. Determining the driver's qualifications based on these indicators involves assessing whether the driver's driving experience, age, criminal record, and vehicle condition all meet the recruitment requirements. If they do, the driver is deemed qualified, thus satisfying the end condition for the driver qualification inquiry phase. Alternatively, if core hard indicators are obtained but the driver is not qualified—for example, when assessing whether the driver's driving experience, age, criminal record, and vehicle condition all meet the recruitment requirements, information indicating non-compliance exists, such as the driver's age exceeding a preset age—then the driver is deemed unqualified, also satisfying the end condition for the driver qualification inquiry phase.

[0033] The platform advantages explanation phase can begin only after the core hard indicators have been obtained and the qualifications are met.

[0034] The platform advantage explanation phase ends when the driver expresses recognition or interest in the core advantages, or raises specific questions / concerns even if they are not completely convinced (i.e., successfully stimulating interaction, rather than remaining silent or perfunctory).

[0035] The user objection resolution phase begins when a driver proactively raises questions, concerns, compares their platform with competitors, or expresses distrust, such as "Your commission is too high," "Other platforms say they earn more," or "I'm afraid of being scammed." Note: If there are no objections throughout the process, this phase can be skipped or simplified to "preventative explanation."

[0036] The user objection resolution phase ends when the driver's core concerns are alleviated, their emotions return to stability, they verbally express understanding or acceptance of the explanation (e.g., "Oh, I see," "That's alright"), and they no longer dwell on the same point of objection.

[0037] The start condition for the intent confirmation phase is that the end condition for the user objection resolution phase is met.

[0038] The intention confirmation stage ends when the driver gives a clear positive signal, such as "I can give it a try", "When can I start working?" or "The benefits are really good".

[0039] The condition for starting the invitation to the store to sign the contract is that the conditions for ending the intention confirmation stage are met. The opening line for the invitation to the store to sign the contract is: "Since you think it's suitable, let's schedule a time to come to the store to complete the formalities..."

[0040] The condition for ending the invitation-to-store signing phase is: monitoring confirms a specific "time + location" agreed upon with the driver. For example, monitoring confirms that the driver can come to the store at "10:00 AM on Wednesday".

[0041] The conditions for ending the idle phase are: meeting the end conditions of the invitation to the store to sign a contract, or meeting the end conditions of the driver qualification inquiry phase when the core hard indicators are completed but the driver does not meet the qualifications.

[0042] The condition for ending the idle phase is: detecting the driver's farewell remarks, such as goodbye, see you later, etc.

[0043] S101: Generate response information based on the task description information of the corresponding dialogue stage according to the monitoring results.

[0044] The task description information for the dialogue phase is determined based on the objectives to be achieved in that phase. For example, if the monitoring results correspond to the intention confirmation phase, the task description information for this phase would be confirming with the driver whether you are eligible to apply. The generated response could then be: "Would you be willing to try applying for a contracted driver position?"

[0045] For example, the dialogue stage corresponding to the monitoring results is the platform advantage explanation stage, and the task description information is the platform advantage information. When the driver shows concern for income, order volume or work mode, it is necessary to transform the general advantages into personalized selling points for the driver. The generated response information can be that you have 3 years of driving experience, which just meets our high priority order dispatch standard...

[0046] In detail, if the monitoring result corresponds to the current dialogue stage (i.e., it forces the user to remain in the current dialogue stage and prohibits unordered jumps across stages), then a response is generated based on the task description information of the current dialogue stage. If the monitoring result corresponds to the next dialogue stage, then a response is generated based on the task description information of the next dialogue stage. The next dialogue stage is the dialogue stage immediately following the current one.

[0047] For example, the dialogue can be divided into several stages: Stage 1 (A1) introduces the platform's services; Stage 2 (A2) inquires about driver qualifications; Stage 3 (A3) explains the platform's advantages; Stage 4 (A4) addresses user objections; Stage 5 (A5) confirms intent; Stage 6 (A6) invites the user to the store to sign a contract; and Stage 7 (A7) ends the conversation. The current stage is explaining the platform's advantages, and the next stage will address user objections.

[0048] If the monitoring result corresponds to the current dialogue stage, i.e., the stage of explaining platform advantages, then a response is generated based on the task description information of the stage of explaining platform advantages. If the monitoring result corresponds to the next dialogue stage, i.e., the stage of addressing user objections, then a response is generated based on the task description information of the stage of addressing user objections.

[0049] S102: Display the response information to the user.

[0050] For example, if the recruitment is conducted via telephone, the response information will be displayed to the user via voice; if the recruitment is conducted via application software, the response information will be converted into text information and displayed to the user.

[0051] When displaying response information using voice, the response information can be sent to the TTS (text-to-speech) synthesis interface. The TTS is configured with multiple customer service voice libraries, which automatically match the corresponding voice according to the context of the conversation, eliminating mechanical electronic voices; the output voice stream has natural pauses and intonation, conveying the warmth of a real conversation and improving the overall humanization from the voice level.

[0052] In some embodiments, step 100 specifically involves monitoring whether the dialogue content meets the end condition of any dialogue stage corresponding to the target scenario. If the dialogue content meets the end condition of a dialogue stage corresponding to the target scenario, i.e., a dialogue stage that meets the end condition is the current dialogue stage, then the next dialogue stage is determined according to the order of the multiple dialogue stages corresponding to the target scenario and whether the start condition of the next dialogue stage is met. Subsequently, response information will be generated based on the task description information of the next dialogue stage.

[0053] In detail, the sequence of multiple dialogue stages corresponding to the target scenario is not a linear sequence; it can branch out into multiple branches. For example, the multiple dialogue stages in a recruitment scenario include: platform business introduction stage, driver qualification inquiry stage, platform advantages explanation stage, user objection resolution stage, intention confirmation stage, invitation to the store for signing stage, and end of call stage; combined with Figure 2 As shown, the first sequence includes: the first stage A1 is the platform business introduction stage, the second stage A2 is the driver qualification inquiry stage, the third stage A3 is the platform advantage explanation stage, the fourth stage A4 is the user objection answering stage, the fifth stage A5 is the intention confirmation stage, the sixth stage A6 is the invitation to the store to sign the contract stage, and the seventh stage A7 is the end of the hanging-up stage. The second sequence includes: Phase 1 A1 is the platform business introduction phase, Phase 2 A2 is the driver qualification inquiry phase, and Phase 7 A7 is the end of the idle period phase; The third sequence includes: the first stage A1 is the platform business introduction stage; the second stage A2 is the driver qualification inquiry stage; the third stage A3 is the platform advantage explanation stage; the fifth stage A5 is the intention confirmation stage; the sixth stage A6 is the invitation to the store to sign the contract stage; and the seventh stage A7 is the end of the idle period stage.

[0054] Since the sequence of multiple dialogue stages corresponding to the target scenario includes multiple phases, and the next phase within the same phase can include multiple phases, the implementation method for the next dialogue stage is determined based on the sequence of multiple dialogue stages corresponding to the target scenario and whether the start condition for the next dialogue stage is met: Based on the sequence of each of the multiple dialogue stages corresponding to the target scenario, determine the dialogue stage corresponding to each sequence. For each sequence, determine whether the dialogue content meets the start conditions of the dialogue stage corresponding to that sequence. If so, then the dialogue phases corresponding to that sequence will be taken as the next dialogue phase.

[0055] In this context, each sequential sequence corresponds to a dialogue stage that is the next dialogue stage in that sequence. Figure 2 For example, if the dialogue stage is the driver qualification inquiry stage, including the platform advantage explanation stage (first and third priority) and the end of the idle stage (second priority); determine whether the dialogue content meets the starting conditions of the platform advantage explanation stage, that is, the core hard indicators have been obtained and the driver meets the qualifications; and determine whether the dialogue content meets the starting conditions of the end of the idle stage, that is, the core hard indicators have been obtained but the driver does not meet the qualifications.

[0056] If the core hard indicators are obtained and the qualifications are met, that is, the conditions for starting the platform advantage explanation stage are met, then the next dialogue stage is the platform advantage explanation stage; or if the core hard indicators are obtained but the qualifications are not met, that is, the conditions for starting the end of the idle stage are met, then the next dialogue stage is the end of the idle stage.

[0057] Of course, if the sequence of multiple dialogue stages corresponding to the target scenario is only one, then according to their sequence, the next dialogue stage in order can be identified as the next dialogue stage, and it can be determined whether the dialogue content meets the start conditions of the next dialogue stage.

[0058] In determining the implementation method of each dialogue stage according to the sequence of multiple dialogue stages corresponding to the target scenario, the state of the dialogue stage can also be taken into account.

[0059] For example, the multiple dialogue stages corresponding to the recruitment scenario include: platform business introduction stage, driver qualification inquiry stage, platform advantage explanation stage, user objection resolution stage, intention confirmation stage, invitation to store for contract signing stage, and end of conversation stage; the status of the platform business introduction stage is completed, the status of the driver qualification inquiry stage is completed, the status of the platform advantage explanation stage is incomplete, the status of the user objection resolution stage is incomplete, the status of the intention confirmation stage is incomplete, the status of the invitation to store for contract signing stage is incomplete, and the status of the end of conversation stage is incomplete.

[0060] The order of the multiple dialogue stages is based on Figure 2 The three sequences are obtained by determining the dialogue stages corresponding to each sequence based on the unfinished dialogue stages in each sequence. For example, from... Figure 2 In the first and third sequences, the unfinished dialogue phases begin with the platform advantage explanation phase, and the second sequence begins with the end of the idle phase. Therefore, the dialogue phases corresponding to each sequence are the platform advantage explanation phase and the end of the idle phase. Since the dialogue phases corresponding to the previously determined sequence are the same, it can be finally determined that the dialogue phases corresponding to the sequence are the two platform advantage explanation phases and the end of the idle phase.

[0061] Of course, the above two methods can be determined individually or in combination. In this regard, the embodiments of the present invention do not impose specific limitations.

[0062] The specific implementation method for generating response information based on the task description information of the next dialogue stage is the same as the specific implementation method for generating response information based on the task description information of the corresponding dialogue stage. For details, please refer to the explanation below on generating response information based on the task description information of the next dialogue stage.

[0063] In some embodiments of the present invention, a finite state machine can also be used to monitor the dialogue phase. The implementation scheme for step 100 is further, specifically, combined with... Figure 3 As shown: S300: Determine the current dialogue stage corresponding to the target scenario; In detail, a finite state machine can record the current stage of a conversation, so when using a finite state machine for monitoring, you only need to get the current stage of the conversation from the record.

[0064] S301: Read the pre-stored structured metadata corresponding to the current dialogue stage, and combine it with the dialogue content to construct a structured event.

[0065] For multiple dialogue stages, corresponding structured metadata is pre-stored. The metadata fields of the structured metadata include: a unique ID of the dialogue stage, the core sub-goal of the current dialogue stage, the business information fields to be collected in this dialogue stage, the boundaries of business information that the dialogue stage is allowed to output, the start conditions for the dialogue stage to trigger a jump, and the end conditions for the dialogue stage. The metadata is persistently stored to enable configurable and iterable business states.

[0066] The start condition for triggering a jump during a dialogue phase can be the start condition for the next dialogue phase relative to the current dialogue phase, based on... Figure 2 Each sequence shown determines the starting conditions that can trigger a jump in the dialogue phase. For example, if the current dialogue phase is the second phase A2, the starting conditions that can trigger a jump in the dialogue phase include the starting conditions for the third phase A3 and the seventh phase A7.

[0067] This configuration of the finite state machine allows it to monitor whether the dialogue content meets the start conditions of the next stage and the end conditions of the current stage, based on the above information.

[0068] Structured events include the following three dimensions of information: the business facts of the preset structure, the end conditions of the current dialogue phase of the preset structure and the start conditions for the dialogue phase to trigger a jump, and the context and boundary constraints of the preset structure.

[0069] S302: Input the structured events and dialogue content into the finite state machine, and use the finite state machine to monitor whether the dialogue content meets the start conditions of the next dialogue phase and the end conditions of the current dialogue phase.

[0070] In detail, the finite state machine is not a traditional finite state machine, but a finite state machine with an AI module. When structured events and dialogue content are input into the finite state machine, the AI ​​module can determine whether the start conditions of the next dialogue stage and the end conditions of the current dialogue stage are met based on the structured events and dialogue content.

[0071] S303: If the monitoring result shows that the start condition of the next dialogue phase is met and the end condition of the current dialogue phase is met, then the next dialogue phase is determined as the dialogue phase to be switched, and the control instruction to execute the dialogue phase to be switched is output through the finite state machine. S304: If the monitoring result is that the start condition of the next dialogue phase is not met and / or the end condition of the current dialogue phase is not met, then the current dialogue phase is maintained, and the control instructions of the current dialogue phase are continued to be executed through the output of the finite state machine.

[0072] For example, in a telephone recruitment scenario, the current stage of the conversation is the driver qualification inquiry stage. The conversation with the driver includes: "I have three years of driving experience and a C1 driver's license, but I have a traffic violation with points that I haven't finished dealing with last year. I don't know if that will work?"

[0073] Extract the business facts of the preset structure from the structured metadata and dialogue content, the end conditions of the current dialogue phase of the preset structure, the start conditions for the dialogue phase to trigger a jump, the core sub-goals of the preset structure, and the boundaries of the business information that can be output.

[0074] The business facts with a pre-defined structure are extracted from the structured metadata and the dialogue content. Specifically, the business information fields in the structured metadata include driving years, driver's license type, compliance risk status, and risk details. According to the requirements of the structured metadata, the business facts are extracted from the dialogue content, namely, [driving years: 3 years], [driver's license type: C1], [compliance risk status: there are unprocessed traffic violation points], and [risk details: traffic violations that occurred last year have not yet been processed].

[0075] Extract the pre-defined end conditions and start conditions for triggering jumps in the current dialogue stage from the structured metadata and dialogue content. Specifically, this includes: extracting the end conditions and start conditions for triggering jumps in the current dialogue stage from the structured metadata; [End condition for the current dialogue stage: core hard indicators are acquired and the driver is deemed qualified based on the core hard indicators]; [Start conditions for triggering jumps in the dialogue stage: the start condition for the platform advantage explanation stage is that the core hard indicators are acquired and the driver is qualified; the start condition for ending the idle stage; the end condition for the driver qualification inquiry stage is that the core hard indicators are acquired, but the driver is not qualified].

[0076] Extract the core sub-objectives and business information boundaries of the pre-defined structure from the structured metadata, specifically including: [Core sub-objective of the current dialogue stage: verify basic driving qualifications and compliance records], [Business information boundaries of the current dialogue stage: only questions related to qualifications and compliance are allowed, and it is strictly forbidden to promise employment, discuss salary or dispatch rules at this stage].

[0077] The structured events and dialogue content (as shown in parentheses) are input into the finite state machine. The AI ​​module of the finite state machine determines whether the dialogue content meets the start conditions for the next dialogue phase and the end conditions for the current dialogue phase based on the structured events and dialogue content. If the AI ​​module determines that there are outstanding traffic violations with demerit points, violations that occurred last year and have not yet been processed, and that the driver's qualification assessment has not been completed, then the current dialogue phase does not meet the end conditions or the start conditions for triggering a transition. Therefore, the AI ​​module determines that neither the start conditions for the next dialogue phase nor the end conditions for the current dialogue phase are met, thus maintaining the current dialogue phase and outputting control instructions to continue executing the current dialogue phase through the finite state machine.

[0078] In some embodiments, step 101 generates response information based on the task description information of the dialogue stage corresponding to the monitoring results, and is implemented as follows: If the finite state machine outputs a control instruction to execute the dialogue phase to be switched, it means that the dialogue phase corresponding to the monitoring result is the next dialogue phase, and the task description information of the next dialogue phase is determined. Generate a response based on the task description information for the next dialogue phase; or If the finite state machine outputs the control instructions for the current dialogue stage, it means that the dialogue stage corresponding to the monitoring result is the current dialogue stage. Then, it continues to generate response information based on the task description information of the current dialogue stage.

[0079] In the above example, the telemarketing robot proactively calls or contacts the driver through the application software to explain its purpose. The user responds, and the dialogue content is input into the intent model. The intent model outputs the user intent. When the output user intent is to continue the dialogue, the finite state machine is invoked to determine the current dialogue stage corresponding to the target scenario as the initial opening stage. Structured events are extracted from the dialogue content and the current dialogue stage as the initial opening stage. These structured events are input into the finite state machine, which monitors whether the dialogue content meets the start conditions of the next dialogue stage and the end conditions of the current dialogue stage.

[0080] In some embodiments, the start and end conditions of any dialogue phase corresponding to the target scenario are determined by the following methods, combined with Figure 4 As shown, it includes: S400: Acquire multiple historical dialogue contents of the target scene; S401: Extract the dialogue template of the target scene from multiple historical dialogue contents of the target scene; S402: According to the change of user intent in the dialogue template, the dialogue template of the target scenario is segmented, and the dialogue stage and the start and end conditions of the dialogue stage are determined based on each segmented sub-dialogue template.

[0081] In detail, historical interaction data from four business scenarios were collected in batches. These business scenarios include driver lead communication records from recruitment platforms, WeChat online recruitment chat texts, robot / human outbound call transcription texts, and driver inquiries conversation records. All of these data were uniformly collected into a dialogue dataset, covering a massive amount of real driver questions, objections, expressions of intent, hang-ups, mid-transitions, and other interaction samples, forming a complete dialogue corpus for each scenario. This dialogue corpus consists of multiple historical dialogue contents acquired for the target scenario of recruitment.

[0082] Then, a text clustering algorithm is used to perform semantic clustering on the historical dialogue content in the complete dialogue corpus of the scene, and the dialogue template of the target scene is automatically extracted. This dialogue template is a complete interactive behavior chain from the initiation of the call to the end of the call.

[0083] Based on the objective dialogue patterns obtained through data mining, each complete communication link is segmented into stages, breaking down the continuous dialogue template into discrete business stages with clear boundaries and independent objectives: When the user's intent in the dialogue template changes significantly, that is, when the core business objective to be completed changes, the dialogue template is segmented into multiple dialogue stages, such as the initial opening stage, the platform business introduction stage, the driver qualification inquiry stage, the platform advantage explanation stage, the user objection answering stage, the intent confirmation stage, the invitation to the store to sign the contract stage, and the end of the call stage. Based on the segmented sub-dialogue templates, the start and end conditions, as well as the task description information, are determined.

[0084] In this way, these dialogue stages are independent of each other and have a single core sub-task, covering the complete process of all the mainstream dialogue patterns discovered. Therefore, they can be used as templates for the corresponding dialogue stages.

[0085] Of course, in addition to the above-mentioned methods that determine the templates for the dialogue phase, custom phases can also be implemented.

[0086] For example, for niche dialogue modes, new business policies, and new expansion channels, a custom stage configuration entry is opened, allowing operations personnel to iteratively supplement exclusive stages based on new dialogue data to adapt to dynamic changes in business.

[0087] In some embodiments, response information is generated based on the task description information of the dialogue stage corresponding to the monitoring results, including: For each user input, the task description information of the dialogue stage corresponding to the monitoring result and the content of the current user input are used as prompt words and input into the dialogue model to output the generated response information.

[0088] For example, a finite state machine and a dialogue model can be used for information interaction. The control instructions output by the finite state machine are used to determine the information to be input into the dialogue model. Specifically, if the finite state machine outputs a control instruction to execute the dialogue stage to be switched, then the task description information of the next dialogue stage is determined. For each user input, the task description information of the next dialogue stage and the current user input are used as prompt words and input into the dialogue model to generate a response.

[0089] If the finite state machine outputs the control instructions for the current dialogue phase, then for each user input, the task description information of the current dialogue phase and the content of this user input are used as prompt words and input into the dialogue model to generate response information.

[0090] The task description information for the dialogue phase can be the business information fields mentioned above. Specifically, the task description information matching the dialogue phase and the user's input are used as prompts and input into the dialogue model, which is essentially a large language model. The large language model outputs the response corresponding to the user's input.

[0091] In some embodiments, response information is generated based on the task description information of the dialogue stage corresponding to the monitoring results, combined with... Figure 5 As shown, it includes: S500: Obtain the control parameters for the dialogue phase corresponding to the monitoring results; wherein, the control parameters include at least: business rule data of the target scenario, a preset information authenticity verification list, and compliant response constraints; S501: For each user input, retrieve the historical dialogue content of the current conversation; S502: Use the task description information of the dialogue stage corresponding to the monitoring result, the content of the current user input, the historical dialogue content of the current dialogue, and the control parameters of the dialogue stage corresponding to the monitoring result as prompt words; S503: Input the prompt words into the dialogue model and output the response information.

[0092] In detail, if the finite state machine outputs a control instruction to execute the dialogue phase to be switched, then the control parameters of the dialogue phase corresponding to the monitoring result become the control parameters of the next dialogue phase. If the finite state machine outputs a control instruction to continue executing the current dialogue phase, then the control parameters of the dialogue phase corresponding to the monitoring result become the control parameters of the current dialogue phase. The historical dialogue content of the current dialogue and the control parameters of the dialogue phase corresponding to the monitoring result are obtained. These, along with the task description information of the dialogue phase corresponding to the monitoring result and the content input by the user, are used as prompts and input into the dialogue model. The dialogue model outputs response information, thus ensuring that the response information generation process is subject to compliant response constraints and filtering out output results inconsistent with the business rule data of the target scenario and the preset information authenticity verification list.

[0093] The business rule data for the target scenario includes global constraint fields. For example, in the recruitment scenario, the platform's recruitment rules are global constraint fields.

[0094] The preset information authenticity verification list includes a negative verification field, which is used to compare and block unverified factual statements before output; for example, the negative verification field can be a list of prohibited information fabrication. The compliance response constraints include the compliance wording requirements field for the response information.

[0095] In this way, because the aforementioned control parameters are input into the dialogue model, relying on the constrained large model, various divergent and personalized questions from drivers (salary, car rental, license application, work schedule, etc.) can be flexibly answered without deviating from the current business objectives. There is no need to pre-write massive branch scripts, which greatly reduces the scenarios of response lag and irrelevant answers. It can eliminate illusions from the bottom up and avoid arbitrarily fabricating false information such as platform salary, subsidies, license application requirements, and contract rules, which could mislead drivers and cause customer complaints and compliance risks. It can also deviate from the core objective of driver recruitment, chat about irrelevant content, prolong the call time, and reduce the efficiency of lead conversion.

[0096] In this way, the present invention only needs to modify the state metadata of the finite state machine and update the constraint prompts, without having to rewrite the dialogue logic on a large scale. The underlying architecture of the finite state machine can be quickly reused for new business scenarios such as driver recruitment and line consultation, thus reducing the cost of human maintenance.

[0097] In some embodiments, before displaying the response information to the user, the method further includes: For each user input, the response information output by the dialogue model is compared with the dialogue content to determine whether there are any output responses whose expression repetition exceeds a preset threshold. If they exist, multiple candidate response templates with the same semantic intent as the response information are obtained. These multiple candidate response templates have the same semantic content but different forms of expression. Select a target response template from the multiple candidate response templates; The response information is rewritten based on the expression structure of the target response template.

[0098] The method for determining the repetition of expression forms includes: extracting text structure features from the response information and the output response respectively, and calculating the repetition of expression forms based on the matching degree of the text structure features; the text structure features include at least one of sentence templates, keyword sequences, and distribution of modal particles.

[0099] Of course, when selecting a candidate response template from multiple candidate response templates, each candidate response template will have an emotion tag, and the selection of a candidate response template can be based on matching the user's emotions.

[0100] In detail, when the driver is resistant, use gentle and reassuring language, and select a corresponding candidate response template for gentle and reassuring language. When the driver is very eager, use concise invitation language, and select a corresponding candidate response template for concise invitation language. This can improve the ability to perceive context and increase communication efficiency.

[0101] In some embodiments, before displaying the response information to the user, the method further includes: Check whether the response information contains any illegal keywords corresponding to the target scenario; If so, the task description information of the dialogue stage corresponding to the monitoring result and the content of the user's input this time will be used as prompt words and input into the dialogue model to output new response information.

[0102] In detail, after the dialogue model outputs the response information, it checks whether there are any prohibited keywords corresponding to the target scenario in the response corresponding to the user's input. If so, the task description information of the dialogue stage corresponding to the monitoring result and the content of the current user input are used as prompt words and input into the dialogue model to output new response information and show the new response to the user.

[0103] Based on the above, embodiments of the present invention provide a complete method for generating questions and answers in a recruitment scenario, combined with... Figure 6 As shown, it includes: S600: Provides users with recruitment-related questions; S601: Obtain the user's response information and input the response information into the intent model. The intent model then outputs the user's intent. S602: If the user's intent is intentional, then invoke the finite state machine; S603: If the user's intent is no intent, output the message to end the conversation.

[0104] S604: Determine the current dialogue stage corresponding to the target scenario; extract structured events from the current dialogue stage and dialogue content; input the structured events into a finite state machine, and use the finite state machine to monitor whether the dialogue content meets the start conditions of the next dialogue stage and the end conditions of the current dialogue stage based on the structured events. S605: If the monitoring result shows that the start condition of the next dialogue stage is met and the end condition of the current dialogue stage is met, then the next dialogue stage is determined as the dialogue stage to be switched, and the control instruction to execute the dialogue stage to be switched is output through the finite state machine; based on the control instruction, the task description information of the next dialogue stage is determined, and the control parameters of the next dialogue stage are obtained; for each user input, the historical dialogue content of this dialogue is obtained; the task description information of the next dialogue stage, the current user input content, the historical dialogue content of this dialogue, and the control parameters of the next dialogue stage are used as prompt words; the prompt words are input into the dialogue model, and the response information is output. S606: If the monitoring result indicates that the start condition for the next dialogue phase or the end condition for the current dialogue phase is not met, then maintain the current dialogue phase and output the control instructions for continuing to execute the current dialogue phase through the finite state machine; based on the control instructions, determine the task description information of the current dialogue phase and obtain the control parameters of the current dialogue phase; for each user input, obtain the historical dialogue content of this dialogue; use the task description information of the current dialogue phase, the current user input content, the historical dialogue content of this dialogue, and the control parameters of the current dialogue phase as prompt words; input the prompt words into the dialogue model and output the response information; S607: Compare the response information output by the dialogue model with the dialogue content to determine whether there is an output response whose expression repetition exceeds a preset threshold; if so, proceed to S608; otherwise, proceed to S609. S608: Obtain multiple candidate response templates with the same semantic intent as the response information; select a target response template from the multiple candidate response templates; rewrite the response information based on the expression structure of the target response template; S609: Detect whether there are any illegal keywords corresponding to the target scenario in the response information; if so, proceed to S610; otherwise, proceed to S611. S 610: Reuse the dialogue model to obtain new response information; S611: Display the response information to the user.

[0105] Among these features, the system records the entire conversation state trajectory: every state transition, dwell time, triggering event, and collected business fields are written to the conversation storage module in real time, generating a complete state transition log and enabling full traceability of the entire call process. Alternatively, it automatically captures the state transition nodes, key driver information, call duration, hang-up points, and intent conversion tags for each call; all data is persistently stored, supporting backend visual monitoring, fully covering the entire business pipeline from lead outbound calls to driver in-store signing, and automating the entire link of information collection and business flow.

[0106] Session state caching creates an independent session ID for each outbound call and stores it persistently. It has collected driver information, historical dialogue context, current state sub-goals, and business constraint boundaries, providing complete contextual input for large model generation.

[0107] Based on the same inventive concept, embodiments of this application provide a question-and-answer generation device for a target scenario. Please refer to... Figure 7 As shown, the device includes: The monitoring module 700 is used to monitor whether the dialogue content meets the start and end conditions of any dialogue stage corresponding to the target scenario during the dialogue with the user. The dialogue module 701 is used to generate response information based on the task description information of the dialogue stage corresponding to the monitoring results; The display module 702 is used to display the response information to the user.

[0108] Optional, monitoring module 700, specifically used for: Determine the current dialogue stage corresponding to the target scenario; Extract structured events from the current dialogue phase and the dialogue content; The structured events are input into a finite state machine, which monitors whether the dialogue content meets the start conditions of the next dialogue phase and the end conditions of the current dialogue phase. If the monitoring result shows that the start condition of the next dialogue phase is met and the end condition of the current dialogue phase is met, then the next dialogue phase is determined as the dialogue phase to be switched, and the control instruction to execute the dialogue phase to be switched is output through the finite state machine. If the monitoring result indicates that the start condition for the next dialogue phase is not met and / or the end condition for the current dialogue phase is not met, then the current dialogue phase is maintained, and the control instructions for the current dialogue phase are continued to be executed through the output of the finite state machine.

[0109] Optionally, the monitoring module 700 is also used for: Obtain multiple historical dialogue contents of the target scene; Extract the dialogue template of the target scene from multiple historical dialogue contents of the target scene; Based on the shift in user intent within the dialogue template, the dialogue template for the target scenario is segmented. Based on each segmented sub-dialogue template, a dialogue phase and the start and end conditions of that dialogue phase are determined.

[0110] Optional, dialogue module 701, specifically used for: If the finite state machine outputs a control instruction to execute the dialogue phase to be switched, then the task description information for the next dialogue phase is determined. Generate a response based on the task description information for the next dialogue phase; or If the finite state machine outputs that it will continue to execute the control instructions for the current dialogue phase, then it will continue to generate response information based on the task description information of the current dialogue phase.

[0111] Optional, dialogue module 701, specifically used for: For each user input, the task description information of the corresponding dialogue stage and the content of the current user input are used as prompt words and input into the dialogue model to output the response information.

[0112] Optional, dialogue module 701, specifically used for: Obtain control parameters for the dialogue phase corresponding to the monitoring results; wherein, the control parameters include at least: business rule data of the target scenario, a preset information authenticity verification list, and compliant response constraints; For each piece of content entered by the user, retrieve the historical dialogue content of the current conversation; The task description information of the dialogue stage corresponding to the monitoring results, the content of the current user input, the historical dialogue content of the current dialogue, and the control parameters of the dialogue stage corresponding to the monitoring results will be used as prompt words. The prompt words are input into the dialogue model, and the response information is output.

[0113] Optionally, the dialogue module 701 is also used for: For each user input, the response information output by the dialogue model is compared with the dialogue content to determine whether there are any output responses whose expression repetition exceeds a preset threshold. If they exist, multiple candidate response templates with the same semantic intent as the response information are obtained. These multiple candidate response templates have the same semantic content but different expression forms. Select a target response template from the plurality of candidate response templates; The response information is rewritten based on the expression structure of the target response template.

[0114] Optionally, the dialogue module 701 is also used for: Detect whether the response information contains any illegal keywords corresponding to the target scenario; If so, the task description information of the dialogue stage corresponding to the monitoring result and the content of the user's input this time will be used as prompt words and re-inputted into the dialogue model to output new response information.

[0115] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software through processing element calls; they can be implemented entirely in hardware; or some modules can be implemented through processing element calls in software, while others are implemented in hardware. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through the integrated logic circuits in the processor element's hardware and software instructions.

[0116] Based on the same inventive concept, embodiments of this application provide an electronic device. Figure 8 The diagram illustrates a schematic representation of an electronic device structure provided in some embodiments, such as... Figure 8 As shown, the electronic device includes: a processor 801, a memory 802, a communication interface 803, and a communication bus 804, wherein the processor 801, the communication interface 803, and the memory 802 communicate with each other through the communication bus 804. The memory 802 stores a computer program that, when executed by the processor 801, causes the processor 801 to perform the question-and-answer generation method for the target scenario as described in any one of the claims.

[0117] The processor 801 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate and transistor logic devices, or discrete hardware components.

[0118] The memory 802 is connected to the processor 801 via the communication bus 804 and completes communication between them. The memory 802 is used to store computer program instructions.

[0119] The communication bus 804 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 804 can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. The transceiver is used to enable communication between the database access device and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.

[0120] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium, the computer program product including: computer program code, which, when run on a computer, causes the computer to execute the question-and-answer generation method for a target scenario as described in any one of the claims.

[0121] Based on the same inventive concept, this application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to execute any of the question-and-answer generation methods for a target scenario discussed above. Since the principle of the above-mentioned computer program product in solving problems is similar to that of the data analysis report construction method, the implementation of the above-mentioned computer program product can refer to the implementation of the method, and the repeated parts will not be described again.

[0122] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0123] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0124] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0125] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of user-operated steps to be executed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0126] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A question-answer generation method for a target scenario, characterized in that, include: During the dialogue with the user, monitor whether the dialogue content meets the start and end conditions of any dialogue stage corresponding to the target scenario; Based on the task description information of the corresponding dialogue stage in the monitoring results, generate response information; The response information will be displayed to the user.

2. The method according to claim 1, characterized in that, The monitoring of whether the dialogue content meets the start and end conditions of any dialogue stage corresponding to the target scenario includes: Determine the current dialogue stage corresponding to the target scenario; Read the pre-stored structured metadata corresponding to the current dialogue stage, and combine it with the dialogue content to construct a structured event; The structured events and the dialogue content are input into a finite state machine, which monitors whether the dialogue content meets the start conditions of the next dialogue phase and the end conditions of the current dialogue phase. If the monitoring result shows that the start condition of the next dialogue phase is met and the end condition of the current dialogue phase is met, then the next dialogue phase is determined as the dialogue phase to be switched, and the control instruction to execute the dialogue phase to be switched is output through the finite state machine. If the monitoring result indicates that the start condition for the next dialogue phase is not met and / or the end condition for the current dialogue phase is not met, then the current dialogue phase is maintained, and the control instructions for the current dialogue phase are continued to be executed through the output of the finite state machine.

3. The method according to claim 1, characterized in that, The start and end conditions for any dialogue phase corresponding to the target scenario are determined in the following ways: Obtain multiple historical dialogue contents of the target scene; Extract the dialogue template of the target scene from multiple historical dialogue contents of the target scene; Based on the shift in user intent within the dialogue template, the dialogue template for the target scenario is segmented. Based on each segmented sub-dialogue template, a dialogue phase and the start and end conditions of that dialogue phase are determined.

4. The method according to claim 2, characterized in that, Based on the task description information of the corresponding dialogue stage according to the monitoring results, generate response information, including: If the finite state machine outputs a control instruction to execute the dialogue phase to be switched, then the task description information for the next dialogue phase is determined. Generate a response based on the task description information for the next dialogue phase; or If the finite state machine outputs that it will continue to execute the control instructions for the current dialogue phase, then it will continue to generate response information based on the task description information of the current dialogue phase.

5. The method according to claim 1, characterized in that, Based on the task description information of the corresponding dialogue stage according to the monitoring results, generate response information, including: For each user input, the task description information of the corresponding dialogue stage and the content of the current user input are used as prompt words and input into the dialogue model to output the response information.

6. The method according to claim 1, characterized in that, Based on the task description information of the corresponding dialogue stage according to the monitoring results, generate response information, including: Obtain control parameters for the dialogue phase corresponding to the monitoring results; wherein, the control parameters include at least: business rule data of the target scenario, a preset information authenticity verification list, and compliant response constraints; For each piece of content entered by the user, retrieve the historical dialogue content of the current conversation; The task description information of the dialogue stage corresponding to the monitoring results, the content of the current user input, the historical dialogue content of the current dialogue, and the control parameters of the dialogue stage corresponding to the monitoring results will be used as prompt words. The prompt words are input into the dialogue model, and the response information is output.

7. The method according to claim 6, characterized in that, Before displaying the response information to the user, the method further includes: For each user input, the response information output by the dialogue model is compared with the dialogue content to determine whether there are any output responses whose expression repetition exceeds a preset threshold. If they exist, multiple candidate response templates with the same semantic intent as the response information are obtained. These multiple candidate response templates have the same semantic content but different expression forms. Select a target response template from the plurality of candidate response templates; The response information is rewritten based on the expression structure of the target response template.

8. The method according to claim 5, characterized in that, Before displaying the response information to the user, the method further includes: Detect whether the response information contains any illegal keywords corresponding to the target scenario; If so, the task description information of the dialogue stage corresponding to the monitoring result and the content of the user's input this time will be used as prompt words and re-inputted into the dialogue model to output new response information.

9. A question-and-answer generation device for a target scenario, characterized in that, include: The monitoring module is used to monitor whether the dialogue content meets the start and end conditions of any dialogue stage corresponding to the target scenario during the dialogue with the user. The dialogue module is used to generate response information based on the task description information of the corresponding dialogue stage in the monitoring results; The display module is used to show the response information to the user.

10. An electronic device, characterized in that, include: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the steps of the method according to any one of claims 1-8.