Method and apparatus for generating dialogue information, device and medium
By constructing a dialogue scenario corpus and a dialogue intent analysis model, the efficiency and accuracy issues of dialogue information generation in intelligent chat systems have been resolved, thereby improving user experience and communication harmony.
Patent Information
- Application Number
- CN202210287981.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-22
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-03-22
AI Technical Summary
Existing intelligent chat systems struggle to provide efficient responses that align with communication skills and psychology, based on the user's dialogue intent and the needs of the scenario, resulting in a poor user experience.
By constructing a dialogue scenario corpus, using multi-layer convolutional neural networks and a dialogue intent analysis model, dialogue intent labels are determined based on dialogue data, matching scenario labels are selected, and dialogue information that meets the needs of the scenario is generated.
It improves the efficiency and accuracy of dialogue information generation, enhances user experience, provides responses that conform to communication skills and psychology, and strengthens the harmony of user communication.
Smart Images

Figure CN114625855B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence, and more particularly to the fields of natural language processing and deep learning, specifically to a method, apparatus, electronic device, computer-readable storage medium, computer program product, and intelligent chat system for generating dialogue information. Background Technology
[0002] Artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies mainly include computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graph technologies.
[0003] Intelligent chat systems are systems that use natural language processing to understand dialogues or text and can simulate human conversations. They are commonly used in applications such as customer service or information retrieval.
[0004] The methods described in this section are not necessarily methods that had been previously conceived or adopted. Unless otherwise specified, no method described in this section should be assumed to be prior art simply because it is included in this section. Similarly, unless otherwise specified, the issues mentioned in this section should not be considered to be accepted in any prior art. Summary of the Invention
[0005] This disclosure provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for generating dialogue information.
[0006] According to one aspect of this disclosure, a method for generating dialogue information is provided, comprising: determining dialogue intent tags of the target dialogue based on dialogue data of the target dialogue; determining target scene tags that match the target dialogue from multiple candidate scene tags based on the dialogue intent tags; and generating dialogue information for the target dialogue based on the target corpus corresponding to the target scene tags.
[0007] According to another aspect of this disclosure, an apparatus for generating dialogue information is provided, comprising: a first determining unit configured to determine a dialogue intent tag of a target dialogue based on dialogue data of a target dialogue; a second determining unit configured to determine a target scene tag matching the target dialogue from a plurality of candidate scene tags based on the dialogue intent tag; and a generating unit configured to generate dialogue information for the target dialogue based on a target corpus set corresponding to the target scene tag.
[0008] According to another aspect of this disclosure, an intelligent chat system is provided, including the aforementioned means for generating dialogue information.
[0009] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described above for generating dialogue information.
[0010] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform the above-described method for generating dialogue information.
[0011] According to another aspect of this disclosure, a computer program product is provided, including a computer program, wherein the computer program, when executed by a processor, is capable of implementing the above-described method for generating dialogue information.
[0012] According to one or more embodiments of this disclosure, it is possible to select a corresponding dialogue scenario based on the dialogue intent of the target dialogue, and generate dialogue information that meets the needs of the scenario based on the corpus of the corresponding dialogue scenario, thereby providing users with a reference for reply information and improving user experience.
[0013] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0014] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0015] Figure 1 A schematic diagram of an exemplary system in which the various methods described herein may be implemented according to embodiments of the present disclosure is shown;
[0016] Figure 2 A flowchart of a method for generating dialogue information according to an embodiment of the present disclosure is shown;
[0017] Figure 3 A flowchart illustrating a method for obtaining a dialogue scenario corpus according to an embodiment of the present disclosure is shown;
[0018] Figure 4A flowchart illustrating a method for obtaining a candidate corpus set according to an embodiment of the present disclosure is shown;
[0019] Figure 5 A flowchart illustrating a method for obtaining a candidate corpus set according to an embodiment of the present disclosure is shown;
[0020] Figure 6 A structural block diagram of an apparatus for generating dialogue information according to an embodiment of the present disclosure is shown;
[0021] Figure 7 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0022] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0023] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.
[0024] The terminology used in the description of the various examples described in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.
[0025] Good communication skills are essential for people in life and work. When communicating with others, many people are affected by their emotions and say things they don't mean, or even use foul language, which can cause communication barriers or unnecessary misunderstandings.
[0026] Therefore, the inventors aim to provide a method for generating dialogue information, which combines natural language processing technology to analyze dialogue information between users and generate response statements that meet the user's dialogue needs and have good communication requirements, thereby providing the user with a reference for response information and improving the user experience.
[0027] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0028] Figure 1 A schematic diagram of an exemplary system 100 in which the various methods and apparatus described herein can be implemented according to embodiments of this disclosure is shown. Reference Figure 1 The system 100 includes one or more client devices 101, 102, 103, 104, 105 and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105 and 106 can be configured to execute one or more applications.
[0029] In embodiments of this disclosure, server 120 may run one or more services or software applications that enable the execution of methods for generating dialogue information.
[0030] In some embodiments, server 120 may also provide other services or software applications that may include non-virtual and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, such as to users of client devices 101, 102, 103, 104, 105 and / or 106 under a Software as a Service (SaaS) model.
[0031] exist Figure 1 In the configuration shown, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or combinations thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 can sequentially interact with server 120 using one or more client applications to utilize the services provided by these components. It should be understood that various different system configurations are possible and may differ from system 100. Therefore, Figure 1 This is an example of a system used to implement the various methods described herein, and is not intended to be limiting.
[0032] Users can use client devices 101, 102, 103, 104, 105, and / or 106 to input dialogue information. The client devices can provide an interface that allows users to interact with the client devices. The client devices can also output information to the user through this interface. Although... Figure 1 Only six client devices are described, but those skilled in the art will understand that this disclosure can support any number of client devices.
[0033] Client devices 101, 102, 103, 104, 105, and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors, or other sensing devices. These computer devices can run various types and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as Google Chrome OS); or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablets, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. Client devices are capable of executing various applications, such as various internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and can use various communication protocols.
[0034] Network 110 can be any type of network well known to those skilled in the art, and can use any of a variety of available protocols (including but not limited to TCP / IP, SNA, IPX, etc.) to support data communication. By way of example only, one or more networks 110 can be a local area network (LAN), an Ethernet-based network, a token ring network, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0035] Server 120 may include one or more general-purpose computers, special-purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running a virtual operating system, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for servers). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0036] The computing unit in server 120 can run one or more operating systems, including any of the aforementioned operating systems and any commercially available server operating system. Server 120 can also run any of a variety of additional server applications and / or middleware applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0037] In some implementations, server 120 may include one or more applications to analyze and merge data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105 and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105 and / or 106.
[0038] In some implementations, server 120 can be a server for a distributed system or a server integrated with blockchain. Server 120 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in the cloud computing service system, designed to address the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.
[0039] System 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. Databases 130 may reside in various locations. For example, a database used by server 120 may be local to server 120, or it may be located away from server 120 and may communicate with server 120 via a network-based or dedicated connection. Databases 130 may be of different types. In some embodiments, the database used by server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data from and from the databases in response to commands.
[0040] In some embodiments, one or more of the databases 130 may also be used by an application to store application data. The databases used by the application may be of different types, such as key-value stores, object stores, or regular stores supported by a file system.
[0041] Figure 1 The system 100 can be configured and operated in various ways to enable the application of the various methods and apparatus described in this disclosure.
[0042] According to embodiments of this disclosure, such as Figure 2 As shown, a method 200 for generating dialogue information is provided, including: step S201, determining the dialogue intent tag of the target dialogue based on the dialogue data of the target dialogue; step S202, determining the target scene tag that matches the target dialogue from multiple candidate scene tags based on the dialogue intent tag; and step S203, generating dialogue information for the target dialogue based on the target corpus set corresponding to the target scene tag.
[0043] Therefore, it is possible to select the appropriate dialogue scenario based on the dialogue intent of the target dialogue, and generate dialogue information that meets the needs of the scenario based on the corpus of the corresponding dialogue scenario, thereby providing users with a reference for reply information and improving the user experience.
[0044] According to some embodiments, determining a target scene label matching the target dialogue from multiple candidate scene labels based on dialogue intent labels may include: obtaining the target scene label matching the target dialogue and the target corpus corresponding to the target scene label from a dialogue scene corpus based on the dialogue intent label, wherein the dialogue scene corpus includes the mapping relationship between multiple candidate scene labels and multiple candidate corpus sets, and the semantic similarity between the dialogue intent label and the target scene label meets a preset condition (e.g., semantic similarity greater than or equal to a preset threshold). Thus, a dialogue scene corpus integrating communication psychology knowledge and communication skills can be constructed. This corpus can provide rich corpora for selection when generating dialogue information, laying the foundation for generating dialogue information that meets user needs.
[0045] In some embodiments, the dialogue scenario corpus may include multiple candidate corpus sets, each with different candidate scenario labels. These candidate corpus sets contain rich data such as vocabulary, phrases, and sentence templates applicable to the corresponding dialogue scenario. Each candidate scenario label may be composed of one or more sub-scenario labels. By using multiple sub-scenario labels corresponding to different scenario dimensions, a relatively complex dialogue scenario integrating various factors can be constructed. For example, different scenario dimensions may be "whether the dialogue partners are young people," "whether it is a leisure scenario," "what kind of entertainment scenario," etc., and the corresponding sub-scenario labels may be "the dialogue partners are young people," "leisure scenario," and "gaming scenario," respectively. These three sub-scenario labels constitute the comprehensive candidate scenario label "a scenario where young people are playing games during their leisure time."
[0046] It is understandable that the number of sub-scene tags contained in each candidate scene tag can be different. Different sub-scene tags of different dimensions can be combined with each other to form a massive number of candidate scene tags corresponding to different dialogue scenarios. Each candidate scene tag corresponds to a corpus set, thus forming a corpus with rich corpus data.
[0047] In some embodiments, such as Figure 3 As shown, the method 300 for obtaining a dialogue scene corpus may include: step S301, obtaining multiple raw text data, wherein the multiple raw text data originates from dialogue data in the field of psychology; step S302, dividing the multiple raw text data into multiple text data sets corresponding to multiple candidate scene labels; and step S303, for each candidate scene label among the multiple candidate scene labels, obtaining the corresponding candidate corpus set based on the text data set corresponding to that candidate scene label. Thus, the corpus in the constructed dialogue scene corpus is stored in the corresponding candidate corpus set corresponding to the corresponding candidate scene labels, thereby facilitating the subsequent selection of target candidate scene labels and corresponding target candidate sets from multiple candidate scene labels based on the dialogue intent, thereby improving the efficiency of corpus selection and thus enhancing the efficiency of dialogue information generation.
[0048] In some embodiments, since the constructed dialogue scenario corpus focuses more on the communication skills and harmony between users, the raw materials used to construct the corpus can be experimental data and professional materials from fields such as psychology and communication skills research. These raw materials contain a lot of dialogue data in different scenarios. By processing and organizing this data, a corpus containing dialogue data that conforms to communication skills and psychology can be obtained.
[0049] In some embodiments, the dialogue data described above, which originates at least from the field of psychology, can be text, audio, or video. Specifically, for audio dialogue data, it can first be converted into text using speech recognition technology to serve as raw text data for subsequent processing; for video dialogue data, the audio or subtitles in the video can first be extracted and converted into text using speech recognition or text recognition technology to serve as raw text data for subsequent processing.
[0050] In some embodiments, dividing multiple raw text data into multiple text data sets corresponding to multiple candidate scene labels includes: inputting each raw text data into a multi-layer convolutional neural network to obtain the candidate scene label corresponding to the raw text data output by the multi-layer convolutional neural network; and dividing the multiple raw text data into multiple text data sets corresponding to multiple candidate scene labels based on the candidate scene labels corresponding to the multiple raw text data. Thus, multiple irregular raw text data can be divided into multiple text data sets first, and then corpus extraction can be performed on each text data set based on the corresponding candidate scene labels, thereby improving the efficiency of corpus extraction.
[0051] In some embodiments, each piece of raw text data may be input into a multi-layer convolutional neural network on a sentence-by-sentence basis. The multi-layer convolutional neural network can classify each piece of raw text data in multiple dimensions, thereby labeling each piece of raw text data with one or more labels corresponding to different scene dimensions.
[0052] In one example, the original text data "I have some different opinions about your proposal document and would like to share them with you" is input into the multi-layer convolutional neural network mentioned above. The multi-layer convolutional neural network can classify it in multiple dimensions and output its labels as two sub-scene labels: "work" and "suggestion". The combination of these two sub-scene labels is the corresponding candidate scene label.
[0053] All raw text data are classified using the method described above, resulting in multiple sets of text data corresponding to different candidate scenario labels. Each set of text data contains multiple sets of raw text data applicable to the corresponding dialogue scenario.
[0054] In some embodiments, the aforementioned multi-layer convolutional neural network can be trained using a prepared sample dataset, where each sample data in the dataset is text data with one or more corresponding sub-scene labels. After training the neural network using the sample dataset, it can be tested by inputting multiple batches of test text data into the neural network and sampling the output data of each batch at a preset ratio (e.g., 46%). The sampled data is then labeled and corrected. The corrected data can be added to the sample dataset, and the updated dataset can be used for iterative training of the model to further improve model performance and classification accuracy.
[0055] In some embodiments, the candidate corpus includes multiple sentence templates and multiple phrase texts. In this case, the method 400 for obtaining the candidate corpus is as follows: Figure 4 As shown. For details, please refer to... Figure 4 The process of obtaining a candidate corpus based on the text data set corresponding to each candidate scene label may include the following steps: Step S401, extracting at least one first phrase text from each original text data in the text data set; Step S402, determining a first statement template corresponding to each original text data and its corresponding at least one first phrase text, wherein the first statement template includes at least one slot corresponding to the position of the at least one first phrase text; Step S403, determining multiple phrase texts of the candidate corpus based on the multiple first phrase texts corresponding to the original text data included in the text data set; and Step S404, determining multiple statement templates of the candidate corpus based on the multiple first statement templates corresponding to the original text data included in the text data set. Thus, by processing each original text data in the text data set into freely combinable phrase texts and statement templates, a corresponding corpus is constructed, thereby providing richer corpus for the generation of dialogue information; simultaneously, after selecting the corresponding statement templates and phrase texts, dialogue information can be directly generated without additional processing, further improving the efficiency of dialogue information generation.
[0056] In some embodiments, for each original text data in a text dataset, it can first be input into a syntactic dependency parsing model to obtain each segmented phrase and its corresponding syntactic component in the original text data; then, each segmented phrase and the original text data can be further input into a lexical importance analysis model to obtain the importance score of each segmented phrase in the original text data; based on the above scores, one or more segmented phrases with the highest importance scores can be selected and extracted as the first phrase text, and the position corresponding to the segmented phrase in the original text data can be set as a slot, thereby generating a first sentence template, wherein each slot can be marked with the corresponding part of speech.
[0057] In some embodiments, each candidate scene tag includes multiple sub-scene tags, and for the candidate corpus corresponding to the candidate scene tag, the number of slots in each statement template is the same as the number of multiple sub-scene tags.
[0058] Therefore, by configuring a correspondence between the number of sub-scene tags and the number of slots in the sentence template, when performing phrase text matching based on sub-dialogue intent tags in this corpus, it is possible to match phrase texts that match the number of slots in the sentence template, thus eliminating the need for further extraction and matching of phrase texts and improving the efficiency of phrase text retrieval and dialogue information generation.
[0059] In one example, the original text data "Regarding your proposal document, I have some different opinions and would like to share them with you" can first undergo syntactic dependency analysis to obtain the following information: "Regarding your proposal document" is an adverbial phrase, where "regarding" is a preposition, "your" is an attributive, and "proposal document" is a noun introduced by a preposition; "I" is the subject, "have" and "want" are predicates, "some" is a quantifier, "different opinions" is the object, "with you" is an adverbial phrase, and "share them with you" is a complement. Then, lexical importance analysis is performed on these word phrases to obtain the phrases with the highest importance scores, such as "different opinions," "proposal document," and "your." The candidate scenario labels corresponding to the text dataset to which this original text data belongs are "work & suggestion," which correspond to the sub-scenario labels "work" and "suggestion," respectively. Therefore, the two phrases with the highest importance scores, "different opinions" and "proposal document," are selected as the first phrase text extractions and replaced with slots in the sentence to form the corresponding sentence template "Regarding your [@noun], I have some [@noun], would like to share them with you."
[0060] In some embodiments, for more complex sentence structures, after performing lexical importance analysis, the segmented phrases can be further input into a lexical analysis model for analysis, thereby outputting the entity type corresponding to each segmented phrase. Here, the entity is also called a named entity, including person names, organization names, place names, and all other entities identified by names. Through the above analysis, segmented phrases of specific entity types can be first filtered from each segmented phrase, and then, based on the lexical importance score, one or more segmented phrases with the highest scores can be selected as the first phrase text.
[0061] Based on the above method, each original text data is processed accordingly, and the first phrase text and the first sentence template are extracted respectively, so that the text data set can be processed into the corresponding corpus set.
[0062] In some embodiments, a method 500 for obtaining a candidate corpus based on a plurality of first phrase texts corresponding to the original text data included in the text data set, and a plurality of first sentence templates corresponding to the original text data included in the text data set, is as follows: Figure 5As shown. The determination of multiple phrase texts in the candidate corpus may include: step S503, determining multiple second phrase texts and multiple first statistical probabilities corresponding to the multiple first phrase texts corresponding to the original text data included in the text data set; and step S504, obtaining multiple phrase texts in the candidate corpus based on the multiple second phrase texts and the multiple first statistical probabilities corresponding to the multiple second phrase texts; and the determination of multiple sentence templates in the candidate corpus may include: step S505, determining multiple second sentence templates and multiple second statistical probabilities corresponding to the multiple first sentence templates corresponding to the original text data included in the text data set; and step S506, obtaining multiple sentence templates in the candidate corpus based on the multiple second sentence templates and the multiple second statistical probabilities corresponding to the multiple second sentence templates.
[0063] The operations of steps S501 and S502 in method 500 for obtaining candidate corpus are similar to those of steps S401 and S402 in method 400 for obtaining candidate corpus, and will not be described in detail here.
[0064] Since there may be duplicate phrase texts and sentence templates in multiple first phrase texts and multiple first sentence templates in a corpus, the first phrase texts and first sentence templates in the above corpus can be further processed to remove duplicate data.
[0065] In some embodiments, the distribution statistics of multiple first phrase texts and multiple first sentence templates in a corpus can be performed separately, and the same phrase texts and the same or similar sentence templates can be merged to obtain multiple second phrase texts and second sentence templates. At the same time, the frequency of each second phrase text in the corpus can be counted, and the first statistical probability of the second phrase text in the corpus can be obtained by calculating its proportion in the total number of first phrase texts in the corpus. Similarly, the statistics of the second sentence templates can be performed to obtain the second statistical probability of each second sentence template in the corpus.
[0066] Through the above processing, the corpus can be further refined, and more reference information such as statistical probability can be provided for subsequent corpus selection, thereby improving the rationality of corpus selection and enhancing the efficiency and effectiveness of generating dialogue information.
[0067] In some embodiments, the target conversation can be the user's current conversation.
[0068] In some embodiments, the conversation data of the target conversation may include at least one chat log text.
[0069] In one example, when the target conversation is initiated by the user's conversation partner, at the very beginning of the conversation, there is only one chat log text sent by that conversation partner. This chat log text can then be used as the conversation data for the target conversation for subsequent analysis.
[0070] In one example, when the user and the conversation partner have exchanged multiple messages, that is, when the user and the conversation partner have had multiple rounds of conversation, the conversation data of the target conversation can be the text of the most recent chat logs, for example, the text of the most recent 5 chat logs.
[0071] In some embodiments, the chat log text may also be voice information sent by the user or their conversation partner. The voice information can be processed first using voice recognition technology to obtain the chat log text.
[0072] Therefore, by performing dialogue intent analysis on one or more chat log texts, we can improve the efficiency of the analysis while ensuring the basic accuracy of the dialogue intent analysis.
[0073] In some embodiments, obtaining the dialogue intent tags of a target dialogue may include: extracting semantic information from the dialogue data of the target dialogue to obtain multiple word segments and multiple syntactic component tags corresponding to the multiple word segments; and inputting the multiple word segments, the multiple syntactic component tags corresponding to the multiple word segments, and historical dialogue state information into a dialogue intent analysis model to obtain the dialogue intent tags output by the dialogue intent analysis model. Thus, by combining natural language understanding technology with a dialogue intent analysis model, the dialogue intent tags of a target dialogue can be obtained efficiently and accurately.
[0074] In some embodiments, semantic information can be extracted from the dialogue data of the target dialogue using natural language understanding technology.
[0075] In one example, the dialogue data for the target conversation could be a chat log text "Why hasn't this project been completed yet?" By performing word segmentation on this chat log text (e.g., applying N-gram segmentation), the sentence is divided into multiple segments such as "this project", "why", "still", and "not completed". Then, syntactic dependency analysis and part-of-speech analysis are performed on each segment to obtain the syntactic component labels of each segment. For example, "this project" is the subject, "not completed" is the predicate, and "why" and "still" are both adverbs used to modify the predicate.
[0076] The above information is input into the dialogue intent analysis model, and the output is the dialogue intent label of the target dialogue. For example, multiple dialogue intent labels such as "question", "dissatisfaction" and "task-oriented dialogue" can be analyzed.
[0077] In some embodiments, the dialogue intent analysis model may include a cascaded dialogue behavior recognition model, a dialogue state recognition model, and a dialogue policy learning model. Multiple word segments, multiple syntactic component labels corresponding to the multiple word segments, and historical dialogue state information may be input into the dialogue behavior recognition model, and the output of the dialogue policy learning model may include dialogue intent labels.
[0078] In one example, the sentence can first be segmented and analyzed using syntactic dependency parsing. The resulting word segments, such as "this project," "why," "still," and "not yet completed," along with their corresponding syntactic components, are then input into a dialogue behavior recognition model to identify the target dialogue's dialogue behavior as questioning. Further, this information, along with the "questioning" dialogue behavior label, is input into a dialogue state recognition model to determine the target dialogue's dialogue state as "slightly dissatisfied." Finally, this information is simultaneously input into a dialogue strategy learning model, which analyzes the target dialogue as a task-oriented dialogue requiring a questioning response strategy. This results in the output of multiple dialogue intent labels for the target dialogue, including "questioning," "dissatisfied," and "task-oriented dialogue."
[0079] Therefore, by using multiple cascaded models, information in the target dialogue can be extracted and analyzed at multiple levels, further improving the accuracy of dialogue intent analysis.
[0080] In some embodiments, the dialogue data of the target dialogue may include historical dialogue state information, which includes dialogue text information, user behavior information, and dialogue intent tags from the preceding dialogues of the target dialogue.
[0081] Typically, users engage in multiple rounds of dialogue with their conversation partners. Therefore, when performing dialogue intent analysis, each round of dialogue is analyzed.
[0082] In one example, the target dialogue is the Nth round of dialogue. First, the multiple chat logs of the Nth round can be segmented and subjected to syntactic dependency analysis to obtain multiple word segments and their syntactic components. Simultaneously, the dialogue text information, user behavior information, and dialogue intent tags of the (N-1)th round can be input into the dialogue intent analysis model. The dialogue text information consists of the multiple word segments and their corresponding syntactic components extracted during the analysis of the (N-1)th round. The user behavior information includes the user's behavioral feedback information identified by the model in response to the (N-1)th round (e.g., a user replying "okay" indicates acceptance). The dialogue intent tags of the (N-1)th round are the multiple dialogue intent tags obtained during the dialogue intent analysis of this round using the methods described above.
[0083] Therefore, by further combining historical dialogue status information for analysis, we can refer to information from historical dialogue rounds, thereby making the obtained results of dialogue intent analysis of the target dialogue more accurate.
[0084] In some embodiments, the dialogue data of the target dialogue may also include the text to be sent from the user-input dialog box. Since in actual dialogues, the current response often addresses a question from several rounds ago, or due to unforeseen circumstances, the information to be replied to may differ from the intent of the current round of dialogue. Therefore, by combining the text to be sent entered by the user into the dialog box with the chat log text and historical dialogue status information for dialogue intent analysis, it is possible to obtain dialogue intent tags that better reflect the user's current true intent, thereby further improving the accuracy of dialogue intent analysis.
[0085] In some embodiments, when a dialogue intent label includes multiple sub-dialogue intent labels and each candidate scene label includes multiple sub-scene labels, determining the target scene label that matches the target dialogue from the multiple candidate scene labels based on the dialogue intent label includes: obtaining at least one sub-scene label that matches each sub-dialogue graph label; and determining the target scene label from the multiple candidate scene labels based on the multiple sub-scene labels that match the multiple sub-dialogue intent labels.
[0086] In some embodiments, the semantic similarity between each sub-dialogue intent tag and each sub-scene tag can be calculated to recall a preset number (e.g., 5) of sub-scene tags with the highest semantic similarity to the sub-dialogue intent tag, or to recall at least one sub-scene tag with a semantic similarity higher than a preset threshold (e.g., semantic similarity above 86.6%).
[0087] In some embodiments, a deep learning model based on Match Function Learning can be used to recall the corresponding sub-scene labels for each sub-dialogue intent label.
[0088] Understandably, the method of recalling sub-scene tags based on sub-dialogue intent tags can be chosen according to the actual situation, and no restrictions are imposed here.
[0089] In some embodiments, for each sub-dialogue intent tag that retrieves multiple sub-scene tags, the sub-scene tag with the highest semantic similarity can be selected and combined to obtain the corresponding target scene tag, thereby obtaining the target corpus set corresponding to the target scene tag. Thus, by rapidly matching and filtering sub-dialogue intent tags of different dimensions, the efficiency of corpus selection is improved while obtaining a corpus set that matches the dialogue scenario.
[0090] In some embodiments, when the dialogue intent tag includes only one sub-dialogue intent tag, a sub-scene tag with the highest semantic similarity can be retrieved using one of the methods described above. In this case, the sub-scene tag is also the target scene tag.
[0091] In some embodiments, the plurality of sub-dialogue intent tags include a first sub-dialogue intent tag and a second sub-dialogue intent tag. Determining a target scene tag from a plurality of candidate scene tags based on a plurality of sub-scene tags that match the plurality of sub-dialogue intent tags includes: for each sub-scene tag that matches the first sub-dialogue intent tag, calculating the corresponding correlation coefficient between the sub-scene tag and the plurality of sub-scene tags that match the second sub-dialogue intent tag; and determining the target scene tag from the plurality of candidate scene tags based on the calculated corresponding correlation coefficients between each sub-scene tag that matches the first sub-dialogue intent tag and the plurality of sub-scene tags that match the second sub-dialogue intent tag.
[0092] In one example, sub-scene tags A and B were retrieved based on the first sub-dialogue intent tag, and sub-scene tags C and D were retrieved based on the second sub-dialogue intent tag. For each sub-scene tag A and B that matched the first sub-dialogue intent icon, the correlation coefficient between each sub-scene tag and sub-scene tags C and D was calculated, thus obtaining the correlation coefficients among the four sub-scene tag combinations "AC", "AD", "BC", and "BD". The sub-scene tag combination with the highest correlation coefficient was then selected as the target scene tag, and its corresponding target corpus was obtained.
[0093] In some embodiments, the aforementioned correlation coefficients can be calculated using the Pearson correlation coefficient. Specifically, the pearsonr(x,y) function from the statistical function library can be used to calculate the Pearson correlation coefficient. Taking the "AC" sub-scene label combination as an example, the inputs (x,y) of the function can be the semantic similarity between sub-scene label A and the first sub-dialogue intent label, and the semantic similarity between sub-scene label C and the second sub-dialogue intent label, respectively.
[0094] In one example, when a dialogue intent tag has three sub-dialogue intent tags, sub-scene tags A and B, C and D, and E and F are recalled for each of these three sub-dialogue intent tags. First, the correlation coefficients of the sub-scene tag combinations "AC", "AD", "BC", "BD", "AE", "AF", "BE", "BF", "CE", "CF", "DE", and "DF" can be calculated using the method described above. The combination with the highest correlation coefficient is "AC". After determining "AC", based on sub-scene tags A and C, the combination with the highest correlation coefficient among "AE", "AF", "CE", and "CF" is selected. For example, if the correlation coefficient of the "CE" combination is the highest, then the final sub-scene tag combination can be further determined to be "ACE".
[0095] Therefore, by calculating the correlation coefficient between sub-scene tags, we can obtain a better combination of sub-scene tags that are more closely related. Using this combination as the target scene tag can better match the actual dialogue scenario, thereby obtaining corpus that is more in line with the dialogue scenario and generating dialogue information that is more in line with user needs.
[0096] In some embodiments, when the target corpus includes multiple phrase texts and a first statistical probability for each of the multiple phrase texts, generating dialogue information for the target dialogue includes: calculating the similarity between each sub-dialogue intent tag and the multiple phrase texts in the target corpus; and determining multiple target phrase texts from the multiple phrase texts in the target corpus based on the similarity between each sub-dialogue intent tag and the multiple phrase texts in the target corpus, and the first statistical probability for each of the multiple phrase texts.
[0097] In some embodiments, when the target corpus further includes multiple statement templates and their respective second statistical probabilities, generating dialogue information for the target dialogue includes: calculating the similarity between each sub-dialogue intent tag and the multiple statement templates in the target corpus; and determining multiple target statement templates from the multiple statements in the target corpus based on the similarity between each sub-dialogue intent tag and the multiple statement templates in the target corpus, and the respective second statistical probabilities of the multiple statement templates.
[0098] In some embodiments, after the target corpus is determined by one or more sub-dialogue intent tags, one or more candidate phrase texts with the highest semantic similarity to the sub-dialogue intent tag can be recalled from the target corpus by each sub-dialogue intent tag, or at least one candidate phrase text with a semantic similarity to the sub-dialogue intent tag that is higher than a preset threshold (e.g., semantic similarity above 86.6%) can be recalled.
[0099] In some embodiments, a candidate statement template with the highest semantic similarity to each sub-dialogue intent tag can be recalled from the target corpus based on each sub-dialogue intent tag.
[0100] In some embodiments, a deep learning model based on Match Function Learning can be used to recall the corresponding candidate phrase text and candidate statement template for each sub-dialogue intent tag.
[0101] In some embodiments, the phrase text with the highest semantic similarity can be selected as the target phrase text from at least one candidate phrase text corresponding to each sub-dialogue intent label by comparing the magnitude of semantic similarity; and the statement template with the highest semantic similarity can be selected as the target statement template from at least one candidate statement template corresponding to at least one sub-dialogue intent label.
[0102] In some embodiments, when the target corpus also includes multiple phrase texts with their respective first statistical probabilities, the phrase text with the highest first statistical probability can be selected as the target phrase text by comparing the magnitudes of their respective first statistical probabilities.
[0103] In some embodiments, when the target corpus also includes the second statistical probabilities of each of the multiple statement templates, the statement template with the highest second statistical probability can be selected as the target statement template from at least one candidate statement template corresponding to at least one sub-dialogue intent label by comparing the magnitudes of their respective second statistical probabilities.
[0104] Therefore, by using reference information from the two dimensions of semantic similarity and statistical probability, we can obtain the sentence templates in the target corpus that best match the target dialogue scenario and dialogue intent. Based on this, we can generate dialogue information that is more in line with the dialogue scenario and more in line with user needs.
[0105] In some embodiments, after determining the target sentence template and target phrase text, the above corpus can be integrated and a complete sentence, i.e., the dialogue information of the target dialogue, can be generated by natural language generation technology.
[0106] In some embodiments, the dialogue information of the target dialogue can be output by inputting the target statement template and the target short text into an end-to-end DNN neural network.
[0107] In some embodiments, the above dialogue information can be further converted into voice information through speech synthesis technology for the user to refer to or apply.
[0108] In some embodiments, when the user has entered the text to be sent in the dialog box, a simple recognition and analysis can be performed on the text to be sent first. In response to detecting sensitive terms (such as uncivilized terms, etc.), intelligent prompt information (i.e., the dialogue information generated by the method in the embodiments of the present disclosure) can be directly output, such as "This way of speaking is inappropriate", etc., to remind the user to pay attention to communication skills and avoid conflicts.
[0109] In one example, the dialogue data of the target dialogue can include a chat record text "Why hasn't this project been completed yet", and the text to be sent entered by the user "How could it be completed in just a few days".
[0110] In some embodiments, in response to detecting the text to be sent entered by the user, an analysis can be performed on the text to be sent first based on natural language understanding technology. Preferably, the emotional words in the text can be detected to obtain the emotional words and their corresponding emotional labels in the text to be sent. For example, for the text to be sent in the above example, the emotional words "just" and "how could it be" and their corresponding emotional label "relatively dissatisfied emotion" are obtained by analysis.
[0111] In some embodiments, when there are uncivilized terms in the text to be sent, they can also be detected by the above method, and the emotional label of the uncivilized term may be "extremely dissatisfied emotion", "angry", etc.
[0112] In response to the detection that the emotion tag of emotional words in the text to be sent belongs to one of the preset tags (e.g., emotion tags with negative emotions), the corresponding dialogue information can be generated using the method in this embodiment. Specifically, for the above example, firstly, multiple sub-dialogue intent tags such as "work scenario" and "deadline" can be obtained through dialogue intent analysis. Then, based on the above sub-dialogue intent tags, matching is performed in the corpus to obtain the target scenario tag "work & deadline". Then, through the above method, the sentence template "We are [@verb][@noun], we believe it will be completed soon" and the two phrase texts "work" and "accelerate progress" corresponding to the two sub-dialogue intent tags can be obtained. Then, through natural language generation technology, the dialogue information "We are accelerating the progress of the work, we believe it will be completed soon" can be obtained. By displaying this information to the user, the user can pay attention to communication skills and refer to the dialogue information to make a more tactful and appropriate response, thereby avoiding unnecessary conflicts in interpersonal communication.
[0113] According to some embodiments, such as Figure 6 As shown, an apparatus 600 for generating dialogue information is also provided, comprising: a first determining unit 610 configured to determine a dialogue intent tag of a target dialogue based on dialogue data of a target dialogue; a second determining unit 620 configured to determine a target scene tag matching the target dialogue from multiple candidate scene tags based on the dialogue intent tag; and a generating unit 630 configured to generate dialogue information for the target dialogue based on a target corpus set corresponding to the target scene tag.
[0114] The operations performed by units 610-630 of the apparatus 600 for generating dialogue information are similar to the operations of steps S201-S203 in the method 200 for generating dialogue information, and will not be described in detail here.
[0115] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0116] According to embodiments of this disclosure, an intelligent chat system is also provided, which may include the means for generating dialogue information as described in embodiments of this disclosure.
[0117] According to embodiments of this disclosure, an electronic device, a readable storage medium, and a computer program product are also provided.
[0118] refer to Figure 7The present invention describes a structural block diagram of an electronic device 700 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0119] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. The RAM 703 may also store various programs and data required for the operation of the electronic device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0120] Multiple components in electronic device 700 are connected to I / O interface 705, including: input unit 706, output unit 707, storage unit 708, and communication unit 709. Input unit 706 can be any type of device capable of inputting information to electronic device 700. Input unit 706 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device, and may include, but is not limited to, a mouse, keyboard, touchscreen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 707 can be any type of device capable of presenting information, and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 708 may include, but is not limited to, hard disk and optical disk. Communication unit 709 allows electronic device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0121] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as method 200. For example, in some embodiments, method 200 may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform method 200 by any other suitable means (e.g., by means of firmware).
[0122] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0123] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0124] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0125] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0126] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0127] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0128] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0129] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the invention is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.
Claims
1. A method for generating dialogue information, comprising: obtaining dialogue data of a target dialogue, wherein the dialogue data comprises at least one chat record text, a to-be-sent text input by a user in a dialogue box, and historical dialogue state information, the historical dialogue state information comprising dialogue text information, user behavior information, and a dialogue intent label of a previous dialogue of the target dialogue; performing emotional vocabulary detection on the to-be-sent text to obtain emotional vocabulary in the to-be-sent text and a corresponding emotional label; in response to the emotional label belonging to a negative emotional label, determining a dialogue intent label of the target dialogue based on the dialogue data of the target dialogue, wherein the determining the dialogue intent label of the target dialogue comprises: performing semantic information extraction on the dialogue data of the target dialogue to obtain a plurality of words and a plurality of syntactic component labels corresponding to the plurality of words; and inputting the plurality of words, the plurality of syntactic component labels corresponding to the plurality of words, and the historical dialogue state information into a dialogue intent analysis model to obtain the dialogue intent label output by the dialogue intent analysis model, wherein the dialogue intent analysis model comprises a cascaded dialogue behavior recognition model, a dialogue state recognition model, and a dialogue strategy learning model, the plurality of words, the plurality of syntactic component labels corresponding to the plurality of words, and the historical dialogue state information are input into the dialogue behavior recognition model, and an output of the dialogue strategy learning model comprises the dialogue intent label; based on the dialogue intent label, determining a target scene label matching the target dialogue from a plurality of candidate scene labels in a dialogue scene corpus, wherein the dialogue scene corpus comprises a plurality of candidate corpus sets corresponding to the plurality of candidate scene labels, and wherein the dialogue scene corpus is constructed based on dialogue data from the field of psychology and contains dialogue corpus integrating communication psychology knowledge and communication skills; and generating dialogue information for the target dialogue based on a target corpus set corresponding to the target scene label.
2. The method of claim 1, wherein, The determining the target scene label matching the target dialogue from the plurality of candidate scene labels in the dialogue scene corpus based on the dialogue intent label comprises: based on the dialogue intent label, obtaining the target scene label matching the target dialogue and a target corpus set corresponding to the target scene label from the dialogue scene corpus, wherein the dialogue scene corpus comprises a mapping relationship between the plurality of candidate scene labels and the plurality of candidate corpus sets, and a semantic similarity between the dialogue intent label and the target scene label satisfies a preset condition.
3. The method of claim 2, wherein, The dialogue scene corpus is obtained by performing the following operations: obtaining a plurality of original text data, the plurality of original text data at least originating from dialogue data in the field of psychology; dividing the plurality of original text data into a plurality of text data sets corresponding to the plurality of candidate scene labels, respectively; and For each candidate scene label in the plurality of candidate scene labels, a candidate corpus corresponding to the candidate scene label is obtained based on a text data set corresponding to the candidate scene label.
4. The method of claim 3, wherein, The candidate corpus includes a plurality of sentence templates and a plurality of phrase texts, and obtaining the candidate corpus corresponding to each candidate scene label based on the text data set corresponding to the candidate scene label includes: extracting at least one first phrase text included in each original text data in the text data set; determining a first sentence template corresponding to each original text data based on the original text data and the at least one first phrase text corresponding to the original text data, wherein the first sentence template includes at least one slot corresponding to the position of the at least one first phrase text; determining a plurality of phrase texts of the candidate corpus based on a plurality of first phrase texts corresponding to the original text data included in the text data set; and determining a plurality of sentence templates of the candidate corpus based on a plurality of first sentence templates corresponding to the original text data included in the text data set.
5. The method of claim 4, wherein, determining a plurality of phrase texts of the candidate corpus based on a plurality of first phrase texts corresponding to the original text data included in the text data set includes: determining a plurality of second phrase texts and a plurality of first statistical probabilities corresponding to the plurality of second phrase texts based on the plurality of first phrase texts corresponding to the original text data included in the text data set; and determining a plurality of phrase texts of the candidate corpus based on the plurality of second phrase texts and the plurality of first statistical probabilities corresponding to the plurality of second phrase texts, and wherein determining a plurality of sentence templates of the candidate corpus based on a plurality of first sentence templates corresponding to the original text data included in the text data set includes: determining a plurality of second sentence templates and a plurality of second statistical probabilities corresponding to the plurality of second sentence templates based on the plurality of first sentence templates corresponding to the original text data included in the text data set; and determining a plurality of sentence templates of the candidate corpus based on the plurality of second sentence templates and the plurality of second statistical probabilities corresponding to the plurality of second sentence templates.
6. The method of claim 4 or 5, wherein, Each candidate scene label includes a plurality of sub-scene labels, and for the candidate corpus corresponding to the candidate scene label, the number of slots in each sentence template included in the candidate corpus is the same as the number of the plurality of sub-scene labels.
7. The method of any one of claims 3-5, wherein, The dividing the plurality of original text data into a plurality of text data sets corresponding to the plurality of candidate scene labels respectively includes: inputting each original text data into a multi-layer convolutional neural network to obtain a candidate scene label corresponding to the original text data output by the multi-layer convolutional neural network; and dividing the plurality of original text data into a plurality of text data sets corresponding to the plurality of candidate scene labels respectively based on the candidate scene labels corresponding to the plurality of original text data.
8. The method of any one of claims 1 to 5, wherein, When the dialogue intent label comprises a plurality of sub-dialogue intent labels, and each candidate scene label comprises a plurality of sub-scene labels, the determining, based on the dialogue intent label, a target scene label matching the target dialogue from a plurality of candidate scene labels in a dialogue scene corpus comprises: obtaining at least one sub-scene label matching each sub-dialogue intent label; determining the target scene label from the plurality of candidate scene labels based on a plurality of sub-scene labels matching the plurality of sub-dialogue intent labels.
9. The method of claim 8, wherein, The plurality of sub-dialogue intent labels comprises a first sub-dialogue intent label and a second sub-dialogue intent label, and the determining the target scene label from the plurality of candidate scene labels based on a plurality of sub-scene labels matching the plurality of sub-dialogue intent labels comprises: calculating, for each sub-scene label matching the first sub-dialogue intent label, a respective correlation coefficient between the sub-scene label and a plurality of sub-scene labels matching the second sub-dialogue intent label; determining the target scene label from the plurality of candidate scene labels based on the respective correlation coefficients calculated between each sub-scene label matching the first sub-dialogue intent label and the plurality of sub-scene labels matching the second sub-dialogue intent label.
10. The method of claim 8, wherein, When the target corpus set comprises a plurality of phrase texts and respective first statistical probabilities of the plurality of phrase texts, the generating dialogue information for the target dialogue comprises: calculating respective similarities between each sub-dialogue intent label and the plurality of phrase texts in the target corpus set; determining a plurality of target phrase texts from the plurality of phrase texts in the target corpus set based on the respective similarities between each sub-dialogue intent label and the plurality of phrase texts in the target corpus set, and the respective first statistical probabilities of the plurality of phrase texts.
11. The method of claim 8, wherein, When the target corpus set further comprises a plurality of sentence templates and respective second statistical probabilities of the plurality of sentence templates, the generating dialogue information for the target dialogue comprises: calculating respective similarities between each sub-dialogue intent label and the plurality of sentence templates in the target corpus set; determining a plurality of target sentence templates from the plurality of sentence templates in the target corpus set based on the respective similarities between each sub-dialogue intent label and the plurality of sentence templates in the target corpus set, and the respective second statistical probabilities of the plurality of sentence templates.
12. An apparatus for generating dialogue information, configured to: acquiring dialogue data of a target dialogue, wherein, the dialogue data comprises at least one chat record text, a text input into a dialogue box to be sent, and historical dialogue state information, the historical dialogue state information comprising dialogue text information of a previous dialogue of the target dialogue, user behavior information, and a dialogue intent label; performing emotional vocabulary detection on the text to be sent to obtain emotional vocabulary in the text to be sent and a corresponding emotion label; In response to the emotion label belonging to a negative emotion label, determining a dialogue intent label of the target dialogue based on dialogue data of the target dialogue, wherein the determining the dialogue intent label of the target dialogue comprises: performing semantic information extraction on dialogue data of the target dialogue to obtain a plurality of words and a plurality of syntactic component labels corresponding to the plurality of words; and inputting the plurality of words, the plurality of syntactic component labels corresponding to the plurality of words, and the historical dialogue state information into a dialogue intent analysis model to obtain the dialogue intent label output by the dialogue intent analysis model, wherein the dialogue intent analysis model comprises a cascaded dialogue behavior recognition model, a dialogue state recognition model, and a dialogue strategy learning model, the plurality of words, the plurality of syntactic component labels corresponding to the plurality of words, and the historical dialogue state information are input into the dialogue behavior recognition model, and an output of the dialogue strategy learning model includes the dialogue intent label; based on the dialogue intent label, determining a target scene label matching the target dialogue from a plurality of candidate scene labels in a dialogue scene corpus, wherein the dialogue scene corpus includes a plurality of candidate corpus sets corresponding one-to-one to the plurality of candidate scene labels, and wherein the dialogue scene corpus is constructed based on dialogue data derived from the field of psychology and contains dialogue corpus that integrates communication psychology knowledge and communication skills; and generating dialogue information for the target dialogue based on a target corpus set corresponding to the target scene label.
13. An intelligent chat system comprising the apparatus for generating dialogue information of claim 12.
14. An electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-11.
15. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1-11.
16. A computer program product comprising a computer program, wherein, The computer program, when executed by a processor, implements the method of any one of claims 1-11. The computer program, when executed by a processor, implements the method of any one of claims 1-11.
Citation Information
Patent Citations
Information pushing method and device
CN112380331A
Dialogue data generation method and device, equipment and medium
CN114118101A