Conversation processing method, voice conversation method, computing device, computer readable storage medium and computer program product
By using reference data assisted model processing based on dialogue situation information expansion in the human-computer dialogue system, the problem of dialogue interruption is solved and the authenticity and fluency of interaction is improved.
Patent Information
- Application Number
- CN202411034279.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-12-31
AI Technical Summary
The existing human-computer dialogue system is prone to interruption of dialogue during the interaction process, resulting in poor authenticity and fluency, and it is impossible to conduct natural chats like humans.
By obtaining target dialogue data, determining processing strategies, and entering it with reference dialogue data expanded based on dialogue situation information into the target dialogue model, obtaining replies results, and using reference data auxiliary models to actively output content, avoiding dialogue interruption, improving fluency and Naturalness.
It realizes more realistic and smooth human-computer dialogue, enhances the accuracy and naturalness of dialogue processing, and avoids interruptions in dialogue.
Smart Images

Figure CN119226453A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of computer technology, and in particular, to a dialogue processing method, a voice dialogue method, a computing device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the development of artificial intelligence, human-computer dialogue technology has gradually become a widely used technology. Human-computer dialogue focuses on enabling machines to understand, generate and use natural language to communicate effectively with humans. This involves multiple technical links such as speech recognition, natural language understanding, dialogue management, and natural language generation. The purpose is to enable machines to chat, provide information queries, perform service reservations, and other tasks like humans.
[0003] At present, in the process of human-computer interaction, the conversation robot may be unable to answer the user's input, resulting in interrupted conversations. This does not conform to the real chat scenario between humans, resulting in poor authenticity and fluency in human-computer interaction. Therefore, a more realistic and smooth conversation processing solution is urgently needed. Summary of the invention
[0004] In view of this, an embodiment of this specification provides a method for processing a conversation. One or more embodiments of this specification also relate to a method for processing a voice conversation, a conversation processing device, a voice conversation device, a computing device, a computer-readable storage medium, and a computer program product to solve the technical defects existing in the prior art.
[0005] According to a first aspect of an embodiment of this specification, a dialog processing method is provided, including:
[0006] Get the target conversation data;
[0007] Determine a processing strategy for the target conversation data based on the target conversation data;
[0008] When it is determined that the processing strategy is to process the target conversation data based on the reference conversation data, the target conversation data and the reference conversation data are input into the target conversation model to obtain a reply result for the target conversation data, wherein the reference conversation data is obtained by expanding the conversation content based on the conversation context information.
[0009] According to a second aspect of the embodiments of this specification, a voice conversation method is provided, including:
[0010] Get voice conversation data;
[0011] Determine a processing strategy for the voice conversation data based on the voice conversation data;
[0012] When it is determined that the processing strategy is to process the voice dialogue data based on the reference dialogue data, the voice dialogue data and the reference dialogue data are input into the target dialogue model to obtain the reply result of the voice dialogue data, wherein the reference dialogue data is obtained by expanding the dialogue content based on the dialogue context information.
[0013] According to a third aspect of the embodiments of this specification, a voice conversation method is provided, including:
[0014] Get the client's voice conversation data;
[0015] Determine a processing strategy for the voice conversation data based on the voice conversation data;
[0016] In the case where the processing strategy is determined to process the voice dialogue data based on the reference dialogue data, the voice dialogue data and the reference dialogue data are input into the target dialogue model to obtain a reply result of the voice dialogue data, wherein the reference dialogue data is obtained by expanding the dialogue content based on the dialogue context information;
[0017] Report the response result of the voice conversation data to the client.
[0018] According to a fourth aspect of an embodiment of this specification, a dialog processing device is provided, including:
[0019] A first acquisition module is configured to acquire target conversation data;
[0020] A first determination module is configured to determine a processing strategy for the target conversation data according to the target conversation data;
[0021] The first input module is configured to input the target conversation data and the reference conversation data into the target conversation model to obtain a reply result for the target conversation data when determining that the processing strategy is to process the target conversation data based on the reference conversation data, wherein the reference conversation data is obtained by expanding the conversation content based on the conversation context information.
[0022] According to a fifth aspect of the embodiments of this specification, a voice dialogue device is provided, including:
[0023] A second acquisition module is configured to acquire voice conversation data;
[0024] A second determination module is configured to determine a processing strategy for the voice dialogue data based on the voice dialogue data;
[0025] The second input module is configured to input the voice conversation data and the reference conversation data into the target conversation model to obtain a reply result of the voice conversation data when determining that the processing strategy is to process the voice conversation data based on the reference conversation data, wherein the reference conversation data is obtained by expanding the conversation content based on the conversation context information.
[0026] According to a sixth aspect of the embodiments of this specification, there is provided a voice dialogue device, including:
[0027] A third acquisition module is configured to acquire the voice conversation data of the client;
[0028] A third determination module is configured to determine a processing strategy for the voice dialogue data based on the voice dialogue data;
[0029] A third input module is configured to input the voice dialogue data and the reference dialogue data into the target dialogue model to obtain a reply result of the voice dialogue data when the processing strategy is to process the voice dialogue data based on the reference dialogue data, wherein the reference dialogue data is obtained by expanding the dialogue content based on the dialogue context information;
[0030] The reporting module is configured to report the reply result of the voice dialogue data to the client.
[0031] According to a seventh aspect of an embodiment of this specification, there is provided a computing device, including:
[0032] Memory and processor;
[0033] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method provided in the first aspect, the second aspect, or the third aspect are implemented.
[0034] According to an eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the method provided in the first aspect, the second aspect, or the third aspect are implemented.
[0035] According to the ninth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the steps of the method provided in the first aspect, the second aspect, or the third aspect.
[0036] A method for processing a conversation provided by an embodiment of the specification includes: obtaining target conversation data; obtaining target conversation data; determining a processing strategy for the target conversation data according to the target conversation data; in the case where the processing strategy is determined to be processing the target conversation data based on reference conversation data, inputting the target conversation data and the reference conversation data into a target conversation model to obtain a reply result of the target conversation data, wherein the reference conversation data is obtained by expanding the conversation content based on conversation context information. First, by parsing the target conversation data, the processing strategy for the target conversation data is determined, so that the processing strategy is more consistent with the target conversation data, and the accuracy of the conversation processing is ensured; secondly, since the reference conversation data is obtained by expanding the conversation content based on the conversation context information, the reference conversation data is more consistent with the real conversation scene; in addition, in the case where the processing strategy is determined to be processing the target conversation data based on the reference conversation data, the reference conversation data is used to assist the target conversation model in conversation processing, so that the target conversation model can obtain knowledge from the reference conversation data, and actively output content in combination with the semantic understanding ability of the model itself, so as to avoid conversation interruptions and improve the fluency and naturalness of conversation processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is an architecture diagram of a conversation processing system provided by an embodiment of this specification;
[0038] Figure 2 is an architecture diagram of another dialog processing system provided by an embodiment of this specification;
[0039] Figure 3 is a flow chart of a conversation processing method provided by an embodiment of this specification;
[0040] Figure 4 is a flow chart of a voice dialogue method provided by an embodiment of this specification;
[0041] Figure 5 is a processing flow chart of a voice dialogue method provided by an embodiment of this specification;
[0042] Figure 6 is a flow chart of another voice dialogue method provided by an embodiment of this specification;
[0043] Figure 7 is a structural diagram of a conversation processing device provided by an embodiment of this specification;
[0044] Figure 8 It is a structural schematic diagram of a voice dialogue device provided by an embodiment of this specification;
[0045] Fig. 9is a structural diagram of another conversation processing device provided by an embodiment of this specification;
[0046] Fig.10 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0047] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0048] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0049] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0050] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0051] In one or more embodiments of this specification, a large model refers to a deep learning model with large-scale model parameters, which usually contains hundreds of millions, tens of billions, hundreds of billions, trillions, or even more than 10 trillion model parameters. A large model can also be called a foundation model / foundation model (Foundation Model 1). The large model is pre-trained with large-scale unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks, and the model has good generalization ability, such as a large-scale language model (LLM, Large Language Model 1), a multi-modal pre-training model (multi-modal pre-training model 1), etc.
[0052] When the big model is used in practice, only a small number of samples are needed to fine-tune the pre-trained model and it can be applied to different tasks. The big model can be widely used in natural language processing (NLP), computer vision and other fields. Specifically, it can be applied to computer vision tasks such as visual question answering (VQA), image description (IC), image generation, as well as natural language processing tasks such as text-based sentiment classification, text summary generation, and machine translation. The main application scenarios of the big model include digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, etc.
[0053] First, the terms involved in one or more embodiments of this specification are explained.
[0054] Agent: refers to a software entity that can perceive the environment and make decisions or perform actions based on its perception results to achieve specific goals.
[0055] Multi-Agent: refers to a system that uses multiple agents to collaborate to achieve specific goals.
[0056] Voice chat: is a technology that communicates via voice, usually in real time. Voice chat allows users to have conversations through any of a microphone, speaker, or headset. In the field of artificial intelligence, voice chat usually refers to a system in which a user interacts with an intelligent assistant (Assistant) via voice, such as a smart speaker or a virtual assistant on a smartphone.
[0057] Conversation Management Unit: In voice interaction applications, the conversation management unit is the component responsible for controlling the flow of conversations with the user. The conversation management unit usually processes user input, executes corresponding conversation processing strategies, manages the state of the conversation, determines when to return control to the user, and how to respond to user input. The conversation management unit is a key part of ensuring natural and effective human-computer interaction.
[0058] Function call: In programming, a function call is the process of referencing or executing a function in a program. A function is a block of code that contains a series of programming instructions designed to accomplish a specific task. When the program reaches the code for a function call, it jumps to the location where the function is defined, executes the code within the function, and returns to the place where the function was called to continue executing the rest of the program after completion.
[0059] Deep Self-Attention (Transformer) Model: It is a deep learning architecture based on the attention mechanism, mainly used to process sequence data. The Transformer model consists of a series of encoders and decoders that can be repeatedly stacked. This design allows the Transformer to efficiently learn long-term dependencies and is suitable for a variety of natural language processing tasks including machine translation, text summarization, question-answering systems, etc.
[0060] Large-scale language model: is an artificial intelligence technology that uses deep learning neural networks, especially the Transformer architecture, to train large amounts of text data to generate language. These models can understand language, generate coherent text, answer questions, translate, summarize, and perform many other language-related tasks.
[0061] At present, common voice dialogue frameworks are all assistant-type subordinate designs. Intelligent assistants can respond to human requests through voice replies to promote dialogue. For example, users can click the "call button" to have a voice call with the intelligent assistant, but the conversation needs to proceed in a question-and-answer paradigm of "user says"-"intelligent assistant says"-"user says". During the conversation, the intelligent assistant does not have the ability to actively interrupt, actively raise topics, and broadcast continuously, resulting in the conversation process not meeting the experience of real chat between humans. In addition, humans usually have two roles in real chats: active and passive. For example, relatively introverted people are not good at guiding the direction of the chat, resulting in interruptions in the conversation process, and poor authenticity and fluency.
[0062] In order to solve the above problems, the embodiments of this specification propose a dialogue processing solution, which determines the processing strategy of the dialogue data according to the actual situation of the dialogue data, and when it is determined that the processing strategy is to process the target dialogue data based on the reference dialogue data, the target dialogue data and the reference dialogue data are input into the target dialogue model to obtain the reply result of the target dialogue data, and the reference dialogue data is used to assist the target dialogue model in dialogue processing, so that the target dialogue model can acquire knowledge from the reference dialogue data, and combine the model's own semantic understanding ability to actively output content, avoid dialogue interruptions, and improve the fluency and naturalness of dialogue processing.
[0063] In this specification, a conversation processing method is provided. This specification also relates to a voice conversation method, a conversation processing device, a voice conversation device, a computing device, a computer-readable storage medium and a computer program product, which are described in detail one by one in the following embodiments.
[0064] See also Figure 1 , Figure 1 The diagram shows an architecture diagram of a dialog processing system provided by an embodiment of the present specification. The dialog processing system may include a client 100 and a server 200;
[0065] The client 100 is used to send target conversation data to the server 200 .
[0066] The server 200 is used to determine a processing strategy for the target conversation data based on the target conversation data; when the processing strategy is determined to be to process the target conversation data based on the reference conversation data, the target conversation data and the reference conversation data are input into a target conversation model to obtain a reply result for the target conversation data, wherein the reference conversation data is obtained by expanding the conversation content based on conversation context information; and the reply result for the target conversation data is sent to the client 100.
[0067] The client 100 is also used to receive a response result of the target conversation data sent by the server 200.
[0068] The scheme of the embodiments of the present specification is applied, firstly, by parsing the target dialogue data, a processing strategy for the target dialogue data is determined, so that the processing strategy is more closely matched with the target dialogue data, thereby ensuring the accuracy of dialogue processing; secondly, because the reference dialogue data is obtained by expanding the dialogue content based on dialogue context information, the reference dialogue data is more consistent with the real dialogue scene; in addition, when it is determined that the processing strategy is to process the target dialogue data based on the reference dialogue data, the reference dialogue data is used to assist the target dialogue model in dialogue processing, so that the target dialogue model can acquire knowledge from the reference dialogue data that conforms to the real dialogue scene, and actively output content in combination with the model's own semantic understanding ability, so as to avoid dialogue interruptions and improve the fluency and naturalness of dialogue processing.
[0069] See also Figure 2 , Figure 2 The diagram shows an architecture of another dialog processing system provided by an embodiment of the present specification. The dialog processing system may include multiple clients 100 and a server 200, wherein the client 100 may include a terminal-side device and the server 200 may include a cloud-side device. A communication connection may be established between multiple clients 100 through the server 200. In the dialog processing scenario, the server 200 is used to provide dialog processing services between multiple clients 100. Multiple clients 100 may serve as a sending end or a receiving end respectively, and realize communication through the server 200.
[0070] The user can interact with the server 200 through the client 100 to receive data sent by other clients 100, or send data to other clients 100, etc. In the dialogue processing scenario, the user can publish a data stream to the server 200 through the client 100, and the server 200 generates a reply result based on the data stream, and pushes the reply result to other clients that have established communication. Among them, the client 100 and the server 200 are connected through a network. The network provides a medium for the communication link between the client 100 and the server 200. The network can include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The data transmitted by the client 100 may need to be encoded, transcoded, compressed, etc. before being published to the server 200.
[0071] The client 100 can be a browser, an application (APP, App l icat ion), or a web application such as HyperText Markup Language Version 5 (H5, HyperText Markup Language 5) application, or a light application (also known as a mini-program, a lightweight application) or a cloud application, etc. The client 100 can be based on the software development kit (SDK, Software Development Kit) of the corresponding service provided by the server 200, such as based on the real-time communication (RTC, Real Time Communication) SDK development and acquisition. The client 100 can be deployed in an electronic device, and needs to rely on the device to run or some APPs in the device to run. For example, the electronic device can have a display screen and support information browsing, such as a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, etc. Various other types of applications can also be configured in the electronic device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, mailbox clients, social platform software, etc.
[0072] The server 200 may include servers that provide various services, such as servers that provide communication services to multiple clients, servers for background training that provide support for models used on clients, and servers that process data sent by clients. It should be noted that the server 200 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server for basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content De l ivery Network), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0073] It is worth noting that the conversation processing method provided in the embodiments of this specification is generally executed by the server, but in other embodiments of this specification, the client may also have similar functions to the server, thereby executing the conversation processing method provided in the embodiments of this specification. In other embodiments, the conversation processing method provided in the embodiments of this specification may also be jointly executed by the client and the server.
[0074] See also Figure 3 , Figure 3 A flow chart of a conversation processing method provided by an embodiment of the present specification is shown, which specifically includes the following steps:
[0075] Step 302: Obtain target conversation data.
[0076] In one or more embodiments of the present specification, when the dialogue processing starts, the target dialogue data may be acquired, and the dialogue processing may be further performed based on the target dialogue data to obtain a response result corresponding to the target dialogue data.
[0077] Exemplarily, the target dialogue data refers to the data generated by the user during the dialogue interaction process. The target dialogue data can be data in different scenarios, such as conference data in a conference scenario, discussion data in a podcast scenario, and so on. The target dialogue data can be single-round dialogue data, such as dialogue data in a question-and-answer scenario, or multi-round dialogue data, such as dialogue data in scenarios such as chatting, negotiation, guidance, and debate. There may be multiple dialogue processing tasks corresponding to the target dialogue data, such as speech summary extraction tasks, speech-to-text transcription tasks, speech content retrieval tasks, and so on. The target dialogue data may include at least one of the target dialogue content and the target dialogue state.
[0078] The target conversation content refers to the content actually communicated by at least one user. The user can be a human or a machine. The target conversation content includes questions raised, facts stated, emotions expressed, opinions shared, and other content that constitute the conversation entity. The target conversation content can be text content or voice content. The text content can be the transcript of the conversation in voice or video.
[0079] The target conversation state is used to reflect the current conversation progress. The target conversation state includes the conversation state and the silent state. The conversation state indicates that the user has output content during the conversation. The silent state indicates that the user has no output content during the conversation. The target conversation state can be used to determine whether there is a break in the conversation process, thereby ensuring the continuity of the conversation in the event of a break.
[0080] It should be noted that if the target conversation data includes the target conversation content, it means that during the current conversation, the user has output content, and the target conversation state is the conversation state. If the target conversation data does not include the target conversation content, it means that during the current conversation, the user has no output content, and the target conversation state is the silent state.
[0081] In actual applications, there are many ways to obtain the target conversation data, which can be selected according to the actual situation, and the embodiments of this specification do not limit this. In one possible implementation of this specification, the target conversation data sent by the user through the client can be received. In another possible implementation of this specification, the target conversation data can be read from other data acquisition devices or databases.
[0082] Step 304: Determine a processing strategy for the target conversation data according to the target conversation data.
[0083] In one or more embodiments of the present specification, after the target conversation data is acquired, a processing strategy for the target conversation data may be determined based on the target conversation data.
[0084] Exemplarily, the processing strategy of the target conversation data refers to a method used to understand and answer the target conversation data. The processing strategy includes at least one of processing the target conversation data based on reference conversation data, processing the target conversation data by a third-party plug-in, and processing the target conversation data by a target processing model, that is, at least one of a processing strategy based on reference conversation data, a processing strategy based on a third-party plug-in, and a processing strategy based on a target processing model.
[0085] It should be noted that when the target conversation data includes the target conversation content, the processing strategy of the target conversation data can be determined based on the target conversation content. When the target conversation data does not include the target conversation content but includes the target conversation state, the processing strategy of the target conversation data can be determined based on the target conversation state. When the target conversation data includes the target conversation content and the target conversation state, the processing strategy of the target conversation data can be determined based on the target conversation content or the target conversation state.
[0086] Step 306: When it is determined that the processing strategy is to process the target conversation data based on the reference conversation data, the target conversation data and the reference conversation data are input into the target conversation model to obtain a reply result for the target conversation data, wherein the reference conversation data is obtained by expanding the conversation content based on the conversation context information.
[0087] In one or more embodiments of the present specification, target conversation data is acquired; after a processing strategy for the target conversation data is determined based on the target conversation data, further, when the processing strategy is determined to be to process the target conversation data based on reference conversation data, the target conversation data and the reference conversation data are input into a target conversation model to obtain a response result for the target conversation data.
[0088] Exemplarily, the reference dialogue data is used to assist the target dialogue model in processing the target dialogue data. Since the reference dialogue data is data obtained by expanding the dialogue content based on the dialogue context information, the reference dialogue data can be a dialogue script. The reference dialogue data can include the dialogue data of one dialogue role, or can include the dialogue data of multiple dialogue roles. The target dialogue model can be a pre-trained large model, or can be a machine learning model trained based on multiple sample dialogue data, sample reference dialogue data of each sample dialogue data, and sample reply results. The target dialogue model has semantic understanding capabilities, which is used to efficiently extract dialogue knowledge from the reference dialogue data, and process the target dialogue data based on the dialogue knowledge to obtain the reply results of the target dialogue data. The dialogue context information refers to the environment and conditions under which the reference dialogue data is generated. The dialogue context information includes the dialogue topic, dialogue role, dialogue location, dialogue content introduction, dialogue plot development, etc. Therefore, the dialogue context information can be the script outline of the dialogue script.
[0089] In actual applications, when the target dialogue data and the reference dialogue data are input into the target dialogue model, preset prompt information can be obtained, dialogue prompt information is constructed according to the target dialogue data and the preset prompt information, and the dialogue prompt information and the reference dialogue data are input into the target dialogue model to obtain the response result of the target dialogue data. Exemplarily, the preset prompt information can be "the target dialogue data includes the target dialogue state [target dialogue state] and the target dialogue content [target dialogue content]. Please determine the response result of the target dialogue data based on the reference dialogue data". The preset prompt information is selected according to the actual situation, and the embodiments of this specification do not impose any limitation on this.
[0090] It should be noted that, taking the above preset prompt information as an example, when constructing the dialogue prompt information according to the target dialogue data and the preset prompt information, the target dialogue state and the target dialogue content in the target dialogue data can be added to the preset prompt information to obtain the dialogue prompt information. If the target dialogue data includes the target dialogue content, the target dialogue model can match the reference dialogue content that has an association relationship with the target dialogue content from the reference dialogue data based on the target dialogue content, and determine the reference dialogue content as the reply result. Among them, the association relationship between the reference dialogue content and the target dialogue content, such as semantic correlation, scene correlation, emotion correlation, etc., is selected according to the actual situation, and the embodiments of this specification do not impose any restrictions on this. If the target dialogue data does not include the target dialogue content, the dialogue prompt information does not include the target dialogue content. At this time, the target dialogue model can randomly select the reply result of the target dialogue data from the reference dialogue data. Alternatively, if the target dialogue data does not include the target dialogue content, the historical dialogue content of the user can be obtained, and the historical dialogue content can be added to the position of the target dialogue content in the preset prompt information, so that the target dialogue model selects the reply result of the target dialogue data from the reference dialogue data based on the historical dialogue content.
[0091] The scheme of the embodiments of the present specification is applied, firstly, by parsing the target dialogue data, a processing strategy for the target dialogue data is determined, so that the processing strategy is more closely matched with the target dialogue data, thereby ensuring the accuracy of dialogue processing; secondly, because the reference dialogue data is obtained by expanding the dialogue content based on dialogue context information, the reference dialogue data is more consistent with the actual dialogue scene; in addition, when it is determined that the processing strategy is to process the target dialogue data based on the reference dialogue data, the reference dialogue data is used to assist the target dialogue model in dialogue processing, so that the target dialogue model can acquire knowledge from the reference dialogue data, and actively output content in combination with the model's own semantic understanding ability, thereby avoiding dialogue interruptions and improving the fluency and naturalness of dialogue processing.
[0092] In an optional embodiment of the present specification, when determining the processing strategy of the target conversation data, in addition to considering the target conversation data itself, the user's user profile may also be considered. For example, when the user profile indicates that the user is an introvert, the processing strategy of the target conversation data may be determined to be processing the target conversation data based on the reference conversation data. When the user profile indicates that the user is an extrovert, the processing strategy of the target conversation data may be determined to be direct processing without the assistance of reference conversation data, that is, the processing strategy of the target conversation data may be a processing strategy based on a third-party plug-in or a processing strategy based on a target processing model.
[0093] In an optional embodiment of the present specification, the target conversation data includes the target conversation content; and the above-mentioned determining the processing strategy of the target conversation data according to the target conversation data may include the following steps:
[0094] Perform intent recognition on the target conversation content to determine the target conversation intention.
[0095] When the target dialogue intent is an instruction processing intent, the processing strategy is determined as a third-party plug-in processing the target dialogue data or a target processing model processing the target dialogue data.
[0096] In the case where the target dialogue intention is a non-instruction processing intention, a processing strategy is determined to process the target dialogue data based on the reference dialogue data.
[0097] Exemplarily, the target conversation intent is used to reflect the goal that the user wants to achieve through the conversation or the task that he wants to complete. The target conversation intent includes instruction processing intent and non-instruction processing intent. Instruction processing intent indicates that the user has a clear goal to achieve or a task to complete during the conversation. For example, when the target conversation content is the question and answer content "How is the weather today" or the translation content "Translate hello into English", the target conversation intent is an instruction processing intent. Non-instruction processing intent indicates that the user does not have a clear goal to achieve or a task to complete during the conversation. For example, when the target conversation content is the chat content "Oh, I'm so bored", the target conversation intent is a non-instruction processing intent.
[0098] In practical applications, there are many ways to identify the intent of the target conversation content and determine the target conversation intent, which can be selected according to the actual situation. The embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, the target conversation content can be input into an intent recognition model to obtain the target conversation intent, wherein the intent recognition model is a machine learning model trained based on multiple sample conversation contents and sample intent labels corresponding to the multiple sample conversation contents. In another possible implementation of this specification, conversation keywords in the target conversation content can be extracted, and the conversation keywords can be matched with intent keywords of different conversation intents, and the conversation intent corresponding to the intent keyword that successfully matches the conversation keyword can be determined as the target conversation intent.
[0099] By applying the solution of the embodiments of this specification, the target conversation intent of the target conversation content is identified, and the processing strategy of the target conversation data is determined according to the target conversation intent, so that the processing strategy is more adaptable to the target conversation data and the accuracy of the conversation processing is improved.
[0100] In an optional embodiment of the present specification, the target dialogue data includes a target dialogue state; and the above-mentioned determining a processing strategy for the target dialogue data according to the target dialogue data may include the following steps:
[0101] When the target dialog state is the silent state, the processing strategy is determined to process the target dialog data based on the reference dialog data.
[0102] It should be noted that the silent state means that the target conversation data does not include the target conversation content. During the current conversation, the user has no content output and remains silent. For example, the user starts a conversation task, but does not know how to start the conversation due to his introverted personality, or does not have a problem to solve. In this case, the target conversation state is silent. In order to avoid conversation interruptions caused by the user's lack of content output, the server can actively interact with the user to guide the user to have a conversation, thereby advancing the conversation process. When the server actively interacts with the user, the processing strategy can be determined to process the target conversation data based on the reference conversation data, and use the reference conversation data to assist in guiding the user.
[0103] In actual applications, when the target dialog state is the dialog state, the processing strategy may be determined to be at least one of a third-party plug-in processing the target dialog data and a target processing model processing the target dialog data.
[0104] By applying the solution of the embodiments of this specification, when the target conversation state is silent, a processing strategy is determined to process the target conversation data based on the reference conversation data, taking into account the influence of the user's personality, thereby using the reference conversation data to encourage the user to actively participate in the conversation, so that introverted users can also successfully conduct conversations, thereby lowering the user conversation threshold and improving user participation.
[0105] In an optional embodiment of the present specification, after determining the processing strategy of the target conversation data according to the target conversation data, the following steps may also be included:
[0106] In the case where the processing strategy is for a third-party plug-in to process the target conversation data, the third-party plug-in is called to process the target conversation data to obtain a reply result of the target conversation data.
[0107] When the processing strategy is that the target processing model processes the target dialogue data, the target dialogue data is input into the target processing model to obtain a response result of the target dialogue data.
[0108] Exemplarily, a third-party plug-in is a plug-in developed by a third-party configuration party. The third-party plug-in can be implemented in the server through a pluggable coding design. At the same time, the third-party plug-in can adapt to the calling form of multiple network application programming interfaces. The third-party plug-in can be a plug-in with different functions, such as a weather query plug-in, a ticket purchase plug-in, a drawing plug-in, etc. The target processing model refers to a machine learning model that can process instruction processing tasks, such as a large model, a text translation model, a text summary extraction model, an information extraction model, etc.
[0109] In an optional embodiment of the present specification, when it is determined that the processing strategy is not based on the reference conversation data to process the target conversation data, it is indicated that the target conversation data includes the target conversation content, and the processing strategy for the target conversation data can be selected from two processing strategies: a third-party plug-in processes the target conversation data and a target processing model processes the target conversation data. In a possible implementation of the present specification, the target conversation data can be first processed using the target processing model, and when the target processing model cannot process the target conversation data, the processing strategy is determined to be a third-party plug-in processes the target conversation data. In another possible implementation of the present specification, a third-party plug-in can be called first to process the target conversation data, and when the third-party plug-in cannot process the target conversation data, the processing strategy is determined to be a target processing model processes the target conversation data.
[0110] In actual applications, when a third-party plug-in is called to process target conversation data, the corresponding function of the third-party plug-in can be executed to obtain the function execution result, and the function execution result can be determined as the reply result of the target conversation data. Furthermore, the function execution result can also be input into the target conversation model for integration and processing to obtain the reply result of the target conversation data.
[0111] By applying the solution of the embodiments of this specification, the target dialogue data is processed by calling a third-party plug-in or a target processing model, so that instruction compliance during the dialogue processing is achieved and the user experience during the dialogue processing is improved.
[0112] In an optional embodiment of the present specification, when the processing strategy is determined to be processing the target dialogue data based on the reference dialogue data, after inputting the target dialogue data and the reference dialogue data into the target dialogue model and obtaining the response result of the target dialogue data, the following steps may also be included:
[0113] The updated target dialogue data is obtained, wherein the updated target dialogue data is data obtained by providing feedback on the reply result.
[0114] Return to the step of determining the processing strategy of the target dialogue data according to the target dialogue data, until the dialogue end condition is met and the target response result is obtained.
[0115] It should be noted that, when the processing strategy is determined to process the target dialogue data based on the reference dialogue data, the target dialogue data and the reference dialogue data are input into the target dialogue model, and after the reply result of the target dialogue data is obtained, the reply result of the target dialogue data can be sent to the client. The user can perform multiple rounds of dialogue tasks based on the reply result. The updated target dialogue data may include at least one of the updated target dialogue content and the updated target dialogue state.
[0116] In actual applications, there are many ways to obtain the updated target dialogue data, which can be selected according to the actual situation. The embodiments of this specification do not limit this. In one possible implementation of this specification, after the reply result is sent to the client, if the updated target dialogue content sent by the client is received within a preset time (such as 5 seconds), the updated target dialogue state is determined to be the dialogue state, and the updated target dialogue data is determined according to the updated target dialogue content and the updated target dialogue state. If the updated target dialogue content sent by the client is not received within the preset time, the updated target dialogue state is determined to be the silent state, and the updated target dialogue data is determined according to the updated target dialogue state, wherein the preset time can be shortened in turn according to the iteration of the dialogue round. In another possible implementation of this specification, the silent state and the dialogue state can be sent to the client at the same time. When the client selects the silent state, it means that the user currently has no content output, and the silent state is determined as the updated target dialogue state, and the updated target dialogue data is determined according to the updated target dialogue state. When the client selects the conversation state, it means that the user currently has content output, the conversation state is determined as the updated target conversation state, and the updated target conversation content sent by the client is received, and the updated target conversation data is determined according to the updated target conversation content and the updated target conversation state.
[0117] By applying the solution of the embodiments of this specification, after sending the reply result to the client, the updated target dialogue data fed back by the client in response to the reply result is obtained, and then multiple rounds of dialogue iterative processing are started, so that the dialogue processing is more flexible and the user's dialogue processing experience is improved.
[0118] In an optional embodiment of the present specification, when the processing strategy is determined to process the target dialogue data based on the reference dialogue data, after inputting the target dialogue data and the reference dialogue data into the target dialogue model and obtaining the response result of the target dialogue data, the following steps may also be included:
[0119] At least one target dialogue role corresponding to the response result is determined.
[0120] The reply result is voice broadcasted according to the voice configuration information of at least one target dialogue role.
[0121] Exemplarily, the target dialogue character refers to a virtual character used to communicate with the user during the dialogue process. For example, the target dialogue character can be a girl with a soft voice but gentle speech, or a sunny boy with a loud voice and full confidence. Voice configuration information refers to the configuration information of the target dialogue character when communicating with the user by voice, and the voice configuration information includes timbre, volume, speech speed, language type, etc.
[0122] It should be noted that there are multiple ways to send the reply result of the target conversation data to the client. The reply result can be sent directly to the client in text form, or the reply result can be broadcast to the client by voice.
[0123] In practical applications, there are many ways to determine at least one target dialogue role corresponding to the reply result, which can be selected according to the actual situation. The embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, at least one dialogue role can be randomly selected from multiple candidate dialogue roles as the target dialogue role corresponding to the reply result. In another possible implementation of this specification, since the reply result is obtained based on reference dialogue data, it is possible to determine the reference dialogue segment to which the reply result belongs, and determine the reference dialogue segment dialogue role as the dialogue role of the reply result.
[0124] By applying the solution of the embodiments of this specification, at least one target dialogue role corresponding to the reply result is directly determined, and the reply result is voice broadcast according to the voice configuration information of the target dialogue role. The user does not need to manually select the broadcast voice, speech speed and other information, which lowers the threshold for users to participate in dialogue processing, simplifies the user operation process, and improves the user experience.
[0125] In an optional embodiment of the present specification, a method for generating reference dialogue data is described. That is, when the processing strategy is determined to process the target dialogue data based on the reference dialogue data, the target dialogue data and the reference dialogue data are input into the target dialogue model, and before obtaining the response result of the target dialogue data, the following steps may be further included:
[0126] Get the conversation generation data.
[0127] Context information is extracted from the dialogue generation data to determine the dialogue context information.
[0128] The conversation content is expanded according to the conversation context information to obtain reference conversation data.
[0129] Exemplarily, the dialogue generation data is used to generate reference dialogue data. The dialogue generation data may be data such as information, facts, and related reports. There are many ways to obtain dialogue generation data, which are selected according to actual conditions, and the embodiments of this specification do not limit this. In one possible implementation of this specification, the dialogue generation data can be read from other data acquisition devices or databases. In another possible implementation of this specification, dialogue generation data can be collected from a large number of data sources according to data acquisition rules. Among them, data acquisition rules include acquisition rules of multiple dimensions such as real-time, popularity, and factuality, and data sources include news websites, entertainment websites, popular science websites, etc. Exemplarily, the network application programming interface of the data source can be called to automatically collect data from information websites, and natural language processing technology can be used to identify and extract dialogue generation data from the collected data. It is also possible to crawl information on relevant resource websites under the premise of complying with machine protocols, and use natural language processing technology to identify and extract dialogue generation data from the crawled data.
[0130] It should be noted that there are multiple ways to extract context information from the dialogue generation data and determine the dialogue context information, which can be selected according to the actual situation, and the embodiments of this specification do not limit this. In one possible implementation of this specification, the content of the dialogue generation data can be analyzed to capture keywords, phrases and sentence patterns, understand the development context and logical relationship of the dialogue generation data, and obtain dialogue context information. In another possible implementation of this specification, the text generation model can be used to extract context information from the dialogue generation data to determine the dialogue context information.
[0131] Furthermore, there are multiple ways to expand the conversation content according to the conversation context information and obtain reference conversation data, which can be selected according to the actual situation, and the embodiments of this specification do not limit this. In one possible implementation of this specification, multiple users can be invited to participate in discussions and co-creation based on the conversation context information through an online collaboration platform to obtain reference conversation data. In another possible implementation of this specification, a text generation model can be used to expand the conversation content according to the conversation context information to obtain reference conversation data.
[0132] The scheme of the embodiment of this specification is applied by using a phased reference dialogue data generation scheme. In the first phase, dialogue scenario information is generated based on the dialogue generation data. In the second phase, the script is expanded based on the dialogue scenario information to obtain reference dialogue data. This integrates scattered dialogue generation data together to obtain reference dialogue data that can provide in-depth content analysis and knowledge. This allows the target dialogue model to acquire knowledge from the reference dialogue data and, combined with the model's own semantic understanding capabilities, actively output content, avoid dialogue interruptions, and improve the fluency and naturalness of dialogue processing.
[0133] In an optional embodiment of the present specification, extracting context information from the dialogue generation data and determining the dialogue context information may include the following steps:
[0134] The extraction prompt information and the dialogue generation data are input into the text generation model to obtain the dialogue context information, wherein the extraction prompt information is used to guide the text generation model to extract context information from the dialogue generation data.
[0135] Expanding the conversation content according to the conversation context information to obtain reference conversation data may include the following steps:
[0136] The expansion prompt information and the dialogue context information are input into the text generation model to obtain reference dialogue data, wherein the expansion prompt information is used to guide the text generation model to expand the dialogue content of the dialogue context information.
[0137] Exemplarily, the text generation model can be a pre-trained large model, or it can be a machine learning model trained based on multiple sample dialogue generation data, sample dialogue context information of each sample dialogue generation data, and sample reference dialogue data. The expansion prompt information may include the number of characters, dialogue style, and story structure of the reference dialogue data, thereby guiding the text generation model to generate multi-role, logical, and attractive reference dialogue data. The expansion prompt information can be text expansion prompt information, such as "Please expand the dialogue content according to the dialogue context information. The expanded reference dialogue data includes three dialogue characters, and the reference dialogue data obtained by expanding the dialogue content is output." The extraction prompt information can be text extraction prompt information, such as "Please extract context information from the dialogue generation data, and output the extracted dialogue context information."
[0138] It should be noted that when generating reference conversation data based on conversation generation data, the data type of the conversation generation data can be identified, and the conversation generation data can be divided into multiple generation data sets according to the data type, and then reference conversation data corresponding to each generation data set is generated respectively, where the data type can be such as entertainment data type, popular science data type, etc.
[0139] The solution of the embodiment of this specification is applied to efficiently and accurately generate dialogue scenario information and reference dialogue data by utilizing the semantic understanding ability of the text generation model and the guidance of extracting prompt information and expanding prompt information.
[0140] In an optional embodiment of the present specification, after obtaining the reference dialogue data, a suitable dialogue character can be created or selected according to the content of the reference dialogue data, and each character can be given a detailed personality, background story and appearance design. That is, the above-mentioned dialogue content expansion according to the dialogue context information, after obtaining the reference dialogue data, can also include the following steps:
[0141] The reference dialogue data is role parsed to determine at least one dialogue role and a reference dialogue segment corresponding to the dialogue role.
[0142] Generate role description information of the dialogue roles according to the reference dialogue segments corresponding to the dialogue roles.
[0143] Generate the voice configuration information of the dialogue role based on the role description information.
[0144] Exemplarily, the role description information is used to describe the character, background story, etc. of the dialogue character. The role description information may include text role description information and image role description information, the text role description information such as character text description information, and the image role description information such as the appearance image of the dialogue character.
[0145] It should be noted that there are multiple ways to generate role description information of dialogue roles based on the reference dialogue segments corresponding to the dialogue roles, and the specific selection is based on the actual situation. The embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, the reference dialogue segment can be input into a text generation model to obtain text role description information. In another possible implementation of this specification, the reference dialogue segment can be input into an image generation model to obtain image role description information.
[0146] In actual applications, there are multiple ways to generate voice configuration information for a dialogue role based on the role description information, and the specific method is selected according to the actual situation. The embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, the voice configuration information of each dialogue role can be randomly selected from multiple candidate voice configuration information. In another possible implementation of this specification, feature extraction can be performed on the role description information to obtain role description features, feature extraction can be performed on the candidate description information of the candidate voice configuration information to obtain candidate description features, the role description features and the candidate description features are matched, and the candidate voice configuration information corresponding to the candidate description features that best matches the role description features is determined as the voice configuration information of the dialogue role.
[0147] By applying the solution of the embodiments of this specification, by generating voice configuration information for each dialogue role, multi-role simulation and humanized script output are achieved, making the dialogue richer and more fascinating, and enhancing dialogue interaction and participation.
[0148] In an optional embodiment of the present specification, after the conversation content is expanded according to the conversation context information and reference conversation data is obtained, the following steps may also be included:
[0149] The conversation content of the reference conversation data is audited using the conversation audit rules to obtain an audit result, wherein the conversation audit rules include at least one of grammar audit rules, compliance audit rules, and copyright audit rules.
[0150] When the audit result is an audit failure, the reference conversation data is adjusted to obtain adjusted reference conversation data, wherein the adjusted reference conversation data complies with the conversation audit rules.
[0151] It should be noted that the audit result represents whether the audit of the reference dialogue data is successful or failed. After obtaining the reference dialogue data, in order to further improve the accuracy of the response results obtained by using the reference dialogue data for dialogue processing, the reference dialogue data can be audited using dialogue audit rules, such as auditing the accuracy, compliance, grammatical errors, whether sensitive content is included in the reference dialogue data, and ensuring that the reference dialogue data does not offend or violate copyright law. In addition, in the case of a failed audit, the reference dialogue data can be adjusted through a text proofreading tool to obtain the adjusted reference dialogue data.
[0152] Grammar review rules refer to the standards used to check whether the reference dialogue data conforms to the grammar rules of a specific language. Grammar review rules are used to ensure that the sentence structure in the reference dialogue data is correct, punctuation is used appropriately, and tenses are consistent. For example, grammar review rules can be used to check whether the sentence is complete and clearly structured, whether the subject and predicate of the sentence are consistent, and whether punctuation is used correctly. Grammar review rules can improve the readability and professionalism of the reference dialogue data and avoid misunderstandings.
[0153] Compliance review rules refer to standards used to ensure that content complies with the laws and regulations of a specific industry or region. Compliance review rules include but are not limited to data protection laws, privacy policies, advertising standards, financial information disclosure requirements, etc. Compliance review rules can protect user rights, prevent misleading information, and maintain market order.
[0154] Copyright review rules refer to the standards used to check whether reference conversation data infringes on the intellectual property rights of others. Copyright review rules include, but are not limited to, copyright protection rules for text works, music, images, and other creative works. Copyright review rules can ensure the originality and legality of content and avoid legal issues caused by unauthorized use of other people's works.
[0155] In an optional embodiment of the present specification, the target dialogue data includes a target dialogue speech; in the case where the processing strategy is determined to be processing the target dialogue data based on the reference dialogue data, before inputting the target dialogue data and the reference dialogue data into the target dialogue model and obtaining the response result of the target dialogue data, the following steps may also be included:
[0156] Perform speech recognition on the target conversation speech to obtain the target conversation text.
[0157] In the case where the processing strategy is determined to process the target dialogue data based on the reference dialogue data, inputting the target dialogue data and the reference dialogue data into the target dialogue model to obtain the response result of the target dialogue data may include the following steps:
[0158] When the processing strategy is determined to process the target dialogue text based on the reference dialogue data, the target dialogue text and the reference dialogue data are input into the target dialogue model to obtain the response result of the target dialogue speech.
[0159] It should be noted that the input of the target dialogue model is usually in text format. In order to enable the target dialogue model to accurately process the target dialogue data, the target dialogue speech can be recognized to obtain the target dialogue text. The target dialogue speech refers to the speech data generated by the user during the dialogue interaction process.
[0160] In practical applications, there are many ways to perform speech recognition on the target conversation speech and obtain the target conversation text, which can be selected according to the actual situation. The embodiments of this specification do not limit this. In one possible implementation of this specification, the target conversation speech can be recognized by a speech recognition tool to obtain the target conversation text. In another possible implementation of this specification, the target conversation speech can be input into a speech recognition model to obtain the target conversation text.
[0161] By applying the solution of the embodiments of this specification, the target dialogue text is obtained by performing speech recognition on the target dialogue speech, and the target dialogue text is directly processed using the target dialogue model, so that the target dialogue model can acquire knowledge from the target dialogue text, and combine the model's own semantic understanding ability to actively output content, avoid dialogue interruptions, and improve the fluency and naturalness of dialogue processing.
[0162] The following combination Figure 4 , taking the application of the dialogue processing method provided in this specification in a voice chat scenario as an example, the dialogue processing method is further described. Among them, Figure 4 A flow chart of a voice dialogue method provided by an embodiment of the present specification is shown, which specifically includes the following steps:
[0163] Step 402: Acquire voice conversation data.
[0164] Step 404: Determine a processing strategy for the voice conversation data based on the voice conversation data.
[0165] Step 406: When it is determined that the processing strategy is to process the voice dialogue data based on the reference dialogue data, the voice dialogue data and the reference dialogue data are input into the target dialogue model to obtain a response result for the voice dialogue data, wherein the reference dialogue data is obtained by expanding the dialogue content based on the dialogue context information.
[0166] It should be noted that the implementation of steps 402 to 406 is the same as the implementation of steps 302 to 306 described above, and the embodiments of this specification will not be repeated. Voice dialogue data refers to the voice data generated by the user during the voice dialogue interaction process. The voice dialogue data may include at least one of the voice dialogue content and the voice dialogue state. The processing strategy of the voice dialogue data refers to the method used to understand and answer the voice dialogue data. The processing strategy of the voice dialogue data includes at least one of processing the voice dialogue data based on reference dialogue data, processing the voice dialogue data by a third-party plug-in, and processing the voice dialogue data by a target processing model, that is, at least one of the processing strategy based on reference dialogue data, the processing strategy based on a third-party plug-in, and the processing strategy based on the target processing model.
[0167] The scheme of the embodiments of the present specification is applied. First, by parsing the voice dialogue data, a processing strategy for the target dialogue data is determined, so that the processing strategy is more closely matched with the voice dialogue data, thereby ensuring the accuracy of the voice dialogue; secondly, because the reference dialogue data is obtained by expanding the dialogue content based on the dialogue context information, the reference dialogue data is more consistent with the real dialogue scene; in addition, when it is determined that the processing strategy is to process the voice dialogue data based on the reference dialogue data, the reference dialogue data is used to assist the target dialogue model in voice dialogue processing, so that the target dialogue model can acquire knowledge from the reference dialogue data, and actively output content in combination with the model's own semantic understanding ability, thereby avoiding dialogue interruptions and improving the fluency and naturalness of the voice dialogue.
[0168] See also Figure 5 , Figure 5 A flow chart of the processing process of a voice dialogue method provided by an embodiment of the present specification is shown. The processing process of the dialogue processing method can be implemented through active interaction of Multi-Agent. The processing process can be divided into two stages: offline content creation and real-time voice chat. The two stages are described below respectively.
[0169] Offline content creation: Content Collection Agent collects real-time information, data and resources from high-quality data sources, and uses natural language processing technology to identify and extract dialogue generation data; Script Creation Agent extracts context information from dialogue generation data, determines dialogue context information, expands dialogue content based on dialogue context information, and obtains reference dialogue data; Content Review Agent uses dialogue review rules to review dialogue content of reference dialogue data, and obtains reference dialogue data that can be updated daily and has passed review; Character Design Agent performs role analysis on reference dialogue data, determines at least one dialogue role and at least one corresponding reference dialogue segment, generates role description information of at least one dialogue role based on the reference dialogue segment, and generates voice configuration information of at least one dialogue role based on the role description information.
[0170] Real-time voice chat: Receive the target conversation voice sent by the user, perform voice recognition on the target conversation voice, obtain the target conversation text, and chat with the user through the conversation processing system. The conversation processing system can load the reference conversation data obtained from offline content creation as an additional knowledge base in the processing process, and perform conversation processing based on the target conversation model. When the user has no topic or is silent, the conversation processing system can judge the current conversation state and use the reference conversation data to recommend topics. When recommending, multiple conversation roles (such as conversation role A and conversation role B) can assist each other in voice broadcasting. Users can interrupt and join the topic discussion at any time, or if the user is not interested in the topic, they can express their willingness to switch topics or stop broadcasting.
[0171] like Figure 5 As shown, the dialogue processing system includes a conversation management unit, a conversation response unit and a function call unit. The conversation management unit is used to control the flow of the conversation, including maintaining the conversation state and making decisions on processing strategies (selecting topics for recommendation from reference conversation data, responding in accordance with user instructions, and deciding which dialogue role should reply). The conversation response unit is used to receive information from the conversation management unit, call the target conversation model or the target processing model to respond to the current round content and output text content. The conversation response unit can also voice broadcast the output text content through dialogue role A and dialogue role B. The function call unit is used to receive information from the conversation management unit, execute the corresponding function call and return the function execution result to the conversation response unit for further processing.
[0172] By applying the scheme of the embodiments of this specification, reference dialogue data is obtained through offline content creation as real-time material for voice chat, and real-time voice interaction is achieved with users through multi-agent response and different processing strategies. In addition, the reference dialogue data is combined with real-time voice chat, and users can insert relevant topic discussions at any time when they can listen to the reference dialogue data. At the same time, they can also switch topics, exit or even have other discussions through voice commands, making the voice chat process more flexible. The dialogue processing system can actively communicate with users when users feel bored or silent, which is more in line with the characteristics of natural dialogue between humans. It also supports voice broadcasting of reply results based on the voice configuration information of at least one target dialogue role, further enhancing the user's sense of substitution and improving the fluency and naturalness of the entire voice chat dialogue.
[0173] See also Figure 6 , Figure 6 A flowchart of another voice dialogue method provided by an embodiment of the present specification is shown, which specifically includes the following steps:
[0174] Step 602: Acquire the voice conversation data of the client.
[0175] Step 604: Determine a processing strategy for the voice conversation data based on the voice conversation data.
[0176] Step 606: When it is determined that the processing strategy is to process the voice dialogue data based on the reference dialogue data, the voice dialogue data and the reference dialogue data are input into the target dialogue model to obtain a response result for the voice dialogue data, wherein the reference dialogue data is obtained by expanding the dialogue content based on the dialogue context information.
[0177] Step 608: Report the reply result of the voice dialogue data to the client by voice broadcast.
[0178] It should be noted that the implementation of step 602 to step 606 is the same as the implementation of step 302 to step 306 described above, and will not be described in detail in this embodiment of the specification.
[0179] In actual applications, when the reply result of the voice dialogue data is voice broadcasted to the client, in one possible implementation, at least one dialogue role can be randomly selected from multiple candidate dialogue roles as the target dialogue role corresponding to the reply result, and the reply result can be voice broadcasted according to the voice configuration information of the at least one target dialogue role. In another possible implementation, the reference dialogue segment to which the reply result belongs in the reference dialogue data can be determined, and the dialogue role of the reference dialogue segment can be determined as the at least one target dialogue role corresponding to the reply result, and the reply result can be voice broadcasted according to the voice configuration information of the at least one target dialogue role.
[0180] By applying the solution of the embodiments of this specification, reference conversation data is used to assist the target conversation model in voice conversation processing, so that the target conversation model can acquire knowledge from the reference conversation data, and combine the model's own semantic understanding ability to actively output content, avoid conversation interruptions, improve the fluency and naturalness of voice conversations, and voice broadcast the response results of the voice conversation data to the client, further improving the user experience.
[0181] Corresponding to the above-mentioned dialogue processing method embodiment, this specification also provides a dialogue processing device embodiment, Figure 7 FIG. 1 is a schematic diagram showing the structure of a dialog processing device provided by an embodiment of the present specification. Figure 7 As shown, the device comprises:
[0182] The first acquisition module 702 is configured to acquire target conversation data.
[0183] The first determination module 704 is configured to determine a processing strategy for the target conversation data according to the target conversation data.
[0184] The first input module 706 is configured to input the target conversation data and the reference conversation data into the target conversation model to obtain a reply result for the target conversation data when determining that the processing strategy is to process the target conversation data based on the reference conversation data, wherein the reference conversation data is obtained by expanding the conversation content based on the conversation context information.
[0185] Optionally, the target conversation data includes the target conversation content; the first determination module 704 is further configured to perform intent recognition on the target conversation content and determine the target conversation intention; when the target conversation intention is an instruction processing intention, the processing strategy is determined to be a third-party plug-in to process the target conversation data or a target processing model to process the target conversation data; when the target conversation intention is a non-instruction processing intention, the processing strategy is determined to be processing the target conversation data based on the reference conversation data.
[0186] Optionally, the target conversation data includes a target conversation state; the first determination module 704 is further configured to determine, when the target conversation state is a silent state, a processing strategy to process the target conversation data based on the reference conversation data.
[0187] Optionally, the device further includes: a fourth acquisition module configured to acquire dialogue generation data; extract context information from the dialogue generation data to determine dialogue context information; and expand the dialogue content according to the dialogue context information to obtain reference dialogue data.
[0188] Optionally, the fourth acquisition module is further configured to input the extraction prompt information and the dialogue generation data into the text generation model to obtain dialogue context information, wherein the extraction prompt information is used to guide the text generation model to extract context information from the dialogue generation data; and input the expansion prompt information and the dialogue context information into the text generation model to obtain reference dialogue data, wherein the expansion prompt information is used to guide the text generation model to expand the dialogue content of the dialogue context information.
[0189] Optionally, the device also includes: a parsing module, configured to perform role parsing on reference dialogue data, determine at least one dialogue role and a reference dialogue segment corresponding to the dialogue role; generate role description information of the dialogue role based on the reference dialogue segments corresponding to the dialogue roles; and generate voice configuration information of the dialogue role based on the role description information.
[0190] Optionally, the device also includes: an audit module, configured to use dialogue audit rules to audit the dialogue content of reference dialogue data to obtain an audit result, wherein the dialogue audit rules include at least one of grammar audit rules, compliance audit rules, and copyright audit rules; when the audit result is an audit failure, adjust the reference dialogue data to obtain adjusted reference dialogue data, wherein the adjusted reference dialogue data complies with the dialogue audit rules.
[0191] Optionally, the target conversation data includes a target conversation speech; the device also includes: a recognition module, configured to perform speech recognition on the target conversation speech to obtain a target conversation text; a first input module 706, further configured to input the target conversation text and the reference conversation data into a target conversation model to obtain a response result of the target conversation speech when determining that the processing strategy is to process the target conversation text based on the reference conversation data.
[0192] Optionally, the device also includes: a fourth determination module, configured to determine at least one target dialogue role corresponding to the reply result; and voice broadcast the reply result according to the voice configuration information of the at least one target dialogue role.
[0193] Optionally, the device also includes: a fourth acquisition module, configured to obtain updated target conversation data, wherein the updated target conversation data is data obtained by feedback on the reply result; return to execute the step of determining a processing strategy for the target conversation data based on the target conversation data until the conversation end condition is met and the target reply result is obtained.
[0194] Optionally, the device also includes: a processing module, configured to call a third-party plug-in to process the target conversation data and obtain a reply result of the target conversation data when the processing strategy is for the third-party plug-in to process the target conversation data; and to input the target conversation data into the target processing model and obtain a reply result of the target conversation data when the processing strategy is for the target processing model to process the target conversation data.
[0195] According to the scheme of the embodiments of the present specification, since the dialogue processing device includes a first determination module that can determine the processing strategy based on the target dialogue data, the processing strategy is more closely aligned with the target dialogue data, thereby ensuring the accuracy of the dialogue processing; secondly, since the reference dialogue data is obtained by expanding the dialogue content based on the dialogue context information, the reference dialogue data is more consistent with the actual dialogue scene; in addition, when the first input module determines that the processing strategy is to process the target dialogue data based on the reference dialogue data, it can use the reference dialogue data to assist the target dialogue model in dialogue processing, so that the target dialogue model can acquire knowledge from the reference dialogue data, and actively output content in combination with the model's own semantic understanding ability, thereby avoiding dialogue interruptions and improving the fluency and naturalness of dialogue processing.
[0196] The above is a schematic scheme of a dialogue processing device of this embodiment. It should be noted that the technical scheme of the dialogue processing device and the technical scheme of the dialogue processing method described above are of the same concept, and the details not described in detail in the technical scheme of the dialogue processing device can be found in the description of the technical scheme of the dialogue processing method described above.
[0197] Corresponding to the above-mentioned voice dialogue method embodiment, this specification also provides a voice dialogue device embodiment, Figure 8 FIG. 1 shows a schematic diagram of the structure of a voice dialogue device provided by an embodiment of the present specification. Figure 8 As shown, the device comprises:
[0198] The second acquisition module 802 is configured to acquire voice conversation data.
[0199] The second determination module 804 is configured to determine a processing strategy for the voice dialogue data according to the voice dialogue data.
[0200] The second input module 806 is configured to input the voice dialogue data and the reference dialogue data into the target dialogue model to obtain a reply result for the voice dialogue data when determining that the processing strategy is to process the voice dialogue data based on the reference dialogue data, wherein the reference dialogue data is obtained by expanding the dialogue content based on the dialogue context information.
[0201] By applying the solution of the embodiments of the present specification, since the voice dialogue device includes a second determination module that can determine the processing strategy based on the voice dialogue data, the processing strategy is more closely aligned with the voice dialogue data, thereby ensuring the accuracy of the voice dialogue; secondly, since the reference dialogue data is obtained by expanding the dialogue content based on the dialogue context information, the reference dialogue data is more consistent with the actual dialogue scene; in addition, when the second input module determines that the processing strategy is to process the voice dialogue data based on the reference dialogue data, the reference dialogue data can be used to assist the target dialogue model in conducting voice dialogue, so that the target dialogue model can acquire knowledge from the reference dialogue data, and actively output content in combination with the model's own semantic understanding ability, thereby avoiding dialogue interruptions and improving the fluency and naturalness of the voice dialogue.
[0202] The above is a schematic scheme of a voice dialogue device of this embodiment. It should be noted that the technical scheme of the voice dialogue device and the technical scheme of the voice dialogue method described above are of the same concept, and the details not described in detail in the technical scheme of the voice dialogue device can be referred to the description of the technical scheme of the voice dialogue method described above.
[0203] Corresponding to the above-mentioned voice dialogue method embodiment, this specification also provides a voice dialogue device embodiment, Fig. 9 FIG. 2 shows a schematic diagram of the structure of another dialog processing device provided by an embodiment of the present specification. Fig. 9 As shown, the device comprises:
[0204] The third acquisition module 902 is configured to acquire the voice conversation data of the client;
[0205] The third determination module 904 is configured to determine a processing strategy for the voice dialogue data according to the voice dialogue data;
[0206] The third input module 906 is configured to input the voice dialogue data and the reference dialogue data into the target dialogue model to obtain a reply result of the voice dialogue data when the processing strategy is to process the voice dialogue data based on the reference dialogue data, wherein the reference dialogue data is obtained by expanding the dialogue content based on the dialogue context information;
[0207] The reporting module 908 is configured to report the reply result of the voice dialogue data to the client by voice.
[0208] By applying the solution of the embodiments of this specification, reference conversation data is used to assist the target conversation model in voice conversation processing, so that the target conversation model can acquire knowledge from the reference conversation data, and combine the model's own semantic understanding ability to actively output content, avoid conversation interruptions, improve the fluency and naturalness of voice conversations, and voice broadcast the response results of the voice conversation data to the client, further improving the user experience.
[0209] The above is a schematic scheme of a voice dialogue device of this embodiment. It should be noted that the technical scheme of the voice dialogue device and the technical scheme of the voice dialogue method described above are of the same concept, and the details not described in detail in the technical scheme of the voice dialogue device can be referred to the description of the technical scheme of the voice dialogue method described above.
[0210] Fig.10 The block diagram of a computing device provided by one embodiment of the present specification is shown. The components of the computing device 1000 include but are not limited to a memory 1010 and a processor 1020. The processor 1020 is connected to the memory 1010 via a bus 1030, and the database 1050 is used to store data.
[0211] The computing device 1000 also includes an access device 1040 that enables the computing device 1000 to communicate via one or more networks 1060. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1040 may include one or more of any type of network interface, wired or wireless (e.g., a network interface card (NIC)), such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0212] In one embodiment of the present specification, the above components of the computing device 1000 and Fig.10 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.10 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0213] The computing device 1000 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 1000 may also be a mobile or stationary server.
[0214] The processor 1020 is used to execute computer programs / instructions, which implement the steps of the above-mentioned dialogue processing method or voice dialogue method when executed by the processor.
[0215] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned dialogue processing method and voice dialogue method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned dialogue processing method or voice dialogue method.
[0216] An embodiment of the present specification also provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned dialogue processing method or voice dialogue method when executed by a processor.
[0217] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned dialogue processing method and voice dialogue method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned dialogue processing method or voice dialogue method.
[0218] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned dialogue processing method or voice dialogue method when executed by a processor.
[0219] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the above-mentioned dialogue processing method and voice dialogue method belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the above-mentioned dialogue processing method or voice dialogue method.
[0220] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0221] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0222] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0223] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0224] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. A conversation processing method, comprising: Get the target conversation data; Determining a processing strategy for the target conversation data according to the target conversation data; When it is determined that the processing strategy is to process the target conversation data based on the reference conversation data, the target conversation data and the reference conversation data are input into a target conversation model to obtain a reply result of the target conversation data, wherein the reference conversation data is obtained by expanding the conversation content based on the conversation context information.
2. The method according to claim 1, wherein the target conversation data comprises target conversation content; Determining a processing strategy for the target conversation data according to the target conversation data includes: Performing intent recognition on the target conversation content to determine the target conversation intent; In the case where the target conversation intention is an instruction processing intention, determining the processing strategy as a third-party plug-in processing the target conversation data or a target processing model processing the target conversation data; In a case where the target dialogue intention is a non-instruction processing intention, the processing strategy is determined to process the target dialogue data based on the reference dialogue data.
3. The method according to claim 1, wherein the target conversation data comprises a target conversation state; Determining a processing strategy for the target conversation data according to the target conversation data includes: When the target dialog state is a silent state, the processing strategy is determined to process the target dialog data based on the reference dialog data.
4. The method according to claim 1, wherein, when determining that the processing strategy is to process the target dialogue data based on the reference dialogue data, before inputting the target dialogue data and the reference dialogue data into a target dialogue model and obtaining a response result for the target dialogue data, the method further comprises: Get the conversation generation data; Extracting context information from the dialogue generation data to determine dialogue context information; The conversation content is expanded according to the conversation context information to obtain the reference conversation data.
5. The method according to claim 4, wherein extracting context information from the dialogue generation data to determine the dialogue context information comprises: Inputting the extraction prompt information and the dialogue generation data into a text generation model to obtain dialogue context information, wherein the extraction prompt information is used to guide the text generation model to extract context information from the dialogue generation data; The step of expanding the conversation content according to the conversation context information to obtain the reference conversation data includes: The expansion prompt information and the dialogue context information are input into the text generation model to obtain the reference dialogue data, wherein the expansion prompt information is used to guide the text generation model to expand the dialogue content of the dialogue context information.
6. The method according to claim 4, after the conversation content is expanded according to the conversation context information and the reference conversation data is obtained, further comprising: Performing role analysis on the reference dialogue data to determine at least one dialogue role and a reference dialogue segment corresponding to the dialogue role; Generating role description information of the dialogue role according to the reference dialogue segment corresponding to the dialogue role; The voice configuration information of the dialogue role is generated according to the role description information.
7. The method according to claim 4, after the conversation content is expanded according to the conversation context information and the reference conversation data is obtained, further comprising: Using a conversation review rule to review the conversation content of the reference conversation data to obtain a review result, wherein the conversation review rule includes at least one of a grammar review rule, a compliance review rule, and a copyright review rule; In the case where the audit result is an audit failure, the reference conversation data is adjusted to obtain adjusted reference conversation data, wherein the adjusted reference conversation data complies with the conversation audit rule.
8. The method according to claim 1, wherein the target conversation data comprises a target conversation speech; In the case where it is determined that the processing strategy is to process the target dialogue data based on the reference dialogue data, before inputting the target dialogue data and the reference dialogue data into the target dialogue model and obtaining the response result of the target dialogue data, the method further includes: Performing speech recognition on the target conversation speech to obtain a target conversation text; In the case where it is determined that the processing strategy is to process the target dialogue data based on the reference dialogue data, the target dialogue data and the reference dialogue data are input into a target dialogue model to obtain a response result of the target dialogue data, including: When it is determined that the processing strategy is to process the target dialogue text based on the reference dialogue data, the target dialogue text and the reference dialogue data are input into a target dialogue model to obtain a response result of the target dialogue speech.
9. The method according to any one of claims 1 to 8, wherein when it is determined that the processing strategy is to process the target dialogue data based on the reference dialogue data, the target dialogue data and the reference dialogue data are input into a target dialogue model, and after obtaining a response result of the target dialogue data, the method further comprises: Determine at least one target dialogue role corresponding to the response result; The reply result is voice broadcasted according to the voice configuration information of the at least one target dialogue role.
10. The method according to any one of claims 1 to 8, wherein when it is determined that the processing strategy is to process the target dialogue data based on the reference dialogue data, the target dialogue data and the reference dialogue data are input into a target dialogue model, and after obtaining a response result of the target dialogue data, the method further comprises: Acquire updated target dialogue data, wherein the updated target dialogue data is data obtained by providing feedback on the response result; Return to the step of determining the processing strategy of the target dialogue data according to the target dialogue data until the dialogue end condition is met and the target reply result is obtained.
11. The method according to any one of claims 1 to 8, after determining the processing strategy of the target conversation data according to the target conversation data, further comprising: In the case where the processing strategy is for a third-party plug-in to process the target conversation data, calling the third-party plug-in to process the target conversation data to obtain a reply result of the target conversation data; In the case where the processing strategy is for the target processing model to process the target dialogue data, the target dialogue data is input into the target processing model to obtain a reply result of the target dialogue data.
12. A voice conversation method, comprising: Get voice conversation data; Determining a processing strategy for the voice conversation data according to the voice conversation data; When it is determined that the processing strategy is to process the voice conversation data based on reference conversation data, the voice conversation data and the reference conversation data are input into a target conversation model to obtain a reply result of the voice conversation data, wherein the reference conversation data is obtained by expanding the conversation content based on conversation context information.
13. A voice conversation method, comprising: Get the client's voice conversation data; Determining a processing strategy for the voice conversation data according to the voice conversation data; In the case where it is determined that the processing strategy is to process the voice dialogue data based on the reference dialogue data, the voice dialogue data and the reference dialogue data are input into the target dialogue model to obtain a reply result of the voice dialogue data, wherein the reference dialogue data is obtained by expanding the dialogue content based on the dialogue context information; The reply result of the voice dialogue data is reported to the client by voice.
14. A computing device comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method described in any one of claims 1 to 11 or claim 12 or claim 13 are implemented.
15. A computer-readable storage medium storing a computer program / instruction, which implements the steps of the method described in any one of claims 1 to 11 or claim 12 or claim 13 when executed by a processor.
16. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 11 or claim 12 or claim 13.
Citation Information
Cited By
Dialog processing method, voice dialog method, computing device, computer-readable storage medium, and computer program product
WO2026026283A1
