Session processing method and device, equipment and medium
By obtaining the current problem and historical session input by the user, and using the preset model for correlation judgment, truncation and completion processing, the inefficient problem in the existing session processing methods is solved, and more efficient session processing is achieved.
Patent Information
- Application Number
- CN202510499258.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-25
AI Technical Summary
The existing session processing methods are insufficient in terms of processing efficiency, ignoring the above information, resulting in low flexibility and mobility, inability to accurately capture user intentions, and increase the risk of misunderstandings and error responses.
By obtaining the current problem and historical session input by the user, using the preset model to judge correlation, truncate and complete the processing, and determine the target problem.
Improves the flexibility and mobility of the conversation, accurately captures user intentions and mentioned entities, reduces the risk of misunderstandings and error responses, and improves processing efficiency.
Smart Images

Figure CN120373319A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence and healthcare, and particularly to a conversation processing method, apparatus, device, and medium. Background Art
[0002] For a conversation, the information of the context is crucial for understanding the current conversation. However, many current conversation processing methods, such as those applied to conversation scenarios like healthcare or e-commerce shopping, are only limited to the current question and ignore the extraction of the information from the previous context; or they rigidly use mechanisms such as slot filling to extract the previous context information, which results in low flexibility and mobility in conversation processing. At the same time, it may not be able to accurately capture the user's intention and the mentioned entities, increasing the risk of misunderstanding and incorrect response, leading to low processing efficiency.
[0003] Therefore, the existing conversation processing methods have the problem of low processing efficiency. Summary of the Invention
[0004] Embodiments of the present invention provide a conversation processing method, apparatus, device, and medium, aiming to solve the problem of low processing efficiency existing in the existing conversation processing methods.
[0005] In a first aspect, embodiments of the present invention provide a conversation processing method, the method comprising:
[0006] Obtaining a current question input by a user and a historical conversation;
[0007] Judging and processing the relevance between the current question and the historical conversation based on a preset model to obtain a judgment result;
[0008] If the judgment result is relevant, using the preset model to perform truncation processing on the current question and the historical conversation to obtain a current conversation;
[0009] Performing completion processing on the current conversation based on the preset model to obtain a target question.
[0010] In a second aspect, embodiments of the present invention further provide a conversation processing apparatus, the apparatus comprising:
[0011] An obtaining unit, configured to obtain a current question input by a user and a historical conversation;
[0012] A judging unit, configured to judge and process the relevance between the current question and the historical conversation based on a preset model to obtain a judgment result;
[0013] A truncation unit, configured to, if the judgment result is relevant, use the preset model to perform truncation processing on the current question and the historical conversation to obtain a current conversation;
[0014] A completion unit for performing completion processing on the current session based on the preset model to obtain a target question.
[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a memory and a processor. A computer program is stored on the memory, and when the processor executes the computer program, the method described in the first aspect above is implemented.
[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium. The storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, the method described in the first aspect above can be implemented.
[0017] The present invention provides a session processing method, apparatus, device and medium. The method includes: obtaining a current question input by a user and a historical session; determining a judgment result by performing judgment processing on the relevance between the current question and the historical session based on a preset model; if the judgment result is relevant, performing truncation processing on the current question and the historical session by using the preset model to obtain a current session; performing completion processing on the current session based on the preset model to obtain a target question. Therefore, the embodiments of the present invention introduce a preset model to perform judgment processing, truncation processing and completion processing on the current question and the historical session, so as to determine the target question, improve the flexibility and mobility of the session, accurately capture the user's intention and the mentioned entities, reduce the risk of misunderstanding and incorrect response, and further improve the processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0019] Figure 1 It is a schematic flowchart of the session processing method provided by the embodiment of the present invention;
[0020] Figure 2 It is a schematic block diagram of the session processing apparatus provided by the embodiment of the present invention;
[0021] Figure 3 It is a schematic block diagram of the electronic device provided by the embodiment of the present invention;
[0022] Figure 4 It is a schematic diagram of the application environment of the session processing method provided by the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0024] 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, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0025] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in this specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.
[0026] It should be further understood that the term "and / or" used in this specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations. The embodiments of the present invention provide a session processing method, apparatus, device, and medium. For the session processing method, please refer to Figure 4 , Figure 4 which is a schematic diagram of the application environment of the session processing method provided by the embodiments of the present invention. The session processing method is applied in an application environment such as Figure 4 , where the terminal communicates with the server through a network. The terminal sends the current problem input by the user and the historical session to the server, and the server judges and processes the relevance between the current problem and the historical session based on a preset model to obtain a judgment result; if the judgment result is relevant, the preset model is used to truncate the current problem and the historical session to obtain the current session; based on the preset model, the current session is complemented to obtain the target problem, so as to improve the processing efficiency of session processing. Among them, the terminal may include, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices. The server can be implemented by an independent server or a server cluster composed of multiple servers. The present invention will be described in detail through specific embodiments below.
[0027] Figure 1 which is a schematic flow chart of the session processing method provided by the embodiments of the present invention. As shown in Figure 1 , the method includes the following steps S110 - S140.
[0028] S110: Obtain the current question and historical conversations input by the user.
[0029] 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, that is, each session identifier can correspond to the corresponding current question and historical session.
[0030] The specific application scenarios of the embodiments of the present invention may be conversation scenarios such as medical care, e-commerce shopping, etc., for example, a conversation scenario between a doctor and a patient or a conversation scenario between a seller and a buyer; that is, the current question and the historical conversation may be related to medical care or shopping.
[0031] S120: Based on a preset model, a judgment is performed on the correlation between the current question and the historical conversation to obtain a judgment result.
[0032] In this embodiment, the preset model is implemented by fine-tuning the generative model. The training process can be to first obtain a series of conversation data from alternate days (i.e., data of summoning doctors on different days), use the data from the previous day as the historical conversation, and the conversation evoked on the next day as the current conversation, and input them into the generative model to train a preliminary model; then use other data (either alternate days or alternate days, and try to increase the diversity of data from real scenarios) to make predictions using the preliminary model, and then mark the data with incorrect predictions and add them to the training set for iteration; and repeat this process until the preset model is trained to achieve the purpose of being applicable to specific scenarios.
[0033] In one embodiment, the determining result of the correlation between the current question and the historical conversation based on the preset model includes:
[0034] Inputting the current question and the historical conversation into the preset model for analysis and processing to obtain conversation parameters;
[0035] The judgment result is obtained by performing judgment processing according to the session parameters.
[0036] In this embodiment, the current question and the historical conversation are input into the preset model for analysis and processing to obtain session parameters; a judgment is performed based on the session parameters to obtain the judgment result; specifically, in the preset model, the current question and the historical conversation are used as two initial input parameters, and the session parameters are used as final output parameters.
[0037] For example, in the medical and health scenario, input parameter one is the historical conversation, which can be "Patient: How to treat diabetes?\nDoctor: The drugs for treating 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 the absorption of sugar, inhibiting hepatic glucose output, enhancing insulin action, or promoting insulin secretion. There are also some surgical treatment methods, which require consultation with relevant doctors."; input parameter two is the current question, which can be "Can I take insulin if I have high blood pressure?"; at this time, the output parameter is the conversation parameter, which can be 1.
[0038] For example, in the medical and health scenario, input parameter one is the historical conversation, which can be "Patient: How to treat diabetes?\nDoctor: The drugs for treating 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 the absorption of sugar, inhibiting hepatic glucose output, enhancing insulin action, or promoting insulin secretion. There are also some surgical treatment methods, which require consultation with relevant doctors."; input parameter two is the current question, which can be "Consult epilepsy issues."; at this time, the output parameter is the conversation parameter, which can be 0.
[0039] Through the above embodiments, it can be seen that by inputting the current question and the historical conversation into the preset model for analysis and processing to obtain the conversation parameter, the current question and the historical conversation can be used to more accurately understand the user's intention. Especially in complex dialogue scenarios with multiple rounds of interaction, it is ensured to maintain the context of the conversation, making the dialogue more coherent and logical, thereby improving the processing efficiency; and the judgment result is obtained by performing judgment processing according to the conversation parameter, so as to perform subsequent targeted processing according to the judgment result.
[0040] In one embodiment, the obtaining of the judgment result by performing judgment processing according to the conversation parameter includes:
[0041] If the conversation parameter is 1, the judgment result is relevant;
[0042] If the conversation parameter is 0, the judgment result is irrelevant.
[0043] In this embodiment, when the conversation parameter is 1, the judgment result is relevant, that is, the current question is related to the historical conversation; when the conversation parameter is 0, the judgment result is irrelevant, that is, the current question is not related to the historical conversation.
[0044] From the above embodiments, it can be seen that the judgment result is obtained by making a judgment and processing according to the session parameters. Therefore, the correlation between the current problem and the historical session is judged and processed through the session parameters to better handle various inputs, especially noise and abnormal situations, improving the robustness of the method and thus enhancing the processing efficiency.
[0045] In one embodiment, after making a judgment and processing on the correlation between the current problem and the historical session based on a preset model to obtain a judgment result, the following further includes:
[0046] If the judgment result is irrelevant, the current problem is directly output as the target problem.
[0047] In this embodiment, when the judgment result is irrelevant, that is, when the current problem has no association with the historical session, the current problem is directly output as the target problem.
[0048] From the above embodiments, it can be seen that when the judgment result is irrelevant, that is, when the current problem has no association with the historical session, the current problem is directly output as the target problem. Therefore, through the judgment result, the number of invalid dialogue turns can be reduced, the labor cost can be lowered, and the automation level can be improved, thereby enhancing the processing efficiency.
[0049] S130. If the judgment result is relevant, the preset model is used to perform a truncation process on the current problem and the historical session to obtain the current session.
[0050] In this embodiment, when the judgment result is relevant, that is, when the current problem has an association with the historical session, the preset model is used to perform a truncation process on the current problem and the historical session to obtain the current session.
[0051] In one embodiment, the using the preset model to perform a truncation process on the current problem and the historical session to obtain the current session includes:
[0052] Integrate the historical session and the current problem to obtain an intermediate session;
[0053] Input the intermediate session into the preset model for an interception process to obtain the current session.
[0054] In this embodiment, the preset model is implemented through the general functions of the generation model. Specifically, an instruction is input to the generation model to complete the truncation function. The historical conversation and the current question are integrated to obtain the intermediate conversation; the intermediate conversation is input to the preset model for truncation processing to obtain the current conversation; therefore, the above part of the conversation related to the current question is truncated through the preset model, and the conversation context with maximized effective information and minimized clutter information is intercepted as much as possible to improve the processing efficiency.
[0055] Among them, the current conversation may include part of the historical conversation and the current question, and the part of the historical conversation is the part related to the current question in the historical conversation.
[0056] For example: in the medical and health scenario, the intermediate conversation obtained by integrating the historical conversation and the current question may be "Doctor: Hello, how can I help you?\nPatient: Hello, doctor\nPatient: How to treat diabetes?\nDoctor: The drugs for treating diabetes are mainly divided into oral medications and injections. Insulin is the only drug that can directly lower blood sugar, and other drugs all lower blood sugar by slowing down the absorption of sugar or inhibiting the output of liver glucose or enhancing the effect of insulin or promoting insulin secretion. There are also some surgical treatment methods, which need to consult relevant doctors.\nPatient: Can I take insulin if I have high blood pressure?"; taking the intermediate conversation as the input parameter and inputting it to the preset model for truncation processing, the obtained current conversation may be "Patient: How to treat diabetes?\nDoctor: The drugs for treating diabetes are mainly divided into oral medications and injections. Insulin is the only drug that can directly lower blood sugar, and other drugs all lower blood sugar by slowing down the absorption of sugar or inhibiting the output of liver glucose or enhancing the effect of insulin or promoting insulin secretion. There are also some surgical treatment methods, which need to consult relevant doctors.\nPatient: Can I take insulin if I have high blood pressure?".
[0057] Through the above embodiment, it can be seen that the historical conversation and the current question are integrated to obtain the intermediate conversation; the intermediate conversation is input to the preset model for truncation processing to obtain the current conversation; therefore, the preset model can quickly truncate, reduce unnecessary conversation turns, and improve the processing efficiency of the conversation.
[0058] S140. Based on the preset model, the current conversation is completed to obtain the target question.
[0059] In this embodiment, the preset model generates the completed sentences by itself during the actual application and production process by adding training data related to various scenarios. The preset model adopts the COT thinking chain to complete, disassembling various scenarios that may be encountered, and consciously adding data according to different scenarios in the training data, so that the training samples form a structure of analysis + generation results, improving the accuracy of model generation and thus improving the processing efficiency.
[0060] In one embodiment, the process of completing the current conversation based on the preset model to obtain the target question includes:
[0061] Inputting the current conversation into the preset model for missing type processing to obtain the question type;
[0062] Completing the current conversation by the preset model according to the question type to obtain the target question.
[0063] In this embodiment, inputting the current conversation into the preset model for missing type processing to obtain the question type; completing the current conversation by the preset model according to the question type to obtain the target question. Among them, the question type may include intent missing, entity missing, and other types of missing, etc.
[0064] For example, in the medical and health scenario, the current conversation may be "Partial historical conversation: What should I do about high blood pressure?\nCurrent question: What about diabetes?" Inputting the current conversation into the preset model for missing type processing, the obtained question type is intent missing; the target question obtained by completing the current conversation according to the question type may be "What should I do about diabetes?"
[0065] For example, in the medical and health scenario, the current conversation may be "Partial historical conversation: What is high blood pressure?\nCurrent question: How to treat it?" Inputting the current conversation into the preset model for missing type processing, the obtained question type is entity missing; the target question obtained by completing the current conversation according to the question type may be "Then how to treat high blood pressure?"
[0066] For example, in the medical and health scenario, the current conversation may be "Partial historical conversation: Please select your symptoms from the following symptoms: 1. Cough 2. Nasal congestion 3. Yellow phlegm\nCurrent question: 1, 3" Inputting the current conversation into the preset model for missing type processing, the obtained question type is other types of missing; the target question obtained by completing the current conversation according to the question type may be "I have a cough and yellow phlegm."
[0067] Through the above embodiments, it can be seen that the current session is input into the preset model for missing type processing to obtain the problem type; the preset model performs completion processing on the current session according to the problem type to obtain the target problem; therefore, the preset model can quickly perform completion, reduce unnecessary conversation turns, improve the flexibility and mobility of the conversation, accurately capture the user's intention and the mentioned entities, reduce the risk of misunderstanding and incorrect response, and thus improve the processing efficiency.
[0068] In one embodiment, after performing completion processing on the current session based on the preset model to obtain the target problem, it further includes:
[0069] Sending the target problem to the target session person.
[0070] In this embodiment, the target session person refers to the person to whom the user sends the current problem. Specifically, the target session person conducts a conversation with the user based on the target problem. For example, in the field of medical and health, the user can be a patient and the target session person can be a doctor; in the field of e-commerce shopping, the user can be a purchaser and the target session person can be a seller. Therefore, directly sending the target problem processed by the preset model to the target session person improves the processing efficiency of subsequent conversations.
[0071] In summary, the embodiments of the present invention can obtain the current problem and historical session input by the user; judge and process the relevance between the current problem and the historical session based on the preset model to obtain a judgment result; if the judgment result is relevant, truncate the current problem and the historical session using the preset model to obtain the current session; perform completion processing on the current session based on the preset model to obtain the target problem. Therefore, the embodiments of the present invention determine the target problem by introducing the preset model to perform judgment processing, truncation processing, and completion processing on the current problem and the historical session, thereby improving the flexibility and mobility of the conversation, accurately capturing the user's intention and the mentioned entities, reducing the risk of misunderstanding and incorrect response, and thus improving the processing efficiency.
[0072] Figure 2 It is a schematic block diagram of the session processing device provided by the embodiments of the present invention. As Figure 2 shown, corresponding to the above session processing method, the present invention further provides a session processing device, and the device is configured as Figure 4In the application environment, the terminal communicates with the server via a network. The terminal sends the current problem and the historical session input by the user to the server, and the server determines and processes the relevance between the current problem and the historical session based on a preset model to obtain a judgment result; if the judgment result is relevant, the preset model is used to truncate the current problem and the historical session to obtain the current session; based on the preset model, the current session is completed to obtain the target problem, so as to improve the processing efficiency of session processing. Among them, the terminal can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices. The server can be implemented by an independent server or a server cluster composed of multiple servers. Specifically, please refer to Figure 2 , the session processing device 700 includes:
[0073] An acquisition unit 701, configured to acquire the current problem and the historical session input by the user;
[0074] A judgment unit 702, configured to determine and process the relevance between the current problem and the historical session based on a preset model to obtain a judgment result;
[0075] A truncation unit 703, configured to, if the judgment result is relevant, use the preset model to truncate the current problem and the historical session to obtain the current session;
[0076] A completion unit 704, configured to complete the current session based on the preset model to obtain the target problem.
[0077] In some embodiments, when the judgment unit 702 executes the step of determining and processing the relevance between the current problem and the historical session based on a preset model to obtain a judgment result, it is specifically configured to:
[0078] Input the current problem and the historical session into the preset model for analysis and processing to obtain session parameters;
[0079] Perform judgment processing according to the session parameters to obtain the judgment result.
[0080] In some embodiments, when executing the step of performing judgment processing according to the session parameters to obtain the judgment result, it is specifically configured to:
[0081] If the session parameter is 1, the judgment result is relevant;
[0082] If the session parameter is 0, the judgment result is irrelevant.
[0083] In some embodiments, when the truncation unit 703 performs truncation processing on the current problem and the historical session by using the preset model to obtain the current session step, it is specifically configured to:
[0084] Integrate the historical session and the current problem to obtain an intermediate session;
[0085] Input the intermediate session into the preset model for truncation processing to obtain the current session.
[0086] In some embodiments, when the completion unit 704 performs completion processing on the current session based on the preset model to obtain the target problem step, it is specifically configured to:
[0087] Input the current session into the preset model for missing type processing to obtain the problem type;
[0088] According to the problem type, the preset model performs completion processing on the current session to obtain the target problem.
[0089] In some embodiments, after the judgment unit 702 performs judgment processing on the relevance between the current problem and the historical session based on the preset model to obtain the judgment result step, it is further configured to:
[0090] If the judgment result is irrelevant, directly output the current problem as the target problem.
[0091] In some embodiments, after the initial processing unit 702 performs completion processing on the current session based on the preset model to obtain the target problem step, it is further configured to:
[0092] Send the target problem to the target session person.
[0093] It should be noted that those skilled in the art can clearly understand that the specific implementation processes of the above session processing device and each unit can refer to the corresponding descriptions in the foregoing method embodiments. For the sake of convenience and brevity of description, they will not be repeated here.
[0094] The above session processing device can be implemented in the form of a computer program, and the computer program can run on an electronic device as shown in Figure 3 shown.
[0095] Please refer to Figure 3 , Figure 3 which is a schematic block diagram of an electronic device provided by an embodiment of the present invention. The electronic device 800 can be a terminal or a server. Among them, the terminal can be an electronic device with a communication function. The server can be an independent server or a server cluster composed of multiple servers.
[0096] Refer to Figure 3 , the electronic device 800 includes a processor 802, a memory, and a network interface 805 connected via a system bus 801. Among them, the memory may include a non-volatile storage medium 803 and an internal memory 804.
[0097] The non-volatile storage medium 803 can store an operating system 8031 and a computer program 8032. The computer program 8032 includes program instructions, and when the program instructions are executed, the processor 802 can be made to execute a session processing method.
[0098] The processor 802 is used to provide computing and control capabilities to support the operation of the entire electronic device 800.
[0099] The internal memory 804 provides an environment for the operation 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 be made to execute a session processing method.
[0100] The network interface 805 is used for network communication with other devices. Those skilled in the art can understand that Figure 3 the structure shown in is only a block diagram of some structures related to the solution of the present invention, and does not constitute a limitation on the electronic device 800 to which the solution of the present invention is applied. The specific electronic device 800 may include more or fewer components than those shown in the figure, or combine some components, or have a different component arrangement.
[0101] Among them, the processor 802 is used to run the computer program 8032 stored in the memory to implement the following steps:
[0102] Obtain the current problem and historical session input by the user;
[0103] Based on a preset model, judge and process the relevance between the current problem and the historical session to obtain a judgment result;
[0104] If the judgment result is relevant, use the preset model to truncate the current problem and the historical session to obtain the current session;
[0105] Based on the preset model, complete the current session to obtain the target problem.
[0106] In some embodiments, when the processor 802 implements the step of judging and processing the relevance between the current problem and the historical session based on a preset model to obtain a judgment result, it is specifically used for:
[0107] Input the current problem and the historical conversation into the preset model for analysis and processing to obtain session parameters;
[0108] Perform judgment processing based on the session parameters to obtain the judgment result.
[0109] In some embodiments, when the processor 802 implements the step of performing judgment processing based on the session parameters to obtain the judgment result, it is specifically configured to:
[0110] If the session parameter is 1, the judgment result is relevant;
[0111] If the session parameter is 0, the judgment result is irrelevant.
[0112] In some embodiments, when the processor 802 implements the step of performing truncation processing on the current problem and the historical conversation by using the preset model to obtain the current session step, it is specifically configured to:
[0113] Integrate the historical conversation and the current problem to obtain an intermediate conversation;
[0114] Input the intermediate conversation into the preset model for interception processing to obtain the current session.
[0115] In some embodiments, when the processor 802 implements the step of performing completion processing on the current session based on the preset model to obtain the target problem step, it is specifically configured to:
[0116] Input the current session into the preset model for missing type processing to obtain the problem type;
[0117] Based on the problem type, the preset model performs completion processing on the current session to obtain the target problem.
[0118] In some embodiments, after the processor 802 implements the step of performing judgment processing on the relevance between the current problem and the historical conversation based on the preset model to obtain the judgment result, it is further configured to:
[0119] If the judgment result is irrelevant, directly output the current problem as the target problem.
[0120] In some embodiments, after the processor 802 implements the step of performing completion processing on the current session based on the preset model to obtain the target problem step, it is further configured to:
[0121] Send the target problem to the target session participant.
[0122] It should be understood that in the embodiments of the present invention, the processor 802 may be a central processing unit (CPU), and the processor 802 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. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0123] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, and the storage medium is a 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.
[0124] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, where the computer program includes program instructions. When the program instructions are executed by a processor, the processor performs the following steps:
[0125] Obtain the current problem and historical conversation input by the user;
[0126] Based on a preset model, judge and process the relevance between the current problem and the historical conversation to obtain a judgment result;
[0127] If the judgment result is relevant, use the preset model to truncate the current problem and the historical conversation to obtain the current conversation;
[0128] Based on the preset model, complete the current conversation to obtain the target problem.
[0129] In an embodiment, when the processor executes the program instructions to implement the step of judging and processing the relevance between the current problem and the historical conversation based on a preset model to obtain a judgment result, it is specifically used for:
[0130] Input the current problem and the historical conversation into the preset model for analysis and processing to obtain session parameters;
[0131] Performing judgment processing according to the session parameters to obtain the judgment result.
[0132] In one embodiment, when the processor executes the program instructions to implement the step of performing judgment processing according to the session parameters to obtain the judgment result, it is specifically used for:
[0133] If the session parameter is 1, the judgment result is relevant;
[0134] If the session parameter is 0, the judgment result is irrelevant.
[0135] In one embodiment, when the processor executes the program instructions to implement the step of performing truncation processing on the current problem and the historical session by using the preset model to obtain the current session step, it is specifically used for:
[0136] Integrating the historical session and the current problem to obtain an intermediate session;
[0137] Inputting the intermediate session into the preset model for truncation processing to obtain the current session.
[0138] In one embodiment, when the processor executes the program instructions to implement the step of performing completion processing on the current session based on the preset model to obtain the target problem step, it is specifically used for:
[0139] Inputting the current session into the preset model for missing type processing to obtain the problem type;
[0140] Completing the current session by the preset model according to the problem type to obtain the target problem.
[0141] In one embodiment, after the processor executes the program instructions to implement the step of judging the relevance between the current problem and the historical session by using the preset model to obtain the judgment result, it is further used for:
[0142] If the judgment result is irrelevant, directly output the current problem as the target problem.
[0143] In one embodiment, after the processor executes the program instructions to implement the step of performing completion processing on the current session by using the preset model to obtain the target problem step, it is further used for:
[0144] Sending the target problem to the target session person.
[0145] The storage medium can be various computer-readable storage media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disc that can store program codes.
[0146] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0147] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0148] The steps in the method embodiments of the present invention can be adjusted, combined, and deleted according to actual needs. The units in the device embodiments of the present invention can be combined, divided, and deleted according to actual needs. In addition, the functional units in each embodiment of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0149] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on such understanding, the technical solution of the present invention, 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. The computer software product is stored in a storage medium and includes several instructions for causing an electronic device (which can be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention.
[0150] As described above, the above are only the specific implementation manners of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A session processing method, characterized in that, The method includes: Obtaining the current problem and the historical conversation input by the user; Based on a preset model, performing a judgment process on the relevance between the current problem and the historical conversation to obtain a judgment result; If the judgment result is relevant, using the preset model to perform a truncation process on the current problem and the historical conversation to obtain the current conversation; Based on the preset model, performing a completion process on the current conversation to obtain the target problem.
2. The session processing method according to claim 1, wherein The performing a judgment process on the relevance between the current problem and the historical conversation based on a preset model to obtain a judgment result includes: Inputting the current problem and the historical conversation into the preset model for analysis and processing to obtain conversation parameters; Performing a judgment process according to the conversation parameters to obtain the judgment result.
3. The session processing method according to claim 1, wherein The performing a judgment process according to the conversation parameters to obtain the judgment result includes: If the conversation parameter is 1, the judgment result is relevant; If the conversation parameter is 0, the judgment result is irrelevant.
4. The session processing method according to claim 1, wherein The using the preset model to perform a truncation process on the current problem and the historical conversation to obtain the current conversation includes: Integrating the historical conversation and the current problem to obtain an intermediate conversation; Inputting the intermediate conversation into the preset model for truncation processing to obtain the current conversation.
5. The session processing method according to claim 1, characterized in that The performing a completion process on the current conversation based on the preset model to obtain the target problem includes: Inputting the current conversation into the preset model for missing type processing to obtain the problem type; According to the problem type, using the preset model to perform a completion process on the current conversation to obtain the target problem.
6. The session processing method according to claim 1, wherein After performing a judgment process on the relevance between the current problem and the historical conversation based on a preset model to obtain a judgment result, it further includes: If the judgment result is irrelevant, directly outputting the current problem as the target problem.
7. The session processing method according to claim 1, wherein After performing a completion process on the current conversation based on the preset model to obtain the target problem, it further includes: Sending the target problem to the target conversation person.
8. A session processing device, characterized in that, The device includes: An obtaining unit, configured to obtain the current problem and the historical conversation input by the user; A judgment unit, configured to perform a judgment process on the relevance between the current problem and the historical conversation based on a preset model to obtain a judgment result; A truncation unit, configured to, if the judgment result is relevant, use the preset model to perform a truncation process on the current problem and the historical conversation to obtain the current conversation; A completion unit, configured to perform a completion process on the current conversation based on the preset model to obtain the target problem.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the conversation processing method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by the processor, the processor is caused to execute the conversation processing method according to any one of claims 1-7.