Talk skill expansion method and device, computer equipment and storage medium
Through the intention identification and keyword analysis of historical dialogue corpus, highly targeted reply corpus is generated, which solves the problem of insufficient business proficiency in insurance telesales by primary and intermediate agents, and improves customer satisfaction and sales efficiency.
Patent Information
- Application Number
- CN202411181439.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-12-17
AI Technical Summary
In insurance telemarketing, due to insufficient business proficiency, it is difficult to answer customers’ questions about insurance products quickly and accurately, resulting in increased call duration, reduced communication efficiency and decreased customer satisfaction.
By obtaining historical discourse corpus for intent recognition, extracting keywords, building keyword graphs, calculating keyword scores, and generating highly targeted replies corpus based on this information, improving the quality of the replies of the seat.
It significantly improves the pertinence and effectiveness of the seat's response, improves customer satisfaction and experience, reduces call time, and enhances customers' willingness to purchase products.
Smart Images

Figure CN119150847A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of artificial intelligence technology, and specifically relates to a speech expansion method, device, computer equipment and storage medium. Background Art
[0002] In the daily work of insurance telephone sales, agents rely on the I TS operating system to establish contact with potential customers and carry out business activities such as insurance sales and renewal. This process is to effectively answer customers' questions and is a key link in building trust and facilitating transactions.
[0003] However, for junior and mid-level agents, their business proficiency and experience accumulation are relatively insufficient, which directly affects the effectiveness of communication with customers. Specifically, when customers raise questions about insurance products, junior and mid-level agents often find it difficult to give quick and accurate answers because they are not familiar with the business details. Junior and mid-level agents may need to spend extra time to look up information or seek help from senior colleagues, which undoubtedly increases the length of the call and reduces communication efficiency. In addition, when answering customer questions, junior and mid-level agents may not be fluent in language organization and lack information due to their lack of in-depth understanding of the business, which will make customers feel that the answers are unconvincing. If the agent appears hesitant or ambiguous when answering customer questions, it will not only make customers dissatisfied, but may also cause customers' doubts and concerns, which in turn affects customers' willingness to purchase products. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose a method, device, computer equipment and storage medium for expanding speech, so as to greatly improve the pertinence and effectiveness of agent replies and significantly improve user satisfaction and experience.
[0005] In order to solve the above technical problems, the present application embodiment provides a method for expanding speech, which adopts the following technical solution:
[0006] A method for expanding speech techniques, the method for expanding speech techniques is applied to speech techniques recommendation, and the method for expanding speech techniques includes:
[0007] Acquire historical dialogue data, perform intent recognition on the historical dialogue data, and obtain intent recognition results;
[0008] Determine the target dialogue corpus in the historical dialogue corpus based on the intention recognition result;
[0009] Extract the keywords of the target dialogue corpus and calculate the keyword frequency of the target dialogue corpus;
[0010] Construct a keyword graph based on the keywords of the target dialogue corpus, wherein the keyword graph includes nodes and edges, the nodes represent keywords, and the edges represent the co-occurrence relationship between keywords;
[0011] Calculate the keyword score based on the keyword graph and the keyword frequency of the target dialogue corpus;
[0012] Generate target reply corpus based on keyword scores and preset speech generation template, and output the target reply corpus.
[0013] Furthermore, the step of constructing a keyword graph based on the keywords of the target dialogue corpus specifically includes:
[0014] Configure the text sliding window;
[0015] Use the text sliding window to slide the historical conversation corpus to implement the corpus segmentation operation and obtain several segmented corpora;
[0016] Identify the co-occurrence relationship between keywords in each segmented corpus, and construct a keyword subgraph based on the co-occurrence relationship between keywords in each segmented corpus;
[0017] The keyword sub-graphs are combined to obtain a keyword graph.
[0018] Further, the step of calculating the keyword score based on the preset PageRank algorithm and the keyword frequency of the keyword graph and the target dialogue corpus specifically includes:
[0019] Initialize the PageRank value of each node in the keyword graph based on the keyword frequency of the target dialogue corpus;
[0020] Based on the PageRank algorithm, the PageRank value of each node in the keyword graph is iterated until the PageRank value of each node in the keyword graph converges;
[0021] Get the PageRank value of each node in the keyword graph and get the keyword score.
[0022] Furthermore, the step of initializing the PageRank value of each node in the keyword graph based on the keyword frequency specifically includes:
[0023] Calculate the keyword frequency of each segmented corpus;
[0024] Determine the initial PageRank value of each node in the keyword subgraph based on the keyword frequency of each segmented corpus and the keyword frequency of the target dialogue corpus;
[0025] Update the PageRank value of each node in the keyword subgraph to the initial PageRank value.
[0026] Furthermore, the step of initializing the PageRank value of each node in the keyword graph based on the keyword frequency specifically includes:
[0027] Determine the target segmented corpus and calculate the keyword frequency of the target segmented corpus, wherein the target segmented corpus is any one of the segmented corpora;
[0028] Determine a target keyword of the target segmented corpus, and calculate the keyword frequency of the target keyword, wherein the target keyword is any keyword in the target segmented corpus;
[0029] Determine the initial PageRank value of the node corresponding to the target keyword in the keyword subgraph based on the keyword frequency of the target keyword and the keyword frequency of the target segmented corpus;
[0030] Update the PageRank value of the target keyword node in the keyword subgraph to the initial PageRank value.
[0031] Furthermore, the PageRank value of each node in the keyword graph is iterated based on the following formula:
[0032]
[0033] Where V i is the i-th node in the keyword graph, V j The keyword V i The node adjacent to the node, d is the damping factor, S(V i ) is V j The PageRank value of the node, S(V j ) is V j The PageRank value of the node, L(V j ) is the keyword V j The number of links between a node and other nodes, In(V i ) is the keyword in the graph pointing to V i The link of the node, j∈In(V i ) is V j Node points to V i Links to nodes.
[0034] Furthermore, the step of combining the keyword subgraphs to obtain a keyword graph specifically includes:
[0035] Calculate the weight of each keyword subgraph based on the keyword frequency of each segmented corpus and the keyword frequency of the target dialogue corpus;
[0036] The keyword subgraphs are combined based on the weights of the respective keyword subgraphs to obtain a keyword graph.
[0037] In order to solve the above technical problems, the embodiment of the present application further provides a speech expansion device, which adopts the following technical solution:
[0038] A speech expansion device is used for speech recommendation, and the speech expansion device includes:
[0039] The intention recognition module is used to obtain historical dialogue data, perform intention recognition on the historical dialogue data, and obtain intention recognition results;
[0040] A target corpus module, used to determine the target dialogue corpus in the historical dialogue corpus based on the intention recognition result;
[0041] A keyword processing module is used to extract keywords from the target dialogue corpus and calculate the keyword frequency of the target dialogue corpus;
[0042] A keyword graph module is used to construct a keyword graph based on the keywords of the target dialogue corpus, wherein the keyword graph includes nodes and edges, where nodes represent keywords and edges represent co-occurrence relationships between keywords;
[0043] A score calculation module, used for calculating a keyword score based on the keyword graph and the keyword frequency of the target dialogue corpus;
[0044] The corpus generation module is used to generate the target reply corpus based on the keyword score and the preset speech generation template, and output the target reply corpus.
[0045] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0046] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the speech expansion method as described in any one of the above items are implemented.
[0047] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0048] A computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by a processor, implement the steps of the speech expansion method as described in any one of the above.
[0049] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0050] The present application discloses a method, device, computer equipment and storage medium for speech expansion, which are applied to speech recommendation. The present application obtains historical dialogue corpus and performs intent recognition on the historical dialogue corpus to obtain intent recognition results; determines the target dialogue corpus in the historical dialogue corpus based on the intent recognition results; extracts the keywords of the target dialogue corpus, and calculates the keyword frequency of the target dialogue corpus; constructs a keyword graph based on the keywords of the target dialogue corpus, wherein the keyword graph includes nodes and edges, the nodes represent keywords, and the edges represent the co-occurrence relationship between keywords; calculates the keyword score based on the keyword graph and the keyword frequency of the target dialogue corpus; generates the target reply corpus based on the keyword score and the preset speech generation template, and outputs the target reply corpus. The present application uses intent recognition and keyword analysis, and calculates the keyword score based on the keyword graph analysis to ensure that the generated reply can accurately reflect the user's intention and needs, thereby greatly improving the pertinence and effectiveness of the reply, and can significantly improve the user's satisfaction and experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0052] Figure 1 An exemplary system architecture diagram is shown in which the present application can be applied;
[0053] Figure 2 A flow chart of an embodiment of a method for expanding speech according to the present application is shown;
[0054] Figure 3 A structural schematic diagram of an embodiment of a speech expansion device according to the present application is shown;
[0055] Figure 4 A schematic structural diagram of an embodiment of a computer device according to the present application is shown. DETAILED DESCRIPTION
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0057] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0058] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0059] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0060] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0061] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers and desktop computers, etc.
[0062] Server 105 can be a server that provides various services, such as a background server that provides support for pages displayed on terminal devices 101, 102, and 103. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDNs), and big data and artificial intelligence platforms.
[0063] It should be noted that the speech expansion method provided in the embodiment of the present application is generally executed by a server, and accordingly, the speech expansion device is generally set in the server.
[0064] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0065] Continue to refer Figure 2 , showing a flow chart of an embodiment of the speech expansion method according to the present application. The present application embodiment can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0066] The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning. The method for expanding speech includes the following steps:
[0067] S201, obtaining historical dialogue data, and performing intent recognition on the historical dialogue data to obtain intent recognition results.
[0068] Specifically, historical conversation corpora are obtained and intent recognition is performed on these corpora. First, a large amount of historical conversation data is collected, which usually comes from call records of the customer service system. Then, these conversation data are processed through natural language processing (NLP) technology to identify the user's intent in each conversation. For example, machine learning algorithms or pre-trained language models can be used to analyze the content of the conversation and determine the intentions of the customer and customer service representative in each conversation. The results of intent recognition will provide basic data for subsequent steps. Through intent recognition, high-quality target conversation corpora can be screened from historical conversation corpora.
[0069] S202: Determine a target dialogue corpus in the historical dialogue corpus based on the intention recognition result.
[0070] Specifically, based on the intention recognition result, the target dialogue corpus is determined in the historical dialogue corpus. First, through the intention recognition result obtained in step S201, the dialogue segments that can reflect the specific intention are screened out. These dialogue segments should be able to effectively express a certain intention and show a high success rate or customer satisfaction in practical applications.
[0071] When screening the target dialogue corpus, you can also set some evaluation criteria, such as the degree of completion of the dialogue, the positive response of the customer, the emotional positivity of the dialogue, etc. Then, among the dialogue segments that meet these standards, further screen out dialogue segments that can cover a wide range of intentions to ensure the diversity and representativeness of the target dialogue corpus. This step must not only ensure the quality of the target dialogue corpus, but also ensure that the quality of the target dialogue corpus can serve as a demonstration in practical applications. In this way, more reliable basic data can be provided for subsequent keyword extraction and speech generation, thereby improving the effectiveness and accuracy of speech recommendation.
[0072] S203, extracting keywords of the target dialogue corpus, and calculating the keyword frequency of the target dialogue corpus.
[0073] Specifically, keywords of the target dialogue corpus are extracted, and the frequency of these keywords is calculated. Keyword extraction is a commonly used natural language processing technique that aims to identify the most representative words from the text. This step can be achieved through a variety of methods, including but not limited to statistical methods (such as TF-IDF), machine learning methods (such as word embedding technology based on word vectors), etc. The extraction of keywords and the calculation of word frequencies are intended to capture the most important information in the conversation, thereby providing a basis for the subsequent construction of keyword graphs and the generation of speech. After extracting keywords, the frequency of occurrence (word frequency) of each keyword in the target dialogue corpus is calculated to measure its importance in the conversation. High-frequency keywords usually reflect the core topic and intention of the conversation, while low-frequency keywords provide some additional background information. In this way, the content and structure of the conversation can be better understood, providing data support for the generation of speech that better meets actual needs.
[0074] Taking the dialogue corpus in the insurance product sales process as an example, assume that the target dialogue corpus is as follows:
[0075] “Corpus A: Hello, we have a new insurance product that is very suitable for your needs and can provide you with comprehensive protection.
[0076] Corpus B: What are the main coverages of this insurance product?
[0077] Corpus C: It mainly includes health insurance, accident insurance and life insurance, and also comes with some additional benefits, such as hospitalization allowance.
[0078] In this conversation, the extracted keywords include "insurance products", "demand", "protection", "health insurance", "accident insurance", "life insurance", "welfare", and "hospitalization allowance". Next, the frequency of these keywords in the conversation is calculated. For example, "insurance products" and "protection" appear twice, and "demand", "health insurance", "accident insurance", "life insurance", "welfare", and "hospitalization allowance" appear once each. Therefore, the frequency of the dialogue corpus in the sales process of this insurance product is 10 times. Through this keyword extraction and frequency calculation, we can better understand the focus of the conversation between customers and salespeople, and provide valuable data support for the subsequent expansion and generation of speech skills.
[0079] S204, constructing a keyword graph based on the keywords of the target dialogue corpus, wherein the keyword graph includes nodes and edges, the nodes represent keywords, and the edges represent co-occurrence relationships between keywords.
[0080] Specifically, a keyword graph is constructed based on the keywords of the target dialogue corpus. A keyword graph is a graph structure in which nodes represent keywords and edges represent co-occurrence relationships between keywords. The first step in constructing a keyword graph is to determine the nodes, i.e., the keywords extracted from step S203. Next, the edges between the nodes are determined by calculating the co-occurrence relationships of these keywords in the target dialogue corpus.
[0081] Co-occurrence usually refers to the frequency of two or more keywords appearing in the same sentence or the same conversation. In this way, the degree of association and structural characteristics between keywords can be intuitively displayed. The keyword graph can not only reflect the theme and structure of the conversation content, but also reveal the potential relationship between different keywords, thereby providing data support for subsequent keyword score calculation and speech generation.
[0082] In the above embodiment, the extracted keywords include "insurance products", "demand", "protection", "health insurance", "accident insurance", "life insurance", "welfare", "hospitalization allowance", "critical illness insurance" and the like. When constructing a keyword graph, these keywords are first used as nodes. Next, the edges between the nodes are determined by calculating the co-occurrence relationship of these keywords in the conversation. For example, in a conversation, "protection" and "health insurance", "accident insurance", and "life insurance" appear simultaneously many times, then in the keyword graph, the "protection" node will be connected to the "health insurance", "accident insurance", and "life insurance" nodes through edges, and "welfare" has a co-occurrence relationship with "hospitalization allowance" and "critical illness insurance", and will also be connected through edges in the keyword graph. In this way, the following keyword graph can be constructed.
[0083] S205, calculating a keyword score based on the keyword graph and the keyword frequency of the target dialogue corpus.
[0084] Specifically, the keyword score is calculated based on the keyword graph and the keyword frequency of the target dialogue corpus. The solution of the present application uses the PageRank algorithm to calculate the keyword score. The PageRank algorithm is an algorithm based on a graph structure. The PageRank algorithm iteratively calculates the score of each node (keyword), and the score depends on the scores of other nodes connected to the node and the number of links between these nodes. In the keyword graph, each keyword is a node, and the edges between the nodes represent the co-occurrence relationship of the keywords. The PageRank algorithm iteratively updates the score of each keyword by considering these co-occurrence relationships and the frequency of each keyword until convergence. Nodes with high keyword scores usually represent more important or representative keywords in the conversation. These keyword scores will provide a basis for subsequent speech generation to ensure that the generated replies can capture the core content and theme of the conversation.
[0085] The specific implementation process of using the PageRank algorithm to calculate keyword scores: First, initialize a PageRank value for each node (ie keyword). Usually, this initial value can be equal (such as 1 / N, where N is the number of nodes), or it can be set based on other information (such as word frequency). Then, the PageRank value of each node needs to be calculated iteratively. The PageRank algorithm calculates the score of the node by simulating the behavior of a random walker in the keyword graph. In each iteration, the walker will randomly jump to other nodes in the graph according to a certain probability (such as the damping factor d, usually set to 0.85). This probability is related to the edge weights between the nodes. After multiple iterations, the PageRank value of each node will tend to be stable, and it can be used as the score of the keyword.
[0086] The PageRank value of each node in the keyword graph is iterated based on the following formula:
[0087]
[0088] Where V i is the i-th node in the keyword graph, V j The keyword V i The node adjacent to the node, d is the damping factor, S(V i ) is V i The PageRank value of the node, S(V j ) is V j The PageRank value of the node, L(V j ) is the keyword V j The number of links between a node and other nodes, In(V i ) is the keyword in the graph pointing to V i The link of the node, j∈In(V i ) is V j Node points to V i Links to nodes.
[0089] S206, generating a target reply corpus based on the keyword score and a preset speech generation template, and outputting the target reply corpus.
[0090] Specifically, the target reply corpus is generated based on the keyword score and the preset speech generation template, and the target reply corpus is output. In the first few steps, the keyword score is calculated through intent recognition, keyword extraction, keyword graph construction and PageRank algorithm. Next, these high-scoring keywords are organized into new conversation content through the preset generation template to form targeted and efficient replies. The generation template can contain various speech strategies, such as opening remarks, explanations, promotional statements, etc., to ensure that the generated replies are not only to the point, but also can guide customers to further interact. Finally, the generated target reply corpus will be output and applied in actual conversations to improve the effectiveness of customer service conversations and customer satisfaction.
[0091] In a specific embodiment of the present application, a speech generation template can be generated by training a large pre-trained language model. First, a large amount of high-quality customer service conversation data is collected and cleaned, which should cover a variety of business scenarios and customer needs, and the data is annotated with intent and keywords. Next, a suitable pre-trained language model, such as GPT-4, is selected, and the cleaned and annotated conversation data is used to fine-tune it so that the model can better adapt to specific business scenarios. Then, a speech template framework is designed, including opening remarks, explanations, promotional statements, and action guides. The context and keywords of the conversation are input using the fine-tuned model to generate specific speech content that conforms to the template framework. After generation, these templates are tested through practical applications, feedback is collected, and the models and templates are continuously optimized and adjusted based on the feedback to ensure that the content generated is more natural, fluent, and meets actual needs. Finally, the optimized speech generation model is integrated into the customer service system to automatically generate high-quality replies, continuously monitor its performance, and regularly update data and retrain the model to maintain its performance.
[0092] In the above embodiment, the present application uses intent recognition and keyword analysis, and calculates keyword scores based on keyword graph analysis to ensure that the generated replies can accurately reflect the user's intentions and needs, thereby greatly improving the pertinence and effectiveness of the replies, and can significantly improve user satisfaction and experience.
[0093] Furthermore, the step of constructing a keyword graph based on the keywords of the target dialogue corpus specifically includes:
[0094] Configure the text sliding window;
[0095] Use the text sliding window to slide the historical conversation corpus to implement the corpus segmentation operation and obtain several segmented corpora;
[0096] Identify the co-occurrence relationship between keywords in each segmented corpus, and construct a keyword subgraph based on the co-occurrence relationship between keywords in each segmented corpus;
[0097] The keyword sub-graphs are combined to obtain a keyword graph.
[0098] First, configure a text sliding window (such as a sentence, paragraph, or entire document). If two keywords appear at the same time in this window, there is a co-occurrence relationship between the two keywords. Set the size of the sliding window to capture the keyword relationship in the conversation. Next, use the sliding window to slide in the historical conversation corpus to divide the conversation corpus into multiple small segments. The co-occurrence relationship between keywords in each small segment is identified. For example, keywords that appear in the same window are considered co-occurrence. Based on these co-occurrence relationships, a keyword subgraph is constructed, and each subgraph shows the keyword relationship in the segmented corpus. Then, all keyword subgraphs are combined to form a complete keyword graph, which represents keywords and their co-occurrence relationships through nodes and edges. In this way, local relationships in the conversation can be captured in detail, and the distribution and association of keywords in the overall corpus can be fully reflected, which is helpful for subsequent keyword score calculation and speech generation.
[0099] For example, in the dialogue corpus in the above-mentioned insurance product sales process, the sliding window takes sentences as an example, and uses the text sliding window to slide in the dialogue corpus in the above-mentioned insurance product sales process to implement the corpus segmentation operation and obtain three segmented corpora, namely corpus A, corpus B and corpus C.
[0100] In the above embodiment, by constructing a keyword graph, keywords and their relationships are accurately captured, thereby improving the pertinence and fluency of speech generation.
[0101] Further, the step of calculating the keyword score based on the preset PageRank algorithm and the keyword frequency of the keyword graph and the target dialogue corpus specifically includes:
[0102] Initialize the PageRank value of each node in the keyword graph based on the keyword frequency of the target dialogue corpus;
[0103] Based on the PageRank algorithm, the PageRank value of each node in the keyword graph is iterated until the PageRank value of each node in the keyword graph converges;
[0104] Get the PageRank value of each node in the keyword graph and get the keyword score.
[0105] The preset PageRank algorithm is used to calculate the keyword score to optimize the quality and effect of speech generation. First, the PageRank value of each node in the keyword graph is initialized based on the keyword frequency of the target dialogue corpus. These initialization values reflect the importance and frequency of the keywords in the target dialogue corpus. Next, the PageRank algorithm is used to iteratively calculate the PageRank value of each node in the keyword graph, taking into account the connection strength and random jump probability between nodes, until the PageRank values of all nodes converge. During the iteration process, the PageRank value of the node reflects the importance and influence of the keyword in the overall corpus. Finally, the final PageRank value of each node is obtained as the keyword score. These scores are used in the subsequent speech generation process to ensure that the generated speech content is highly matched and responsive to customer needs.
[0106] In the above embodiment, by comprehensively considering the frequency and correlation of keywords in the dialogue text, the accuracy and pertinence of the generated speech are effectively improved. The keyword score calculated by the PageRank algorithm ensures that the generated speech content not only meets the actual needs of customers, but also enables more natural and effective communication and recommendations.
[0107] Furthermore, the step of initializing the PageRank value of each node in the keyword graph based on the keyword frequency specifically includes:
[0108] Calculate the keyword frequency of each segmented corpus;
[0109] Determine the initial PageRank value of each node in the keyword subgraph based on the keyword frequency of each segmented corpus and the keyword frequency of the target dialogue corpus;
[0110] Update the PageRank value of each node in the keyword subgraph to the initial PageRank value.
[0111] The keyword frequency is used to initialize the PageRank value of each node in the keyword graph, thus providing a basis for the subsequent PageRank algorithm calculation. First, by calculating the keyword frequency of each segmented corpus, determine which keywords are more frequent or more important in each corpus segment. Then, combined with the overall keyword frequency of the target dialogue corpus, determine the initial PageRank value of each node in the keyword subgraph. These initial values reflect the importance of keywords in different corpus segments and the overall corpus. Finally, update the PageRank value of each node in the keyword subgraph to its initial value.
[0112] For example, in the dialogue corpus during the insurance product sales process mentioned above, taking corpus A "Hello, we have a new insurance product that is very suitable for your needs and can provide you with comprehensive protection." as an example, the keywords of corpus A include "insurance products", "demand", and "protection", and the above keywords all appear once in corpus A, so the keyword frequency of corpus A is 3 times, so the initial PageRank value of the keyword subgraph corresponding to corpus A is 3 / 10=0.3.
[0113] In the above embodiment, the PageRank value is initialized based on the keyword frequency, which effectively improves the weight and influence of the keyword in the speech generation process.
[0114] Furthermore, the step of initializing the PageRank value of each node in the keyword graph based on the keyword frequency specifically includes:
[0115] Determine the target segmented corpus and calculate the keyword frequency of the target segmented corpus, wherein the target segmented corpus is any one of the segmented corpora;
[0116] Determine a target keyword of the target segmented corpus, and calculate the keyword frequency of the target keyword, wherein the target keyword is any keyword in the target segmented corpus;
[0117] Determine the initial PageRank value of the node corresponding to the target keyword in the keyword subgraph based on the keyword frequency of the target keyword and the keyword frequency of the target segmented corpus;
[0118] Update the PageRank value of the target keyword node in the keyword subgraph to the initial PageRank value.
[0119] Initializing the PageRank value of each node in the keyword graph by keyword frequency is intended to improve the accuracy of keyword scores. First, determine the target segmented corpus and calculate its keyword frequency. The target segmented corpus is selected from multiple segmented corpora, which are obtained from the dialogue corpus through the sliding window technology. Next, determine the target keyword in the target segmented corpus and calculate its keyword frequency. The target keyword is a keyword selected from the target segmented corpus, and its frequency reflects the importance of the keyword in the target segmented corpus. Then, based on the keyword frequency of the target keyword and the keyword frequency of the target segmented corpus, determine the initial PageRank value of the node corresponding to the target keyword in the keyword subgraph. This initial value is intended to reflect the relative importance of the target keyword in the entire corpus. Finally, update the PageRank value of the target keyword node in the keyword subgraph to the initial value.
[0120] For example, in the dialogue corpus of the above-mentioned insurance product sales process, continuing to take corpus A as an example, corpus A is determined as the target segmentation corpus, and the "insurance product" keyword in corpus A is determined as the target keyword. The keyword frequency of corpus A is 3 times, and the keyword frequency of "insurance product" in corpus A is 1 time. Therefore, the initial PageRank value of the node corresponding to the target keyword "insurance product" is 1 / 3=0.333 (rounded to three decimal places), and the initial PageRank values of the nodes corresponding to other keywords "demand" and "guarantee" in corpus A can be calculated using the same method, and finally the initial PageRank values of the nodes corresponding to each keyword in corpus A are obtained.
[0121] In the above embodiment, the PageRank value is determined by the initial keyword frequency, which improves the accuracy of the keyword score, so that the final generated speech content can better reflect the actual importance of the keyword in the conversation text. This can ensure that the generated speech is more in line with customer needs and enhance the communication effect with customers.
[0122] Furthermore, the step of combining the keyword subgraphs to obtain a keyword graph specifically includes:
[0123] Calculate the weight of each keyword subgraph based on the keyword frequency of each segmented corpus and the keyword frequency of the target dialogue corpus;
[0124] The keyword subgraphs are combined based on the weights of the respective keyword subgraphs to obtain a keyword graph.
[0125] By calculating and combining the weights of keyword subgraphs, an overall keyword graph is generated to accurately reflect the keyword relationships in the dialogue corpus. First, the weights of each keyword subgraph are calculated based on the keyword frequency of each segmented corpus and the keyword frequency of the target dialogue corpus. The keyword frequency of the segmented corpus reflects the importance of the keyword in the local corpus, while the keyword frequency of the target dialogue corpus reflects the importance of the keyword in the overall dialogue. By combining these two frequencies, the weight of each keyword subgraph can be calculated. The higher the weight value, the more important the keyword relationship in the subgraph. Then, based on the weights of each keyword subgraph, the keyword subgraphs are combined to generate a complete keyword graph. When combining, appropriate weights are assigned according to the weights of the subgraphs, so that the subgraphs with higher weights occupy a more important position in the final keyword graph. This method ensures that the final generated keyword graph not only integrates the keyword relationships in each segmented corpus, but also emphasizes those keyword relationships with high frequency and high importance in the overall corpus, thus laying a solid foundation for the subsequent keyword score calculation and speech generation.
[0126] In the above embodiment, by comprehensively considering the keyword frequencies of the segmented corpus and the target dialogue corpus, accurately calculating the weights of the keyword subgraphs, and combining them to generate a comprehensive keyword graph, the accuracy and reliability of keyword scores and speech generation are significantly improved. The generated speech is closer to customer needs and effectively improves communication effectiveness.
[0127] In this embodiment, the electronic device (eg Figure 1 The server shown in the figure) can receive instructions or obtain data through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.
[0128] It should be emphasized that in order to further ensure the privacy and security of the above dialogue data, the above dialogue data can also be stored in a node of a blockchain.
[0129] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0130] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0131] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0132] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a speech expansion device, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0133] like Figure 3 As shown, the speech expansion device 300 described in this embodiment is applied to speech recommendation, and the speech expansion device 300 includes:
[0134] The intention recognition module 301 is used to obtain historical dialogue data, and perform intention recognition on the historical dialogue data to obtain an intention recognition result;
[0135] A target corpus module 302, configured to determine a target dialogue corpus in the historical dialogue corpus based on the intention recognition result;
[0136] The keyword processing module 303 is used to extract keywords of the target dialogue corpus and calculate the keyword frequency of the target dialogue corpus;
[0137] A keyword graph module 304 is used to construct a keyword graph based on the keywords of the target dialogue corpus, wherein the keyword graph includes nodes and edges, the nodes represent keywords, and the edges represent the co-occurrence relationship between keywords;
[0138] A score calculation module 305 is used to calculate a keyword score based on the keyword graph and the keyword frequency of the target dialogue corpus;
[0139] The corpus generation module 306 is used to generate target reply corpus based on keyword scores and a preset speech generation template, and output the target reply corpus.
[0140] The present application discloses a speech expansion device, which is applied to speech recommendation. The present application obtains historical dialogue corpus and performs intent recognition on the historical dialogue corpus to obtain intent recognition results; determines the target dialogue corpus in the historical dialogue corpus based on the intent recognition results; extracts the keywords of the target dialogue corpus, and calculates the keyword frequency of the target dialogue corpus; constructs a keyword graph based on the keywords of the target dialogue corpus, wherein the keyword graph includes nodes and edges, the nodes represent keywords, and the edges represent the co-occurrence relationship between keywords; calculates the keyword score based on the keyword graph and the keyword frequency of the target dialogue corpus; generates the target reply corpus based on the keyword score and the preset speech generation template, and outputs the target reply corpus. The present application uses intent recognition and keyword analysis, and calculates the keyword score based on the keyword graph analysis to ensure that the generated reply can accurately reflect the user's intention and needs, thereby greatly improving the pertinence and effectiveness of the reply, and can significantly improve the user's satisfaction and experience.
[0141] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0142] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmab l eGate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0143] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0144] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the speech expansion method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0145] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the speech expansion method.
[0146] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0147] The present application discloses a computer device, which is applied to speech recommendation. The present application obtains historical dialogue corpus and performs intent recognition on the historical dialogue corpus to obtain intent recognition results; determines the target dialogue corpus in the historical dialogue corpus based on the intent recognition results; extracts the keywords of the target dialogue corpus, and calculates the keyword frequency of the target dialogue corpus; constructs a keyword graph based on the keywords of the target dialogue corpus, wherein the keyword graph includes nodes and edges, the nodes represent keywords, and the edges represent the co-occurrence relationship between keywords; calculates the keyword score based on the keyword graph and the keyword frequency of the target dialogue corpus; generates the target reply corpus based on the keyword score and the preset speech generation template, and outputs the target reply corpus. The present application uses intent recognition and keyword analysis, and calculates the keyword score based on the keyword graph analysis to ensure that the generated reply can accurately reflect the user's intention and needs, thereby greatly improving the pertinence and effectiveness of the reply, and can significantly improve the user's satisfaction and experience.
[0148] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the above-mentioned speech expansion method.
[0149] The present application discloses a computer-readable storage medium, which is applied to speech recommendation. The present application obtains historical dialogue corpus and performs intent recognition on the historical dialogue corpus to obtain intent recognition results; determines the target dialogue corpus in the historical dialogue corpus based on the intent recognition results; extracts the keywords of the target dialogue corpus, and calculates the keyword frequency of the target dialogue corpus; constructs a keyword graph based on the keywords of the target dialogue corpus, wherein the keyword graph includes nodes and edges, the nodes represent keywords, and the edges represent the co-occurrence relationship between keywords; calculates the keyword score based on the keyword graph and the keyword frequency of the target dialogue corpus; generates the target reply corpus based on the keyword score and the preset speech generation template, and outputs the target reply corpus. The present application uses intent recognition and keyword analysis, and calculates the keyword score based on the keyword graph analysis to ensure that the generated reply can accurately reflect the user's intention and needs, thereby greatly improving the pertinence and effectiveness of the reply, and can significantly improve the user's satisfaction and experience.
[0150] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0151] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0152] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A method for expanding speech, characterized in that: The speech expansion method is applied to speech recommendation, and the speech expansion method includes: Acquire historical dialogue data, and perform intent recognition on the historical dialogue data to obtain an intent recognition result; Determining a target dialogue corpus in the historical dialogue corpus based on the intention recognition result; Extracting keywords from the target dialogue corpus and calculating the keyword frequency of the target dialogue corpus; Constructing a keyword graph based on the keywords of the target dialogue corpus, wherein the keyword graph includes nodes and edges, the nodes represent the keywords, and the edges represent the co-occurrence relationship between the keywords; Calculating a keyword score based on the keyword graph and the keyword frequency of the target dialogue corpus; A target reply corpus is generated based on the keyword score and a preset speech generation template, and the target reply corpus is output.
2. The method for expanding speech as claimed in claim 1, characterized in that: The step of constructing a keyword graph based on the keywords of the target dialogue corpus specifically includes: Configure the text sliding window; Use the text sliding window to slide the historical conversation corpus to implement a corpus segmentation operation and obtain a plurality of segmented corpora; Identifying the co-occurrence relationship between the keywords in each of the segmented corpora, and constructing a keyword subgraph based on the co-occurrence relationship between the keywords in each of the segmented corpora; The keyword subgraphs are combined to obtain the keyword graph.
3. The method for expanding speech as claimed in claim 2, characterized in that: The keyword score is calculated based on a preset PageRank algorithm, and the step of calculating the keyword score based on the keyword graph and the keyword frequency of the target dialogue corpus specifically includes: Initializing the PageRank value of each node in the keyword graph based on the keyword frequency of the target dialogue corpus; Iterating the PageRank value of each node in the keyword graph based on the PageRank algorithm until the PageRank value of each node in the keyword graph converges; The PageRank value of each node in the keyword graph is obtained to obtain the keyword score.
4. The method for expanding speech as claimed in claim 3, characterized in that: The step of initializing the PageRank value of each node in the keyword graph based on the keyword frequency specifically includes: Calculating the keyword frequency of each of the segmented corpora; Determine the initial PageRank value of each node in the keyword subgraph based on the keyword frequency of each of the segmented corpora and the keyword frequency of the target dialogue corpus; The PageRank value of each node in the keyword subgraph is updated to the initial PageRank value.
5. The method for expanding speech as claimed in claim 3, characterized in that: The step of initializing the PageRank value of each node in the keyword graph based on the keyword frequency specifically includes: Determine a target segmented corpus, and calculate the keyword frequency of the target segmented corpus, wherein the target segmented corpus is any one of the segmented corpora; Determine a target keyword of the target segmented corpus, and calculate a keyword frequency of the target keyword, wherein the target keyword is any keyword in the target segmented corpus; Determine the PageRank initial value of the node corresponding to the target keyword in the keyword subgraph based on the keyword frequency of the target keyword and the keyword frequency of the target segmented corpus; The PageRank value of the target keyword node in the keyword subgraph is updated to the initial PageRank value.
6. The method for expanding speech as claimed in claim 3, characterized in that: The PageRank value of each node in the keyword graph is iterated based on the following formula: Where V i is the i-th node in the keyword graph, V j The keyword V i The node adjacent to the node, d is the damping factor, S(V i ) is V i The PageRank value of the node, S(V j ) is V j The PageRank value of the node, L(V j ) is the keyword V j The number of links between a node and other nodes, In(V i ) is the keyword in the graph pointing to V i The link of the node, j∈In(V i ) is V j Node points to V i Links to nodes.
7. The method for expanding speech as claimed in claim 4, characterized in that: The step of combining the keyword subgraphs to obtain the keyword graph specifically includes: Calculating the weight of each of the keyword subgraphs based on the keyword frequency of each of the segmented corpora and the keyword frequency of the target dialogue corpus; The keyword subgraphs are combined based on the weights of the respective keyword subgraphs to obtain the keyword graph.
8. A speech expansion device, characterized in that: The speech expansion device is applied to speech recommendation, and the speech expansion device comprises: An intention recognition module is used to obtain historical dialogue data and perform intention recognition on the historical dialogue data to obtain an intention recognition result; A target corpus module, configured to determine a target dialogue corpus in the historical dialogue corpus based on the intention recognition result; A keyword processing module, used to extract keywords from the target dialogue corpus and calculate the keyword frequency of the target dialogue corpus; A keyword graph module, used to construct a keyword graph based on the keywords of the target dialogue corpus, wherein the keyword graph includes nodes and edges, the nodes represent the keywords, and the edges represent the co-occurrence relationship between the keywords; A score calculation module, used for calculating a keyword score based on the keyword graph and the keyword frequency of the target dialogue corpus; The corpus generation module is used to generate the target reply corpus based on the keyword score and the preset speech generation template, and output the target reply corpus.
9. A computer device, characterized in that: It includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the speech expansion method as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the speech expansion method according to any one of claims 1 to 7 are implemented.
