Session processing method and apparatus, device and medium
Patent Information
- Application Number
- PCT/CN2025/135616
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-04-18
- Filing Date
- 2025-11-18
- Publication Date
- 2026-10-22
Smart Images

Figure CN2025135616_22102026_PF_FP_ABST
Abstract
Description
Session processing methods, devices, equipment and media
[0001] This application claims priority to Chinese Patent Application No. 202510499258.9, filed on April 18, 2025, entitled "Conversation Processing Method, Apparatus, Device and Medium", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the fields of artificial intelligence and healthcare, and in particular to a conversation processing method, apparatus, device, and medium. Background Technology
[0003] For conversations, contextual information is crucial for understanding the current session. However, many current conversation processing methods, such as those applied to healthcare or e-commerce scenarios, are limited to the current question, neglecting the extraction of preceding context; or they rigidly use slot filling mechanisms to extract this information, resulting in low flexibility and agility in conversation processing. Furthermore, the inventors found that these methods may fail to accurately capture the user's intent and mentioned entities, increasing the risk of misunderstandings and incorrect responses, leading to lower processing efficiency.
[0004] Therefore, existing session processing methods suffer from low processing efficiency. Summary of the Invention
[0005] This application provides a session processing method, apparatus, device, and medium, aiming to solve the problem of low processing efficiency in existing session processing methods.
[0006] In a first aspect, embodiments of this application provide a session processing method, the method comprising:
[0007] Get the user's current question and historical conversation input;
[0008] Based on a preset model, the correlation between the current problem and the historical sessions is judged to obtain a judgment result;
[0009] If the judgment result is relevant, the current question and the historical session are truncated using the preset model to obtain the current session;
[0010] The target question is obtained by performing completion processing on the current session based on the preset model.
[0011] Secondly, embodiments of this application also provide a session processing apparatus, the apparatus comprising:
[0012] The acquisition unit is used to acquire the user's input of the current question and historical sessions;
[0013] The judgment unit is used to judge the correlation between the current problem and the historical session based on a preset model to obtain a judgment result;
[0014] The truncation unit is used to truncate the current question and the historical session using the preset model to obtain the current session if the judgment result is relevant.
[0015] The completion unit is used to complete the current session based on the preset model to obtain the target question.
[0016] Thirdly, embodiments of this application also provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0017] Get the user's current question and historical conversation input;
[0018] Based on a preset model, the correlation between the current problem and the historical sessions is judged to obtain a judgment result;
[0019] If the judgment result is relevant, the current question and the historical session are truncated using the preset model to obtain the current session;
[0020] The target question is obtained by performing completion processing on the current session based on the preset model.
[0021] Fourthly, embodiments of this application also provide a non-volatile computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform the following steps:
[0022] Get the user's current question and historical conversation input;
[0023] Based on a preset model, the correlation between the current problem and the historical sessions is judged to obtain a judgment result;
[0024] If the judgment result is relevant, the current question and the historical session are truncated using the preset model to obtain the current session;
[0025] The target question is obtained by performing completion processing on the current session based on the preset model.
[0026] This application provides a session processing method, apparatus, device, and medium. The method includes: acquiring a current question and historical sessions input by a user; judging the correlation between the current question and the historical sessions based on a preset model to obtain a judgment result; if the judgment result is related, truncating the current question and the historical sessions using the preset model to obtain the current session; and completing the current session based on the preset model to obtain a target question. Therefore, this application's embodiments, by introducing a preset model to judge, truncate, and complete the current question and historical sessions, determine the target question, improving the flexibility and agility of the session, accurately capturing the user's intent and mentioned entities, reducing the risk of misunderstanding and erroneous responses, and thus improving processing efficiency. Attached Figure Description
[0027] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 is a flowchart illustrating the session processing method provided in an embodiment of this application;
[0029] Figure 2 is a schematic block diagram of a session processing device provided in an embodiment of this application;
[0030] Figure 3 is a schematic block diagram of an electronic device provided in an embodiment of this application;
[0031] Figure 4 is a schematic diagram of the application environment of the session processing method provided in the embodiments of this application. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. 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.
[0033] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0034] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0035] It should also be further understood that the term "and / or" as used in this application specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. This application provides a session processing method, apparatus, device, and medium. The session processing method is illustrated in Figure 4, which is a schematic diagram of the application environment of the session processing method provided in this application embodiment. The session processing method is applied in the application environment shown in Figure 4, where a terminal communicates with a server via a network. The terminal sends the current question and historical sessions input by the user to the server. The server judges the correlation between the current question and the historical sessions based on a preset model to obtain a judgment result. If the judgment result is related, the current question and the historical sessions are truncated using the preset model to obtain the current session. The current session is then completed based on the preset model to obtain the target question, thereby improving the processing efficiency of session processing. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster composed of multiple servers. The following detailed description of specific embodiments further illustrates this application.
[0036] Figure 1 is a schematic flowchart of the session processing method provided in an embodiment of this application. As shown in Figure 1, the method includes the following steps S110-S140.
[0037] S110. Obtain the current question and historical session information input by the user.
[0038] In this embodiment, the current question input by the user is obtained from the terminal, and the historical session corresponding to the current question is obtained based on the session identifier corresponding to the current question. The session identifier is unique, meaning that each session identifier can correspond to both a current question and a historical session.
[0039] The specific application scenarios of this application embodiment can be conversational scenarios such as medical health and e-commerce shopping, for example, a dialogue scenario between a doctor and a patient or a dialogue scenario between a seller and a buyer; that is, the current question and the historical conversation can be related to medical care or shopping.
[0040] S120. Based on a preset model, the correlation between the current problem and the historical session is judged to obtain a judgment result.
[0041] In this embodiment, the preset model is achieved through fine-tuning of the generative model. The training process can be as follows: first, a series of dialogue data from different days (i.e., data from calling the doctor on different days) are acquired. The data from the previous day is used as the historical conversation, and the dialogue from the next day is used as the current conversation. These are then input into the generative model to train an initial version of the model. Next, other data (either from different days or different days, with the aim of increasing the diversity of data from real-world scenarios) are used to perform predictive analysis on the initial version of the model. Then, data with incorrect predictions are labeled and added to the training set for iteration. This process is repeated until the preset model is trained to achieve the purpose of being applicable to specific scenarios.
[0042] In one embodiment, the step of determining the correlation between the current question and the historical session based on a preset model to obtain a determination result includes:
[0043] The current problem and the historical sessions are input into the preset model for analysis and processing to obtain session parameters;
[0044] The judgment result is obtained by performing judgment processing based on the session parameters.
[0045] In this embodiment, the current problem and the historical conversation are input into the preset model for analysis and processing to obtain conversation parameters; the judgment result is obtained based on the conversation parameters; specifically, in the preset model, the current problem and the historical conversation are used as two initial input parameters, and the conversation parameters are used as the final output parameters.
[0046] For example, in a healthcare scenario, the first input parameter is the historical conversation, which could be: "Patient: How is diabetes treated? Doctor: Diabetes medications are mainly divided into oral medications and injections. Insulin is the only medication that can directly lower blood sugar. Other medications lower blood sugar by slowing down sugar absorption, inhibiting hepatic glucose output, or enhancing insulin action and promoting insulin secretion. There are also some surgical treatment methods, which require consultation with relevant doctors." The second input parameter is the current question, which could be: "Can I take insulin if I have high blood pressure?" In this case, the output parameter is the conversation parameter, which can be 1.
[0047] For example, in a healthcare scenario, the first input parameter is the historical conversation, which could be: "Patient: How is diabetes treated? Doctor: Diabetes medications are mainly divided into oral medications and injections. Insulin is the only medication that can directly lower blood sugar. Other medications lower blood sugar by slowing down sugar absorption, inhibiting hepatic glucose output, or enhancing insulin action and promoting insulin secretion. There are also some surgical treatment methods, which require consultation with relevant doctors." The second input parameter is the current question, which could be "Consulting about epilepsy." In this case, the output parameter is the conversation parameter, which can be 0.
[0048] As can be seen from the above embodiments, by inputting the current question and the historical conversation into the preset model for analysis and processing to obtain conversation parameters, the user's intent can be understood more accurately using the current question and the historical conversation, especially in complex dialogue scenarios with multiple rounds of interaction, ensuring the maintenance of the conversation context, making the dialogue more coherent and logical, and thus improving processing efficiency; and the judgment result is obtained by judging based on the conversation parameters, so as to carry out subsequent targeted processing based on the judgment result.
[0049] In one embodiment, obtaining the judgment result by performing judgment processing based on the session parameters includes:
[0050] If the session parameter is 1, then the judgment result is relevant;
[0051] If the session parameter is 0, then the judgment result is irrelevant.
[0052] In this embodiment, when the session parameter is 1, the judgment result is related, that is, the current question is related to the historical session; when the session parameter is 0, the judgment result is unrelated, that is, the current question is not related to the historical session.
[0053] As can be seen from the above embodiments, the judgment result is obtained by judging based on the session parameters. Therefore, the correlation between the current problem and the historical session is judged and processed through the session parameters, so as to better deal with various inputs, especially noise and abnormal situations, improve the robustness of the method, and thus improve the processing efficiency.
[0054] In one embodiment, after determining the correlation between the current question and the historical session based on a preset model to obtain a determination result, the method further includes:
[0055] If the judgment result is irrelevant, then the current problem will be directly output as the target problem.
[0056] In this embodiment, when the judgment result is irrelevant, that is, when the current question is not associated with the historical session, the current question is directly output as the target question.
[0057] As can be seen from the above embodiments, when the judgment result is irrelevant, that is, when the current question is not related to the historical session, the current question is directly output as the target question. Therefore, the judgment result can reduce invalid dialogue rounds, reduce labor costs and improve the level of automation, thereby improving processing efficiency.
[0058] S130. If the judgment result is relevant, the current problem and the historical session are truncated using the preset model to obtain the current session.
[0059] In this embodiment, when the determination result is related, that is, when the current problem is associated with the historical session, the current session is obtained by truncating the current problem and the historical session using the preset model.
[0060] In one embodiment, the step of using the preset model to truncate the current question and the historical sessions to obtain the current session includes:
[0061] The historical sessions and the current question are integrated to obtain an intermediate session;
[0062] The intermediate session is input into the preset model for interception processing to obtain the current session.
[0063] In this embodiment, the preset model is implemented through the general functions of the generated model, specifically by inputting instructions to the generated model to complete the interception function. The historical conversation and the current question are integrated to obtain the intermediate conversation; the intermediate conversation is input into the preset model for interception processing to obtain the current conversation; therefore, by using the preset model to intercept the preceding text related to the current question, the dialogue context that maximizes effective information and minimizes clutter is extracted as much as possible to improve processing efficiency.
[0064] The current session may include a portion of the historical sessions and the current question, wherein the portion of the historical sessions is the part of the historical sessions related to the current question.
[0065] For example, in a healthcare scenario, the intermediate conversation obtained by integrating the historical conversation and the current question could be: "Doctor: Hello, how can I help you?\nPatient: Hello doctor\nPatient: How is diabetes treated?\nDoctor: Medications for diabetes are mainly divided into oral medications and injections. Insulin is the only drug that can directly lower blood sugar. Other drugs lower blood sugar by slowing down sugar absorption, inhibiting hepatic glucose output, or enhancing the effect of insulin and promoting insulin secretion. There are also some surgical treatments, which require consultation with a doctor.\nPatient: Can I take insulin if I have high blood pressure?"; Using the intermediate conversation as input parameters, the current conversation obtained by inputting it into the preset model for truncation processing could be: "Patient: How is diabetes treated?\nDoctor: Medications for diabetes are mainly divided into oral medications and injections. Insulin is the only drug that can directly lower blood sugar. Other drugs lower blood sugar by slowing down sugar absorption, inhibiting hepatic glucose output, or enhancing the effect of insulin and promoting insulin secretion. There are also some surgical treatments, which require consultation with a doctor.\nPatient: Can I take insulin if I have high blood pressure?".
[0066] As can be seen from the above embodiments, the historical conversation and the current question are integrated to obtain an intermediate conversation; the intermediate conversation is input into the preset model for truncation to obtain the current conversation; therefore, the preset model can quickly truncate, reduce unnecessary dialogue rounds, and improve the processing efficiency of the conversation.
[0067] S140. Based on the preset model, the current session is completed to obtain the target question.
[0068] In this embodiment, the preset model is created by adding training data involving various scenarios. During actual application and production, the model automatically generates the completed statements. The preset model employs a COT (Content-Oriented Thinking) framework, breaking down various possible scenarios and consciously adding data to the training data according to different scenarios. This creates an analysis + result generation structure in the training samples, improving the accuracy of model generation and thus increasing processing efficiency.
[0069] In one embodiment, the step of performing completion processing on the current session based on the preset model to obtain the target question includes:
[0070] The current session is input into the preset model to handle missing types and obtain the problem type;
[0071] The target question is obtained by performing completion processing on the current session according to the question type using the preset model.
[0072] In this embodiment, the current session is input into the preset model for missing type processing to obtain the question type; based on the question type, the preset model performs completion processing on the current session to obtain the target question. The question type may include missing intent, missing entity, and other types of missing information.
[0073] For example, in a healthcare scenario, the current session could be "Partial historical session: What to do about high blood pressure?\nCurrent question: What about diabetes?". The question type obtained by inputting the current session into the preset model for missing type processing is intent missing. The target question obtained by performing completion processing on the current session based on the question type could be "What to do about diabetes?".
[0074] For example, in a healthcare scenario, the current session could be “Partial historical session: What is hypertension?\nCurrent question: How to treat it?” The question type obtained by inputting the current session into the preset model for missing type processing is entity missing; the target question obtained by performing completion processing on the current session according to the question type could be “Then how to treat hypertension?”.
[0075] For example, in a healthcare scenario, the current session could be “Partial historical session: Please select your symptoms from the following: 1. Cough 2. Nasal congestion 3. Yellow phlegm\nCurrent question: 1, 3”. The question type obtained by inputting the current session into the preset model for missing type processing is “Other missing type”. The target question obtained by performing completion processing on the current session according to the question type can be “I have a cough and yellow phlegm”.
[0076] As can be seen from the above embodiments, the current session is input into the preset model for missing type processing to obtain the question type; according to the question type, the preset model performs completion processing on the current session to obtain the target question; therefore, the preset model can quickly complete the process, reducing unnecessary dialogue rounds, improving the flexibility and agility of the session, accurately capturing the user's intent and mentioned entities, reducing the risk of misunderstanding and incorrect responses, and thus improving processing efficiency.
[0077] In one embodiment, after performing completion processing on the current session based on the preset model to obtain the target question, the method further includes:
[0078] Send the target question to the target conversation partner.
[0079] In this embodiment, the target conversation partner refers to the person who sends the current question to the user. Specifically, the target conversation partner initiates a conversation with the user based on the target question. For example, in the healthcare field, the user can be a patient, and the target conversation partner can be a doctor; in e-commerce, the user can be a buyer, and the target conversation partner can be a seller. Therefore, by directly sending the target question, processed through the preset model, to the target conversation partner, the processing efficiency of subsequent dialogues is improved.
[0080] In summary, this application embodiment can obtain the current question and historical conversation input by the user; determine the correlation between the current question and the historical conversation based on a preset model to obtain a judgment result; if the judgment result is related, truncate the current question and the historical conversation using the preset model to obtain the current conversation; and complete the current conversation based on the preset model to obtain the target question. Therefore, this application embodiment, by introducing a preset model to perform judgment, truncation, and completion processing on the current question and historical conversation, determines the target question, improves the flexibility and agility of the conversation, accurately captures the user's intent and mentioned entities, reduces the risk of misunderstanding and erroneous responses, and thus improves processing efficiency.
[0081] Figure 2 is a schematic block diagram of a session processing device provided in an embodiment of this application. As shown in Figure 2, corresponding to the above session processing method, this application also provides a session processing device, which is configured in the application environment shown in Figure 4, wherein the terminal communicates with the server through a network. The terminal sends the current question and historical session input by the user to the server. The server judges the correlation between the current question and the historical session based on a preset model to obtain a judgment result; if the judgment result is related, the current question and the historical session are truncated using the preset model to obtain the current session; the current session is completed based on the preset model to obtain the target question, thereby improving the processing efficiency of session processing. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster composed of multiple servers. Specifically, referring to Figure 2, the session processing device 700 includes:
[0082] The acquisition unit 701 is used to acquire the current question and historical session input by the user;
[0083] The judgment unit 702 is used to judge the correlation between the current problem and the historical session based on a preset model to obtain a judgment result;
[0084] The truncation unit 703 is used to truncate the current question and the historical session using the preset model to obtain the current session if the judgment result is relevant.
[0085] The completion unit 704 is used to complete the current session based on the preset model to obtain the target question.
[0086] In some embodiments, when the judgment unit 702 performs the step of judging the correlation between the current question and the historical session based on a preset model to obtain a judgment result, it is specifically used for:
[0087] The current problem and the historical sessions are input into the preset model for analysis and processing to obtain session parameters;
[0088] The judgment result is obtained by performing judgment processing based on the session parameters.
[0089] In some embodiments, when performing the step of obtaining the judgment result based on the session parameters, the specific steps are as follows:
[0090] If the session parameter is 1, then the judgment result is relevant;
[0091] If the session parameter is 0, then the judgment result is irrelevant.
[0092] In some embodiments, when the truncation unit 703 performs the step of truncation processing of the current problem and the historical session using the preset model to obtain the current session, it is specifically used for:
[0093] The historical sessions and the current question are integrated to obtain an intermediate session;
[0094] The intermediate session is input into the preset model for interception processing to obtain the current session.
[0095] In some embodiments, when the completion unit 704 performs the step of completing the current session based on the preset model to obtain the target question, it is specifically used for:
[0096] The current session is input into the preset model to handle missing types and obtain the problem type;
[0097] The target question is obtained by performing completion processing on the current session according to the question type using the preset model.
[0098] In some embodiments, after performing the step of judging the correlation between the current question and the historical session based on a preset model to obtain a judgment result, the judging unit 702 is further configured to:
[0099] If the judgment result is irrelevant, then the current problem will be directly output as the target problem.
[0100] In some embodiments, after performing the step of completing the current session based on the preset model to obtain the target question, the initial processing unit 702 is further configured to:
[0101] Send the target question to the target conversation partner.
[0102] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned session processing device and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.
[0103] The aforementioned session processing device can be implemented as a computer program that can run on the electronic device shown in Figure 3.
[0104] Please refer to Figure 3, which is a schematic block diagram of an electronic device provided in an embodiment of this application. The electronic device 800 can be a terminal or a server. The terminal can be an electronic device with communication functions. The server can be a standalone server or a server cluster composed of multiple servers.
[0105] Referring to Figure 3, the electronic device 800 includes a processor 802, a memory, and a network interface 805 connected via a system bus 801. The memory may include a non-volatile storage medium 803 and internal memory 804.
[0106] The non-volatile storage medium 803 may store an operating system 8031 and a computer program 8032. The computer program 8032 includes program instructions that, when executed, cause the processor 802 to perform a session processing method.
[0107] The processor 802 provides computing and control capabilities to support the operation of the entire electronic device 800.
[0108] The internal memory 804 provides an environment for the execution of the computer program 8032 in the non-volatile storage medium 803. When the computer program 8032 is executed by the processor 802, the processor 802 can execute a session processing method.
[0109] The network interface 805 is used for network communication with other devices. Those skilled in the art will understand that the structure shown in Figure 3 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device 800 to which the present application is applied. A specific electronic device 800 may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0110] The processor 802 is used to run a computer program 8032 stored in the memory to perform the following steps:
[0111] Get the user's current question and historical conversation input;
[0112] Based on a preset model, the correlation between the current problem and the historical sessions is judged to obtain a judgment result;
[0113] If the judgment result is relevant, the current question and the historical session are truncated using the preset model to obtain the current session;
[0114] The target question is obtained by performing completion processing on the current session based on the preset model.
[0115] In some embodiments, when implementing the step of determining the correlation between the current problem and the historical session based on a preset model to obtain a determination result, the processor 802 is specifically used for:
[0116] The current problem and the historical sessions are input into the preset model for analysis and processing to obtain session parameters;
[0117] The judgment result is obtained by performing judgment processing based on the session parameters.
[0118] In some embodiments, when the processor 802 implements the step of obtaining the judgment result by performing judgment processing based on the session parameters, it is specifically used for:
[0119] If the session parameter is 1, then the judgment result is relevant;
[0120] If the session parameter is 0, then the judgment result is irrelevant.
[0121] In some embodiments, when implementing the step of truncating the current problem and the historical session using the preset model to obtain the current session, the processor 802 is specifically used for:
[0122] The historical sessions and the current question are integrated to obtain an intermediate session;
[0123] The intermediate session is input into the preset model for interception processing to obtain the current session.
[0124] In some embodiments, when implementing the step of performing completion processing on the current session based on the preset model to obtain the target problem, the processor 802 is specifically used for:
[0125] The current session is input into the preset model to handle missing types and obtain the problem type;
[0126] The target question is obtained by performing completion processing on the current session according to the question type using the preset model.
[0127] In some embodiments, after implementing the step of determining the correlation between the current problem and the historical session based on a preset model to obtain a determination result, the processor 802 is further configured to:
[0128] If the judgment result is irrelevant, then the current problem will be directly output as the target problem.
[0129] In some embodiments, after implementing the step of performing completion processing on the current session based on the preset model to obtain the target problem, the processor 802 is further configured to:
[0130] Send the target question to the target conversation partner.
[0131] It should be understood that, in the embodiments of this application, the processor 802 may be a Central Processing Unit (CPU), but it may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0132] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a non-volatile computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0133] Therefore, this application also provides a storage medium. This storage medium can be a non-volatile computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When executed by a processor, the program instructions cause the processor to perform the following steps:
[0134] Get the user's current question and historical conversation input;
[0135] Based on a preset model, the correlation between the current problem and the historical sessions is judged to obtain a judgment result;
[0136] If the judgment result is relevant, the current question and the historical session are truncated using the preset model to obtain the current session;
[0137] The target question is obtained by performing completion processing on the current session based on the preset model.
[0138] In one embodiment, when the processor executes the program instructions to implement the step of judging the correlation between the current problem and the historical session based on a preset model to obtain a judgment result, it is specifically used for:
[0139] The current problem and the historical sessions are input into the preset model for analysis and processing to obtain session parameters;
[0140] The judgment result is obtained by performing judgment processing based on the session parameters.
[0141] In one embodiment, when the processor executes the program instructions to implement the step of determining the result based on the session parameters, it is specifically used for:
[0142] If the session parameter is 1, then the judgment result is relevant;
[0143] If the session parameter is 0, then the judgment result is irrelevant.
[0144] In one embodiment, when the processor executes the program instructions to implement the step of truncation processing of the current problem and the historical session using the preset model to obtain the current session, it is specifically used for:
[0145] The historical sessions and the current question are integrated to obtain an intermediate session;
[0146] The intermediate session is input into the preset model for interception processing to obtain the current session.
[0147] In one embodiment, when the processor executes the program instructions to perform completion processing on the current session based on the preset model to obtain the target problem, it is specifically used for:
[0148] The current session is input into the preset model to handle missing types and obtain the problem type;
[0149] The target question is obtained by performing completion processing on the current session according to the question type using the preset model.
[0150] In one embodiment, after executing the program instructions to implement the step of judging the correlation between the current problem and the historical session using a preset model to obtain a judgment result, the processor is further configured to:
[0151] If the judgment result is irrelevant, then the current problem will be directly output as the target problem.
[0152] In one embodiment, after executing the program instructions to perform completion processing on the current session using a preset model to obtain the target problem, the processor is further configured to:
[0153] Send the target question to the target conversation partner.
[0154] The storage medium can be any non-volatile computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0155] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0156] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0157] The steps in the methods of this application embodiment can be adjusted, merged, or deleted according to actual needs. The units in the apparatus of this application embodiment can be merged, divided, or deleted according to actual needs. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0158] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0159] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered 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.
Claims
1. A session processing method, wherein, The method includes: Get the user's current question and historical conversation input; Based on a preset model, the correlation between the current problem and the historical sessions is judged to obtain a judgment result; If the judgment result is relevant, the current question and the historical session are truncated using the preset model to obtain the current session; The target question is obtained by performing completion processing on the current session based on the preset model.
2. The session processing method according to claim 1, wherein, The process of determining the correlation between the current question and the historical sessions based on a preset model to obtain a judgment result includes: The current problem and the historical sessions are input into the preset model for analysis and processing to obtain session parameters; The judgment result is obtained by performing judgment processing based on the session parameters.
3. The session processing method according to claim 1, wherein, The step of obtaining the judgment result by performing judgment processing based on the session parameters includes: If the session parameter is 1, then the judgment result is relevant; If the session parameter is 0, then the judgment result is irrelevant.
4. The session processing method according to claim 1, wherein, The step of using the preset model to truncate the current question and the historical sessions to obtain the current session includes: The historical sessions and the current question are integrated to obtain an intermediate session; The intermediate session is input into the preset model for interception processing to obtain the current session.
5. The session processing method according to claim 1, wherein, The step of performing completion processing on the current session based on the preset model to obtain the target question includes: The current session is input into the preset model to handle missing types and obtain the problem type; The target question is obtained by performing completion processing on the current session according to the question type using the preset model.
6. The session processing method according to claim 1, wherein, After obtaining the judgment result by judging the correlation between the current problem and the historical session based on the preset model, the method further includes: If the judgment result is irrelevant, then the current problem will be directly output as the target problem.
7. The session processing method according to claim 1, wherein, After obtaining the target question by performing completion processing on the current session based on the preset model, the process further includes: Send the target question to the target conversation partner.
8. A session processing apparatus, wherein, The device includes: The acquisition unit is used to acquire the user's input of the current question and historical sessions; The judgment unit is used to judge the correlation between the current problem and the historical session based on a preset model to obtain a judgment result; The truncation unit is used to truncate the current question and the historical session using the preset model to obtain the current session if the judgment result is relevant. The completion unit is used to complete the current session based on the preset model to obtain the target question.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, When the processor executes the computer program, it performs the following steps: Get the user's current question and historical conversation input; Based on a preset model, the correlation between the current problem and the historical sessions is judged to obtain a judgment result; If the judgment result is relevant, the current question and the historical session are truncated using the preset model to obtain the current session; The target question is obtained by performing completion processing on the current session based on the preset model.
10. The electronic device of claim 9, wherein, The process of determining the correlation between the current question and the historical sessions based on a preset model to obtain a judgment result includes: The current problem and the historical sessions are input into the preset model for analysis and processing to obtain session parameters; The judgment result is obtained by performing judgment processing based on the session parameters.
11. The electronic device of claim 9, wherein, The step of obtaining the judgment result by performing judgment processing based on the session parameters includes: If the session parameter is 1, then the judgment result is relevant; If the session parameter is 0, then the judgment result is irrelevant.
12. The electronic device of claim 9, wherein, The step of using the preset model to truncate the current question and the historical sessions to obtain the current session includes: The historical sessions and the current question are integrated to obtain an intermediate session; The intermediate session is input into the preset model for interception processing to obtain the current session.
13. The electronic device of claim 9, wherein, The step of performing completion processing on the current session based on the preset model to obtain the target question includes: The current session is input into the preset model to handle missing types and obtain the problem type; The target question is obtained by performing completion processing on the current session according to the question type using the preset model.
14. The electronic device of claim 9, wherein, After obtaining the judgment result by judging the correlation between the current problem and the historical session based on the preset model, the method further includes: If the judgment result is irrelevant, then the current problem will be directly output as the target problem.
15. The electronic device of claim 9, wherein, After obtaining the target question by performing completion processing on the current session based on the preset model, the process further includes: Send the target question to the target conversation partner.
16. A non-volatile computer-readable storage medium, wherein, The storage medium stores a computer program, which includes program instructions that, when executed by a processor, cause the processor to perform the following steps: Get the user's current question and historical conversation input; Based on a preset model, the correlation between the current problem and the historical sessions is judged to obtain a judgment result; If the judgment result is relevant, the current question and the historical session are truncated using the preset model to obtain the current session; The target question is obtained by performing completion processing on the current session based on the preset model.
17. The non-volatile computer-readable storage medium of claim 16, wherein, The process of determining the correlation between the current question and the historical sessions based on a preset model to obtain a judgment result includes: The current problem and the historical sessions are input into the preset model for analysis and processing to obtain session parameters; The judgment result is obtained by performing judgment processing based on the session parameters.
18. The non-volatile computer-readable storage medium of claim 16, wherein, The step of obtaining the judgment result by performing judgment processing based on the session parameters includes: If the session parameter is 1, then the judgment result is relevant; If the session parameter is 0, then the judgment result is irrelevant.
19. The non-volatile computer-readable storage medium of claim 16, wherein, The step of using the preset model to truncate the current question and the historical sessions to obtain the current session includes: The historical sessions and the current question are integrated to obtain an intermediate session; The intermediate session is input into the preset model for interception processing to obtain the current session.
20. The non-volatile computer-readable storage medium of claim 16, wherein, The step of performing completion processing on the current session based on the preset model to obtain the target question includes: The current session is input into the preset model to handle missing types and obtain the problem type; The target question is obtained by performing completion processing on the current session according to the question type using the preset model.