Man-machine conversation processing method and device, electronic equipment and storage medium

By using the communication intention prediction model and the large language model in the human-computer dialogue system, combined with action tags and intention operation instructions, the continuous conversation problem caused by weak user communication intention in the prior art is solved, and the effect of improving user satisfaction is achieved.

CN119862258APending Publication Date: 2025-04-22LINGXI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411924354.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The existing human-computer dialogue system still conducts continuous conversations when the user's communication intention is not strong, resulting in low user satisfaction with the service.

Method used

By entering the pre-constructed communication intention prediction model by entering the current wheel user side statement and the historical wheel user side statement sent by the user terminal, the communication intention of the user terminal is obtained, and the historical human-computer dialogue records of the current wheel user side statement and the session are input into the large language model, generating the current wheel machine side statement, and adding action tags that match the communication intention of the user terminal, and executing intention operation instructions.

Benefits of technology

It realizes the timely perception of user communication intentions during the human-computer dialogue process and adaptively conducts human-computer dialogue processing, thereby improving user satisfaction with service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862258A_ABST
    Figure CN119862258A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a man-machine conversation processing method and device, electronic equipment and a storage medium, and relates to the technical field of artificial intelligence. The man-machine conversation processing method comprises the following steps: inputting a current round user side statement and a historical round user side statement sent by a user terminal into a pre-constructed communication intention prediction model to obtain a communication intention of the user terminal; inputting the user side statement of the current round and the historical man-machine conversation record of the session into a pre-constructed large language model to obtain a machine side statement of the current round; adding an action label matched with the communication intention of the user terminal to the current round machine side statement; wherein the action label is used for indicating an intention operation instruction for the session; and sending the current round machine side statement to the user terminal, and executing the intention operation instruction after the user terminal receives the current round machine side statement. According to the embodiment of the invention, the satisfaction degree of the user to the service can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and more specifically, to a method, device, electronic device and storage medium for processing human-computer dialogue. Background Art

[0002] At present, human-computer dialogue systems are widely used in many fields, such as business marketing, to provide users with various services such as product recommendations and payment reminders. In the process of communicating with users, the existing human-computer dialogue systems usually only end the conversation after the service is completed or the user actively disconnects the conversation channel, which means that the conversation with the user continues even when the user has no strong communication intention, resulting in low user satisfaction with the service. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a human-computer dialogue processing method, device, electronic device and storage medium to achieve the technical effect of improving user satisfaction with the service.

[0004] In a first aspect, an embodiment of the present application provides a method for processing a human-computer dialogue, comprising:

[0005] Inputting the current round user side sentence and the historical round user side sentence sent by the user terminal into a pre-built communication intention prediction model to obtain the communication intention of the user terminal;

[0006] Input the current round of user-side sentences and the historical human-machine dialogue records of this conversation into a pre-built large language model to obtain the current round of machine-side sentences;

[0007] Adding an action tag matching the communication intention of the user terminal to the current round of machine-side statements; wherein the action tag is used to indicate the intended operation instruction for the current conversation;

[0008] The current wheel machine side statement is sent to the user terminal, and after the user terminal receives the current wheel machine side statement, the intended operation instruction is executed.

[0009] In the above implementation process, the communication intention of the user terminal is obtained by inputting the current round of user-side sentences and the historical rounds of user-side sentences sent by the user terminal into a pre-built communication intention prediction model, and the current round of user-side sentences and the historical human-computer dialogue records of this conversation are input into a pre-built large language model to obtain the current round of machine-side sentences. An action tag that matches the communication intention of the user terminal and is used to indicate the intention operation instruction for this conversation is added to the current round of machine-side sentences, the current round of machine-side sentences is sent to the user terminal, and after the user terminal receives the current round of machine-side sentences, the intention operation instruction is executed. In this way, the user's communication intention can be perceived in a timely manner during each round of dialogue between the human-computer dialogue terminal and the user terminal, and human-computer dialogue processing can be adaptively performed according to the user's communication intention, thereby improving user satisfaction with the service.

[0010] Furthermore, the step of inputting the current round user side statement and the historical round user side statement sent by the user terminal into a pre-built communication intention prediction model to obtain the communication intention of the user terminal includes:

[0011] Extracting target feature words from the current round of user-side sentences and the historical round of user-side sentences; wherein the target feature words are used to reflect user behavior characteristics;

[0012] The target feature word is input into the communication intention prediction model, so that the communication intention prediction model outputs the communication intention of the user terminal.

[0013] In the above implementation process, by extracting target feature words used to reflect user behavior characteristics from the current round of user-side statements and the historical round of user-side statements, the target feature words are input into the communication intention prediction model, so that the communication intention prediction model outputs the communication intention of the user terminal. This can ensure that the communication intention prediction model quickly learns the characteristics of the user-side statements to accurately predict the communication intention of the user terminal, thereby improving user satisfaction with the service.

[0014] Furthermore, the step of inputting the current round of user-side statements and the historical human-machine dialogue records of this session into a pre-built large language model to obtain the current round of machine-side statements includes:

[0015] splicing the current round of user-side statements and the historical human-computer dialogue records to obtain the current human-computer dialogue record;

[0016] Filling the current human-computer dialogue record in a predefined Prompt template to generate a Prompt instruction;

[0017] The Prompt instruction is input into the large language model, so that the large language model outputs the current round of machine-side sentences.

[0018] In the above implementation process, the current round of user-side statements and the historical human-computer dialogue records of this conversation are first spliced ​​into the current human-computer dialogue record, and then the Prompt instructions generated by filling in the current human-computer dialogue record on the pre-defined Prompt template are input into the large language model, so that the large language model outputs the current round of machine-side statements. This can ensure that the large language model can quickly and accurately understand the current business scenario and generate the current round of machine-side statements, which is conducive to improving the efficiency of human-computer dialogue processing.

[0019] Furthermore, before inputting the current round of user-side statements and the historical human-machine dialogue records of this conversation into a pre-built large language model to obtain the current round of machine-side statements, the method further includes:

[0020] The historical human-computer dialogue record is obtained according to the current session identifier carried by the current round of user-side statements; wherein the current session identifier is generated when the dialogue channel with the user terminal is successfully established this time, and is stored in association with the historical human-computer dialogue record.

[0021] In the above implementation process, by obtaining the historical human-computer dialogue record of this session stored in association with the session identifier carried by the current round of user-side statements, it is possible to ensure that the historical human-computer dialogue record of this session is obtained quickly and accurately, thereby improving user satisfaction with the service.

[0022] Further, adding an action tag matching the communication intention of the user terminal to the current round of machine-side statements includes:

[0023] In the case that the communication intention of the user terminal is to end the session, determining that the intention operation instruction includes a first operation instruction for canceling the voice broadcast of the current round of machine-side sentences to the user terminal, a second operation instruction for sending a session end prompt sentence to the user terminal, and a third operation instruction for disconnecting the session channel of the current session;

[0024] In the case where the communication intention of the user terminal is to continue the conversation, determining that the intention operation instruction includes a fourth operation instruction for voice broadcasting the current round of machine-side sentences to the user terminal;

[0025] The action label is generated according to the intended operation instruction, and the action label is added to the current round of machine-side statements.

[0026] In the above implementation process, when the communication intention of the user terminal is to end the session, it is determined that the intention operation instruction includes a first operation instruction for canceling the voice broadcast of the current round of machine-side statements to the user terminal, a second operation instruction for sending a session end prompt statement to the user terminal, and a third operation instruction for disconnecting the session channel of this session; when the communication intention of the user terminal is to continue the session, it is determined that the intention operation instruction includes a fourth operation instruction for voice broadcasting the current round of machine-side statements to the user terminal, an action label is generated according to the intention operation instruction, and an action label is added to the current round of machine-side statements, so that human-computer dialogue processing can be adaptively performed for both situations where the user intends to end the session and continue the session, thereby improving user satisfaction with the service.

[0027] Furthermore, the method further comprises:

[0028] Inserting the current round of user-side statements and the current round of machine-side statements into a message queue;

[0029] The message queue is consumed, the historical human-computer dialogue record is updated, and the updated historical human-computer dialogue record is stored.

[0030] In the above implementation process, by inserting the current round of user-side statements and the current round of machine-side statements into the message queue, consuming the message queue, updating the historical human-computer dialogue records, and storing the updated historical human-computer dialogue records, the human-computer dialogue processing pressure can be effectively reduced and a quick response can be ensured, thereby improving user satisfaction with the service.

[0031] Furthermore, before inputting the current round user side sentence and the historical round user side sentence sent by the user terminal into the pre-built communication intention prediction model to obtain the communication intention of the user terminal, it also includes:

[0032] Acquire the current round initial user side statement sent by the user terminal;

[0033] In a case where the current round initial user side statement is not text data, the current round initial user side statement is converted into text data to obtain the current round user side statement.

[0034] In the above implementation process, by first converting the current round initial user side sentence sent by the user terminal which is not text data into text data, the current round user side sentence is obtained, and then human-computer dialogue processing is performed based on the current round user side sentence. This can ensure that human-computer dialogue processing is effectively performed based on the user side sentence, thereby improving user satisfaction with the service.

[0035] In a second aspect, an embodiment of the present application provides a human-computer dialogue processing device, including:

[0036] A communication intention prediction module, used to input the current round user side sentence and the historical round user side sentence sent by the user terminal into a pre-built communication intention prediction model to obtain the communication intention of the user terminal;

[0037] A dialogue sentence acquisition module, used to input the current round of user-side sentences and the historical human-machine dialogue records of this conversation into a pre-built large language model to obtain the current round of machine-side sentences;

[0038] An action tag adding module, used to add an action tag matching the communication intention of the user terminal to the current round of machine-side statements; wherein the action tag is used to indicate the intended operation instruction for the current session;

[0039] The human-computer dialogue execution module is used to send the current wheel machine side statement to the user terminal, and execute the intended operation instruction after the user terminal receives the current wheel machine side statement.

[0040] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor; when the processor executes the computer program, the method as described above is implemented.

[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 A flowchart of a human-computer dialogue processing method provided in the first embodiment of the present application;

[0044] Figure 2 A schematic diagram of the structure of a human-computer dialogue processing device provided in the second embodiment of the present application;

[0045] Figure 3 A schematic diagram of the structure of an electronic device provided in the third embodiment of the present application. DETAILED DESCRIPTION

[0046] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0047] It should be noted that in the description of this application, the terms "first", "second", etc. are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance. At the same time, the step numbers in the text are only for the convenience of explaining the embodiments of this application and do not serve to limit the order of execution of the steps. The method provided in the embodiments of this application can be executed by relevant terminal devices, and the following description will be given by taking a human-machine dialogue terminal equipped with a human-machine dialogue system as an example of the execution subject.

[0048] Please see Figure 1 , Figure 1 The first embodiment of the present application provides a method for processing a human-computer dialogue, including steps S101 to S104:

[0049] S101, inputting the current round user side sentence and the historical round user side sentence sent by the user terminal into a pre-built communication intention prediction model to obtain the communication intention of the user terminal;

[0050] S102, inputting the current round of user-side statements and the historical human-machine dialogue records of this conversation into a pre-built large language model to obtain the current round of machine-side statements;

[0051] S103: adding an action tag matching the communication intention of the user terminal to the current round of machine-side statements; wherein the action tag is used to indicate the intended operation instruction for this conversation;

[0052] S104: Send the current wheel machine side statement to the user terminal, and execute the intended operation instruction after the user terminal receives the current wheel machine side statement.

[0053] As an example, the human-machine dialogue terminal can establish a conversation channel with any user terminal according to actual business needs, and when the conversation channel with a user terminal is successfully established, it interacts with the user terminal for multiple rounds of conversations to complete the conversation. The user terminal refers to a smart terminal such as a mobile phone, tablet or computer held by the user that can communicate with the human-machine dialogue terminal.

[0054] During each round of interaction with the user terminal, the human-machine dialogue terminal obtains the current round user-side statements and the historical round user-side statements sent by the user terminal.

[0055] It should be noted that the historical round user-side statements refer to the user-side statements sent by the user terminal in the historical round dialogues before the human-machine dialogue terminal interacted with the user terminal for the current round dialogue, such as the user-side statements in the previous round.

[0056] After obtaining the current user side statement and the historical user side statement, the human-computer dialogue terminal inputs the current user side statement and the historical user side statement into a pre-built communication intention prediction model to obtain the communication intention of the user terminal.

[0057] In practical applications, a classification model can be selected to build a communication intention prediction model. According to actual business needs, multiple communication intention categories are determined in advance, and the classification model is trained using sample user-side sentences labeled with communication intention categories, so that the classification model can fully learn the features of sample user-side sentences to accurately identify the communication intention categories corresponding to the sample user-side sentences, thereby building a communication intention prediction model.

[0058] After obtaining the current round of user-side statements and the historical human-computer dialogue records of this conversation, the human-computer dialogue terminal inputs the current round of user-side statements and the historical human-computer dialogue records of this conversation into a pre-built large language model to obtain the current round of machine-side statements.

[0059] In practical applications, large language models are pre-configured according to actual business needs. The Large Language Model (LLM) is a deep learning model trained based on massive text data. It can not only generate natural language text, but also deeply understand the meaning of the text and handle various natural language tasks, such as text summarization, question answering, translation, etc.

[0060] After obtaining the communication intention of the user terminal and the current round of machine-side statements, the human-computer dialogue terminal determines the action tag that matches the communication intention of the user terminal, where the action tag is used to indicate the intended operation instruction for this conversation and adds the action tag to the current round of machine-side statements.

[0061] After adding an action tag to the current round machine side statement, the human-computer dialogue terminal sends the current round machine side statement to the user terminal, and detects whether the user terminal has received the current round machine side statement. After the user terminal receives the current round machine side statement, it executes the intended operation instruction.

[0062] By first sending the current round of machine-side statements to the user terminal, and then executing the intended operation instruction after the user terminal receives the current round of machine-side statements, it can be ensured that the current round of machine-side statements are returned to the user terminal in a timely manner, and the connection status of this session can be monitored in real time, avoiding the human-computer dialogue terminal from continuing to process the human-computer dialogue after the user terminal actively disconnects the session channel.

[0063] The embodiment of the present application obtains the communication intention of the user terminal by inputting the current round of user-side sentences and the historical rounds of user-side sentences sent by the user terminal into a pre-built communication intention prediction model, inputs the current round of user-side sentences and the historical human-computer dialogue records of this conversation into a pre-built large language model to obtain the current round of machine-side sentences, adds an action tag that matches the communication intention of the user terminal and is used to indicate the intention operation instruction for this conversation to the current round of machine-side sentences, sends the current round of machine-side sentences to the user terminal, and executes the intention operation instruction after the user terminal receives the current round of machine-side sentences. The embodiment of the present application can timely perceive the user's communication intention in the process of each round of dialogue between the human-computer dialogue terminal and the user terminal, and adaptively perform human-computer dialogue processing according to the user's communication intention, thereby improving user satisfaction with the service.

[0064] In an optional embodiment, the current round of user side sentences and historical round of user side sentences sent by the user terminal are input into a pre-built communication intention prediction model to obtain the communication intention of the user terminal, including: extracting target feature words from the current round of user side sentences and historical round of user side sentences; wherein the target feature words are used to reflect user behavior characteristics; inputting the target feature words into the communication intention prediction model so that the communication intention prediction model outputs the communication intention of the user terminal.

[0065] As an exemplary embodiment, after acquiring the current round of user side statements and the historical round of user side statements, the human-computer dialogue terminal extracts target feature words for reflecting user behavior characteristics from the current round of user side statements and the historical round of user side statements.

[0066] In practical applications, considering that the longer the data length of the current round of user-side sentences and the historical round of user-side sentences is, the more target feature words they may contain. In order to reduce the data processing pressure of the communication intention prediction model, the current round of user-side sentences and the historical round of user-side sentences can be concatenated to obtain the current user-side paragraph, and multiple feature words used to reflect user behavior characteristics are extracted from the current user-side paragraph, such as "activate service", "do not activate service", "busy" or "no time", etc. The number of occurrences of each feature word in the current user-side paragraph is counted, and a preset number of feature words with the largest number of occurrences among the multiple feature words, such as 20 feature words, are determined as target feature words.

[0067] After obtaining the target feature words in the current round of user-side sentences and the historical rounds of user-side sentences, the human-computer dialogue terminal inputs the target feature words into a pre-built communication intention prediction model to obtain the communication intention of the user terminal.

[0068] The embodiment of the present application extracts target feature words that reflect user behavior characteristics from the current round of user-side statements and the historical round of user-side statements, and inputs the target feature words into a communication intention prediction model, so that the communication intention prediction model outputs the communication intention of the user terminal. This can ensure that the communication intention prediction model quickly learns the characteristics of the user-side statements to accurately predict the communication intention of the user terminal, thereby improving user satisfaction with the service.

[0069] In an optional embodiment, the current round of user-side statements and the historical human-computer dialogue records of this conversation are input into a pre-built large language model to obtain the current round of machine-side statements, including: concatenating the current round of user-side statements and the historical human-computer dialogue records to obtain the current human-computer dialogue record; filling the current human-computer dialogue record on a pre-defined Prompt template to generate a Prompt instruction; and inputting the Prompt instruction into the large language model to enable the large language model to output the current round of machine-side statements.

[0070] As an example, after acquiring the current round of user-side statements and the historical human-computer dialogue records of this conversation, the human-computer dialogue terminal splices the current round of user-side statements and the historical human-computer dialogue records of this conversation to obtain the current human-computer dialogue record.

[0071] For example, assuming that the current user-side statement is "Do not activate service A.", and the historical human-computer dialogue record of this session is "Human-computer dialogue terminal: Do you need to activate service A?", then the current human-computer dialogue record is {Human-computer dialogue terminal: "Do you need to activate service A?"; User terminal: "Do not activate service A."}.

[0072] When the human-machine dialogue terminal obtains the current human-machine dialogue record, it fills the current human-machine dialogue record on the predefined Prompt template, generates a Prompt instruction, and inputs the Prompt instruction into the large language model so that the large language model outputs the current round of machine-side sentences.

[0073] Prompt template is a prompt tool in Natural Language Processing (NLP) that can be used to guide large language models to better understand and respond to input.

[0074] The embodiment of the present application first splices the current round of user-side statements and the historical human-computer dialogue records of this conversation into the current human-computer dialogue record, and then fills the Prompt instructions generated by the current human-computer dialogue record in the pre-defined Prompt template into the large language model, so that the large language model outputs the current round of machine-side statements. This can ensure that the large language model can quickly and accurately understand the current business scenario and generate the current round of machine-side statements, which is conducive to improving the efficiency of human-computer dialogue processing.

[0075] In an optional embodiment, before the current round of user-side statements and the historical human-computer dialogue records of this conversation are input into a pre-built large language model to obtain the current round of machine-side statements, it also includes: obtaining the historical human-computer dialogue records according to the current round of user-side statements. The current session identifier is generated when the conversation channel with the user terminal is successfully established this time, and is stored in association with the historical human-computer dialogue records.

[0076] As an example, when the human-machine dialogue terminal successfully establishes the conversation channel with the user terminal this time, it generates a unique conversation identifier, so that in each round of conversation in this conversation, the user-side statement sent by the user terminal carries the conversation identifier.

[0077] After obtaining the current round of user-side statements sent by the user terminal, the human-computer dialogue terminal obtains the historical human-computer dialogue record of the current session stored in association with the current session identifier according to the current session identifier carried by the current round of user-side statements.

[0078] The embodiment of the present application obtains the historical human-computer dialogue record of the current session stored in association with the current session identifier according to the current session identifier carried by the current round of user-side statements, thereby ensuring that the historical human-computer dialogue record of the current session is obtained quickly and accurately, thereby improving user satisfaction with the service.

[0079] In an optional embodiment, the adding of an action tag matching the communication intention of the user terminal to the current round of machine-side statements includes: when the communication intention of the user terminal is to end the session, determining that the intention operation instruction includes a first operation instruction for canceling the voice broadcast of the current round of machine-side statements to the user terminal, a second operation instruction for sending a session end prompt statement to the user terminal, and a third operation instruction for disconnecting the session channel of this session; when the communication intention of the user terminal is to continue the session, determining that the intention operation instruction includes a fourth operation instruction for voice broadcasting the current round of machine-side statements to the user terminal; generating an action tag based on the intention operation instruction, and adding the action tag to the current round of machine-side statements.

[0080] As an exemplary embodiment, after acquiring the communication intention of the user terminal and the current round of machine-side statements, the human-machine dialogue terminal determines whether the communication intention of the user terminal is to end the session or to continue the session.

[0081] When the communication intention of the user terminal is to end the conversation, a first operation instruction is generated to cancel the voice broadcast of the current round of machine-side sentences to the user terminal, a second operation instruction is generated to send a conversation end prompt statement to the user terminal, and a third operation instruction is generated to disconnect the conversation channel of this conversation, and it is determined that the intention operation instruction includes the first operation instruction, the second operation instruction and the third operation instruction.

[0082] When the communication intention of the user terminal is to continue the conversation, a fourth operation instruction is generated for voice broadcasting the current round of machine-side sentences to the user terminal, and it is determined that the intention operation instruction includes the fourth operation instruction.

[0083] After determining the intended operation instruction, the human-machine dialogue terminal generates an action label according to the intended operation instruction and adds the action label to the current round of machine-side statements.

[0084] After adding an action tag to the current round machine side statement, the human-computer dialogue terminal sends the current round machine side statement to the user terminal, and detects whether the user terminal has received the current round machine side statement. After the user terminal receives the current round machine side statement, it executes the intended operation instruction.

[0085] Assuming that the intended operation instruction includes a first operation instruction, a second operation instruction and a third operation instruction, the human-computer dialogue terminal performs the following operations after receiving the current round of machine-side statements at the user terminal: cancel the voice broadcast of the current round of machine-side statements to the user terminal; generate a session end prompt statement, such as "Okay, then I won't disturb you for now, thank you for answering the call, and I wish you a happy life!", and send a session end prompt statement to the user terminal; disconnect the session channel of this session.

[0086] Assuming that the intended operation instruction includes the fourth operation instruction, the human-machine dialogue terminal performs the following operations after the user terminal receives the current round of machine-side statements: voice broadcasting the current round of machine-side statements to the user terminal.

[0087] The embodiment of the present application determines, when the communication intention of the user terminal is to end the session, that the intention operation instruction includes a first operation instruction for canceling the voice broadcast of the current round of machine-side statements to the user terminal, a second operation instruction for sending a session end prompt statement to the user terminal, and a third operation instruction for disconnecting the session channel of this session; and when the communication intention of the user terminal is to continue the session, determines that the intention operation instruction includes a fourth operation instruction for voice broadcasting the current round of machine-side statements to the user terminal, generates an action label according to the intention operation instruction, and adds the action label to the current round of machine-side statements. Human-computer dialogue processing can be adaptively performed for both situations where the user intends to end the session and continue the session, thereby improving user satisfaction with the service.

[0088] In an optional embodiment, the method further includes steps S105-S106:

[0089] S105, inserting the current round of user-side statements and the current round of machine-side statements into a message queue;

[0090] S106: Consume the message queue, update the historical human-computer dialogue record, and store the updated historical human-computer dialogue record.

[0091] As an exemplary example, after obtaining the current round of machine-side statements, the human-computer dialogue terminal sequentially inserts the previously obtained current round of user-side statements and the current round of machine-side statements into the message queue.

[0092] After inserting the current round of user-side statements and the current round of machine-side statements into the message queue, the human-computer dialogue terminal consumes the message queue, updates the historical human-computer dialogue records, and stores the updated historical human-computer dialogue records in order to continue the next round of dialogue and persist the updated historical human-computer dialogue records.

[0093] Message Queue (MQ) refers to a container that stores messages during the transmission process. It is a message middleware used to implement asynchronous communication. When a thread of a human-computer dialogue terminal inserts the current round of user-side statements and the current round of machine-side statements into the message queue, the thread will directly return to perform other operations. The message queue can be connected to another thread or other process of the human-computer dialogue terminal. Another thread or other process of the human-computer dialogue terminal can consume the message queue, obtain the current round of user-side statements and the current round of machine-side statements to update the historical human-computer dialogue record of this session, and store the updated historical human-computer dialogue record, so as to achieve asynchronous update of the historical human-computer dialogue record and storage of the updated historical human-computer dialogue record.

[0094] The message queue follows the "first in, first out" principle. By obtaining the current round of user-side statements and the current round of machine-side statements from the message queue to update the historical human-computer dialogue records, the updated historical human-computer dialogue records can be obtained. This can ensure that the current round of user-side statements and the current round of machine-side statements are recorded in sequence and the historical human-computer dialogue records are accurately updated.

[0095] In practical applications, the updated historical human-computer dialogue records may be stored in the target cache.

[0096] Cache refers to a high-speed memory with a faster access speed than general random access memory (RAM). By storing the updated historical human-computer dialogue records in the target cache, the historical human-computer dialogue records of this conversation can be instantly obtained in each conversation round after this conversation in this conversation.

[0097] In practical applications, Redis cache can be used as the target cache.

[0098] Redis (Remote Dictionary Server) cache is an open source log-type, key-value database written in ANSI C language, supporting the network, memory-based and persistent, and providing APIs (Application Programming Interface) in multiple languages.

[0099] By selecting Redis cache as the target cache and storing the updated historical human-computer dialogue records in the Redis cache, the historical human-computer dialogue records of this session can be instantly obtained in each round of dialogue after this round of dialogue in this session. The session identifier can also be used as the key and the historical human-computer dialogue records as the corresponding value to associate the two for storage, which is conducive to improving the processing speed of each round of dialogue.

[0100] The embodiment of the present application inserts the current round of user-side statements and the current round of machine-side statements into the message queue, consumes the message queue, updates the historical human-computer dialogue records, and stores the updated historical human-computer dialogue records, which can effectively reduce the pressure of human-computer dialogue processing and ensure rapid response, thereby improving user satisfaction with the service.

[0101] In an optional embodiment, before inputting the current round user side statement and the historical round user side statement sent by the user terminal into a pre-built communication intention prediction model to obtain the communication intention of the user terminal, it also includes: obtaining the current round initial user side statement sent by the user terminal; when the current round initial user side statement is not text data, converting the current round initial user side statement into text data to obtain the current round user side statement.

[0102] As an example, considering that the user terminal may send non-text data such as voice in actual scenarios, in order to ensure effective human-computer dialogue processing based on user-side sentences, the non-text data sent by the user terminal can be converted into text data.

[0103] During each round of dialogue between the human-computer dialogue terminal and the user terminal, the human-computer dialogue terminal obtains the current round initial user side statement sent by the user terminal, determines whether the current round initial user side statement is text data, and if the current round initial user side statement is not text data, converts the current round initial user side statement into text data to obtain the current round user side statement, and if the current round initial user side statement is text data, directly determines the current round initial user side statement as the current round user side statement.

[0104] The embodiment of the present application first converts the current round initial user side statement sent by the user terminal which is not text data into text data to obtain the current round user side statement, and then performs human-computer dialogue processing based on the current round user side statement. This can ensure that human-computer dialogue processing is effectively performed based on the user side statement, thereby improving user satisfaction with the service.

[0105] Please see Figure 2 , Figure 2 A schematic diagram of the structure of a human-computer dialogue processing device provided for the second embodiment of the present application. The second embodiment of the present application provides a human-computer dialogue processing device, including: a communication intention prediction module 201, which is used to input the current round of user-side statements and historical rounds of user-side statements sent by the user terminal into a pre-built communication intention prediction model to obtain the communication intention of the user terminal; a dialogue sentence acquisition module 202, which is used to input the current round of user-side statements and the historical human-computer dialogue records of this conversation into a pre-built large language model to obtain the current round of machine-side statements; an action label adding module 203, which is used to add an action label matching the communication intention of the user terminal to the current round of machine-side statements; wherein the action label is used to indicate the intention operation instruction for this conversation; a human-computer dialogue execution module 204, which is used to send the current round of machine-side statements to the user terminal, and execute the intention operation instruction after the user terminal receives the current round of machine-side statements.

[0106] In an optional embodiment, the current round of user side sentences and historical round of user side sentences sent by the user terminal are input into a pre-built communication intention prediction model to obtain the communication intention of the user terminal, including: extracting target feature words from the current round of user side sentences and historical round of user side sentences; wherein the target feature words are used to reflect user behavior characteristics; inputting the target feature words into the communication intention prediction model so that the communication intention prediction model outputs the communication intention of the user terminal.

[0107] In an optional embodiment, the current round of user-side statements and the historical human-computer dialogue records of this conversation are input into a pre-built large language model to obtain the current round of machine-side statements, including: concatenating the current round of user-side statements and the historical human-computer dialogue records to obtain the current human-computer dialogue record; filling the current human-computer dialogue record on a pre-defined Prompt template to generate a Prompt instruction; and inputting the Prompt instruction into the large language model to enable the large language model to output the current round of machine-side statements.

[0108] In an optional embodiment, the dialogue sentence acquisition module 202 is also used to obtain the historical human-computer dialogue record according to the current session identifier carried by the current round of user-side sentences before inputting the current round of user-side sentences and the historical human-computer dialogue records of this conversation into a pre-built large language model to obtain the current round of machine-side sentences; wherein the current session identifier is generated when the conversation channel with the user terminal is successfully established this time, and is stored in association with the historical human-computer dialogue record.

[0109] In an optional embodiment, the adding of an action tag matching the communication intention of the user terminal to the current round of machine-side statements includes: when the communication intention of the user terminal is to end the session, determining that the intention operation instruction includes a first operation instruction for canceling the voice broadcast of the current round of machine-side statements to the user terminal, a second operation instruction for sending a session end prompt statement to the user terminal, and a third operation instruction for disconnecting the session channel of this session; when the communication intention of the user terminal is to continue the session, determining that the intention operation instruction includes a fourth operation instruction for voice broadcasting the current round of machine-side statements to the user terminal; generating an action tag based on the intention operation instruction, and adding the action tag to the current round of machine-side statements.

[0110] In an optional embodiment, the device also includes: a dialogue record update module, which is used to: insert the current round of user-side statements and the current round of machine-side statements into the message queue; consume the message queue, update the historical human-computer dialogue record, and store the updated historical human-computer dialogue record.

[0111] In an optional embodiment, the device also includes: a user-side statement preprocessing module, which is used to: obtain the current round initial user-side statement sent by the user terminal before inputting the current round user-side statement and the historical round user-side statement sent by the user terminal into a pre-built communication intention prediction model to obtain the communication intention of the user terminal; when the current round initial user-side statement is not text data, convert the current round initial user-side statement into text data to obtain the current round user-side statement.

[0112] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0113] Please see Figure 3 , Figure 3 The third embodiment of the present application provides an electronic device 30, comprising a processor 301, a memory 302, and a computer program stored in the memory 302 and configured to be executed by the processor 301; when the processor 301 executes the computer program, the method described in the first embodiment of the present application is implemented and the same beneficial effects can be achieved.

[0114] When the processor 301 reads the computer program from the memory 302 through the bus 303 and executes the computer program, the method of any embodiment included in the method described in the first embodiment of the present application can be implemented.

[0115] Processor 301 can process digital signals and can include various computing structures, such as complex instruction set computer structure, reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, processor 301 can be a microprocessor.

[0116] The memory 302 may be used to store instructions executed by the processor 301 or data related to the execution of instructions. These instructions and / or data may include codes for implementing some or all functions of one or more modules described in the embodiments of the present application. The processor 301 of the disclosed embodiment may be used to execute instructions in the memory 302 to implement the method described in the first embodiment of the present application. The memory 302 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory, or other memory known to those skilled in the art.

[0117] The fourth embodiment of the present application provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method described in the first embodiment of the present application, and can achieve the same beneficial effects as the method.

[0118] In summary, the embodiments of the present application provide a method, device, electronic device and storage medium for processing human-computer dialogue, wherein the method includes: inputting the current round of user-side statements and historical rounds of user-side statements sent by the user terminal into a pre-built communication intention prediction model to obtain the communication intention of the user terminal; inputting the current round of user-side statements and the historical human-computer dialogue records of this conversation into a pre-built large language model to obtain the current round of machine-side statements; adding an action tag that matches the communication intention of the user terminal to the current round of machine-side statements; wherein the action tag is used to indicate the intention operation instruction for this conversation; sending the current round of machine-side statements to the user terminal, and executing the intention operation instruction after the user terminal receives the current round of machine-side statements. The embodiment of the present application obtains the communication intention of the user terminal by inputting the current round of user-side sentences and the historical rounds of user-side sentences sent by the user terminal into a pre-built communication intention prediction model, inputs the current round of user-side sentences and the historical human-computer dialogue records of this conversation into a pre-built large language model to obtain the current round of machine-side sentences, adds an action tag that matches the communication intention of the user terminal and is used to indicate the intention operation instruction for this conversation to the current round of machine-side sentences, sends the current round of machine-side sentences to the user terminal, and executes the intention operation instruction after the user terminal receives the current round of machine-side sentences. The embodiment of the present application can timely perceive the user's communication intention in the process of each round of dialogue between the human-computer dialogue terminal and the user terminal, and adaptively perform human-computer dialogue processing according to the user's communication intention, thereby improving user satisfaction with the service.

[0119] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0120] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0121] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0122] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for processing human-computer dialogue, characterized in that: include: Inputting the current round user side sentence and the historical round user side sentence sent by the user terminal into a pre-built communication intention prediction model to obtain the communication intention of the user terminal; Input the current round of user-side sentences and the historical human-machine dialogue records of this conversation into a pre-built large language model to obtain the current round of machine-side sentences; Adding an action tag matching the communication intention of the user terminal to the current round of machine-side statements; wherein the action tag is used to indicate the intended operation instruction for the current conversation; The current wheel machine side statement is sent to the user terminal, and after the user terminal receives the current wheel machine side statement, the intended operation instruction is executed.

2. The method according to claim 1, characterized in that The step of inputting the current round of user-side statements and the historical round of user-side statements sent by the user terminal into a pre-built communication intention prediction model to obtain the communication intention of the user terminal includes: Extracting target feature words from the current round of user-side sentences and the historical round of user-side sentences; wherein the target feature words are used to reflect user behavior characteristics; The target feature word is input into the communication intention prediction model, so that the communication intention prediction model outputs the communication intention of the user terminal.

3. The method according to claim 1, characterized in that The step of inputting the current round of user-side statements and the historical human-machine dialogue records of this session into a pre-built large language model to obtain the current round of machine-side statements includes: splicing the current round of user-side statements and the historical human-computer dialogue records to obtain the current human-computer dialogue record; Filling the current human-computer dialogue record in a predefined Prompt template to generate a Prompt instruction; The Prompt instruction is input into the large language model, so that the large language model outputs the current round of machine-side sentences.

4. The method according to claim 1, characterized in that: Before inputting the current round of user-side statements and the historical human-machine dialogue records of this conversation into a pre-built large language model to obtain the current round of machine-side statements, the method further includes: The historical human-computer dialogue record is obtained according to the current session identifier carried by the current round of user-side statements; wherein the current session identifier is generated when the dialogue channel with the user terminal is successfully established this time, and is stored in association with the historical human-computer dialogue record.

5. The method according to claim 1, characterized in that The adding an action tag matching the communication intention of the user terminal to the current round of machine-side statements includes: In the case where the communication intention of the user terminal is to end the session, determining that the intention operation instruction includes a first operation instruction for canceling the voice broadcast of the current round of machine-side sentences to the user terminal, a second operation instruction for sending a session end prompt sentence to the user terminal, and a third operation instruction for disconnecting the session channel of the current session; or, In the case where the communication intention of the user terminal is to continue the conversation, determining that the intention operation instruction includes a fourth operation instruction for voice broadcasting the current round of machine-side sentences to the user terminal; The action label is generated according to the intended operation instruction, and the action label is added to the current round of machine-side statements.

6. The method according to claim 1, characterized in that The method further comprises: Inserting the current round of user-side statements and the current round of machine-side statements into a message queue; The message queue is consumed, the historical human-computer dialogue record is updated, and the updated historical human-computer dialogue record is stored.

7. The method according to any one of claims 1 to 6, characterized in that: Before inputting the current round of user-side statements and the historical round of user-side statements sent by the user terminal into a pre-built communication intention prediction model to obtain the communication intention of the user terminal, the method further includes: Acquire the current round initial user side statement sent by the user terminal; In a case where the current round initial user side statement is not text data, the current round initial user side statement is converted into text data to obtain the current round user side statement.

8. A human-computer dialogue processing device, characterized in that: include: A communication intention prediction module, used to input the current round user side sentence and the historical round user side sentence sent by the user terminal into a pre-built communication intention prediction model to obtain the communication intention of the user terminal; A dialogue sentence acquisition module, used to input the current round of user-side sentences and the historical human-machine dialogue records of this conversation into a pre-built large language model to obtain the current round of machine-side sentences; An action tag adding module, used to add an action tag matching the communication intention of the user terminal to the current round of machine-side statements; wherein the action tag is used to indicate the intended operation instruction for the current session; The human-computer dialogue execution module is used to send the current wheel machine side statement to the user terminal, and execute the intended operation instruction after the user terminal receives the current wheel machine side statement.

9. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor; when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.