Dialogue interaction method, device and equipment and storage medium
By acquiring interaction scenarios and decomposition guidelines, the text was broken down and displayed one by one, solving the reading difficulties when the dialogue assistant generated complex replies and achieving a more efficient user interaction experience.
Patent Information
- Application Number
- CN202310916177.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2043-07-25
AI Technical Summary
Existing chat assistants display large blocks of text directly when generating complex replies, which negatively impacts the user experience, leading to reading difficulties and low comprehension efficiency.
By acquiring the interaction scenario of the input text, and using a pre-trained dialogue assistant model and decomposition guidance, the text is decomposed and displayed step by step in the display box. The decomposition is combined with the interaction scenario to avoid inappropriate interruptions.
It improves the readability and comprehension efficiency of interactive text, enhances the user's interactive experience, and ensures that the displayed text is consistent and smooth.
Smart Images

Figure CN116975249B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to dialogue interaction methods, apparatus, devices and storage media. Background Technology
[0002] With the continuous development of technology, conversational assistants are increasingly appearing in people's daily lives and work. A conversational assistant is a type of software based on artificial intelligence technology that can communicate with users in natural language. It uses technologies such as natural language processing and deep learning to understand user input and then generate corresponding responses. For example, customer service chatbots are a common type of conversational assistant.
[0003] In related technologies, when the user's input is complex, the response text generated by the dialogue assistant may also become complex. In such cases, displaying large blocks of text on the screen can negatively impact the user's interactive experience, making it difficult for the user to read and reducing comprehension efficiency. Summary of the Invention
[0004] The main objective of this application is to propose a dialogue interaction method, apparatus, device, and storage medium that can improve the intuitiveness of the displayed content and enhance the user's interactive experience.
[0005] To achieve the above objectives, a first aspect of this application proposes a dialogue interaction method, comprising:
[0006] Get the input text of the target object;
[0007] Based on a pre-selected display interaction method, at least one display text obtained after responding to the input text is displayed one by one in the text display order, and each display text is displayed in a first display box;
[0008] The at least one display text is generated through the following steps:
[0009] Obtain the interaction scenario of the input text, and obtain decomposition guidance based on the interaction scenario;
[0010] The decomposition guide and the input text are input into a pre-trained dialogue assistant model to obtain interactive text and at least one decomposition identifier of the interactive text.
[0011] Based on the disassembly identifier, the interactive text is disassembled to generate at least one of the displayed texts.
[0012] In one embodiment, the step of inputting the decomposition guidance and the input text into a pre-trained dialogue assistant model to obtain the interaction text and at least one decomposition identifier of the interaction text includes:
[0013] The disassembly guide and the input text are input into a pre-trained dialogue assistant model to obtain the interactive text and the disassembly location;
[0014] The disassembly identifier is generated based on the disassembly location.
[0015] In one embodiment, the display interaction method includes: word-based interaction; the step of displaying at least one displayed text obtained after responding to the input text in order of text display sequence based on a pre-selected display interaction method includes:
[0016] At least one first display data is obtained according to the text display order; the first display data is obtained by adding the disassembly identifier associated with the display text at a preset position on the display text;
[0017] Use the first displayed data as the first target data;
[0018] If the preset position is the last position, the displayed text in the first target data is displayed in the first display box according to the first preset number of characters until the disassembly mark is detected. Then, a new first display box is generated, and the next first data group is selected as the first target data for display.
[0019] If the preset position is the first position, the first display box is generated according to the detected disassembly identifier. The display text in the first target data is displayed in the first display box according to the first preset number of characters until the last character of the display text is reached. Then, the next first data group is selected as the first target data for display.
[0020] In one embodiment, the display interaction method includes: segmented interaction; the step of displaying at least one piece of text obtained after responding to the input text in sequence according to the text display order, based on a pre-selected display interaction method, includes:
[0021] At least one second display data is obtained according to the text display order; the second display data is obtained by adding the disassembly identifier associated with the displayed text at a preset position on the displayed text;
[0022] Use the second displayed data as the second target data;
[0023] If the preset position is the last position, then the preset content is displayed in the first display box, and the characters in the displayed text of the second target data are obtained according to the second preset number of characters to form the text segment to be displayed until the disassembly mark is detected. The preset content is replaced by the text segment to be displayed in the first display box, and a new first display box is generated. The next second data group is selected as the second target data group for display.
[0024] If the preset position is the first position, the first display box is generated according to the detected disassembly identifier, the preset content is displayed in the first display box, and the characters in the display text of the second target data are obtained according to the second preset number of characters to form a text segment to be displayed until the last character of the display text is reached. The preset content is replaced by the text segment to be displayed in the first display box, and a new first display box is generated. The next second data group is selected as the second target data group for display.
[0025] In one embodiment, after displaying at least one displayed text obtained after responding to the input text in the order of text display, the method further includes:
[0026] In response to the aggregation command of the target object, a second display box is generated; the aggregation command includes an aggregation method.
[0027] The displayed text is grouped according to the aggregation method to obtain one or more display groups; the number of display groups is the same as the number of the second display boxes.
[0028] The contents of the display group are displayed within the second display frame.
[0029] In one embodiment, the dialogue assistant model is trained through the following steps:
[0030] Construct a training sample set; the training sample set includes: multiple input data samples, the input data samples include input data and disassembly guidance data; the input data samples are associated with sample labels, the sample labels include interaction data and disassembly labels, the disassembly labels are the disassembly position vectors corresponding to the interaction scenarios of the input data samples;
[0031] The input data sample is input into the dialogue assistant model for prediction to obtain the predicted interaction result and the predicted decomposition vector.
[0032] A first loss value is obtained based on the predicted interaction result and the interaction data, and a second loss value is obtained based on the predicted decomposition vector and the decomposition label;
[0033] The total loss value is calculated based on the first loss value and the second loss value, and the model weights of the dialogue assistant model are adjusted according to the total loss value until the iteration ends, resulting in the trained dialogue assistant model.
[0034] In one embodiment, the disassembly guidance data is obtained through the following steps:
[0035] Obtain profile data from the input data sample; the profile data is obtained based on user usage data, which includes historical usage data and / or current usage data;
[0036] The portrait data is input into the scene classification model to obtain the interaction scene, and the decomposition guidance data is obtained based on the interaction scene.
[0037] To achieve the above objectives, a second aspect of this application provides a dialogue interaction device, comprising:
[0038] Input acquisition module: used to acquire the input text of the target object;
[0039] Interactive display module: used to display at least one text obtained after responding to the input text in the order of text display based on a pre-selected display interaction method, with each text displayed in a first display box;
[0040] The at least one display text is generated through the following steps:
[0041] Obtain the interaction scenario of the input text, and obtain decomposition guidance based on the interaction scenario;
[0042] The decomposition guide and the input text are input into a pre-trained dialogue assistant model to obtain interactive text and at least one decomposition identifier of the interactive text.
[0043] Based on the disassembly identifier, the interactive text is disassembled to generate at least one of the displayed texts.
[0044] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.
[0045] To achieve the above objectives, a fourth aspect of the present application provides a storage medium, which is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.
[0046] The dialogue interaction method, apparatus, device, and storage medium proposed in this application obtain input text from a target object and, based on a pre-selected display interaction method, display at least one displayed text obtained after responding to the input text in the order of text display, with each displayed text displayed within a first display box. The displayed text is generated through the following steps: obtaining a decomposition guide for the input text; inputting the decomposition guide and the input text into a pre-trained dialogue assistant model to obtain interactive text and at least one decomposition identifier for the interactive text; and decomposing the interactive text based on the decomposition identifier to generate at least one displayed text. This application embodiment obtains the decomposition guide in conjunction with the interaction scenario, uses the decomposition guide to decompose the interactive text, and displays the decomposed displayed text one by one within the first display box. This method avoids the reading difficulties caused by displaying large blocks of text, as the sequential display of the decomposed text guides the user to gradually understand the response content, improving the readability of the interactive text and enhancing the user's comprehension efficiency. Furthermore, using a decomposition guide adapted to the interaction scenario to decompose the interactive text avoids interruptions in the interactive text at inappropriate points, resulting in disjointed displayed text. The decomposed displayed text is more reasonable and fluent, further enhancing the interactive experience. Attached Figure Description
[0047] Figure 1 This is a flowchart of the dialogue interaction method provided in the embodiments of this disclosure.
[0048] Figure 2 This is a schematic diagram of a program or applet installed on a terminal for dialogue interaction, according to another embodiment of the dialogue interaction method provided in this disclosure.
[0049] Figure 3 This is a schematic diagram illustrating the corresponding process of different interaction scenarios of the dialogue interaction method provided in another embodiment of this disclosure.
[0050] Figure 4 This is a flowchart illustrating the training process of a dialogue assistant model for different interaction scenarios provided in another embodiment of the dialogue interaction method disclosed herein.
[0051] Figure 5 This is a schematic diagram showing the disassembly location of a dialogue interaction method provided in another embodiment of this disclosure.
[0052] Figure 6 This is a schematic diagram of the decomposition tag generation process of a dialogue interaction method provided in another embodiment of this disclosure.
[0053] Figure 7 yes Figure 1 The flowchart of step S120.
[0054] Figure 8This is a schematic diagram of the display text of a dialogue interaction method provided in another embodiment of this disclosure.
[0055] Figure 9 This is a schematic diagram illustrating the word-by-word display of text in a dialogue interaction method provided in another embodiment of this disclosure.
[0056] Figure 10 yes Figure 1 Another flowchart of step S120 in the process
[0057] Figure 11 This is a schematic diagram of the display text of a dialogue interaction method provided in another embodiment of this disclosure.
[0058] Figure 12 This is a schematic diagram illustrating the segmented display of text in a dialogue interaction method provided in another embodiment of this disclosure.
[0059] Figure 13 This is a flowchart of the display text aggregation process of a dialogue interaction method provided in another embodiment of this disclosure.
[0060] Figure 14a This is a schematic diagram illustrating the entire aggregation process of the display text in a dialogue interaction method provided in another embodiment of this disclosure.
[0061] Figure 14b This is a partial aggregation diagram of the display text aggregation process in a dialogue interaction method provided in another embodiment of this disclosure.
[0062] Figure 15 A schematic diagram of the interface display of the dialogue interaction method provided in another embodiment of this disclosure without interactive text decomposition.
[0063] Figure 16 This disclosure provides a schematic diagram of word-based and segment-based interactive methods for dialogue interaction, based on another embodiment.
[0064] Figure 17 A schematic diagram of the interface display of a dialogue interaction method provided in another embodiment of this disclosure.
[0065] Figure 18 This is a schematic diagram of the display frame shape of a dialogue interaction method provided in another embodiment of this disclosure.
[0066] Figure 19 This is a structural block diagram of a dialogue interaction device provided in another embodiment of this disclosure.
[0067] Figure 20 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this disclosure. Detailed Implementation
[0068] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this disclosure.
[0069] It should be noted that although functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.
[0070] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing embodiments of this disclosure only and is not intended to be limiting of this disclosure.
[0071] First, let's analyze some of the terms used in this disclosure:
[0072] Artificial intelligence (AI) is a new branch of computer science that studies, develops, and applies theories, methods, technologies, and systems to simulate, extend, and expand human intelligence. It aims to understand the essence of intelligence and produce intelligent machines that can react in a way similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thought. Furthermore, AI utilizes digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceiving the environment, acquiring knowledge, and using that knowledge to achieve optimal results.
[0073] Deep learning is based on artificial neural networks and uses multi-layered neural networks for data processing and pattern recognition. The core idea of deep learning is to learn complex feature representations and abstract concepts through training on large-scale data, thereby achieving efficient information processing and decision-making. In deep learning, multi-layered neural networks can automatically learn feature representations of data. Each layer of the neural network transforms and abstracts the input data, progressively extracting higher-level feature representations. Through optimization methods such as backpropagation and gradient descent, deep learning models can learn and adjust parameters based on given input data, thus achieving model training and optimization. Deep learning has a wide range of applications, including image recognition, speech recognition, natural language processing, and recommender systems.
[0074] Natural Language Processing (NLP) is a discipline that studies how to enable computers to understand and process human natural language. It encompasses multiple tasks and techniques aimed at enabling computers to interact with, analyze, and generate natural language used by humans. NLP methods include statistical methods, machine learning methods, and deep learning methods. Statistical methods primarily use probabilistic and language models, machine learning methods utilize feature engineering and supervised learning algorithms to build models, and deep learning methods achieve this through the training and learning of deep neural networks. NLP has a wide range of applications, including search engines, intelligent assistants, machine translation, automatic summarization, sentiment analysis, and speech recognition.
[0075] Question-answering systems: Question-answering systems aim to answer questions posed by users. These systems need to understand the meaning of the questions and find answers from structured and unstructured data.
[0076] With the continuous development of technology, conversational assistants are increasingly appearing in people's daily lives and work. A conversational assistant is a type of software based on artificial intelligence technology that can communicate with users in natural language. It uses technologies such as natural language processing and deep learning to understand user input and then generate corresponding responses. For example, customer service chatbots are a common type of conversational assistant.
[0077] In related technologies, when user input is complex, the response text generated by the dialogue assistant may also become complex, often displaying large amounts of multi-faceted content directly on the interface. In such cases, presenting large blocks of text negatively impacts the user experience, making reading difficult and reducing comprehension efficiency. Some related technologies use artificially set decomposition rules, such as strict limits on the number of sentences per paragraph or the total text length, to break down long texts. However, due to the diverse nature of interaction scenarios, decomposition based on rigid rules often results in text that does not conform to human reading habits, potentially leading to even greater reading difficulties.
[0078] Based on this, embodiments of this disclosure provide a dialogue interaction method, apparatus, device, and storage medium. A decomposition guide is obtained in conjunction with the interaction scenario, and the interactive text is decomposed using this guide. The decomposed text is then displayed one by one in a first display frame. This approach avoids the reading difficulties caused by displaying large blocks of text. Displaying the decomposed text sequentially guides the user to gradually understand the response content, improving the readability of the interactive text and enhancing the user's comprehension efficiency. Furthermore, using a decomposition guide adapted to the interaction scenario prevents interruptions in the interactive text, avoiding discontinuous display. The resulting decomposed text is more logical and fluid, further enhancing the interactive experience.
[0079] This disclosure provides a dialogue interaction method, apparatus, device, and storage medium, which are specifically described through the following embodiments. First, the dialogue interaction method in the embodiments of this disclosure is described.
[0080] This disclosure allows for the acquisition and processing of relevant data based on artificial intelligence (AI) technology. AI is a theory, method, technology, and application system that uses digital computers or computers-controlled machines to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce new intelligent machines that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities.
[0081] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0082] The dialogue interaction method provided in this disclosure relates to the field of artificial intelligence technology, and more particularly to the field of data mining technology. The dialogue interaction method provided in this disclosure can be applied to a terminal, a server, or a computer program running on either the terminal or the server. For example, the computer program can be a native program or software module in an operating system; it can be a native application (APP), i.e., a program that needs to be installed in the operating system to run, such as a client that supports dialogue interaction; it can also be a mini-program, i.e., a program that only needs to be downloaded to a browser environment to run; or it can be a mini-program that can be embedded into any APP. In short, the above-mentioned computer program can be any form of application, module, or plugin. The terminal communicates with the server via a network. The dialogue interaction method can be executed by the terminal or the server, or by the terminal and the server working together.
[0083] In some embodiments, the terminal may be a smartphone, tablet, laptop, desktop computer, or smartwatch, etc. Additionally, the terminal may also be a smart in-vehicle device. This smart in-vehicle device uses the dialogue interaction method of this embodiment to provide related services and enhance the driving experience. The server may be an independent server, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms; it may also be a service node in a blockchain system, where the service nodes form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). The server may have a server-side application for the dialogue interaction system installed on it, allowing interaction with the terminal. This server-side application may have corresponding software installed on it, such as an application implementing the dialogue interaction method, but is not limited to the above forms. The terminal and the server can be connected via Bluetooth, USB (Universal Serial Bus), or network communication methods, and this embodiment does not impose any restrictions.
[0084] This disclosure can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and so on. This disclosure can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and so on that perform a specific task or implement a specific abstract data type. This disclosure can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0085] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards of the relevant countries and regions. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirects to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data for the proper functioning of the embodiments of this application obtained.
[0086] The dialogue interaction method in the embodiments of this disclosure is described below.
[0087] Figure 1 This is an optional flowchart of the dialogue interaction method provided in the embodiments of this disclosure. Figure 1 The method may include, but is not limited to, steps S110 to S120, and sub-steps S121 to S123 of step S120. It is also understood that this embodiment... Figure 1 The order of steps S110 to S120 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.
[0088] Step S110: Obtain the input text of the target object.
[0089] In one embodiment, reference is made to Figure 2This is a diagram illustrating a software program or mini-program installed on a terminal for interactive dialogue. The target audience includes users of the software program or mini-program, or test programs simulating human dialogue behavior. These test programs are used for testing during the testing phase of the interactive dialogue software or mini-program.
[0090] For example Figure 2 The software or mini-program is named "xx Conversation Assistant". After the target clicks on the software or mini-program, the following appears... Figure 2 The interface shown contains an input dialog box for receiving input text from the target object. The target object enters the text to ask a question in the input dialog box, and the terminal reads the content of the input dialog box in the background to obtain the target object's input text. The input text can be stored as a string. Additionally, a program or app can run on the terminal, where the terminal performs a dialogue interaction based on the acquired input text and displays the response information on the interface. Alternatively, the program or app can run on a server, where the terminal only displays the corresponding interface. The terminal sends the acquired input text to the server via the network for dialogue interaction, then receives the response information returned by the server and displays the response information on the interface. This embodiment does not impose specific limitations on this approach.
[0091] In one embodiment, when no input is made to the target object, Figure 2 The input dialog box shown in the interface can display prompts and guidance information, such as "Enter your question here".
[0092] Step S120: Based on the pre-selected display interaction method, display at least one display text obtained after responding to the input text in the order of text display, with each display text displayed in a first display box.
[0093] In one embodiment, to avoid the reading difficulties caused by displaying large blocks of text when displaying interactive text, this embodiment breaks down the interactive text into one or more display texts, and displays the broken-down display texts one by one in a first display box. Each display text is displayed in a first display box, achieving segmented display. This method of displaying the broken-down display texts sequentially can guide the user to gradually understand the response content, improve the readability of the interactive text, and enhance the user's comprehension efficiency.
[0094] The following describes the process of generating the displayed text in the embodiments of this application. (Refer to...) Figure 1 At least one display text is generated through the following steps:
[0095] Step S121: Obtain the interaction scenario of the input text and obtain the decomposition guide based on the interaction scenario.
[0096] In one embodiment, to improve response efficiency, a general interaction scenario can be pre-defined, and each user can use the same scenario for subsequent operations. Alternatively, the interaction scenario can be obtained for each user's input text, which can improve personalization and increase user satisfaction. In one embodiment, there are two ways to obtain the interaction scenario of the input text: the first is keyword matching, and the second is to input the input text into a pre-trained scenario classification model for parsing to obtain the interaction scenario of the input text. These two methods are described below.
[0097] In one embodiment, the input text contains key characters related to the scene. The interactive scene corresponding to the input text can be obtained by matching the key characters with preset scene information. For example, refer to... Figure 3 This refers to the corresponding process for different interaction scenarios.
[0098] 1) Enter text: Please recommend a menu suitable for mornings;
[0099] The extracted keywords are: morning, menu;
[0100] The interaction scenario could be: recipe recommendation.
[0101] 2) Enter text: Which department should I go to for gastrointestinal discomfort?
[0102] The extracted keywords are: gastrointestinal, science;
[0103] The interaction scenario could be: medical advice.
[0104] 3) Input text: Please briefly describe the neural network model;
[0105] The extracted key characters are: neural network model;
[0106] Interactive scenarios could include: popularizing knowledge.
[0107] It is understood that the key characters contained in the input text in this embodiment can be obtained using key character matching or by content parsing through a natural language learning model. Key character matching refers to searching through the input text one by one using a preset key character list to determine whether a matching key character exists. Furthermore, the correspondence between key characters and interaction scenarios can also be stored in a preset scenario mapping table. This embodiment does not limit the interaction scenarios, key character extraction methods, or scenario mapping tables.
[0108] It is understandable that the granularity of decomposition varies depending on the interaction scenario. For example, interactive texts for popular science have a high knowledge density, so they can be decomposed at a finer granularity. This embodiment does not limit the specific granularity of decomposition.
[0109] In one embodiment, user profile data can be obtained by parsing the input text, and then the user profile data can be input into a pre-trained scene classification model for parsing to obtain the interaction scene. Here, the scene classification model is a neural network model, capable of obtaining the corresponding interaction scene based on the user profile data. The process of parsing the input text to obtain user profile data is as follows: After obtaining user information, user usage data is obtained from the user information. User usage data can be user behavior data, such as the length of articles the user prefers to read, the text length of posts published, and the user's chat history. Then, user profile data is obtained based on the user usage data and the input text.
[0110] In one embodiment, user profile data is input into a scene classification model. The scene classification model outputs corresponding interaction scenarios based on the profile data, with different interaction scenarios corresponding to different decomposition guidelines. The profile data is constructed based on the user's historical and / or current usage data, and can characterize user preferences to a certain extent. Considering that user profiles may differ for different target objects under different interaction scenarios, different user profile data corresponds to different decomposition guidelines under different interaction scenarios. For example, if a user prefers a more serious tone in a certain interaction scenario, the decomposition guideline could be: fewer decomposition symbols and more at the end of the sentence. Or, if a user speaks casually in a certain interaction scenario, the decomposition guideline could be: include more decomposition symbols, such as decomposing only two or three words. This embodiment, combining profile data and a scene classification model, can improve the decomposition guidelines for the dialogue assistant model, thereby enabling real-time adjustment of the decomposition strategy during the decomposition process and providing more personalized and accurate decomposition suggestions for interactive text for different users.
[0111] In one embodiment, if a target object asks multiple questions within a certain time period, such as five minutes, the interaction scenario is only identified on the first question. Subsequent questions and answers are then segmented using the interaction scenario identified on the first question, which can improve the efficiency of question and answering.
[0112] Step S122: Input the decomposition guide and input text into the pre-trained dialogue assistant model to obtain the interactive text and at least one decomposition identifier of the interactive text.
[0113] In one embodiment, the decomposition instructions and input text are simultaneously input into a pre-trained dialogue assistant model. The dialogue assistant model needs to generate interactive text based on the input text and, based on the interactive scenario, generate decomposition markers for decomposing the interactive text. The dialogue assistant model can be a large language model, a sequence-to-sequence model (e.g., a Seq2Seq model), or a pre-trained language model (e.g., a GPT model or a BERT model). This embodiment does not limit the specific structure of the dialogue assistant model.
[0114] The training process of the dialogue assistant model is described below. (Refer to...) Figure 4 The training process includes the following steps:
[0115] Step S410: Construct the training sample set.
[0116] In one embodiment, the training sample set includes multiple input data samples. Each input data sample includes input data and decomposition guidance data, and each input data sample is associated with a set of sample labels, including: interaction data and decomposition labels. The interaction data is the response content required for the input data sample, and the decomposition label is the decomposition position vector of the interaction data. This decomposition position vector is obtained by vectorizing the decomposition positions of the interaction data. It can be understood that the dialogue assistant model predicts the interaction data based on the input data, then decomposes the interaction data according to the decomposition guidance data, outputs the predicted decomposition positions, and then compares them with the decomposition labels.
[0117] In one embodiment, reference is made to Figure 5 The splitting positions are obtained based on the character positions of the interactive data. For example, if the interactive data has 15 characters, namely {z1,…,z15}, and needs to be split into 3 segments, namely {z1,…,z4}, {z5,…,z8} and {z9,…,z15}, then there are two corresponding splitting positions, w1=4 and w2=8. Here, w1=4 means splitting from the 4th character onwards, and w2=8 means splitting from the 8th character onwards. The splitting position vector can be the vector obtained by representing {4,8}.
[0118] In one embodiment, the rationality and fluency of the disassembly scheme need to be considered when constructing interactive data and corresponding disassembly tags. Therefore, the disassembly tags can be generated manually. This embodiment does not limit this approach.
[0119] In one embodiment, reference is made to Figure 6 The disassembly guide data is obtained through the following steps:
[0120] Step S610: Obtain the portrait data of the input data sample.
[0121] In one embodiment, the user profile data is obtained based on the user's historical usage data, which includes historical usage data and / or current usage data. Historical usage data can be usage data collected within a preset time period, and current usage data can be usage data collected in the current time period, wherein the preset time period is earlier than the current time period. In another embodiment, the usage data can be user behavioral data, such as the length of articles the user prefers to read, the text length of posts, the user's chat history, and the emotions contained in the user's text.
[0122] Step S620: Input the portrait data into the scene classification model to obtain the interaction scene, and obtain the decomposition guidance data based on the interaction scene.
[0123] In one embodiment, the scene classification model is trained using pre-designed data samples. These data samples can be different user profiles, and their labels correspond to the respective interaction scenarios. The model is then trained using these sample data, and the model weights are adjusted based on the corresponding labels, enabling the scene classification model to output appropriate interaction scenarios for different user profiles. The combination of user profile data and interaction scenarios corresponds to decomposition guidance data, with different user profiles corresponding to different decomposition guidance data in different interaction scenarios. For example, if a user prefers a more serious tone in a certain interaction scenario, the decomposition guidance data might be: fewer decomposition symbols, mostly placed after the whole sentence. Or, if a user speaks casually in a certain interaction scenario, the decomposition guidance data might include more decomposition symbols, such as decomposing sentences after only a few words. It is understood that the decomposition guidance data can be set according to actual needs. The correspondence between the decomposition guidance data can be: User Profile 1 / Interaction Scenario 1 - Decomposition Guidance Data 1, User Profile 2 / Interaction Scenario 1 - Decomposition Guidance Data 2, User Profile 1 / Interaction Scenario 3 - Decomposition Guidance Data 3... Therefore, after obtaining the interaction scenario, the decomposition guidance data can be obtained by combining it with the user profile. It is understandable that the correspondence between the interaction scenario, user profile, and decomposition guidance data can be set according to actual needs.
[0124] The disassembly guidance data constructed through the above process includes profile data, interaction scenarios, and disassembly location information, which can adapt to the specific needs of each user and generate customized disassembly solutions.
[0125] As can be seen from the above decomposition guidance data generation process, the dialogue assistant model in this embodiment does not need to manually formulate complex decomposition rules when decomposing, and does not introduce additional decomposition models. The quality of the decomposition labels is strongly correlated with the dialogue assistant model's own training data, training process, text understanding and decomposition capabilities.
[0126] Step S420: Input the input data sample into the dialogue assistant model for prediction to obtain the predicted interaction result and the predicted decomposition vector.
[0127] In one embodiment, the input data sample is fed into the dialogue assistant model for prediction, resulting in predicted input data and predicted decomposition vectors. The predicted interaction result is the predicted question-and-answer content generated by the dialogue assistant model based on the input data sample, and the predicted decomposition vector is the information related to the decomposition position corresponding to the predicted question-and-answer content.
[0128] Step S430: Obtain the first loss value based on the predicted interaction results and interaction data, and obtain the second loss value based on the predicted decomposition vector and decomposition label.
[0129] In one embodiment, loss values are calculated for the two prediction data respectively. Specifically, a first loss value L1 is obtained based on the prediction interaction result and the interaction data, and a second loss value L2 is obtained based on the prediction decomposition vector and the decomposition label.
[0130] Step S440: Calculate the total loss value based on the first loss value and the second loss value, and adjust the model weights of the dialogue assistant model according to the total loss value until the iteration ends, and obtain the trained dialogue assistant model.
[0131] In one embodiment, the total loss value is expressed as: L = a*L1 + (1-a)*L2, where a represents the loss weight, which can be set according to actual needs. Then, the model weights of the dialogue assistant model are adjusted based on the total loss value until the iteration termination condition is met, at which point the iteration ends, and the trained dialogue assistant model is obtained. Through multiple iterations, the predictive ability of the dialogue assistant model is continuously improved.
[0132] The iteration termination conditions here include: 1) The number of iterations reaches the preset number of iterations: A preset number of iterations is set for the dialogue assistant model to run. Training stops when the preset number of iterations is reached. 2) The total loss value reaches the loss threshold: When the total loss value drops to or approaches the preset loss threshold, the dialogue assistant model is considered to have converged, and training stops. This embodiment does not limit the iteration termination conditions.
[0133] It is understandable that the dialogue assistant model can be continuously updated. For example, once the dialogue assistant model is online and running, it can obtain real-time user feedback, utilize online learning and collaborative filtering techniques to continuously improve the model's text breakdown effectiveness, and appropriately reference and introduce breakdown schemes from similar users to enhance the flexibility of interactive text breakdown and adapt to various scenarios in real time. This embodiment does not limit the method of continuous updating the dialogue assistant model.
[0134] Step S123: Based on the disassembly identifier, disassemble the interactive text to generate at least one display text.
[0135] In one embodiment, the dialogue assistant model obtained through the above training process can generate interactive text based on the input text, and can also generate decomposition vectors for deconstructing the interactive text based on the interactive scenario. Since the decomposition vector represents the decomposition position, the decomposition identifier can be obtained by parsing the content of the decomposition vector, and each decomposition identifier corresponds to a decomposition position. For example Figure 5In the middle, a disassembly identifier is generated after the 4th character and after the 8th character. The disassembly identifier can be a pre-defined identifier, such as "|" or "&". This embodiment does not limit the specific symbol of the disassembly identifier.
[0136] In one embodiment, in order to improve the efficiency of the question-and-answer experience, this embodiment of the application will add a welcome message and a closing message before and after the question-and-answer text according to the interaction scenario.
[0137] For example, if the interaction scenario is medical advice, the welcome message can be something that shows care for the user, such as "Dear, I'm sorry to hear you're not feeling well," and the closing message can be "I hope you get better soon!"
[0138] For example, if the interaction scenario is knowledge dissemination, the welcome message could be encouraging content for the user, such as "I'm very happy to provide you with knowledge related to xx," and the closing message could be "If you have any questions, please feel free to ask again."
[0139] It is understood that the welcome and closing remarks can be set according to the actual situation, and this embodiment does not limit this. In this embodiment, welcome and closing remarks are added before and after the question and answer text. When decomposing, only the question and answer text needs to be input into the dialogue assistant model. After obtaining the decomposition position, the corresponding decomposition marker is added after the welcome and before the closing remarks.
[0140] After obtaining multiple display texts and disassembly identifiers, they need to be displayed. The following describes the display interaction method for the display texts.
[0141] In one embodiment, the text display interaction methods are divided into two types: character-based interaction and paragraph-based interaction. The display process of these two display interaction methods is described below.
[0142] In one embodiment, reference is made to Figure 7 When the display interaction mode is text-based, based on the pre-selected display interaction mode, displaying at least one piece of text obtained after responding to the input text in the order of text display includes the following steps:
[0143] Step S710: Obtain at least one first display data according to the text display order.
[0144] In one embodiment, reference is made to Figure 8The interactive text P1 is decomposed into four display texts {X1, X2, X3, X4}, with decomposition positions {3, 5, 9}. Each display text contains three decomposition markers: C1, C2, and C3. The text display order is: X1--X2--X3--X4. For example, the display text X3 is displayed in the 3rd position. The first display data is obtained by adding a decomposition marker associated with the display text at a preset position. If the preset position is the last position, it's equivalent to adding a corresponding decomposition marker at the end of the display text. In this case, the last display text has no associated decomposition marker, so an empty decomposition marker, C0, is associated with the end of the last display text. The resulting first display texts are: X1C1, X2C2, X3C3, and X4C0. If the preset position is the first position, it's equivalent to adding a corresponding disassembly identifier to the first and second positions of the displayed text. In this case, the first displayed text doesn't have an associated disassembly identifier, so an empty disassembly identifier, C0, is associated with the first position of the first displayed text. The resulting first displayed text is: C0X1, C1X2, C2X3, and C3X4. As can be seen from the above, the disassembly identifier is related to the text display order; each first displayed text contains a corresponding disassembly identifier, which can be used to locate the first displayed text.
[0145] Step S720: Use the first displayed data as the first target data.
[0146] Step S730: If the preset position is the last position, the text in the first target data is displayed in the first display box according to the first preset number of characters until the disassembly mark is detected. Then, a new first display box is generated, and the next first data group is selected as the first target data for display.
[0147] In one embodiment, the first display data is selected as the first target data one by one according to the text display order corresponding to the disassembly identifier. The number of the first preset characters can be one or more. This embodiment uses one as an example. If the preset position is the last character, combined with... Figure 8 The first displayed text is: X1C1, X2C2, X3C3, and X4C0. (See reference...) Figure 9, the first display text X1C1 is displayed as the first first target data in the first first display box K1. Assuming the content of the display text X1 is "one, two, three, four, five", then "one", "two", "three", "four", and "five" are displayed one by one in the first display box K1 in the character order. After the character "five" is displayed, the disassembling identifier C1 is detected. At this time, the first display text X1C1 is displayed completely in the corresponding first display box K1. A new first display box K2 is generated, and the first display text X2C2 is displayed as the second first target data in the second first display box K2. Assuming the content of the display text X2 is "six, seven, eight, nine, ten", then "six", "seven", "eight", "nine", and "ten" are displayed one by one in the first display box K2 in the character order. After the character "ten" is displayed, the disassembling identifier C2 is detected. At this time, the first display text X2C2 is displayed completely in the corresponding first display box K2. Repeat multiple times until all the first display texts are displayed.
[0148] Step S740: If the preset position is the first position, generate a first display box according to the detected disassembling identifier, and display the display text in the first target data in the first display box according to the first preset number of characters until the last character of the display text is reached, and select the next first data group as the first target data for display.
[0149] In an embodiment, the first display data is selected one by one as the first target data according to the text display order corresponding to the disassembling identifier. The first preset number of characters here can be one or more than one. This embodiment is described by taking one as an example. If the preset position is the first position, combined with Figure 8 , the first display text is: C0X1, C1X2, C2X3, and C3X4. Refer to Figure 9, take the first display text C0X1 as the first first target data. First, generate a first display box K1' according to the detected disassembly identifier C0, and then display the first display text in the first first display box K1'. Assume that the content of the display text X1 is "one, two, three, four, five", then display "one", "two", "three", "four", and "five" one by one in the first display box K1 in the character order. After the character "five" is displayed, at this time, the first display text C0X1 is displayed in the corresponding first display box K1. Generate a new first display box K2', and display the first display text C1X2 as the second first target data in the second first display box K2'. Assume that the content of the display text X2 is "six, seven, eight, nine, ten", then display "six", "seven", "eight", "nine", and "ten" one by one in the first display box K2' in the character order. After the character "ten" is displayed, at this time, the first display text X2C2 is displayed in the corresponding first display box K2'. Repeat this process multiple times, and generate corresponding first display boxes for each first display text according to the disassembly identifier for display until all the first display texts are displayed.
[0150] It can be understood that when displaying a certain display text according to the first preset number of characters, if not all the content is displayed, a prompt message can be added in the first display box until the last display text is displayed, so as to avoid the target object waiting too long. The prompt message can be something like "Typing character by character, please wait a moment." This embodiment does not limit this.
[0151] It can be understood that the character-based interaction can also first obtain all the characters in each first display text and transmit them to the client of the terminal at one time for display according to the first preset number of characters on the display interface of the client. This embodiment does not limit this.
[0152] In one embodiment, refer to Figure 10 , when the display interaction mode is segment-based interaction, based on the pre-selected display interaction mode, displaying at least one display text obtained by responding to the input text one by one according to the text display order includes the following steps:
[0153] Step S1010: Obtain at least one second display data according to the text display order.
[0154] In one embodiment, refer to Figure 11The interactive text P2 is decomposed into four display texts {Y1, Y2, Y3, Y4}, with decomposition positions {4, 7, 11}. Each display text contains three decomposition markers: C4, C7, and C11. The text display order is Y1--Y2--Y3--Y4. For example, the display text Y3 is displayed in the 3rd position. The second display data is obtained by adding decomposition markers associated with the display text at preset positions. If the preset position is the last position, it's equivalent to adding the corresponding decomposition marker at the end of the display text. In this case, the last display text has no associated decomposition marker, so an empty decomposition marker, C0', is associated with the end of the last display text. The resulting second display texts are: Y1C4, Y2C7, Y3C11, and Y4C0'. If the preset position is the first position, it's equivalent to adding a corresponding disassembly identifier to the beginning of the displayed text. In this case, the second displayed text doesn't have an associated disassembly identifier, so an empty disassembly identifier, C0', is associated with the beginning of the second displayed text. The resulting second displayed text is: C0'Y1, C4Y2, C7Y3, and C11Y4. As can be seen, the disassembly identifier is related to the text display order; each second displayed text contains a corresponding disassembly identifier, which can be used to locate the second displayed text.
[0155] Step S1020: Use the second displayed data as the second target data.
[0156] Step S1030: If the preset position is the last position, the preset content is displayed in the first display box, and the characters in the displayed text of the second target data are obtained according to the second preset number of characters to form the text segment to be displayed until the disassembly mark is detected. The preset content is replaced by the text segment to be displayed in the first display box, and a new first display box is generated. The next second data group is selected as the second target data group for display.
[0157] In one embodiment, the second display data is selected one by one as the second target data according to the text display order corresponding to the disassembly identifier. The number of the second preset characters can be one or more. This embodiment uses one as an example. If the preset position is the last character, combined with... Figure 11 The second displayed text is: Y1C4, Y2C7, Y3C11, and Y4C0'. (See reference...) Figure 12, the second display text Y1C4 is displayed as the first second target data in the first second display box K3. Assuming the content of the display text Y1 is "one, two, three, four, five", first, the preset content is displayed in the second display box K3, and the preset content can be "In the answer...". The characters "one", "two", "three", "four", and "five" are obtained one by one in character order to form the text segment to be displayed. When the character "five" is obtained and the disassembling identifier C4 is detected, the content of the text segment to be displayed at this time is "one, two, three, four, five". The preset content in the second display box K3 is replaced with the text segment to be displayed, and at this time, "one, two, three, four, five" is displayed in the second display box K3. Then, a new second display box K4 is generated, and the second display text Y2C7 is used as the second second target data. At this time, the preset content is displayed in the second second display box K4, and the preset content can be "In the answer...". After obtaining the complete text segment to be displayed by identifying the disassembling identifier C7 in the above manner, the text segment to be displayed is displayed in the second display box K4. Assuming the content of the display text Y2 is "six, seven, eight, nine, ten", then after the disassembling identifier C7 is detected, the text segment to be displayed is "six, seven, eight, nine, ten". Therefore, the preset content "In the answer..." in the second display box K4 is replaced with "six, seven, eight, nine, ten", and at this time, the second display text Y2C7 is completely displayed in the corresponding second display box K4. Repeat multiple times until all the second display texts are displayed.
[0158] Step S1040: If the preset position is the first position, a first display box is generated according to the detected disassembling identifier, the preset content is displayed in the first display box, and the characters in the display text of the second target data are obtained according to the second preset character quantity to form the text segment to be displayed until the last character of the display text is reached. The preset content in the first display box is replaced with the text segment to be displayed and a new first display box is generated, and the next second data group is selected as the second target data group for display.
[0159] In one embodiment, the second display data is selected one by one as the second target data according to the text display order corresponding to the disassembling identifier. If the preset position is the last position, in combination with Figure 11 , the second display texts are: C0’Y1, C4Y2, C7Y3, and C11Y4. Refer to Figure 12, the second display text C0’Y1 is used as the first second target data and is displayed in the first second display box K3’. Assume the content of the display text Y1 is "one, two, three, four, five". First, the disassembling identifier C0’ is detected, and the second display box K3’ is generated and the preset content is displayed. The preset content can be "responding...". The characters "one", "two", "three", "four", and "five" are obtained one by one in character order to form the text segment to be displayed. Until the character "five" is obtained, at this time, the content of the text segment to be displayed is "one, two, three, four, five". In the second display box K3, the text segment to be displayed is used to replace the original preset content. At this time, "one, two, three, four, five" is displayed in the second display box K3. Then, the disassembling identifier C4 is detected, and a new second display box K4’ is generated. The second display text C4Y2 is used as the second second target data. At this time, the preset content is displayed in the second second display box K4’. The preset content can be "responding...". After obtaining the complete text segment to be displayed in the above manner, the text segment to be displayed is displayed in the second display box K4’. Assume the content of the display text Y2 is "six, seven, eight, nine, ten", then the text segment to be displayed is "six, seven, eight, nine, ten". Therefore, in the second display box K4’, "six, seven, eight, nine, ten" is used to replace the preset content "responding...". At this time, the second display text C4Y2 is completely displayed in the corresponding second display box K4’. Repeat this process multiple times until all the second display texts are displayed.
[0160] It can be understood that if not all the display texts are displayed, a prompt message is added outside the second display box until the last display text is completely displayed, so as to prevent the target object from waiting too long. The prompt message can be something like "Inputting, please wait a moment". This embodiment does not limit this.
[0161] In addition, although the embodiments of the present application disassemble the interaction text, for the sake of easy understanding, some symbols can also be used to associate the display texts corresponding to the same interaction text. The symbols can be: square brackets, arrows, or dashed boxes, etc. This embodiment does not limit this.
[0162] The above process describes the process of displaying the display text word by word and segment by segment in the embodiments of the present application. It can be seen that in any of the display interaction methods, the disassembling identifier will not be displayed on the interface. Refer to Figure 13 , after step S120 in the embodiments of the present application displays at least one display text obtained by responding to the input text one by one according to the text display order, it further includes:
[0163] Step S1310: Generate a second display box in response to the aggregation instruction of the target object.
[0164] In one embodiment, displaying the question-and-answer text after it has been broken down can improve the reading experience for the target audience. If the target audience has gone through multiple question-and-answer processes, too many first display boxes will be displayed on the interface. Therefore, to further improve the experience, this embodiment provides an aggregation function, which allows the target audience to selectively aggregate previous question-and-answer processes by aggregating the first display boxes. The aggregation command includes aggregation methods, including partial aggregation and full aggregation. Full aggregation refers to aggregating the question-and-answer text broken down from each question-and-answer process on the interface into a corresponding display box. For example, the interface may display "One-click aggregation." After the target audience clicks or touches this icon, the generated aggregation command will aggregate the question-and-answer text broken down from each question-and-answer process. Partial aggregation refers to aggregating a portion of the selected question-and-answer text, while the unselected text remains displayed separately. For example, the target audience can directly select the text to be aggregated on the interface, or they can drag it, for example, selecting a text and dragging it over other texts to be aggregated, thus achieving the selection process.
[0165] In the above embodiment, the display text to be aggregated is selected according to the aggregation method. If it is a full aggregation, all display text for each question and answer text is selected; if it is a partial aggregation, one or more display texts are selected as needed. Multiple second display boxes are generated based on the number of aggregated text boxes.
[0166] Step S1320: Group the displayed text according to the aggregation method to obtain one or more display groups.
[0167] Step S1330: Display the contents of the display group in the second display frame.
[0168] In one embodiment, the displayed text that needs to be aggregated is grouped into one display group. If partial aggregation is required, the unselected displayed text is grouped into a separate display group. The number of display groups is the same as the number of second display frames, meaning one second display frame is set for each display group. The content of the display group is displayed within each second display frame. It is understood that the display order of the second display frames is not limited and can be consistent with the logical order of the displayed text.
[0169] In one embodiment, reference is made to Figure 14aThe question-and-answer text D1 of input text T1 is broken down into 5 display texts: D1-1, D1-2, D1-3, D1-4, and D1-5. The question-and-answer text D2 of input text T2 is broken down into 4 display texts: D2-1, D2-2, D2-3, D2-4, and D2-5. Clicking the aggregation button "One-Click Aggregation" on the interface aggregates all texts, generating two second display boxes: second display box S1 and second display box S2. D1-1, D1-2, D1-3, D1-4, and D1-5 are aggregated into one second display box S1, and D2-1, D2-2, D2-3, D2-4, and D2-5 are aggregated into one second display box S2.
[0170] Reference Figure 14b The question-and-answer text D1 of input text T1 is broken down into 5 display texts, namely D1-1, D1-2, D1-3, D1-4 and D1-5. The question-and-answer text D2 of input text T2 is broken down into 4 display texts, namely D2-1, D2-2, D2-3, D2-4 and D2-5. Partial aggregation is performed on the question-and-answer text D1, selecting D1-2, D1-4, and D1-5 for aggregation. Full aggregation is performed on the question-and-answer text D2. Therefore, the question-and-answer text D1 also includes two unselected display texts, D1-1 and D1-3. A total of four second display boxes need to be generated: second display box S3, second display box S4, second display box S5, and second display box S6. D1-1 is displayed in second display box S3, D1-2, D1-4, and D1-5 are aggregated and displayed in second display box S4, D1-3 is displayed in second display box S5, and D2-1, D2-2, D2-3, D2-4, and D2-5 are aggregated in second display box S6.
[0171] Understandably, the aggregation button can float anywhere on the screen with high transparency, or it can be hidden. Figure 14a and Figure 14b The aggregation button after aggregation is hidden. This embodiment does not limit this.
[0172] As mentioned above, aggregating multiple displayed texts within a larger display box allows the target user to more efficiently search for and locate relevant information. When the target user needs to revisit previous chat history, the fragmented displayed text can be inconvenient. Therefore, the method of aggregating displayed text in this embodiment enables the target user to better locate the content they are looking for, simplifies the interactive interface, better meets user needs, and improves the user experience.
[0173] The dialogue interaction method in this application is illustrated below through a specific embodiment.
[0174] Reference Figure 15 to Figure 17The relevant dialogue assistant software is installed on the terminal. The dialogue assistant model runs in the background, and the interface includes the target user's user icon and the assistant icon. The target user inputs the text "How to relieve stomach pain" on the software interface. The terminal then determines that the interaction scenario is medical advice, and therefore inputs both the input text and the medical scenario into the dialogue assistant model to generate interactive text and multiple decomposed identifiers of the interactive text. The interactive text is: "1. Hot compress: Applying a hot water bottle to the stomach can help relieve pain. 2. Drink hot tea: Warming tea, such as brown sugar ginger tea, can promote blood circulation and relieve pain. 3. Gently massage the stomach: Gently massage the painful area with both hands in a counterclockwise direction, which can reduce the pain." The welcoming message is: "Dear, I'm sorry to hear that your stomach pain is so severe. It's okay, the assistant is here to tell you some ways to relieve stomach pain~" The closing message is: "I hope you get better soon and that your stomach pain will no longer bother you. Wishing you good health."
[0175] If interactive text is not broken down, then refer to Figure 15 The welcome message, interactive text, and closing remarks are all displayed together in a single text box. However, displaying large blocks of text at this point can easily cause reading difficulties.
[0176] This application embodiment uses decomposition markers to decompose interactive text into 5 display texts, which are:
[0177] Display text 1 (welcome message): "Honey, I'm so sorry to hear you have such a bad stomachache. Don't worry, your little helper is here to tell you some ways to relieve your stomachache~";
[0178] Text 2: "1. Hot compress: Applying a hot water bottle to the stomach can help relieve pain."
[0179] Text 3: "2. Drink hot tea: Warming teas, such as brown sugar ginger tea, can promote blood circulation and relieve pain."
[0180] Text 4: "3. Gently massage your abdomen: Gently massage the painful area with both hands in a counter-clockwise direction. This can help relieve the pain."
[0181] Text 5 (closing remarks): "I hope you get well soon, dear, and that your stomachache will no longer bother you. Wishing you good health."
[0182] Reference Figure 16 In character-based interaction, each piece of text is displayed in the first display box according to a first preset number of characters. When displaying the text character by character, a prompt message is added to the first display box before all content is displayed. The prompt message reads "Character by character input, please wait" until the displayed text 5 is finished displaying, at which point the prompt message is removed.
[0183] Reference Figure 16 In segmented interaction mode, each piece of text is displayed as a complete segment in the second display box, with the default content being "Replying...". If not all the text is displayed, a prompt is added outside the second display box, such as "Types in progress, please wait." The prompt is removed when all text 5 is displayed.
[0184] Reference Figure 17 The image shows the disassembled display interface. Each piece of text corresponds to a display box, and the assistant icon is associated with each display box of that interactive text.
[0185] If the target object needs to aggregate the displayed text, refer to... Figure 17 The interface includes an aggregation icon called "One-Click Aggregation". This embodiment uses the aggregation of all items as an example for illustration. Figure 17 The text boxes displaying text 1, text 2, text 3, text 4, and text 5 are aggregated and displayed within a single text box. This method allows users to better locate the content they are looking for, simplifies the interface, better meets user needs, and enhances the user experience.
[0186] In one embodiment, the first display frame and the second display frame can be of any shape. (Refer to...) Figure 16 The frame can be a rectangle or an irregular shape, such as a bubble. It can also include a background. This embodiment does not limit the shape of the display frame.
[0187] The technical solution provided in this disclosure involves acquiring input text from a target object, and based on a pre-selected display interaction method, displaying at least one displayed text obtained after responding to the input text in the order of text display, with each displayed text displayed within a first display box. The displayed text is generated through the following steps: obtaining a decomposition guide for the input text; inputting the decomposition guide and the input text into a pre-trained dialogue assistant model to obtain interactive text and at least one decomposition identifier for the interactive text; and decomposing the interactive text based on the decomposition identifier to generate at least one displayed text. This application embodiment combines the decomposition guide with the interaction scenario, uses the decomposition guide to decompose the interactive text, and displays the decomposed displayed text one by one within the first display box. This method avoids the reading difficulties caused by displaying large blocks of text, as the sequential display of the decomposed text guides the user to gradually understand the response content, improving the readability of the interactive text and enhancing the user's comprehension efficiency. Furthermore, using a decomposition guide adapted to the interaction scenario to decompose the interactive text avoids interruptions in the interactive text at inappropriate points, resulting in disjointed displayed text. The decomposed displayed text is more reasonable and fluent, further enhancing the interactive experience.
[0188] This disclosure also provides a dialogue interaction device that can implement the above-described dialogue interaction method, see reference. Figure 19 The device includes:
[0189] Input acquisition module 1910: Used to acquire the input text of the target object;
[0190] Interactive display module 1920: Used to display at least one text obtained after responding to the input text in the order of text display based on a pre-selected display interaction method, with each text displayed in a first display box;
[0191] At least one display text is generated through the following steps:
[0192] Obtain the interaction scenario of the input text, and obtain decomposition guidance based on the interaction scenario;
[0193] The decomposition guide and input text are input into a pre-trained dialogue assistant model to obtain interactive text and at least one decomposition identifier of the interactive text.
[0194] At least one display text is generated by disassembling interactive text based on the disassembly identifier.
[0195] In one embodiment, reference is made to Figure 19 The interactive device also includes: an aggregation display module 1930: used to generate a second display box in response to an aggregation command of a target object; the aggregation command includes an aggregation method; the displayed text is grouped according to the aggregation method to obtain one or more display groups; the number of display groups is the same as the number of second display boxes; and the content of the display group is displayed in the second display box.
[0196] The specific implementation of the dialogue interaction device in this embodiment is basically the same as the specific implementation of the dialogue interaction method described above, and will not be repeated here.
[0197] This disclosure also provides an electronic device, including:
[0198] At least one memory;
[0199] At least one processor;
[0200] At least one program;
[0201] The program is stored in a memory, and the processor executes the at least one program to implement the dialogue interaction method described above. The electronic device can be any smart terminal, including mobile phones, tablets, personal digital assistants (PDAs), and in-vehicle computers.
[0202] Please seeFigure 20 , Figure 20 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0203] The processor 2001 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this disclosure.
[0204] The memory 2002 can be implemented in the form of ROM (Read-Only Memory), static storage device, dynamic storage device, or RAM (Random Access Memory). The memory 2002 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 2002 and is called and executed by the processor 2001 using the dialogue interaction method of the embodiments of this disclosure.
[0205] Input / output interface 2003 is used to implement information input and output;
[0206] Communication interface 2004 is used to enable communication and interaction between this device and other devices. Communication can be achieved via wired means (e.g., USB, Ethernet cable) or wireless means (e.g., mobile network, Wi-Fi, Bluetooth).
[0207] Bus 2005 transmits information between various components of the device (e.g., processor 2001, memory 2002, input / output interface 2003, and communication interface 2004);
[0208] The processor 2001, memory 2002, input / output interface 2003 and communication interface 2004 are connected to each other within the device via bus 2005.
[0209] This application also provides a storage medium, which is a computer-readable storage medium, storing a computer program that, when executed by a processor, implements the above-described dialogue interaction method.
[0210] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0211] The dialogue interaction method, device, electronic device, and storage medium proposed in this disclosure acquire the input text of the target object and, based on a pre-selected display interaction method, display at least one displayed text obtained after responding to the input text in the order of text display, with each displayed text displayed within a first display box. The displayed text is generated through the following steps: obtaining a decomposition guide for the input text; inputting the decomposition guide and the input text into a pre-trained dialogue assistant model to obtain interactive text and at least one decomposition identifier for the interactive text; and decomposing the interactive text based on the decomposition identifier to generate at least one displayed text. This application embodiment combines the decomposition guide with the interaction scenario, uses the decomposition guide to decompose the interactive text, and displays the decomposed displayed text one by one within the first display box. This method avoids the reading difficulties caused by displaying large blocks of text, as the sequential display of the decomposed text guides the user to gradually understand the response content, improving the readability of the interactive text and enhancing the user's comprehension efficiency. Furthermore, using a decomposition guide adapted to the interaction scenario to decompose the interactive text avoids interruptions in the interactive text at inappropriate points, resulting in disjointed displayed text. The decomposed displayed text is more reasonable and fluent, further enhancing the interactive experience.
[0212] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0213] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0214] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0215] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0216] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0217] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0218] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0219] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0220] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0221] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0222] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A conversational interaction method, characterized by, The method comprises the following steps: obtaining input text of a target object; displaying at least one display text obtained after responding to the input text one by one according to a text display order based on a pre-selected display interaction mode, each display text being displayed in a first display box; the at least one display text is generated by the following steps: using key character matching or parsing the input text to obtain user portrait data, inputting the user portrait data into a pre-trained scene classification model to analyze the input text, obtaining an interaction scene of the input text, and obtaining a disassembly guide based on the interaction scene; inputting the disassembly guide and the input text into a pre-trained dialogue assistant model to obtain an interactive text and a disassembly position; and generating a disassembly identifier according to the disassembly position; based on the disassembly identifier, disassembling the interactive text to generate at least one display text.
2. The conversational interaction method of claim 1, wherein, The display interaction mode includes character interaction; the display interaction mode based on the pre-selected display interaction mode includes: obtaining at least one first display data according to the text display order; the first display data is obtained by adding the disassembly identifier associated with the display text at a preset position of the display text; taking the first display data as first target data; if the preset position is the last position, displaying the display text in the first target data in the first display box according to a first preset character number, until the disassembly identifier is detected, a new first display box is generated, and the next first data group is selected as the first target data for display; if the preset position is the first position, generating the first display box according to the detected disassembly identifier, displaying the display text in the first target data in the first display box according to the first preset character number, until the last character of the display text is reached, and the next first data group is selected as the first target data for display.
3. The conversational interaction method of claim 1, wherein, The display interaction mode includes segment interaction; the display interaction mode based on the pre-selected display interaction mode includes: obtaining at least one second display data according to the text display order; the second display data is obtained by adding the disassembly identifier associated with the display text at a preset position of the display text; taking the second display data as second target data; if the preset position is the last position, displaying preset content in the first display box, and obtaining a to-be-displayed text segment composed of characters in the display text in the second target data according to a second preset character number, until the disassembly identifier is detected, the to-be-displayed text segment is used to replace the preset content displayed in the first display box, a new first display box is generated, and the next second data group is selected as the second target data group for display. If the preset position is the first position, a first display box is generated according to the detected disassembly identifier, preset content is displayed in the first display box, and a character-constituted display text segment to be displayed in the second target data is obtained according to a second preset character quantity until the last character of the display text is reached, the display of the preset content in the first display box is replaced by the display text segment to be displayed, a new first display box is generated, and the next second data group is selected as the second target data group for display.
4. The conversational interaction method of claim 1, wherein, After the at least one display text obtained after responding to the input text is displayed one by one in the text display order, the method further comprises: in response to an aggregation instruction of the target object, generating a second display box; the aggregation instruction comprises an aggregation manner; grouping the display texts according to the aggregation manner to obtain one or more display groups; the number of display groups is consistent with the number of second display boxes; displaying the content of the display groups in the second display boxes.
5. The conversational interaction method according to any one of claims 1 to 4, characterized in that, The dialogue assistant model is trained by the following steps: constructing a training sample set; the training sample set comprises: a plurality of input data samples, the input data samples comprising input data and disassembly guide data; the input data samples are associated with sample labels, the sample labels comprising interaction data and disassembly labels, and the disassembly labels being disassembly position vectors corresponding to the interaction scenarios of the input data samples; inputting the input data samples into the dialogue assistant model for prediction to obtain predicted interaction results and predicted disassembly vectors; obtaining a first loss value according to the predicted interaction results and the interaction data, and a second loss value according to the predicted disassembly vectors and the disassembly labels; calculating a total loss value according to the first loss value and the second loss value, adjusting the model weight of the dialogue assistant model according to the total loss value until the iteration ends, and obtaining the trained dialogue assistant model.
6. The conversational interaction method of claim 5, wherein, The disassembly guide data is obtained by the following steps: obtaining portrait data of the input data sample; the portrait data is obtained according to user usage data, and the user usage data comprises historical usage data and / or current usage data; inputting the portrait data into a scene classification model to obtain an interaction scenario, and obtaining the disassembly guide data according to the interaction scenario.
7. A dialog interaction device, characterized by comprises: an input acquisition module for acquiring input text of a target object; an interaction display module for displaying at least one display text obtained after responding to the input text one by one in a text display order based on a preselected display interaction manner, each display text being displayed in a first display box; the at least one display text is generated by the following steps: using key character matching or analyzing the input text to obtain user portrait data, inputting the user portrait data into a pre-trained scene classification model for analysis, obtaining an interaction scenario of the input text, and obtaining disassembly guidance based on the interaction scenario; inputting the disassembling guide and the input text into a pre-trained dialogue assistant model to obtain interactive text and a disassembling position; and generating a disassembling mark according to the disassembling position; disassembling the interactive text based on the disassembling mark to generate at least one display text.
8. An electronic device, comprising: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the dialogue interaction method of any one of claims 1 to 6 when executing the computer program.
9. A computer readable storage medium, the storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the dialogue interaction method of any one of claims 1 to 6. The computer program is executed by the processor to implement the dialogue interaction method of any one of claims 1 to 6.
Citation Information
Patent Citations
Multi-mode man-machine interaction method and device
CN114020153A