Dialogue flow chart generation method, generation device, equipment and medium
Through the process analysis of dialogue data and the generation of label co-occurrence matrix, the automatic generation of dialogue flow charts is realized, the high cost and inefficiency problems caused by manual analysis in the prior art are solved, and the ability to deal with unexpected customer answers is improved.
Patent Information
- Application Number
- CN202411838812.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-08
AI Technical Summary
The existing dialogue flowchart generation method is based on manual analysis, which leads to high generation costs and low efficiency, making it difficult to deal with unexpected customer answers and rhetorical questions.
By performing process analysis on the target dialogue data, the dialogue labels of each round of dialogue statements are extracted, the dialogue label combination is constructed, the number of tags co-occurrences is counted, the tag co-occurrence matrix is generated, and the dialogue flow chart is automatically generated.
It realizes the automated generation of dialogue flowcharts, reduces generation costs, improves efficiency, and can better respond to unexpected answers and rhetorical questions from customers.
Smart Images

Figure CN119782519A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method for generating a dialog flow chart, a device for generating a dialog flow chart, an electronic device, and a computer-readable storage medium. Background Art
[0002] In various business scenarios, agents often have conversations with customers based on training scripts, thus generating corresponding conversation data. However, in actual situations, training scripts are difficult to deal with unexpected answers and counter-questions from customers, so agents will respond based on experience, resulting in diverse conversation data.
[0003] Through the dialogue flow chart, the dialogue process in the dialogue data can be intuitively displayed, so as to facilitate a panoramic understanding of the dialogue process and discover excellent dialogue skills. However, the existing dialogue flow charts are often constructed based on manual sorting of dialogue data, which not only has high generation costs but also low generation efficiency. Summary of the invention
[0004] The present application provides a method, a generating device, an electronic device, and a computer-readable storage medium for generating a conversation flow chart, which can perform process analysis on conversation data and realize automatic generation of a conversation flow chart based on the analysis results.
[0005] In a first aspect, the present application provides a method for generating a dialogue flow chart, which includes: extracting labels for each round of dialogue statements in target dialogue data to generate dialogue labels corresponding to each round of dialogue statements; constructing dialogue label combinations based on dialogue labels corresponding to adjacent rounds of dialogue statements to obtain multiple dialogue label combinations corresponding to the target dialogue data; counting the number of label co-occurrences corresponding to each dialogue label combination, and generating a label co-occurrence matrix based on the number of label co-occurrences corresponding to each dialogue label combination; and generating a dialogue flow chart corresponding to the target dialogue data based on the label co-occurrence matrix.
[0006] In a second aspect, the present application provides a device for generating a dialogue flow chart, which includes: a label extraction module, which is used to extract labels for each round of dialogue statements in the target dialogue data, and generate dialogue labels corresponding to each round of dialogue statements; a combination construction module, which is used to construct dialogue label combinations according to dialogue labels corresponding to adjacent rounds of dialogue statements, and obtain multiple dialogue label combinations corresponding to the target dialogue data; a matrix generation module, which is used to count the number of label co-occurrences corresponding to each dialogue label combination, and generate a label co-occurrence matrix according to the number of label co-occurrences corresponding to each dialogue label combination; a flowchart generation module, which is used to generate a dialogue flow chart corresponding to the target dialogue data according to the label co-occurrence matrix.
[0007] In a third aspect, the present application provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and one or more of the computer programs are executed by the at least one processor so that the at least one processor can execute the above-mentioned method for generating a dialog flow chart.
[0008] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned method for generating a dialog flow chart when executed by a processor / processing core.
[0009] The embodiments provided by the present application firstly extract labels for each round of dialogue sentences in the target dialogue data, and generate dialogue labels corresponding to each round of dialogue sentences, thereby realizing content analysis of the target dialogue data; secondly, construct dialogue label combinations according to dialogue labels corresponding to adjacent rounds of dialogue sentences, and obtain multiple dialogue label combinations corresponding to the target dialogue data; then, count the number of label co-occurrences corresponding to each dialogue label combination, and generate a label co-occurrence matrix according to the number of label co-occurrences corresponding to each dialogue label combination, so that the dialogue flow corresponding to adjacent rounds of dialogue sentences in the target dialogue data can be reflected in the generated label co-occurrence matrix, thereby realizing dialogue flow analysis of the target dialogue data; finally, generate a dialogue flow chart corresponding to the target dialogue data according to the label co-occurrence matrix, thereby realizing automatic dialogue flow chart generation.
[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings. In the accompanying drawings:
[0012] Figure 1 A flowchart of a method for generating a dialogue flow chart provided in an embodiment of the present application;
[0013] Figure 2 A schematic diagram of a dialogue flow chart in an embodiment of the present application;
[0014] Figure 3 A schematic diagram of a method for generating a dialogue flow chart provided in an embodiment of the present application;
[0015] Figure 4 This is a schematic diagram of a label co-occurrence matrix in an embodiment of the present application;
[0016] Figure 5 A schematic diagram of a dialogue flow chart in an embodiment of the present application;
[0017] Figure 6 A block diagram of a device for generating a dialog flow chart provided in an embodiment of the present application;
[0018] Figure 7 A block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the technical solution of the present application, the exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0020] In the absence of conflict, the embodiments of the present application and the features therein may be combined with each other.
[0021] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0022] The terms used herein are only used to describe specific embodiments and are not intended to limit the present application. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0023] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this application, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined herein.
[0024] In various business scenarios such as telemarketing business scenarios, a large number of agents communicate with customers based on the language learned through training. In actual situations, due to the diversity of customer conversation content, the agents will generate corresponding responses based on the customer conversation content, resulting in multiple branches outside the original conversation process.
[0025] Constructing a conversation flow chart for conversation data helps to gain a panoramic understanding of the agent's marketing process for customers, thereby discovering excellent conversation skills. However, the existing flowchart generation method is mainly based on manual analysis and understanding of conversation data to construct the corresponding conversation flow chart, which makes the generation cost of the conversation flow chart high and the efficiency low.
[0026] According to the method for generating a dialogue flow chart of an embodiment of the present application, first, labels are extracted for each round of dialogue sentences in the target dialogue data, and dialogue labels corresponding to each round of dialogue sentences are generated, thereby realizing content analysis of the target dialogue data. Secondly, dialogue label combinations are constructed based on dialogue labels corresponding to dialogue sentences in adjacent rounds, and multiple dialogue label combinations corresponding to the target dialogue data are obtained. Then, the number of label co-occurrences corresponding to each dialogue label combination is counted respectively, and a label co-occurrence matrix is generated based on the number of label co-occurrences corresponding to each dialogue label combination, so that the dialogue flow corresponding to adjacent rounds of dialogue sentences in the target dialogue data can be reflected in the generated label co-occurrence matrix, thereby realizing dialogue flow analysis of the target dialogue data. Finally, a dialogue flow chart corresponding to the target dialogue data is generated based on the label co-occurrence matrix, thereby realizing automatic dialogue flow chart generation.
[0027] The method for generating a dialog flow chart according to an embodiment of the present application can be performed by an electronic device such as a terminal device or a server, and the terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The method can be implemented by a processor calling a computer-readable program instruction stored in a memory. The server can be an independent physical server, a server cluster composed of multiple servers, or a cloud server capable of cloud computing.
[0028] Figure 1 A flowchart of a method for generating a dialogue flow chart provided in an embodiment of the present application. Figure 1 , the method comprising:
[0029] Step S110: extract labels for each round of dialogue sentences in the target dialogue data, and generate dialogue labels corresponding to each round of dialogue sentences.
[0030] The target conversation data refers to the conversation data generated by the call object during the call, for example, the conversation data generated by the agent and the customer during the call, which is not limited in this embodiment of the present application.
[0031] It should be noted that the target conversation data may be conversation data corresponding to one call, or may include conversation data corresponding to multiple calls, which is not limited in this embodiment of the present application.
[0032] Accordingly, each round of dialogue sentences in the target dialogue data may include multiple continuous dialogue sentences. The multiple continuous dialogue sentences included in each round of dialogue sentences are all used to represent the same dialogue requirement.
[0033] In an optional implementation, in order to improve the accuracy of the division of each round of dialogue sentences in the target dialogue data, each round of dialogue sentences in the target dialogue data can be divided in the following manner: according to the business scenario corresponding to the target dialogue data, determine the number of sentences in each round of dialogue sentences corresponding to the business scenario; according to the number of sentences in each round of dialogue sentences corresponding to the business scenario, divide the target dialogue data into multiple rounds of dialogue sentences.
[0034] The business scenario corresponding to the target conversation data can be determined by statistically analyzing the conversation content of the target conversation data. For example, for the target conversation data, a customer may consult an agent based on multiple business issues in succession, and the agent will answer the customer's questions accordingly. Therefore, the business scenario corresponding to the target conversation data can be multiple business scenarios corresponding to multiple business issues.
[0035] Therefore, by determining the number of sentences in each round of dialogue corresponding to the business scenario, multiple dialogue sentences corresponding to the same business scenario in the target dialogue data are divided into one round of dialogue sentences or into multiple rounds of dialogue data.
[0036] Among them, the number of sentences in each round of dialogue corresponding to the business scenario can be adaptively set according to the complexity of the business scenario, and the embodiments of the present application do not limit this.
[0037] For example, the number of sentences in each round of dialogue corresponding to a certain business scenario is 4 sentences, and the number of dialogue sentences corresponding to the business scenario in the target dialogue data is 8 sentences, so it can be divided into 2 rounds of dialogue sentences.
[0038] In an optional implementation, in order to improve the efficiency of dividing each round of dialogue sentences for the target dialogue data, the dialogue sentences corresponding to an interaction process between different call objects in the target dialogue data can also be divided into one round of dialogue sentences. Optionally, the number of call objects included in the call process can also be predetermined. For example, in the application scenario of multi-party calls or multi-person conferences, the N call objects (such as N participants) included in the call process can be predetermined. Accordingly, the dialogue sentences corresponding to an interaction process between M call objects in the target dialogue data are divided into one round of dialogue sentences. Among them, M can be less than or equal to N, and the specific value is flexibly set according to the type of application scenario (such as the number of people who need to speak in each round of discussion).
[0039] For example, in a customer service application scenario, the following dialogue sentence "Customer: Let me introduce product XX; Agent: The main advantage of product XX is..." is a round of dialogue sentences.
[0040] Thus, the target conversation data may include multiple rounds of conversation sentences. When the target conversation data includes conversation data corresponding to multiple calls, the conversation data corresponding to each call may be adaptively divided into multiple rounds of conversation sentences.
[0041] The dialogue tag corresponding to each round of dialogue sentences refers to the process tag corresponding to each round of dialogue sentences, that is, the dialogue tag is used to represent the process link corresponding to the dialogue content of the dialogue sentence in this round.
[0042] For example, for a conversation sentence "Customer: Hello; Agent: Hello, how can I help you?", by extracting labels for this conversation sentence, the conversation label corresponding to this conversation sentence can be generated as "greeting". That is, this conversation label is used to indicate that the process link corresponding to this conversation sentence is greeting between the call parties.
[0043] It should be noted that each round of dialogue sentences in the target dialogue data can be input into a preset model, such as a trained large language model, to perform label extraction, so that the preset model generates dialogue labels corresponding to each round of dialogue sentences, and the embodiments of the present application are not limited to this.
[0044] Step S120: constructing dialogue tag combinations according to dialogue tags corresponding to dialogue sentences in adjacent rounds, and obtaining multiple dialogue tag combinations corresponding to the target dialogue data.
[0045] The adjacent rounds of dialogue statements may be dialogue statements of two adjacent rounds or multiple adjacent rounds. For example, the adjacent rounds of dialogue statements may be dialogue statements of the first and second rounds, dialogue statements of the second to fifth rounds, etc., which are not limited in the present embodiment of the application.
[0046] Among them, the dialogue tag combination is constructed according to the dialogue tags corresponding to the dialogue sentences in adjacent rounds.
[0047] Exemplarily, the dialogue tag combination may be constructed in the form of <first dialogue tag, second dialogue tag> or <second dialogue tag, first dialogue tag>, and the dialogue turn of the dialogue sentence corresponding to the first dialogue tag must be earlier than the dialogue turn of the dialogue sentence corresponding to the second dialogue tag.
[0048] Among them, since there may be duplication of labels or high label similarity between the dialogue tags corresponding to the dialogue sentences of adjacent rounds, when constructing the dialogue tag combination, in order to improve the construction quality of the dialogue tag combination, the dialogue tags can be similarly calculated, and then the dialogue tag combination can be constructed according to the similarity calculation results.
[0049] In an optional implementation, when constructing a dialogue tag combination based on dialogue tags corresponding to dialogue statements in adjacent rounds, it can be implemented in the following way: for the dialogue tags corresponding to the dialogue statements in the mth round, perform tag traversal starting from the dialogue tags corresponding to the dialogue statements in the m+1th round according to the dialogue rounds, and calculate the similarity between the current traversal tag and the dialogue tag corresponding to the dialogue statement in the mth round in turn. When the similarity calculation result exceeds a preset similarity threshold, continue to traverse the tags. When the similarity calculation result does not exceed the preset similarity threshold, construct a dialogue tag combination based on the dialogue tags corresponding to the dialogue statements in the mth round and the current traversal tags, where m is a natural number.
[0050] Among them, the preset similarity threshold is used to filter out dialogue tags with low similarity to the dialogue tags corresponding to the mth round of dialogue statements. The specific value can be adaptively set according to the screening needs, and the embodiment of the present application does not limit this.
[0051] Among them, the similarity between the current traversal label and the dialogue label corresponding to the m-th round of dialogue statement can be calculated according to any similarity calculation algorithm, and the corresponding similarity calculation result is used to characterize the label similarity between the current traversal label and the dialogue label corresponding to the m-th round of dialogue statement.
[0052] It should be noted that after constructing a dialogue tag combination for the dialogue tag corresponding to the mth round of dialogue statements and the current traversal tag, in order to improve the generation efficiency of the dialogue tag combination, the construction process of the next dialogue tag combination can be continued for the current traversal tag.
[0053] Exemplarily, assuming that the target dialogue data includes 5 rounds of dialogue sentences, and their corresponding dialogue tags are [greeting, hello, product introduction, contact information consultation, closing remarks], accordingly, for the dialogue tags corresponding to the first round of dialogue sentences, the tag traversal is started from the dialogue tag "greeting" corresponding to the second round of dialogue sentences, so that the similarity calculation result between the dialogue tag "product introduction" corresponding to the third round of dialogue sentences and the dialogue tag corresponding to the first round of dialogue sentences does not exceed the preset similarity threshold, and the dialogue tag combination is constructed as <greeting, product introduction>.
[0054] Correspondingly, after constructing the dialogue tag combination of <greeting, product introduction>, the construction process of the next dialogue tag combination can be carried out directly from the dialogue tag "product introduction" corresponding to the third round of dialogue sentences, so that the next constructed dialogue tag combination is obtained as <product introduction, contact information consultation>.
[0055] Therefore, the multiple dialogue tag combinations corresponding to the target dialogue data are <greeting, product introduction>, <product introduction, contact information consultation>, and <contact information consultation, closing remarks>.
[0056] In an optional implementation, in order to improve the efficiency of generating dialogue tag combinations, dialogue tag combinations may also be constructed directly based on dialogue tags corresponding to two adjacent dialogue statements, and this embodiment of the present application does not impose any restrictions on this.
[0057] For example, for the above-mentioned dialogue tags [hello, hello, product introduction, contact information consultation, closing remarks], the multiple dialogue tag combinations constructed can be <hello, hello>, <hello, product introduction>, <product introduction, contact information consultation>, <contact information consultation, closing remarks>.
[0058] Step S130: Count the number of times the tags co-occur corresponding to each conversation tag combination, and generate a tag co-occurrence matrix according to the number of times the tags co-occur corresponding to each conversation tag combination.
[0059] The tag co-occurrence count is used to represent the number of co-occurrences (i.e., the number of co-occurrences) of the dialogue flow corresponding to the dialogue tag combination in the overall dialogue flow corresponding to the target dialogue data.
[0060] For example, for a dialogue tag combination <greeting, product introduction>, the corresponding dialogue flow is the transition from the greeting stage to the product introduction stage. Therefore, in the overall dialogue flow corresponding to the target dialogue data, if there are multiple transitions from the greeting stage to the product introduction stage, the number of repetitions is the number of tag co-occurrences of the dialogue tag combination.
[0061] The tag co-occurrence matrix is used to characterize the dialogue flow of the target dialogue data. Specifically, the tag co-occurrence matrix includes a first orientation tag and a second orientation tag, wherein the first orientation tag is used to indicate the dialogue tag corresponding to the dialogue sentence of the first dialogue round, and the second orientation tag is used to indicate the dialogue tag corresponding to the dialogue sentence of the second dialogue round, and the first dialogue round is earlier than the second dialogue round.
[0062] The first orientation label and the second orientation label are row labels or column labels of the label co-occurrence matrix. If the first orientation label is a row label, the second orientation label is a column label; if the first orientation label is a column label, the second orientation label is a row label.
[0063] In addition, the first position label and the second position label need to be determined according to the dialogue label. For example, if the target dialogue data corresponds to 4 dialogue labels, label 1 to label 4, then the first position label and the second position label of the label co-occurrence matrix are also label 1 to label 4.
[0064] Correspondingly, the matrix element values corresponding to the first orientation label and the second orientation label in the label co-occurrence matrix are used to characterize the degree of process association of the dialogue process corresponding to the first orientation label and the second orientation label, which can be determined according to the number of label co-occurrences of the dialogue label combination corresponding to the first orientation label and the second orientation label.
[0065] The higher the matrix element values corresponding to the first orientation label and the second orientation label, the stronger the process correlation between the process link corresponding to the first orientation label and the process link corresponding to the second orientation label, and the higher the probability of transferring from the process link corresponding to the first orientation label to the process link corresponding to the second orientation label.
[0066] Exemplarily, the first orientation label is a row label, the second orientation label is a column label, and the first orientation label and the second orientation label are both labels 1 to 4. Accordingly, the generated label co-occurrence matrix is shown below.
[0067]
[0068] Among them, Nij is the matrix element value corresponding to the i-th first-position label and the j-th second-position label. For example, N12 is the matrix element value corresponding to label 1 and label 2. When the construction form of the dialogue label combination is <first dialogue label, second dialogue label>, N12 can be determined according to the number of co-occurrences of labels corresponding to the dialogue label combination <label 1, label 2>.
[0069] It should be noted that, when the target conversation data includes conversation data corresponding to multiple calls, a label co-occurrence matrix corresponding to each call data may be generated.
[0070] Step S140: Generate a conversation flow chart corresponding to the target conversation data according to the tag co-occurrence matrix.
[0071] Since the tag co-occurrence matrix represents the dialog flow of the target dialog data, and the matrix element values corresponding to the first orientation tag and the second orientation tag in the tag co-occurrence matrix are used to represent the degree of process association between the dialog flows corresponding to the first orientation tag and the second orientation tag.
[0072] Therefore, the process nodes in the conversation flow chart can be constructed according to the conversation tags, and the process correlation of the conversation processes corresponding to different first-position tags and different second-position tags can be determined according to the matrix element values of the tag co-occurrence matrix. Based on the process correlation, connecting lines can be established between the process nodes corresponding to the first-position tags and the second-position tags, thereby generating a conversation flow chart corresponding to the target conversation data.
[0073] According to the method for generating a dialogue flow chart of an embodiment of the present application, first, labels are extracted for each round of dialogue sentences in the target dialogue data, and dialogue labels corresponding to each round of dialogue sentences are generated, thereby realizing content analysis of the target dialogue data. Secondly, dialogue label combinations are constructed based on dialogue labels corresponding to dialogue sentences in adjacent rounds, and multiple dialogue label combinations corresponding to the target dialogue data are obtained. Then, the number of label co-occurrences corresponding to each dialogue label combination is counted respectively, and a label co-occurrence matrix is generated based on the number of label co-occurrences corresponding to each dialogue label combination, so that the dialogue flow corresponding to adjacent rounds of dialogue sentences in the target dialogue data can be reflected in the generated label co-occurrence matrix, thereby realizing dialogue flow analysis of the target dialogue data. Finally, a dialogue flow chart corresponding to the target dialogue data is generated based on the label co-occurrence matrix, thereby realizing automatic dialogue flow chart generation.
[0074] In addition, those skilled in the art may also make various modifications and variations to the method in this application:
[0075] In an optional implementation, in order to improve the label generation effect of the dialogue tags corresponding to each round of dialogue sentences, the preset model can extract the initial dialogue tags corresponding to the dialogue sentences, and then divide the initial dialogue tags into label levels, and finally generate the dialogue tags corresponding to each round of dialogue sentences according to the label level division results.
[0076] Accordingly, labels are extracted for each round of dialogue sentences in the target dialogue data to generate dialogue labels corresponding to each round of dialogue sentences, including: based on a preset model, extracting the dialogue intention corresponding to each round of dialogue sentences, and generating multiple initial dialogue labels corresponding to multiple rounds of dialogue sentences; dividing the multiple initial dialogue labels into label hierarchies according to a preset label hierarchy structure to obtain hierarchical dialogue labels corresponding to multiple label hierarchies; inputting each round of dialogue sentences in the target dialogue data and the hierarchical dialogue labels corresponding to the multiple label hierarchies into the preset model, so that the preset model generates dialogue labels corresponding to each round of dialogue sentences according to the hierarchical dialogue labels corresponding to the multiple label hierarchies.
[0077] The preset model may be any large language model used for natural language processing tasks, such as the Qwen model.
[0078] It should be noted that an initial dialogue label generation task can be constructed based on each round of dialogue sentences, so that by inputting the initial dialogue label generation task into a preset model, the preset model can generate initial dialogue labels corresponding to each round of dialogue sentences for the task.
[0079] Among them, the preset tag hierarchy structure is used to represent the preset hierarchy of dialogue tags and the tag relationship between hierarchical dialogue tags corresponding to different preset hierarchies.
[0080] For example, the preset tag hierarchy structure includes three tag hierarchies from top to bottom, and the hierarchical dialogue tag corresponding to the next tag hierarchy is a subtag of the hierarchical dialogue tag corresponding to the previous tag hierarchy.
[0081] Since the initial conversation tags may have similar tags or a variety of tags, multiple initial conversation tags are divided into tag levels according to a preset tag hierarchy structure, and the initial conversation tags can be sorted out to obtain hierarchical conversation tags corresponding to multiple tag levels, that is, a tag structure with regular content.
[0082] Exemplarily, the hierarchical dialogue tags corresponding to the two tag levels may be:
[0083] 'First level label': ['Say hello', 'Add user WeChat', 'Company introduction', 'Promotion introduction', 'Collect user information', 'Invite to store'],
[0084] 'Secondary Label':{
[0085] 'Say hello': ['Say hello'],
[0086] 'Add user WeChat': ['Request to add WeChat', 'Add user phone', 'Provide design case'],
[0087] 'Company Introduction': ['Company Introduction'],
[0088] 'Introduction to promotion': ['Activity time and address', 'Introduction to promotion'],
[0089] 'Collect user information': ['Has the house been delivered', 'Has it been decorated', 'Ask about the delivery time', 'Ask when to decorate', 'Ask if it is the first house', 'Ask about user preferences', 'Ask about user budget'],
[0090] 'Invite to the store':['Invite to the store','Introduction to store gifts']}
[0091] };
[0092] Among them, the first-level label is the first-level label level, and the second-level label is the second-level label level.
[0093] After obtaining the hierarchical dialogue labels corresponding to multiple label levels, each round of dialogue sentences in the target dialogue data and the hierarchical dialogue labels corresponding to the multiple label levels can be input into the preset model together, so that the preset model generates dialogue labels corresponding to each round of dialogue sentences according to the hierarchical dialogue labels corresponding to the multiple label levels.
[0094] For example, the preset model determines the dialogue tags corresponding to each round of dialogue sentences from the hierarchical dialogue tags corresponding to the last label level, and the embodiments of the present application are not limited to this.
[0095] In an embodiment of the present application, a preset model extracts initial dialogue tags for each round of dialogue sentences, thereby performing hierarchical division based on the extracted initial dialogue tags, and generating dialogue tags corresponding to each round of dialogue sentences based on the hierarchical dialogue tags after the hierarchical division, thereby improving the label regularity and label accuracy of the dialogue sentence labels.
[0096] In an optional implementation, in order to improve the correspondence between the hierarchical dialogue tags and their tag levels, initial dialogue tags with similar semantics among multiple initial dialogue tags may be fused, and the tag frequency of the dialogue tags may be determined based on the number of fused initial dialogue tags, thereby performing tag hierarchy division based on the tag frequency.
[0097] Accordingly, multiple initial dialogue tags are divided into label hierarchies according to a preset label hierarchy structure to obtain hierarchical dialogue tags corresponding to multiple label hierarchies, including: fusing initial dialogue tags with similar semantics among multiple initial dialogue tags to obtain multiple processed dialogue tags; for each processed dialogue tag, determining the label frequency of the processed dialogue tag according to the label quantity of the initial dialogue tag corresponding to the processed dialogue tag; and dividing the multiple processed dialogue tags into hierarchies according to the label frequency corresponding to each processed dialogue tag among the multiple processed dialogue tags and a preset label hierarchy structure to obtain hierarchical dialogue tags corresponding to multiple label hierarchies.
[0098] Among them, the preset tag hierarchy structure includes: multiple tag levels, each tag level is used to characterize the tag granularity of the hierarchical dialogue tags, and the tag granularity of the hierarchical dialogue tags corresponding to the tag level at the lower level is greater than the tag granularity of the hierarchical dialogue tags corresponding to the tag level at the upper level.
[0099] The label levels are increased from top to bottom, that is, the first label level is located above the second label level, and the second label level is located above the third label level.
[0100] Among them, the label granularity is used to characterize the fine-grainedness of the label division of the hierarchical dialogue labels. The lower the label level is, the larger the label granularity of its hierarchical dialogue labels is. Correspondingly, the more hierarchical dialogue labels there are in the label level of this layer, and the richer the label content is.
[0101] Taking the hierarchical dialogue tags corresponding to the two label levels shown above as an example, the first label level, i.e. the first-level label, corresponds to the hierarchical dialogue tags ['Say hello', 'Add user WeChat', 'Company introduction', 'Introduction to promotions', 'Collect user information', 'Invite to store'], while the second label level below it, i.e. the second-level label, only 'Collect user information' corresponds to multiple hierarchical dialogue tags: ['Has the house been delivered', 'Has it been decorated', 'Ask about the delivery time', 'Ask when it will be decorated', 'Ask if it is the first house', 'Ask about user preferences', 'Ask about user budget'].
[0102] Therefore, as the tag level increases, the number of tag types of the corresponding hierarchical dialogue tags increases, and the dialogue process represented by the hierarchical dialogue tags becomes more detailed.
[0103] The fusing of the initial conversation tags with similar semantics among the multiple initial conversation tags refers to fusing the initial conversation tags with repeated contents or repeated semantics.
[0104] Correspondingly, the processed conversation tag is the conversation tag obtained after fusing multiple initial conversation tags.
[0105] For example, for multiple initial dialogue tags, such as 'add WeChat', 'add WeChat', 'add user WeChat', and 'add WeChat', after fusion processing, the processed dialogue tag "add user WeChat" can be obtained.
[0106] As for the initial dialogue tags without repeated content and repeated semantics, they can be directly used as processing dialogue tags.
[0107] Furthermore, for each processed dialogue tag, the tag frequency of the processed dialogue tag needs to be determined according to the tag quantity of the initial dialogue tag corresponding to the processed dialogue tag.
[0108] The tag frequency of the processing dialogue tag is used to represent the number of times the processing dialogue tag appears in multiple initial dialogue tags. The initial dialogue tag corresponding to the processing dialogue tag is the initial dialogue tag used to generate the processing dialogue tag.
[0109] For example, the four initial dialogue tags corresponding to the dialogue tag "add user WeChat" are 'add WeChat', 'add WeChat', 'add user WeChat', and 'add WeChat'. Accordingly, the tag frequency of the dialogue tag can be 4.
[0110] The higher the label frequency corresponding to the processing dialogue label, the more important the corresponding process is in the entire dialogue process corresponding to the target dialogue data, and the more labels it may be further divided into. Correspondingly, the label level corresponding to the processing dialogue label is higher.
[0111] Therefore, when multiple processing dialogue tags are divided into levels, the tag frequency corresponding to each processing dialogue tag in the multiple processing dialogue tags, the preset tag hierarchy structure, and the multiple processing dialogue tags can be input into the preset model together, so that the preset model can divide the multiple processing dialogue tags into levels according to the tag frequency and the preset tag hierarchy structure, and obtain hierarchical dialogue tags corresponding to the multiple tag levels.
[0112] In an embodiment of the present application, redundant tags are avoided in hierarchical dialog tags by fusing tags with similar semantics in the initial dialog tags, and the dialog tags are hierarchically divided by processing the tag frequencies corresponding to the dialog tags and the preset tag hierarchy structure, so that the generated hierarchical dialog tags have a stronger correspondence with their tag hierarchies, thereby improving the generation effect of the hierarchical dialog tags.
[0113] In an optional implementation, in order to achieve accurate statistics on the number of label co-occurrences, the adjacent rounds of dialogue statements may be matched with the first dialogue label and the second dialogue label in each dialogue label combination, thereby adjusting the number of label co-occurrences of the dialogue label combination according to the matching results.
[0114] Correspondingly, the adjacent rounds of dialogue statements used to construct each dialogue label combination include: a first dialogue statement and a second dialogue statement, the dialogue round of the first dialogue statement is earlier than that of the second dialogue statement; and each dialogue label combination includes: a first dialogue label corresponding to the first dialogue statement, and a second dialogue label corresponding to the second dialogue statement; then the number of label co-occurrences corresponding to each dialogue label combination is counted respectively, including: matching the dialogue label corresponding to the i-th round of dialogue statement with the first dialogue label included in each dialogue label combination to obtain a first matching result; matching the dialogue label corresponding to the i+1-th round of dialogue statement with the second dialogue label included in each dialogue label combination to obtain a second matching result; determining the dialogue label combination whose first matching result and the second matching result meet the preset matching condition as the target dialogue label combination, and adjusting the number of label co-occurrences corresponding to the target dialogue label combination so that the number of label co-occurrences corresponding to the target dialogue label combination increases, wherein i is a natural number.
[0115] The difference in rounds between the dialogue round corresponding to the first dialogue sentence and the dialogue round corresponding to the second dialogue sentence may be one round or multiple rounds.
[0116] Since the first dialogue tag corresponds to the first dialogue sentence, and the second dialogue tag corresponds to the second dialogue sentence, when counting the number of tag co-occurrences corresponding to each dialogue tag combination, for the dialogue tag corresponding to the i-th round of dialogue sentence, it is necessary to match the tag with the first dialogue tag included in each dialogue tag combination, and match the dialogue tag corresponding to the i+1-th round of dialogue sentence with the second dialogue tag included in each dialogue tag combination.
[0117] It should be noted that, since the difference in rounds between the dialogue round corresponding to the first dialogue statement and the dialogue round corresponding to the second dialogue statement can be multiple rounds, the dialogue tags corresponding to the multiple rounds of dialogue statements after the i-th round, that is, the i+K-round dialogue statements, can also be matched with the second dialogue tags included in each dialogue tag combination, and the embodiments of the present application are not limited to this.
[0118] Among them, the first matching result represents the label similarity between the dialogue tag corresponding to the i-th round of dialogue statement and the first dialogue tag included in each dialogue tag combination, and the second matching result represents the label similarity between the dialogue tag corresponding to the i-th round of dialogue statement or the i+K-th round of dialogue statement and the second dialogue tag included in each dialogue tag combination.
[0119] Accordingly, the preset matching condition is used to characterize the matching success condition of the first matching result and the second matching result. In an optional implementation, a first matching threshold corresponding to the first matching result and a second matching threshold corresponding to the second matching result can be set, so that when the first matching result satisfies the first matching threshold and the second matching result satisfies the second matching threshold, it is determined that the first matching result and the second matching result meet the preset matching condition. Thus, the dialogue tag combination in which the first matching result and the second matching result meet the preset matching condition is determined as the target dialogue tag combination.
[0120] For example, it is assumed that the dialogue tags corresponding to the multiple rounds of dialogue sentences are: 'say hello', 'say hello', 'introduce discount information', 'invite to the store', 'invite to the store'.
[0121] When the difference in dialogue turns between the first dialogue sentence and the second dialogue sentence is one round, the corresponding dialogue tag combinations are combination 1 <Say hello, say hello>, combination 2 <Say hello, introduction to discount information>, combination 3 <Introduction to discount information, invite to store>, and combination 4 <Invite to store, invite to store>.
[0122] Correspondingly, when counting the number of label co-occurrences corresponding to each dialogue label combination, for the dialogue label 'hello' of the first round of dialogue sentences, match it with the first dialogue label 'hello', 'hello', 'introduction to preferential information', and 'invite to store' of each label combination respectively; match the dialogue label 'hello' of the second round of dialogue sentences with the second dialogue label 'hello', 'introduction to preferential information', 'invite to store', and 'invite to store' of each label combination respectively, so that the target dialogue label combination can be determined as combination 1 <hello, hello>, thereby increasing the number of label co-occurrences corresponding to this combination.
[0123] When the difference in rounds between the dialogue round corresponding to the first dialogue sentence and the dialogue round corresponding to the second dialogue sentence is multiple rounds, the corresponding dialogue tag combinations may be combination 1 <greeting, introduction to discount information>, combination 2 <introduction to discount information, invitation to the store>.
[0124] Correspondingly, when counting the number of label co-occurrences corresponding to each dialogue label combination, the dialogue label 'hello' of the first round of dialogue sentences is matched with the first dialogue labels 'hello' and 'introduction to discount information' of each label combination, and the dialogue label 'hello' of the second round of dialogue sentences is matched with the second dialogue labels 'introduction to discount information' and 'invite to store' of each label combination. Since the label similarity between the dialogue label of the second round of dialogue sentences and the second dialogue label of the label combination is low, the target dialogue label combination is not screened out.
[0125] Then continue to filter the third round of dialogue sentences, and match the dialogue tag 'introduction to discount information' of the third round of dialogue sentences with the second dialogue tags 'introduction to discount information' and 'invite to store' of each tag combination, so as to determine that the target dialogue tag combination is combination 1 <greeting, introduction to discount information>, thereby increasing the number of co-occurrences of tags corresponding to this combination.
[0126] As can be seen from the above, the method for determining the target dialogue tag combination in the present application can be adaptively adjusted according to the method for constructing the dialogue tag combination, and the embodiments of the present application are not limited to this.
[0127] It should also be noted that when adjusting the number of tag co-occurrences corresponding to the target conversation tag combination, the number of tag co-occurrences can be adaptively increased according to actual needs.
[0128] For example, directly add 1 to the number of tag co-occurrences. For another example, determine the combined weight value corresponding to the target conversation tag combination, and adjust the number of tag co-occurrences corresponding to the target conversation tag combination according to the combined weight value. The embodiments of the present application do not limit this.
[0129] In an embodiment of the present application, by matching the conversation tag of the previous round with the first conversation tag in the conversation tag combination, and matching the conversation tag of the next round with the second conversation tag in the conversation tag combination, a target conversation tag combination is determined based on the matching results, and the number of tag co-occurrences corresponding to the combination is adjusted, thereby achieving accurate statistics of the number of tag co-occurrences.
[0130] In an optional implementation, in order to enable the generated label co-occurrence matrix to reflect the dialogue process corresponding to the target dialogue data, the first orientation label and the second orientation label of the label co-occurrence matrix can be constructed according to the dialogue label corresponding to each round of dialogue sentences, and the matrix element values corresponding to the first orientation label and the second orientation label in the label co-occurrence matrix can be generated according to the number of label co-occurrences corresponding to the dialogue label combination.
[0131] Accordingly, a label co-occurrence matrix is generated according to the label co-occurrence times corresponding to each dialogue label combination, including: constructing a dialogue label sequence according to the dialogue labels corresponding to each dialogue sentence, wherein the dialogue label sequence includes N different dialogue labels arranged according to the dialogue rounds; constructing N first orientation labels and N second orientation labels of the label co-occurrence matrix according to the N different dialogue labels included in the dialogue label sequence, wherein the first orientation label is used to indicate the dialogue label corresponding to the dialogue sentence of the first dialogue round, and the second orientation label is used to indicate the dialogue label corresponding to the dialogue sentence of the second dialogue round, and the first dialogue round is earlier than the second dialogue round; for each dialogue label combination, matching the first dialogue label in the dialogue label combination with the N first orientation labels respectively to obtain a first matching orientation label matching the first dialogue label; matching the second dialogue label in the dialogue label combination with the N second orientation labels respectively to obtain a second matching orientation label matching the second dialogue label; and generating matrix element values corresponding to the first matching orientation label and the second matching orientation label in the label co-occurrence matrix according to the label co-occurrence times corresponding to each dialogue label combination.
[0132] Among them, the dialogue label sequence includes different dialogue labels arranged according to the dialogue rounds. For example, assuming that the dialogue labels corresponding to multiple dialogue sentences are: 'say hello', 'say hello', 'introduce discount information', 'invite to the store', 'invite to the store', then the dialogue label sequence is {'say hello', 'introduce discount information', 'invite to the store'}.
[0133] The first orientation label and the second orientation label are row labels or column labels of the label co-occurrence matrix. When the first orientation label is a row label, the second orientation label is a column label. When the first orientation label is a column label, the second orientation label is a row label.
[0134] Among them, the first position label is used to indicate the dialogue label corresponding to the dialogue sentence of the first dialogue round, and the second position label is used to indicate the dialogue label corresponding to the dialogue sentence of the second dialogue round. The first dialogue round is earlier than the second dialogue round. That is, the first position label is used to represent the previous dialogue flow, and the second position label is used to represent the subsequent dialogue flow.
[0135] It should be noted that the first orientation label and the second orientation label need to be constructed according to different dialogue labels included in the dialogue label sequence. When the dialogue label sequence includes N different dialogue labels, the number of the first orientation label and the second orientation label is also N, where N is greater than 1.
[0136] Exemplarily, when the conversation tag sequence is {'say hello', 'introduce discount information', 'invite to the store'}, the tag co-occurrence matrix contains 3 first-direction tags and 3 second-direction tags, and the tag content is: 'say hello', 'introduce discount information', 'invite to the store'.
[0137] Accordingly, since the first position label is used to indicate the dialogue label corresponding to the dialogue sentence of the first dialogue round, and the second position label is used to indicate the dialogue label corresponding to the dialogue sentence of the second dialogue round, for each dialogue label combination, it is necessary to match the first dialogue label contained in the dialogue label combination with the first position label of the label co-occurrence matrix, and match the second dialogue label combination with the second position label of the label co-occurrence matrix, so as to obtain the first matching position label matching the first dialogue label and the second matching position label matching the second dialogue label.
[0138] Finally, according to the number of label co-occurrences corresponding to the dialogue label combination, the matrix element values corresponding to the first matching position label and the second matching position label are generated.
[0139] It should be noted that corresponding matching thresholds may be set for the first dialogue tag and the second dialogue tag, so that the first matching orientation tag matching the first dialogue tag and the second matching orientation tag matching the second dialogue tag are screened out according to the matching thresholds.
[0140] It should also be noted that, in the initial state, the values of each matrix element in the tag co-occurrence matrix can be set to a default value, such as 0, and then the matrix element values corresponding to the first matching orientation label and the second matching orientation label in the tag co-occurrence matrix that match each dialogue tag combination are adjusted according to the number of tag co-occurrences corresponding to the combination.
[0141] Furthermore, when generating matrix element values corresponding to the first matching orientation label and the second matching orientation label in the label co-occurrence matrix, the number of label co-occurrences may be directly used as the matrix element value, or the corresponding matrix element value may be generated based on the combined weight value corresponding to the dialogue label combination and the number of label co-occurrences. This embodiment of the present application does not impose any restrictions on this.
[0142] Exemplarily, assume that there are dialogue tag combinations and their tag co-occurrence times are: Combination 1 <Has the house been delivered, Has the house been delivered> 5 times, Combination 2 <Has the house been delivered, Company introduction> 2 times, Combination 3 <Has the house been delivered, Invite to the store> 2 times, Combination 4 <Company introduction, Company introduction> 24 times, Combination 5 <Company introduction, Invite to the store> 5 times, Combination 6 <Invite to the store, Company introduction> 2 times, Combination 7 <Invite to the store, Invite to the store> 41 times.
[0143] When generating the tag co-occurrence matrix, the first-position tags (whether the house has been delivered, company introduction, invitation to the store) are used as the row tags of the matrix, the second-position tags (whether the house has been delivered, company introduction, invitation to the store) are used as the column tags of the matrix, and the tag co-occurrence times are directly used as the matrix element values. Accordingly, the tag co-occurrence matrix generated according to the above conversation tag combination and its tag co-occurrence times can be:
[0144]
[0145] Among them, since the dialogue tag combination constructed based on the dialogue tags corresponding to the adjacent dialogue sentences does not contain the combination <company introduction, has the room been delivered> and <invite to the store, has the room been delivered>, the corresponding matrix co-occurrence count is 0. Accordingly, the corresponding matrix element value in the tag co-occurrence matrix can be set to 0.
[0146] In an optional implementation, in order to improve the content accuracy of the dialogue flow chart, a dialogue flow chart corresponding to the target dialogue data is generated according to a tag co-occurrence matrix, including: generating process nodes corresponding to different dialogue tags in the dialogue flow chart according to different dialogue tags included in the dialogue tag sequence; for each first orientation tag in the tag co-occurrence matrix, comparing the matrix element values corresponding to the first orientation tag and each second orientation tag with a preset threshold value, and determining a second associated orientation tag having an associated relationship with the first orientation tag according to the comparison result; for each first orientation tag, generating a connecting line in the dialogue flow chart from the process node corresponding to the first orientation tag to the process node corresponding to the second associated orientation tag, and generating a weight value corresponding to the connecting line in the dialogue flow chart according to the matrix element values corresponding to the first orientation tag and the second associated orientation tag.
[0147] For each dialogue tag included in the dialogue tag sequence, a corresponding process node is generated for it. Therefore, for each first position tag and second position tag, there is a corresponding process node in the dialogue flow chart.
[0148] Accordingly, since there are a large number of dialogue tag combinations, in order to only display critical interaction processes in the dialogue flow chart, the matrix element values can be filtered by a preset threshold.
[0149] The specific value of the preset threshold value can be adaptively set according to actual needs, and the embodiment of the present application does not limit this. Thus, according to the comparison result, if the matrix element value is greater than the preset threshold value, the second orientation label corresponding to the matrix element value is determined as a second associated orientation label having an associated relationship with the first orientation label corresponding to the matrix element value.
[0150] Correspondingly, for each first position label, a connection line is generated in the dialog flow chart from the process node corresponding to the first position label to the process node corresponding to the second associated position label, and a weight value corresponding to the connection line is generated according to the matrix element value.
[0151] Among them, the weight value corresponding to the connecting line is used to characterize the process importance of the process corresponding to the connecting line. The matrix element value can be directly used as the weight value corresponding to the connecting line, or the weight value corresponding to the connecting line can be adaptively generated according to the matrix element value. The embodiment of the present application does not limit this.
[0152] For example, for the tag co-occurrence matrix mentioned above, the generated dialogue flow chart is as follows: Figure 2 shown.
[0153] Among them, the dialogue flow chart contains process nodes such as whether the house has been delivered, company introduction, and invitation to the store.
[0154] Assume that the preset threshold is set to 1, so that in the dialog flow chart, only the corresponding connection lines are generated for the matrix element values exceeding the preset threshold, and accordingly, the matrix element values are directly used as the weight values corresponding to the connection lines.
[0155] Furthermore, since there are two matrix element values corresponding to the same label in the matrix, a corresponding connection line pointing from the own process node to the own process node can be generated in the dialog flow chart, or Figure 2 As shown, the above connection relationship is not shown in the dialogue flow chart, and only connection lines between different process nodes are generated in the dialogue flow chart. This embodiment of the present application does not limit this.
[0156] In an embodiment of the present application, corresponding process nodes are constructed for dialogue tags, and matrix element values in the tag co-occurrence matrix are screened according to a preset threshold value, so as to determine the second associated orientation tag that has an associated relationship with the first orientation tag. Finally, corresponding connecting lines are generated only for the process nodes corresponding to the first orientation tag and the second associated orientation tag, so that the generated dialogue flow chart only contains important processes between different process nodes, and by generating weight values corresponding to the connecting lines according to the matrix element values, the importance of each process can be further reflected, thereby improving the content validity and accuracy of the dialogue flow chart.
[0157] In an optional implementation, when there are a large number of dialogue tags, in order to make the layout of each process node in the dialogue flow chart more standardized, the node layout of the process node corresponding to the dialogue tag can be determined based on the first-level dialogue tag of the first-level tag hierarchy corresponding to each dialogue tag.
[0158] Correspondingly, different label levels correspond to different level dialogue tags, and the level dialogue tag corresponding to the label level at the lower level is a sub-tag of the level dialogue tag corresponding to the label level at the upper level. Then, according to the different dialogue tags included in the dialogue tag sequence, generating process nodes corresponding to different dialogue tags in the dialogue flow chart includes: determining that each dialogue tag corresponds to a first-level dialogue tag of the first-level label level according to the level dialogue tags corresponding to different label levels; determining the node layout of process nodes corresponding to multiple different dialogue tags according to the first-level dialogue tags corresponding to multiple different dialogue tags; and generating process nodes corresponding to multiple different dialogue tags in the dialogue flow chart according to the node layout.
[0159] Among them, the tag levels from top to bottom are the first tag level, the second tag level, the third tag level, etc. Moreover, the level dialogue tag corresponding to the tag level at the lower level is a subtag of the level dialogue tag corresponding to the tag level at the upper level. For example, the level dialogue tag corresponding to the second tag level is a subtag of the level dialogue tag corresponding to the first tag level, and the level dialogue tag corresponding to the third tag level is a subtag of the level dialogue tag corresponding to the second tag level.
[0160] Accordingly, for each dialogue tag, it can be determined that the dialogue tag corresponds to the first-level dialogue tag of the first-level tag level. Since the first-level dialogue tag is the overall process link tag, by determining the first-level dialogue tag corresponding to each dialogue tag, the process link to which the process node corresponding to the dialogue tag belongs can be determined.
[0161] In an optional implementation, in order to further improve the layout standardization of process nodes, the node layout of process nodes corresponding to multiple different dialogue tags is determined based on the first-level dialogue tags corresponding to the multiple different dialogue tags, including: arranging the process nodes corresponding to multiple different dialogue tags corresponding to the same first-level dialogue tag according to the first node layout, and arranging the process nodes corresponding to multiple different dialogue tags corresponding to different first-level dialogue tags according to the second node layout.
[0162] The first node layout and the second node layout correspond to different layout directions. For example, when the first node layout is an up-down layout, the second node layout is a left-right layout, so that different process nodes can be arranged in a standardized manner.
[0163] For example, for the dialogue tags 'Has the house been delivered' and 'Has it been renovated', the corresponding first-level dialogue tags are 'Collect user information'. Therefore, the process nodes corresponding to 'Has the house been delivered' and 'Has it been renovated' need to be arranged according to the first node layout, such as arranged in an up-down layout.
[0164] For the dialogue tags 'Has the house been delivered' and 'Introduction to discount information', the corresponding first-level dialogue tags are 'Collect user information' and 'Introduction to discount activities'. Therefore, the process nodes corresponding to 'Has the house been delivered' and 'Introduction to discount information' need to be arranged according to the second node layout, such as arranging in a left-right layout.
[0165] Furthermore, since different first-level dialogue tags represent different dialogue links, the node area where the process node corresponding to the dialogue tag is located can be determined according to the dialogue link corresponding to the first-level dialogue tag.
[0166] For example, when the first-level dialogue tag represents the start dialogue link, it is determined that the process node corresponding to the dialogue tag is located in the start node area. When the first-level dialogue tag represents the middle dialogue link, it is determined that the process node corresponding to the dialogue tag is located in the middle node area. When the first-level dialogue tag represents the end dialogue link, it is determined that the process node corresponding to the dialogue tag is located in the end node area.
[0167] In an embodiment of the present application, the node layout of the process nodes of the dialogue tags is determined by the first-level dialogue tags of the first tag level corresponding to different dialogue tags, so that the process nodes are generated according to the node layout, so that the generated process nodes can be distributed in an orderly manner, thereby improving the generation standardization of the process nodes.
[0168] For ease of understanding, the following is a specific example to describe the specific implementation details of the above solution:
[0169] In the telemarketing business scenario, a large number of agents communicate with customers through the words they have learned through training. However, in actual situations, the training words are difficult to deal with unexpected answers and counter-questions from customers. Agents will answer based on experience, resulting in multiple branches outside the original SOP (Standard Operating Procedure) process.
[0170] Generating a dialogue flow chart corresponding to the conversation helps to gain a panoramic understanding of the marketing process and discover excellent speech techniques. However, manual generation of dialogue flow charts often includes dialogue annotation, process combing and other links, which is not only costly but also inefficient. Traditional SOP processes are often designed based on idealized scenarios, and the actual situation is complex and changeable, making it difficult to use as a reference.
[0171] In view of this, this example provides a method for generating a dialogue flow chart to achieve comprehensive and automatic generation of dialogue flow charts. Figure 3 , the method comprising:
[0172] Step S301: Based on a preset model, extract the dialogue intention corresponding to each round of dialogue sentences in the target dialogue data, and generate multiple initial dialogue tags corresponding to multiple rounds of dialogue sentences.
[0173] The target conversation data may be conversation data of the call object, such as historical conversation data between a customer and an agent in an outbound telemarketing call scenario.
[0174] In the case where the target conversation data has a large amount of data, the target conversation data can be sampled at a certain ratio (for example, 30%), and then the sampled conversation sentences of each round are input into the preset model one by one. Thus, the preset model automatically performs initial dialogue labels on each round of conversation data, and the initial dialogue labels of the customer sentences and the agent sentences in each round of conversation sentences are usually consistent.
[0175] That is, at this time, the initial dialogue tags corresponding to the multiple rounds of dialogue sentences are defined by the preset model, such as greeting, company introduction, promotional activities, event information, information collection, whether to decorate, add user phone number, add user, add WeChat and invite to the store, etc.
[0176] Step S302: dividing the multiple initial conversation tags into tag hierarchies according to a preset tag hierarchy structure to obtain hierarchical conversation tags corresponding to the multiple tag hierarchies.
[0177] For all the initial dialogue tags output by the preset model, further fusion processing such as deduplication and merging can be performed. For example, "add WeChat" and "add user WeChat" can be merged into "add user WeChat" to obtain the processed dialogue tag. And for each processed dialogue tag, the number of tags of the corresponding initial dialogue tag, that is, the tag frequency, is counted respectively. Then it is used as the input of the preset model, and the preset model sorts and integrates the processed dialogue tags according to the preset tag hierarchy structure (such as: two-layer tags), so that the preset model outputs the tag structure system after the processing dialogue tags are divided, and the hierarchical dialogue tags corresponding to multiple tag hierarchies are obtained.
[0178] Step S303: Input each round of dialogue sentences in the target dialogue data and the hierarchical dialogue tags corresponding to multiple tag levels into the preset model, so that the preset model generates dialogue tags corresponding to each round of dialogue sentences according to the hierarchical dialogue tags corresponding to the multiple tag levels.
[0179] In this step, by reading the target conversation data, such as each round of conversation sentences in the historical conversation data of outbound telemarketing calls, they are input into the preset model one by one, so that the preset model can combine the obtained label structure system, that is, the hierarchical conversation labels corresponding to multiple label levels, to automatically re-label each round of conversation sentences and obtain the conversation labels for each round of conversation sentences.
[0180] Step S304: construct dialogue tag combinations according to dialogue tags corresponding to dialogue sentences in adjacent rounds, and obtain multiple dialogue tag combinations corresponding to the target dialogue data.
[0181] Step S305: Count the number of times the tags co-occur for each dialogue tag combination, and construct a dialogue tag sequence based on the dialogue tags corresponding to each dialogue sentence.
[0182] Based on the dialogue labels of each round of dialogue sentences, according to each dialogue contained in the target dialogue data, the co-occurrence of the dialogue sentence labels of the previous round and the dialogue sentence labels of the current round is counted round by round, so as to obtain the label co-occurrence count corresponding to each dialogue label combination. The label co-occurrence count is used to indicate the number of times two labels appear simultaneously in adjacent dialogue sentences.
[0183] Step S306: constructing N first orientation tags and N second orientation tags of a tag co-occurrence matrix according to the N different dialog tags included in the dialog tag sequence.
[0184] Step S307: For each dialogue tag combination, the first dialogue tag in the dialogue tag combination is matched with the N first orientation tags respectively to obtain a first matching orientation tag that matches the first dialogue tag; the second dialogue tag in the dialogue tag combination is matched with the N second orientation tags respectively to obtain a second matching orientation tag that matches the second dialogue tag.
[0185] Step S308: Generate matrix element values corresponding to the first matching orientation label and the second matching orientation label in the label co-occurrence matrix according to the label co-occurrence counts corresponding to each dialog label combination.
[0186] Among them, the first orientation label and the second orientation label of the label co-occurrence matrix are respectively used to indicate the dialogue labels corresponding to the dialogue sentences of the first dialogue round and the dialogue sentences of the second dialogue round. The first dialogue round is earlier than the second dialogue round. Therefore, the first orientation label and the second orientation label are respectively used to characterize the previous dialogue process and the subsequent dialogue process, and the matrix element values in the matrix are determined according to the number of label co-occurrences, which are used to reveal the correlation between the dialogue processes corresponding to different labels, and provide data support for automatically constructing flowcharts.
[0187] Step S309: Generate a dialog flow chart corresponding to the target dialog data according to the tag co-occurrence matrix.
[0188] In this step, you can use code scripts to generate corresponding process nodes for different conversation tags, and add connecting lines and corresponding weight values between different process nodes according to the matrix element values in the tag co-occurrence matrix, thereby generating a directed graph layout, that is, automatically constructing a conversation flow chart corresponding to the target conversation data, such as a conversation flow chart for outbound telemarketing conversations, so as to clearly display the process direction and key nodes of each link from customer contact, company introduction to successful conversion or rejection.
[0189] For ease of understanding, Figure 4 A schematic diagram showing the generated tag co-occurrence matrix, Figure 5 Shown according to Figure 4 Schematic diagram of the dialogue flow chart generated by the tag co-occurrence matrix, refer to Figure 4 , Figure 5 ,in, Figure 4 The row labels of the label co-occurrence matrix are first-position labels, which are used to characterize the previous dialogue process. The column labels are second-position labels, which are used to characterize the subsequent dialogue process. The first-position labels and the second-position labels are specifically: 'Has the house been delivered', 'Company introduction', 'Invite to the store', 'Conclusion', 'Introduction to preferential information', 'Ask when to decorate', 'Ask user preferences', 'Add user phone number', 'Ask if it is the first house', 'Has it been decorated', 'Event time and address', 'Request to add WeChat', 'Provide design cases', 'Ask about the location of the house', 'Ask about the delivery time', and 'Ask about the user's budget'.
[0190] Correspondingly, for the above position labels, Figure 5 There are process nodes corresponding to the above-mentioned location labels in the dialogue flow chart. Figure 4 The matrix element value of the label co-occurrence matrix in can be generated Figure 5 The connecting lines between corresponding process nodes in the dialogue flow chart and the weight values corresponding to the connecting lines.
[0191] For example, for the matrix element value 5 corresponding to company introduction and invitation to store, a connection line is generated from the company introduction process node to the invitation to store process node in the dialogue flow chart, and the weight value corresponding to the connection line is 5. For the matrix element value 6 corresponding to invitation to store and closing remarks, a connection line is generated from the invitation to store process node to the closing remarks process node in the dialogue flow chart, and the weight value corresponding to the connection line is 6. For the matrix element value 2 corresponding to asking whether it is the first set and asking about user preferences, a connection line is generated from the asking whether it is the first set process node to the asking about user preferences process node in the dialogue flow chart, and the weight value corresponding to the connection line is 2.
[0192] Furthermore, the node area where the process node corresponding to the dialogue tag in the dialogue flow chart is located is determined according to the first-level dialogue tag of the first-level tag level corresponding to it.
[0193] For example, Figure 5 The text in the dotted area is the first-level dialogue label, and different first-level dialogue labels have corresponding areas. Therefore, for any process node, the process node is set to the area corresponding to the first-level dialogue label. For example, the 'Introduction to Discount Information' process node and the 'Activity Time and Address' process node are both distributed in the area corresponding to the first-level dialogue label 'Introduction to Discount Activities'.
[0194] In addition, for the automatically constructed flowchart, combined with its intuitive display of processes and results, business experts can also make visual adjustments to the automatically constructed flowchart, thereby exploring and optimizing telemarketing strategies. For example, they can adjust the connecting lines between different process nodes, or adjust the display size of the weight values corresponding to the connecting lines, highlight key process nodes, etc.
[0195] In the embodiments of the present application, on the one hand, by automatically analyzing the target dialogue data, a large amount of manpower input in manually combing the SOP process is reduced, thereby greatly reducing costs, significantly improving analysis efficiency, and ensuring the comprehensiveness and accuracy of the analysis results. On the other hand, through the analysis of actual dialogue data, the difference between the SOP process and the actual situation can be found, providing data support for optimizing the SOP process. At the same time, through the generated dialogue flow chart, the seat staff can understand the entire dialogue process more intuitively and improve their ability to respond to unexpected answers and questions from customers.
[0196] It can be understood that the above-mentioned various method embodiments mentioned in this application can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, this application will not go into details. Those skilled in the art can understand that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined by its function and possible internal logic.
[0197] In addition, the present application also provides a device for generating a dialog flow chart, an electronic device, and a computer-readable storage medium, all of which can be used to implement any method for generating a dialog flow chart provided in the present application. The corresponding technical solutions and descriptions are referred to in the corresponding records of the method part and will not be repeated here.
[0198] Figure 6 A block diagram of a device for generating a dialog flow chart provided in an embodiment of the present application.
[0199] Reference Figure 6 , the embodiment of the present application provides a device for generating a dialog flow chart, and the device 60 for generating a dialog flow chart includes:
[0200] A label extraction module 61 is used to extract labels from each round of dialogue sentences in the target dialogue data and generate dialogue labels corresponding to each round of dialogue sentences;
[0201] A combination construction module 62, configured to construct a dialogue tag combination according to dialogue tags corresponding to adjacent dialogue sentences, to obtain a plurality of dialogue tag combinations corresponding to the target dialogue data;
[0202] A matrix generation module 63, used to count the number of tag co-occurrences corresponding to each dialog tag combination, and generate a tag co-occurrence matrix according to the number of tag co-occurrences corresponding to each dialog tag combination;
[0203] The flow chart generating module 64 is used to generate a dialogue flow chart corresponding to the target dialogue data according to the tag co-occurrence matrix.
[0204] In an optional implementation, extracting labels from each round of dialogue sentences in the target dialogue data to generate dialogue labels corresponding to each round of dialogue sentences includes:
[0205] Based on the preset model, the conversation intent corresponding to each round of conversation sentences is extracted, and multiple initial conversation tags corresponding to multiple rounds of conversation sentences are generated;
[0206] Dividing the multiple initial conversation tags into tag levels according to a preset tag level structure to obtain hierarchical conversation tags corresponding to multiple tag levels;
[0207] Each round of dialogue sentences in the target dialogue data and the hierarchical dialogue tags corresponding to the multiple tag levels are input into the preset model, so that the preset model generates the dialogue tags corresponding to each round of dialogue sentences according to the hierarchical dialogue tags corresponding to the multiple tag levels.
[0208] In an optional implementation, dividing the multiple initial dialogue tags into tag hierarchies according to a preset tag hierarchy structure to obtain hierarchical dialogue tags corresponding to multiple tag hierarchies includes:
[0209] fusing the initial dialogue tags with similar semantics among the multiple initial dialogue tags to obtain multiple processed dialogue tags;
[0210] For each processing dialogue tag, determining the tag frequency of the processing dialogue tag according to the tag quantity of the initial dialogue tag corresponding to the processing dialogue tag;
[0211] According to the tag frequency corresponding to each of the multiple processing dialogue tags and the preset tag hierarchy structure, the multiple processing dialogue tags are hierarchically divided to obtain hierarchical dialogue tags corresponding to the multiple tag hierarchies;
[0212] Among them, the preset tag hierarchy structure includes: multiple tag levels, each tag level is used to characterize the tag granularity of the hierarchical dialogue tags, and the tag granularity of the hierarchical dialogue tags corresponding to the tag level at the lower level is greater than the tag granularity of the hierarchical dialogue tags corresponding to the tag level at the upper level.
[0213] In an optional implementation, the adjacent-turn dialogue sentences used to construct each dialogue tag combination include: a first dialogue sentence and a second dialogue sentence, wherein the dialogue turn of the first dialogue sentence is earlier than that of the second dialogue sentence; and each dialogue tag combination includes: a first dialogue tag corresponding to the first dialogue sentence, and a second dialogue tag corresponding to the second dialogue sentence; then the counting of the number of tag co-occurrences corresponding to each dialogue tag combination includes:
[0214] Matching the dialogue tag corresponding to the i-th dialogue statement with the first dialogue tag included in each dialogue tag combination to obtain a first matching result;
[0215] Matching the dialogue tag corresponding to the (i+1)th round of dialogue statement with the second dialogue tag included in each dialogue tag combination to obtain a second matching result;
[0216] The conversation tag combination whose first matching result and the second matching result satisfy the preset matching condition is determined as the target conversation tag combination, and the tag co-occurrence number corresponding to the target conversation tag combination is adjusted so that the tag co-occurrence number corresponding to the target conversation tag combination increases, where i is a natural number.
[0217] In an optional implementation, generating a tag co-occurrence matrix according to the tag co-occurrence counts corresponding to each dialog tag combination includes:
[0218] Constructing a dialogue tag sequence according to the dialogue tags corresponding to each dialogue sentence, wherein the dialogue tag sequence includes N different dialogue tags arranged according to the dialogue rounds;
[0219] According to the N different dialogue tags included in the dialogue tag sequence, constructing N first orientation tags and N second orientation tags of the tag co-occurrence matrix, wherein the first orientation tag is used to indicate the dialogue tag corresponding to the dialogue sentence of the first dialogue round, and the second orientation tag is used to indicate the dialogue tag corresponding to the dialogue sentence of the second dialogue round, and the first dialogue round is earlier than the second dialogue round;
[0220] For each dialogue tag combination, a first dialogue tag in the dialogue tag combination is matched with the N first position tags respectively to obtain a first matching position tag matching the first dialogue tag; a second dialogue tag in the dialogue tag combination is matched with the N second position tags respectively to obtain a second matching position tag matching the second dialogue tag;
[0221] According to the number of tag co-occurrences corresponding to each dialog tag combination, matrix element values corresponding to the first matching orientation tag and the second matching orientation tag in the tag co-occurrence matrix are generated.
[0222] In an optional implementation, generating a dialog flow chart corresponding to the target dialog data according to the tag co-occurrence matrix includes:
[0223] According to different dialogue tags included in the dialogue tag sequence, generating process nodes corresponding to the different dialogue tags in the dialogue flow chart;
[0224] For each first orientation tag in the tag co-occurrence matrix, respectively compare the matrix element values corresponding to the first orientation tag and each second orientation tag with a preset threshold, and determine a second associated orientation tag having an associated relationship with the first orientation tag according to the comparison result;
[0225] For each of the first orientation labels, a connecting line is generated in the dialog flow chart from the process node corresponding to the first orientation label to the process node corresponding to the second associated orientation label, and a weight value corresponding to the connecting line in the dialog flow chart is generated according to the matrix element values corresponding to the first orientation label and the second associated orientation label.
[0226] In an optional implementation, different tag levels correspond to different level dialogue tags, and the level dialogue tag corresponding to the tag level at the lower level is a subtag of the level dialogue tag corresponding to the tag level at the upper level, then generating, according to the different dialogue tags included in the dialogue tag sequence, the process nodes corresponding to the different dialogue tags in the dialogue flow chart includes:
[0227] According to the hierarchical dialogue tags corresponding to different tag levels, determining that each dialogue tag corresponds to a first-level dialogue tag of the first-level tag level;
[0228] Determining, according to the first-level dialog tags corresponding to the multiple different dialog tags, a node layout of the process nodes corresponding to the multiple different dialog tags;
[0229] According to the node layout, process nodes corresponding to the multiple different dialogue tags in the dialogue flow chart are generated.
[0230] Each module in the above-mentioned device for generating a dialog flow chart can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0231] Figure 7 A block diagram of an electronic device provided in an embodiment of the present application.
[0232] Reference Figure 7 An embodiment of the present application provides an electronic device 700, which includes: at least one processor 701; at least one memory 702, and one or more I / O interfaces 703, connected between the processor 701 and the memory 702; wherein the memory 702 stores one or more computer programs that can be executed by at least one processor 701, and the one or more computer programs are executed by at least one processor 701 so that at least one processor 701 can execute the above-mentioned method for generating a dialog flow chart.
[0233] Each module in the above electronic device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0234] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above-mentioned method for generating a dialog flow chart when executed by a processor / processing core. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0235] An embodiment of the present application also provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned method for generating a dialog flow chart.
[0236] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).
[0237] As is known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0238] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0239] The computer program instructions for performing the operation of the present application can be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions can be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of a computer-readable program instruction to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA), the electronic circuit can execute a computer-readable program instruction, thereby realizing various aspects of the present application.
[0240] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0241] Various aspects of the present application are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0242] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0243] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0244] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the function involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a dedicated hardware-based system that performs the function or action of the specification, or can be realized by a combination of special-purpose hardware and computer instructions.
[0245] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present application as set forth in the appended claims.
Claims
1. A method for generating a dialogue flow chart, characterized in that: The method comprises: Extracting labels for each round of dialogue sentences in the target dialogue data, and generating dialogue labels corresponding to each round of dialogue sentences; Constructing a dialogue tag combination according to dialogue tags corresponding to dialogue sentences of adjacent rounds to obtain a plurality of dialogue tag combinations corresponding to the target dialogue data; Counting the number of times the tags co-occur corresponding to each dialog tag combination, and generating a tag co-occurrence matrix according to the number of times the tags co-occur corresponding to each dialog tag combination; A conversation flow chart corresponding to the target conversation data is generated according to the tag co-occurrence matrix.
2. The method according to claim 1, characterized in that The step of extracting labels from each round of dialogue sentences in the target dialogue data and generating dialogue labels corresponding to each round of dialogue sentences includes: Based on the preset model, the conversation intent corresponding to each round of conversation sentences is extracted, and multiple initial conversation tags corresponding to multiple rounds of conversation sentences are generated; Dividing the multiple initial conversation tags into tag levels according to a preset tag level structure to obtain hierarchical conversation tags corresponding to multiple tag levels; Each round of dialogue sentences in the target dialogue data and the hierarchical dialogue tags corresponding to the multiple tag levels are input into the preset model, so that the preset model generates the dialogue tags corresponding to each round of dialogue sentences according to the hierarchical dialogue tags corresponding to the multiple tag levels.
3. The method according to claim 2, characterized in that The step of dividing the multiple initial dialogue tags into tag hierarchies according to a preset tag hierarchical structure to obtain hierarchical dialogue tags corresponding to multiple tag hierarchies includes: fusing the initial dialogue tags with similar semantics among the multiple initial dialogue tags to obtain multiple processed dialogue tags; For each processing dialogue tag, determining the tag frequency of the processing dialogue tag according to the tag quantity of the initial dialogue tag corresponding to the processing dialogue tag; According to the tag frequency corresponding to each of the multiple processing dialogue tags and the preset tag hierarchy structure, the multiple processing dialogue tags are hierarchically divided to obtain hierarchical dialogue tags corresponding to the multiple tag hierarchies; Among them, the preset tag hierarchy structure includes: multiple tag levels, each tag level is used to characterize the tag granularity of the hierarchical dialogue tags, and the tag granularity of the hierarchical dialogue tags corresponding to the tag level at the lower level is greater than the tag granularity of the hierarchical dialogue tags corresponding to the tag level at the upper level.
4. The method according to claim 1, characterized in that: The adjacent dialogue statements for constructing each dialogue label combination include: a first dialogue statement and a second dialogue statement, wherein the dialogue turn of the first dialogue statement is earlier than that of the second dialogue statement; and each dialogue label combination includes: a first dialogue label corresponding to the first dialogue statement, and a second dialogue label corresponding to the second dialogue statement; then the counting of the number of label co-occurrences corresponding to each dialogue label combination includes: Matching the dialogue tag corresponding to the i-th round of dialogue statement with the first dialogue tag included in each dialogue tag combination to obtain a first matching result; Matching the dialogue tag corresponding to the (i+1)th round of dialogue statement with the second dialogue tag included in each dialogue tag combination to obtain a second matching result; The conversation tag combination whose first matching result and the second matching result satisfy the preset matching condition is determined as the target conversation tag combination, and the tag co-occurrence number corresponding to the target conversation tag combination is adjusted so that the tag co-occurrence number corresponding to the target conversation tag combination increases, where i is a natural number.
5. The method according to claim 4, characterized in that Generating a tag co-occurrence matrix according to the tag co-occurrence counts corresponding to each dialog tag combination includes: Constructing a dialogue tag sequence according to the dialogue tags corresponding to each dialogue sentence, wherein the dialogue tag sequence includes N different dialogue tags arranged according to the dialogue rounds; According to the N different dialogue tags included in the dialogue tag sequence, constructing N first orientation tags and N second orientation tags of the tag co-occurrence matrix, wherein the first orientation tag is used to indicate the dialogue tag corresponding to the dialogue sentence of the first dialogue round, and the second orientation tag is used to indicate the dialogue tag corresponding to the dialogue sentence of the second dialogue round, and the first dialogue round is earlier than the second dialogue round; For each dialogue tag combination, a first dialogue tag in the dialogue tag combination is matched with the N first position tags respectively to obtain a first matching position tag matching the first dialogue tag; a second dialogue tag in the dialogue tag combination is matched with the N second position tags respectively to obtain a second matching position tag matching the second dialogue tag; According to the number of tag co-occurrences corresponding to each dialog tag combination, matrix element values corresponding to the first matching orientation tag and the second matching orientation tag in the tag co-occurrence matrix are generated.
6. The method according to claim 5, characterized in that The step of generating a dialog flow chart corresponding to the target dialog data according to the tag co-occurrence matrix includes: According to different dialogue tags included in the dialogue tag sequence, generating process nodes corresponding to the different dialogue tags in the dialogue flow chart; For each first orientation tag in the tag co-occurrence matrix, respectively compare the matrix element values corresponding to the first orientation tag and each second orientation tag with a preset threshold, and determine a second associated orientation tag having an associated relationship with the first orientation tag according to the comparison result; For each of the first orientation labels, a connecting line is generated in the dialog flow chart from the process node corresponding to the first orientation label to the process node corresponding to the second associated orientation label, and a weight value corresponding to the connecting line in the dialog flow chart is generated according to the matrix element values corresponding to the first orientation label and the second associated orientation label.
7. The method according to claim 6, characterized in that Different tag levels correspond to different level dialogue tags, and the level dialogue tag corresponding to the tag level at the lower level is a subtag of the level dialogue tag corresponding to the tag level at the upper level, then generating the process nodes corresponding to the different dialogue tags in the dialogue flow chart according to the different dialogue tags included in the dialogue tag sequence includes: According to the hierarchical dialogue tags corresponding to different tag levels, determining that each dialogue tag corresponds to a first-level dialogue tag of the first-level tag level; Determining, according to the first-level dialog tags corresponding to the multiple different dialog tags, a node layout of the process nodes corresponding to the multiple different dialog tags; According to the node layout, process nodes corresponding to the multiple different dialogue tags in the dialogue flow chart are generated.
8. A device for generating a dialog flow chart, characterized in that: The device comprises: A label extraction module is used to extract labels from each round of dialogue sentences in the target dialogue data and generate dialogue labels corresponding to each round of dialogue sentences; A combination construction module, used to construct a dialogue label combination according to dialogue labels corresponding to adjacent rounds of dialogue sentences, to obtain multiple dialogue label combinations corresponding to the target dialogue data; A matrix generation module, used to count the number of tag co-occurrences corresponding to each dialogue tag combination, and generate a tag co-occurrence matrix according to the number of tag co-occurrences corresponding to each dialogue tag combination; A flow chart generation module is used to generate a dialogue flow chart corresponding to the target dialogue data according to the tag co-occurrence matrix.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor so that the at least one processor can execute the method for generating a dialog flow chart according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the method for generating a dialog flow chart according to any one of claims 1 to 7.