Implementation method of ai-based template type dialogue and related product
By using an AI-based template-based speech implementation method, the terminal receives sample speech data, performs word segmentation and tagging, and generates diverse voice data. This solves the problems of high cost and low efficiency caused by manual intervention in existing technologies, and improves the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHAOLIAN CONSUMER FINANCE CO LTD
- Filing Date
- 2022-11-08
- Publication Date
- 2026-07-24
Smart Images

Figure CN115762470B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of big data and financial technology, and in particular to an AI-based template-based script implementation method and related products. Background Technology
[0002] Telephone customer service is a convenient and efficient way for customer service personnel to communicate and maintain relationships with customers on behalf of the company via telephone. With the recent application of artificial intelligence in the voice field, more and more telephone customer service providers are adopting AI robots to achieve voice-based customer service. Existing AI robots use different voice templates to achieve dialogue, but in real-world scenarios, manual intervention is required to handle these template-based conversations, which increases costs and reduces dialogue efficiency. Summary of the Invention
[0003] This application discloses an AI-based template-based dialogue implementation method and related products. This method reduces the proportion of manual intervention in template-based conversations, reduces labor costs, and improves user experience.
[0004] Firstly, an AI-based method for implementing template-based dialogue is provided, the method comprising the following steps:
[0005] The terminal receives sample corpus, performs word segmentation preprocessing on the sample corpus to obtain the word segmentation result, and performs session tagging on the word segmentation result to obtain multiple session tags for the sample corpus;
[0006] The terminal performs template mining processing on each of the multiple session tags to obtain the matching rule set under each tag;
[0007] The terminal performs fluency processing based on multiple matching rule sets under multiple session tags to obtain the final speech data of the sample corpus.
[0008] Secondly, an AI-based template-based script implementation system is provided, the system comprising:
[0009] The receiving unit is used to receive sample corpora.
[0010] The processing unit is used to perform word segmentation preprocessing on the sample corpus to obtain the word segmentation result, perform conversation tagging on the word segmentation result to obtain multiple conversation tags for the sample corpus, perform template mining processing on each of the multiple conversation tags to obtain the matching rule set under each tag, and perform fluency processing based on the multiple matching rule sets under the multiple conversation tags to obtain the final speech data of the sample corpus.
[0011] Thirdly, an electronic device is provided, including a processor, a memory, a communication interface, and one or more programs, said one or more programs being stored in the memory and configured to be executed by the processor, said programs including instructions for performing the steps of the method described in the first aspect.
[0012] Fourthly, a computer-readable storage medium is provided for storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform the method described in the first aspect.
[0013] Fifthly, a computer program product is provided, comprising a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the first aspect of the embodiments of this application. The computer program product may be a software installation package.
[0014] The technical solution provided in this application receives sample corpora through a terminal, performs word segmentation preprocessing on the sample corpora to obtain word segmentation results, performs session tagging on the word segmentation results to obtain multiple session tags for the sample corpora, and then performs template mining processing on each of the multiple session tags to obtain a matching rule set under each tag. Finally, the terminal performs fluency processing based on the multiple matching rule sets under the multiple session tags to obtain the final speech data of the sample corpora. This enables the diversity of the final speech data from the same sample corpora, improving the user experience. In addition, the above-mentioned synthetic speech data solution involves less manual intervention, reducing labor costs and overall costs, thus offering the advantage of improved user experience. Attached Figure Description
[0015] The accompanying drawings used in the embodiments of this application are described below.
[0016] Figure 1 This is a schematic diagram of the structure of a terminal device according to this application;
[0017] Figure 2 This is a schematic diagram of the model architecture of this application;
[0018] Figure 3 This is a schematic diagram of the session tagging model provided in this application;
[0019] Figure 4A A schematic diagram of the matching rule set for example A provided in this application;
[0020] Figure 4B A schematic diagram of the matching rule set for Example B provided in this application.
[0021] Figure 5This is a flowchart illustrating an embodiment of an AI-based template-based dialogue implementation method provided in this application.
[0022] Figure 6 This is a schematic diagram of the structure of an AI-based template-based dialogue implementation system provided in one embodiment of this application;
[0023] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0024] The embodiments of this application are described below with reference to the accompanying drawings.
[0025] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document indicates that the preceding and following related objects have an "or" relationship.
[0026] In this application's embodiments, "multiple" refers to two or more. The use of terms like "first," "second," etc., in this application's embodiments is merely illustrative and for distinguishing the described objects; it has no order and does not indicate a specific limitation on the number of devices in this application's embodiments, nor does it constitute any limitation on the embodiments of this application. The term "connection" in this application's embodiments refers to various connection methods, such as direct or indirect connections, to achieve communication between devices; this application's embodiments do not impose any limitations on this.
[0027] Conversation tags: Based on the model, text content is broken down and abstracted into tags. For example, the sentence "If you don't return it, we may have to process you further" will be abstracted into the tag "${If an overdue bad record is generated}", and the conversation content "We may have to process you further" will be abstracted into the tag "${May be processed further according to procedures}". Subsequent similar or synonymous sentences will also be abstracted in the same way. For example, "If you don't return it, it will also be abstracted into "${If an overdue bad record is generated}".
[0028] Conversation Templates: Assuming all text content has been abstracted based on the above method, the language used by people in real-world scenarios is based on the permutation and combination of conversation tags. For example, "If you don't pay back, we may have to process your application further. Can you process it now?" would be abstracted into the template "${If an overdue bad record is generated}${May be processed further according to procedure}${Confirm repayment}". Similarly, "Can you process it now? If you don't pay back, we may have to call your family for further verification" would be abstracted into the template "${Confirm repayment}${If an overdue bad record is generated}${May contact family for verification}".
[0029] See Figure 1 , Figure 1 A structural block diagram of a terminal device is provided, such as Figure 1 As shown, the terminal device may include a processor, memory, communication unit, and bus. Depending on the function, the processor may be equipped with hardware structures such as a microphone and mobile devices. In practical applications, it can also be implemented based on different hardware. In practical applications, the terminal device may also be integrated into other hardware devices, such as smartphones, servers, and computer devices.
[0030] The technical solution of this application is mainly based on the transfer of real-person speech experience to AI using three models: "conversation tagging model," "template mining model," and "fluency testing model." Figure 2 As shown, Figure 2 This is a schematic diagram of the model structure of this application.
[0031] Using rules, word segmentation, association models, and clustering models to mine central sentences, and employing a set of baffles to implement a conversation tag model, such as... Figure 3 As shown.
[0032] The input text is abstracted into corresponding multi-tags using a conversation tagging model. This captures multiple expressions (center sentences) corresponding to the same meaning under a single tag, ultimately forming specific sets of matching rules, as shown in the following two examples: Example A is represented as follows... Figure 4A As shown, the representation of example B is as follows: Figure 4B As shown.
[0033] The long text will eventually be abstracted into multiple tags, which may include: Your debt to our company is overdue $ (an overdue record has been created), you currently owe 1,321 yuan $ (the overdue amount is M), there is not much time left $ (the situation is urgent), please settle your current debt as soon as possible $ (it is recommended to settle the debt as soon as possible). The "$" in this application represents the abstracted tag.
[0034] The template mining model scheme is as follows: The input corpus will calculate a large tag co-occurrence matrix, which will be combined with the actual business constraints to enhance compliance, rationality and relevance, and finally produce a series of speech templates.
[0035] Constructing a clause pool solution:
[0036] The input corpus will construct a large pool of tagged clauses. Each tag will contain a series of clauses, and each clause will be a meticulously crafted short sentence that fully meets the business requirements. The greater the number of clauses under a single tag and the greater the differences between the clauses, the stronger the diversity.
[0037] Smoothness testing scheme:
[0038] The input text will be scored by a fluency test model, which mainly includes a large number of quality inspection rules modules such as sensitive words and illegal words, as well as a model module based on recurrent neural networks to detect word order.
[0039] See Figure 5 , Figure 5 A flowchart illustrating an AI-based template-based dialogue implementation method provided in this application is shown below. Figure 5 As shown, this method can be derived from, for example... Figure 1 The terminal shown executes the method as follows: Figure 5 As shown, it includes the following steps:
[0040] Step S501: The terminal receives the sample corpus, performs word segmentation preprocessing on the sample corpus to obtain the word segmentation result, and performs session tag processing on the word segmentation result to obtain multiple session tags for the sample corpus.
[0041] For example, the above word segmentation method can be implemented using existing word segmentation methods, and this application does not limit the above word segmentation method.
[0042] For example, the conversation tags obtained by performing conversation tagging on the word segmentation results described above can specifically include:
[0043] The word segmentation result is input into the association mining model to obtain the baffle and keywords. At the same time, the word segmentation result is input into the clustering model to obtain the central sentence. Based on the baffle, keywords and central sentence, the multiple conversation tags are determined.
[0044] For example, the sample corpus mentioned above can be text information, such as "Zhang San owes 500 yuan on his credit card, which is overdue." This text information can be in various formats, such as image format, PDF format, TXT format, etc. This application does not limit the specific format of the text information.
[0045] Step S502: The terminal performs template mining processing on each of the multiple session tags to obtain the matching rule set under each tag;
[0046] For example, the implementation method of step S502 above may specifically include:
[0047] The terminal retrieves multiple central sentences with the same meaning from the preset matching rule set database for each session tag, aggregates these multiple central sentences with the same meaning into the matching rule set for that session tag, and iterates through all session tags to obtain the matching rule set for each tag.
[0048] Specifically, the aforementioned preset matching rule set database can construct a large tag clause pool from historical input corpus. Each tag contains a series of multiple clauses, and each clause is a finely crafted short sentence that fully meets business requirements. Under a single tag, the larger the number of clauses and the greater the differences between clauses, the stronger the diversity.
[0049] like Figure 4A and Figure 4B The table shows the matching rule sets under different session tags. The central sentence in the matching rule set database can be obtained by collecting historical data manually, which will not be elaborated here.
[0050] Step S503: The terminal performs fluency processing based on multiple matching rule sets under multiple session tags to obtain the final speech data of the sample corpus.
[0051] The technical solution provided in this application receives sample corpora through a terminal, performs word segmentation preprocessing on the sample corpora to obtain word segmentation results, performs session tagging on the word segmentation results to obtain multiple session tags for the sample corpora, and then performs template mining processing on each of the multiple session tags to obtain a matching rule set under each tag. Finally, the terminal performs fluency processing based on the multiple matching rule sets under the multiple session tags to obtain the final speech data of the sample corpora. This enables the diversity of the final speech data from the same sample corpora, improving the user experience. In addition, the above-mentioned synthetic speech data solution involves less manual intervention, reducing labor costs and overall costs, thus offering the advantage of improved user experience.
[0052] For example, the terminal described above performs fluency processing based on multiple matching rule sets under multiple session tags to obtain the final speech data of the sample corpus, which may specifically include:
[0053] The terminal generates n voice data, specifically including: randomly selecting a central sentence from the matching rule set under each session tag, combining the central sentences according to the order of the session tags to obtain the first combined central text, generating the first voice data from the first combined central text, performing this process n times to obtain n voice data, inputting the n voice data into the fluency model to calculate n calculation results, and selecting the voice data corresponding to one of the n calculation results as the final voice data.
[0054] For example, the above-mentioned input of n speech data into the fluency model to calculate n results can specifically include:
[0055] n voice data points are input as n input data points to the fluency model to perform neural network operations and obtain n operation results. Activation processing is then performed on the n operation results to obtain n calculation results.
[0056] For example, the above method of selecting the speech data corresponding to one of the n calculation results as the final speech data specifically includes:
[0057] Select the maximum value from n calculation results and determine it as a single calculation result;
[0058] Alternatively, extract m calculation results greater than the first threshold from n calculation results, and randomly select one from the m calculation results to determine it as a calculation result.
[0059] For example, the neural network operations described above may include: multi-layer convolution operations and fully connected operations. The activation processing described above can be handled by an activation function, which may specifically be:
[0060] y = sigmoid(x), where x is the result of the operation and y is the activation result. The activation function can also be tanh, relu, softmax or a function of linear activation operation.
[0061] See Figure 6 , Figure 6 A schematic diagram of the structure of an AI-based template-based dialogue implementation system is provided, such as... Figure 6 As shown, the system includes:
[0062] The receiving unit 601 is used to receive sample corpus;
[0063] The processing unit 602 is used to perform word segmentation preprocessing on the sample corpus to obtain word segmentation results, perform conversation tag processing on the word segmentation results to obtain multiple conversation tags for the sample corpus, perform template mining processing on each of the multiple conversation tags to obtain a matching rule set under each tag, and perform fluency processing based on the multiple matching rule sets under the multiple conversation tags to obtain the final speech data of the sample corpus.
[0064] For example, processing unit 602 is specifically used to input the word segmentation processing result into the association mining model to obtain the baffle and keywords, and at the same time input the word segmentation processing result into the clustering model to obtain the center sentence, and determine the multiple conversation tags based on the baffle, keywords and center sentence.
[0065] For example, the processing unit 602 is specifically used by the terminal to query multiple central sentences with the same meaning under each session tag from the preset matching rule set database, gather the multiple central sentences with the same meaning into the matching rule set under the session tag, and traverse all session tags to obtain the matching rule set under each tag.
[0066] For example, processing unit 602 is specifically used to generate n voice data for the terminal, specifically including: randomly extracting a central sentence from the matching rule set under each session tag, combining the central sentences according to the order of the session tags to obtain a first combined central text, generating the first voice data from the first combined central text, performing the above steps n times to obtain n voice data, inputting the n voice data into the fluency model to calculate n calculation results, and selecting the voice data corresponding to one of the n calculation results as the final voice data.
[0067] For example, the processing unit 602 is specifically used to input n voice data as n input data into the fluency model to perform neural network operations to obtain n operation results, and perform activation processing on the n operation results to obtain n calculation results.
[0068] For example, processing unit 602 is specifically used to select the maximum value from n calculation results to determine a calculation result;
[0069] Alternatively, extract m calculation results greater than the first threshold from n calculation results, and randomly select one from the m calculation results to determine it as a calculation result.
[0070] It is understood that, in order to achieve the aforementioned functions, the above-described apparatus includes hardware and / or software modules corresponding to the execution of each function. Based on the algorithmic steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.
[0071] This embodiment can divide the electronic device into functional modules according to the above method example. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0072] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0073] When using integrated units, the user equipment may include a processing module and a storage module. The processing module can be used to control and manage the actions of the user equipment; for example, it can support the electronic device in executing the steps performed by the acquisition unit, communication unit, and processing unit described above. The storage module can support the electronic device in executing stored program code and data.
[0074] The processing module can be a processor or a controller. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination of functions that implement computing capabilities, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.
[0075] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the user equipment. In other embodiments of this application, the user equipment may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0076] Please see Figure 7 , Figure 7 This application provides an electronic device 70, which includes a processor 701, a memory 702, a communication interface 703, and a display screen 704. The processor 701, memory 702, and communication interface 703 are interconnected via a bus. The display screen powers the electronic device. The electronic device may also include:
[0077] The memory 702 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM), and is used for related computer programs and data. The communication interface 703 is used for receiving and sending data.
[0078] Processor 701 can be one or more central processing units (CPUs). When processor 701 is a CPU, the CPU can be a single-core CPU or a multi-core CPU.
[0079] Processor 701 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). Different processing units may be independent components or integrated into one or more processors. In some embodiments, the user equipment may also include one or more processing units. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. In other embodiments, the processing unit may also include a memory for storing instructions and data. For example, the memory in the processing unit may be a cache memory. This memory can store instructions or data that the processing unit has just used or is repeatedly used. If the processing unit needs to reuse the instruction or data, it can directly retrieve it from the memory. This avoids repeated access, reduces the waiting time of the processing unit, and thus improves the efficiency of the user equipment in processing data or executing instructions.
[0080] In some embodiments, the processor 701 may include one or more interfaces. These interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface. The USB interface is a USB standard-compliant interface, specifically a Mini USB interface, a Micro USB interface, a USB Type-C interface, etc. The USB interface can be used to connect a charger to charge the user device, and can also be used for data transfer between the user device and peripheral devices. The USB interface can also be used to connect headphones for audio playback.
[0081] If the electronic device 70 is a user device or terminal device, such as a smartphone, computer device, or server, the processor 701 in the electronic device 70 is used to read the computer program code stored in the memory 702 and perform the following operations:
[0082] Receive sample corpus, perform word segmentation preprocessing on the sample corpus to obtain the word segmentation result, and perform conversation tagging on the word segmentation result to obtain multiple conversation tags for the sample corpus;
[0083] Perform template mining processing on each of the multiple session tags to obtain the matching rule set under each tag;
[0084] The final speech data of the sample corpus is obtained by performing fluency processing based on multiple matching rule sets under multiple conversation tags.
[0085] The above-mentioned process of performing conversation tagging on the word segmentation result to obtain multiple conversation tags for the sample corpus specifically includes:
[0086] The word segmentation result is input into the association mining model to obtain the baffle and keywords. At the same time, the word segmentation result is input into the clustering model to obtain the central sentence. Based on the baffle, keywords and central sentence, the multiple conversation tags are determined.
[0087] The above-mentioned process of performing template mining on each of the multiple session tags to obtain the matching rule set under each tag specifically includes:
[0088] From the preset matching rule set database, we query multiple central sentences with the same meaning under each session tag, gather multiple central sentences with the same meaning into the matching rule set under that session tag, and traverse all session tags to obtain the matching rule set under each tag.
[0089] The final speech data of the sample corpus obtained by performing fluency processing based on multiple matching rule sets under multiple conversation tags specifically includes:
[0090] The process of generating n speech data points specifically includes: randomly selecting a central sentence from the matching rule set under each conversation tag, combining the central sentences according to the order of the conversation tags to obtain the first combined central text, generating the first speech data from the first combined central text, performing this process n times to obtain n speech data points, inputting the n speech data points into the fluency model to calculate n calculation results, and selecting the speech data corresponding to one of the n calculation results as the final speech data.
[0091] The above calculation of n results from inputting n speech data into the fluency model specifically includes:
[0092] n voice data points are input as n input data points to the fluency model to perform neural network operations and obtain n operation results. Activation processing is then performed on the n operation results to obtain n calculation results.
[0093] The above-mentioned method of selecting one speech data corresponding to each of the n calculation results as the final speech data specifically includes:
[0094] Select the maximum value from n calculation results and determine it as a single calculation result;
[0095] Alternatively, extract m calculation results greater than the first threshold from n calculation results, and randomly select one from the m calculation results to determine it as a calculation result.
[0096] All relevant content in each scenario involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0097] This application also provides a computer-readable storage medium storing a computer program that, when run on a network device,... Figure 5 The method and flow shown are thus implemented.
[0098] This application also provides a computer program product, which, when run on a terminal, provides a method for... Figure 5The method and flow shown are thus implemented.
[0099] The above primarily describes the solutions of the embodiments of this application from the perspective of the method execution process. It is understood that, in order to achieve the above functions, the electronic device includes the corresponding hardware structure and / or software template for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments provided herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0100] This application embodiment can divide the electronic device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0101] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and templates involved are not necessarily essential to this application.
[0102] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0103] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0104] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0105] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0106] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0107] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
Claims
1. A method for implementing template-based dialogue scripts based on AI, characterized in that, The method includes the following steps: The terminal receives sample corpus, performs word segmentation preprocessing on the sample corpus to obtain the word segmentation result, and performs session tagging on the word segmentation result to obtain multiple session tags for the sample corpus; The terminal performs template mining processing on each of the multiple session tags to obtain the matching rule set under each tag; The terminal performs fluency processing based on multiple matching rule sets under multiple session tags to obtain the final speech data of the sample corpus, specifically including: The terminal generates n voice data points, specifically including: randomly selecting a central sentence from the matching rule set under each session tag, combining the central sentences according to the order of the session tags to obtain the first combined central text, generating the first voice data from the first combined central text, performing this process n times to obtain n voice data points, inputting the n voice data points into the fluency model to calculate n calculation results, and selecting the voice data corresponding to one of the n calculation results as the final voice data. Select the maximum value from n calculation results and determine it as a single calculation result; Alternatively, extract m calculation results greater than the first threshold from n calculation results, and randomly select one from the m calculation results to determine it as a calculation result.
2. The method according to claim 1, characterized in that, The step of performing conversation tagging on the word segmentation result to obtain multiple conversation tags for the sample corpus specifically includes: The word segmentation result is input into the association mining model to obtain the baffle and keywords. At the same time, the word segmentation result is input into the clustering model to obtain the central sentence. Based on the baffle, keywords and central sentence, the multiple conversation tags are determined.
3. The method according to claim 1, characterized in that, The terminal performs template mining processing on each of the multiple session tags to obtain the matching rule set under each tag, specifically including: The terminal retrieves multiple central sentences with the same meaning from the preset matching rule set database for each session tag, aggregates these multiple central sentences with the same meaning into the matching rule set for that session tag, and iterates through all session tags to obtain the matching rule set for each tag.
4. The method according to claim 1, characterized in that, The specific steps of inputting n voice data into the fluency model to obtain n calculation results include: n voice data points are input as n input data points to the fluency model to perform neural network operations and obtain n operation results. Activation processing is then performed on the n operation results to obtain n calculation results.
5. The method according to claim 1, characterized in that, The activation function for the activation process is: sigmoid, tanh, relu, or softmax.
6. A template-based dialogue implementation system based on AI, characterized in that, The system includes: The receiving unit is used to receive sample corpora. The processing unit is used to perform word segmentation preprocessing on the sample corpus to obtain word segmentation results, perform conversation tagging on the word segmentation results to obtain multiple conversation tags for the sample corpus; perform template mining on each of the multiple conversation tags to obtain a matching rule set under each tag; and perform fluency processing on the multiple matching rule sets under the multiple conversation tags to obtain the final speech data of the sample corpus. Specifically, this includes: randomly extracting a central sentence from the matching rule set under each conversation tag, combining the central sentences according to the order of the conversation tags to obtain a first combined central text, generating the first speech data from the first combined central text, performing this process n times to obtain n speech data, inputting the n speech data into the fluency model to calculate n calculation results, and selecting the speech data corresponding to one of the n calculation results as the final speech data. Select the maximum value from n calculation results and determine it as a single calculation result; Alternatively, extract m calculation results greater than the first threshold from n calculation results, and randomly select one from the m calculation results to determine it as a calculation result.
7. An electronic device comprising a processor, a memory, a communication interface, and one or more programs, said one or more programs being stored in the memory and configured to be executed by the processor, said programs comprising instructions for performing the steps of the method as claimed in any one of claims 1-5.
8. A computer-readable storage medium storing a computer program that, when run on a user device, performs the method as described in any one of claims 1-5.