Response text generation method and device, computer equipment and storage medium

By adopting the reply text generation method in the intelligent customer service system, using professional category recognition, knowledge base query, entity extraction and ERNIE-Gram-CharCNN model to generate reply text, the existing system's shortcomings in user intention analysis depth and question response accuracy are solved, and a higher problem matching rate and answer accuracy are achieved.

CN119848210APending Publication Date: 2025-04-18ASPIRE TECH (SHENZHEN) LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411997472.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The existing intelligent customer service system has shortcomings in the depth of user intention analysis and the accuracy of question response.

Method used

A reply text generation method is adopted to receive text data input by users, professional category recognition is carried out, system knowledge base and initial question and answer model are called, entity extraction and matching association are carried out, and finally the target reply text is generated using the ERNIE-Gram-CharCNN model.

Benefits of technology

It improves the matching rate of questions and the accuracy of answers, and enhances the system's understanding of user intentions and the accuracy of reply.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848210A_ABST
    Figure CN119848210A_ABST
Patent Text Reader

Abstract

The embodiment of the invention belongs to the technical field of natural language processing, and relates to a reply text generation method and device, computer equipment and a storage medium, and the method comprises the following steps: carrying out professional category identification operation on input text data to obtain professional category data; calling a system knowledge base, and obtaining target knowledge data corresponding to the professional category data from the system knowledge base; calling an initial question and answer model, and inputting the target knowledge data into the initial question and answer model to perform a first text generation operation to obtain a preliminary reference parameter; calling an entity extraction model, and inputting the preliminary reference parameters and the input text data into the entity extraction model for entity extraction operation to obtain triple data; performing matching association operation on the triple data and the target knowledge data to obtain matching association data; and inputting the matched associated data into the ERNIE-Gram-CHARCNN model to carry out a second text generation operation, thereby obtaining a target reply text. According to the invention, the accuracy of answers can be dynamically optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing technology, and in particular to a method, device, computer equipment and storage medium for generating a reply text. Background Art

[0002] With the rapid development of artificial intelligence technology, natural language processing (NLP) is an important research field of human-computer interaction, which analyzes and processes natural language. It has promoted the innovation of language model development. Traditional intelligent customer service systems are based on a limited knowledge base and are difficult to meet the diverse needs of linearly growing users. The rapid development of natural language processing has provided a new research solution for intelligent customer service systems.

[0003] There is an existing intelligent customer service system that analyzes information sent by users based on preset rules and knowledge base templates, captures user needs, and thus generates a reply text for the intelligent customer service.

[0004] However, the applicant has found that the depth of analysis of user intent and the accuracy of answering questions by existing systems need to be improved. Summary of the invention

[0005] The purpose of the embodiments of the present application is to propose a reply text generation method, apparatus, computer equipment and storage medium to solve the problem of low reply accuracy in existing intelligent customer service systems.

[0006] In order to solve the above technical problems, the present application embodiment provides a reply text generation method applied to a customer service system, which adopts the following technical solution: Receiving input text data sent by a user terminal; Performing a professional category recognition operation on the input text data to obtain professional category data; Calling a system knowledge base, and acquiring target knowledge data corresponding to the professional category data in the system knowledge base; Calling an initial question-answering model, and inputting the target knowledge data into the initial question-answering model to perform a first text generation operation to obtain preliminary reference parameters; Calling an entity extraction model, and inputting the preliminary reference parameters and the input text data into the entity extraction model to perform an entity extraction operation to obtain triple data; Perform matching and associating operations on the triple data and the target knowledge data to obtain matching and associating data; Inputting the matching associated data into the ERNIE-Gram-CharCNN model to perform a second text generation operation to obtain a target reply text; The target reply text is output to the user terminal.

[0007] Furthermore, the step of performing a professional category recognition operation on the input text data to obtain professional category data specifically includes the following steps: Performing a preprocessing operation on the input text data to obtain preprocessed text data; Input the preprocessed text data into the ERNIE-Gram model for segmentation and position encoding operations to obtain an embedding vector; The embedding vector is input into the CharCNN model to perform category prediction operation to obtain the professional category data.

[0008] Furthermore, the step of inputting the embedding vector into the CharCNN model for category prediction operation to obtain the professional category data specifically includes the following steps: Inputting the embedding vector into the convolutional layer of the CharCNN model to perform a first feature extraction operation to obtain first feature extraction data; Inputting the first feature extraction data into the pooling layer of the CharCNN model to perform a second feature extraction operation to obtain second feature extraction data; Integrating the first feature extraction data and the second feature extraction data to obtain integrated feature extraction data; The integrated feature extraction data is input into the fully connected layer of the CharCNN model to perform category prediction operation to obtain the professional category data.

[0009] Furthermore, the step of calling the initial question-answering model and inputting the target knowledge data into the initial question-answering model to perform a first text generation operation to obtain preliminary reference parameters specifically includes the following steps: Performing vectorization processing on the target knowledge data and the input text data respectively to obtain target knowledge vector data and input text vector data; Performing a similarity comparison operation on the target knowledge vector data and the input text vector data to obtain a similarity comparison result; The target knowledge data and input text data corresponding to the similarity comparison result with the highest similarity are input into the initial question-answering model to perform a first text generation operation to obtain the preliminary reference parameters.

[0010] Furthermore, the step of inputting the preliminary reference parameters and the input text data into the entity extraction model to perform entity extraction operation to obtain triple data specifically includes the following steps: Segmenting the input text data to obtain segmented text data; Acquire the user's real intention data according to the preliminary reference parameters and the segmented text data; Generate an execution vector path according to the real intent data and the node data of the service layer; The execution vector path is input into the entity layer of the entity extraction model to perform entity extraction operation to obtain the triple data.

[0011] In order to solve the above technical problems, the embodiment of the present application further provides a reply text generation device applied to a customer service system, which adopts the following technical solution: An input text acquisition module, used to receive input text data sent by a user terminal; A professional category recognition module, used to perform a professional category recognition operation on the input text data to obtain professional category data; A target knowledge acquisition module, used for calling a system knowledge base and acquiring target knowledge data corresponding to the professional category data in the system knowledge base; A first text generation module is used to call the initial question-answering model and input the target knowledge data into the initial question-answering model to perform a first text generation operation to obtain preliminary reference parameters; An entity extraction module, used for calling an entity extraction model, and inputting the preliminary reference parameters and the input text data into the entity extraction model to perform entity extraction operation, thereby obtaining triple data; A matching and associating module, used for performing matching and associating operations on the triple data and the target knowledge data to obtain matching and associating data; A second text generation module, used for inputting the matching associated data into the ERNIE-Gram-CharCNN model to perform a second text generation operation to obtain a target reply text; A reply text output module is used to output the target reply text to the user terminal.

[0012] Furthermore, the professional category identification module includes: A preprocessing submodule, used for performing a preprocessing operation on the input text data to obtain preprocessed text data; A position encoding submodule, used for inputting the preprocessed text data into the ERNIE-Gram model for segmentation and position encoding operations to obtain an embedding vector; The category prediction submodule is used to input the embedding vector into the CharCNN model to perform a category prediction operation to obtain the professional category data.

[0013] Furthermore, the category prediction submodule includes: A first feature extraction unit, used for inputting the embedding vector into the convolution layer of the CharCNN model to perform a first feature extraction operation to obtain first feature extraction data; A second feature extraction unit, used for inputting the first feature extraction data into the pooling layer of the CharCNN model to perform a second feature extraction operation to obtain second feature extraction data; an integration unit, configured to integrate the first feature extraction data and the second feature extraction data to obtain integrated feature extraction data; The category prediction unit is used to input the integrated feature extraction data into the fully connected layer of the CharCNN model to perform a category prediction operation to obtain the professional category data.

[0014] 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: 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 reply text generation method applied to the customer service system as described above are implemented.

[0015] 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: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the reply text generation method applied to the customer service system as described above are implemented.

[0016] The present application provides a reply text generation method applied to a customer service system, comprising: receiving input text data sent by a user terminal; performing a professional category recognition operation on the input text data to obtain professional category data; calling a system knowledge base, and obtaining target knowledge data corresponding to the professional category data in the system knowledge base; calling an initial question-answering model, and inputting the target knowledge data into the initial question-answering model to perform a first text generation operation to obtain preliminary reference parameters; calling an entity extraction model, and inputting the preliminary reference parameters and the input text data into the entity extraction model to perform an entity extraction operation to obtain triple data; performing a matching and association operation on the triple data and the target knowledge data to obtain matching and association data; inputting the matching and association data into an ERNIE-Gram-CharCNN model to perform a second text generation operation to obtain a target reply text; and outputting the target reply text to the user terminal. Compared with the prior art, this application identifies and analyzes the questions raised by users, combines with the knowledge base, searches for knowledge related to the text of the customer's query, and builds a large model. This is used as an aggregation of triple elements of the knowledge graph, and is extracted and matched from top to bottom. The ERNIE-Gram-CharCNN model is then used to train the final matching answer to the question. This application improves the question matching rate and the accuracy of the answer through the aggregation of two large model constructions. At the same time, the system can perform learning optimization for the user's question records, continuously enrich the coupling, and dynamically optimize the accuracy of the answer. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] 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.

[0018] Figure 1 is an exemplary system architecture diagram to which the present application may be applied; Figure 2 It is a flowchart of the implementation of the reply text generation method applied to the customer service system provided in the embodiment of the present application; Figure 3 It is a structural diagram of an embodiment of the ERNIE-Gram-CharCNN model provided in an embodiment of the present application; Figure 4 It is a structural schematic diagram of a reply text generating device applied to a customer service system provided in an embodiment of the present application; Figure 5 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0019] 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.

[0020] 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.

[0021] 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.

[0022] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0023] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0024] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to a laptop computer 1011, a tablet computer 1012 or a mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.

[0025] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .

[0026] It should be noted that the reply text generation method applied to the customer service system provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the reply text generation device applied to the customer service system is generally set in the server / terminal device.

[0027] 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.

[0028] Continue to refer Figure 2 , shows a flow chart of an embodiment of a method for generating a reply text applied to a customer service system according to the present application. The method for generating a reply text applied to a customer service system comprises: step S201, step S202, step S203, step S204, step S205, step S206, step S207 and step S208.

[0029] In step S201, input text data sent by a user terminal is received.

[0030] In the embodiments of the present application, the user terminal refers to a terminal device used to execute the image processing method for preventing document abuse provided by the present application. The user terminal can be a mobile terminal such as a mobile phone, a smart phone, a laptop computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, etc., as well as a fixed terminal such as a digital TV, a desktop computer, etc. It should be understood that the examples of user terminals here are only for the convenience of understanding and are not used to limit the present application.

[0031] In step S202, a professional category recognition operation is performed on the input text data to obtain professional category data.

[0032] In an embodiment of the present application, intent recognition analysis is performed on the text question input by the user to determine the professional category to which the user's question belongs.

[0033] In step S203, the system knowledge base is called, and target knowledge data corresponding to the professional category data is obtained in the system knowledge base.

[0034] In the embodiment of the present application, knowledge related to the text question input by the user is retrieved in the knowledge base of the corresponding category.

[0035] In step S204, the initial question-answering model is called, and the target knowledge data is input into the initial question-answering model to perform a first text generation operation to obtain preliminary reference parameters.

[0036] In an embodiment of the present application, the retrieved knowledge is transmitted to the model as input parameters to predict the answer to the question and form preliminary reference parameters.

[0037] In step S205, the entity extraction model is called, and the preliminary reference parameters and the input text data are input into the entity extraction model to perform entity extraction operations to obtain triple data.

[0038] In the embodiment of the present application, triples are generated by large model extraction using the above-mentioned preliminary reference parameters.

[0039] In step S206, a matching and association operation is performed on the triple data and the target knowledge data to obtain matching and associated data.

[0040] In an embodiment of the present application, the generated triples are matched and associated with the constructed professional category knowledge graph.

[0041] In step S207, the matching associated data is input into the ERNIE-Gram-CharCNN model to perform a second text generation operation to obtain the target reply text.

[0042] In an embodiment of the present application, the data associated with the knowledge graph is again passed as a parameter to the ERNIE-Gram-CharCNN model for secondary construction to generate the answer to the question.

[0043] In step S208, the target reply text is output to the user terminal.

[0044] In an embodiment of the present application, a reply text generation method applied to a customer service system is provided, comprising: receiving input text data sent by a user terminal; performing a professional category recognition operation on the input text data to obtain professional category data; calling a system knowledge base, and obtaining target knowledge data corresponding to the professional category data in the system knowledge base; calling an initial question-answering model, and inputting the target knowledge data into the initial question-answering model for a first text generation operation to obtain a preliminary reference parameter; calling an entity extraction model, and inputting the preliminary reference parameter and the input text data into the entity extraction model for an entity extraction operation to obtain triple data; performing a matching association operation on the triple data and the target knowledge data to obtain matching association data; inputting the matching association data into an ERNIE-Gram-CharCNN model for a second text generation operation to obtain a target reply text; and outputting the target reply text to the user terminal. Compared with the prior art, the present application performs recognition and analysis on the questions raised by the user, combines the knowledge base, searches for knowledge related to the customer query question text, and constructs a large model, which is used as an aggregation of the triple elements of the knowledge graph, extracts and matches the construction from top to bottom, and then trains the ERNIE-Gram-CharCNN model to obtain the answer to the final matching question. This application improves the question matching rate and the accuracy of the answer by building and aggregating two large models. At the same time, the system can perform learning optimization on the user's question records, continuously enrich the coupling, and dynamically optimize the accuracy of the answer.

[0045] In some optional implementations of the embodiments of the present application, the above step of performing a professional category recognition operation on the input text data to obtain professional category data specifically includes the following steps: Performing a preprocessing operation on the input text data to obtain preprocessed text data; Input the preprocessed text data into the ERNIE-Gram model for segmentation and position encoding operations to obtain an embedding vector; The embedded vector is input into the CharCNN model for category prediction operation to obtain professional category data.

[0046] In an embodiment of the present application, the initially acquired user query information is preprocessed. The preprocessing mainly cleans and cuts the data that have interference information for model training, such as special symbols and stop words in the text, obtains the truncated preprocessed data set, and performs labeling and classification, so as to convert the data into the training input format of the ERNIE-Gram model.

[0047] In the embodiment of the present application, the processed data is input into the embedding layer of the ERNIE-Gram model, and segmentation and position encoding operations are performed to obtain an embedding vector, and the embedding vector is used to perform language modeling by displaying n-gram identifiers as pre-training targets to reduce the prediction space, wherein the loss function is as follows:

[0048] in, Indicates the statement after the mask operation. Indicates the characters to be masked.

[0049] At the same time, predictions are made at the fine-grained token level and single-identity coarse-grained coverage of n-Gram entities. The internal connections are considered in more detail to retain and extract more comprehensive semantics. The loss function is as follows:

[0050] In an embodiment of the present application, the data processed by the above steps are subjected to multiple linear mappings, normalization, residual connection and other operations to obtain the output vector data of the ERNIE-Gram model.

[0051] In an embodiment of the present application, the output vector data of the ERNIE-Gram model is input into the CharCNN model for category prediction operation to obtain professional category data.

[0052] In some optional implementations of the embodiments of the present application, the step of inputting the embedding vector into the CharCNN model for category prediction operation to obtain professional category data specifically includes the following steps: Input the embedded vector into the convolution layer of the CharCNN model to perform a first feature extraction operation to obtain first feature extraction data; Input the first feature extraction data into the pooling layer of the CharCNN model to perform a second feature extraction operation to obtain second feature extraction data; Integrate the first feature extraction data and the second feature extraction data to obtain integrated feature extraction data; The integrated feature extraction data is input into the fully connected layer of the CharCNN model for category prediction operation to obtain professional category data.

[0053] In the embodiment of the present application, the output vector data of the ERNIE-Gram model is input into the CharCNN model. First, the input vector matrix is ​​transferred to the convolution layer through the input layer of the CharCNN model for feature extraction. The granularity of feature extraction is adjusted based on the set convolution kernel size. Then, the convolution kernel is moved to perform a scanning operation on the obtained vector matrix to extract feature information. The convolution calculation formula is as follows: Wherein, assuming that the input is , the convolution kernel is , the step length is t , m is the bias term, then the convolution formula is:

[0054]

[0055] In the embodiment of the present application, after feature extraction is performed through the convolution layer, the pooling layer obtains input from the convolution layer and performs secondary feature extraction. CharCNN uses the maximum pooling method, which can not only retain the most significant features of the text, but also reduce parameters to improve the model training rate and ensure the generalization ability of data processing. Assume that the input is , the maximum pooling function is , m is the bias term, then the formula is:

[0056]

[0057] In the embodiment of the present application, the fully connected layer integrates the information of the convolutional layer and the combined information extracted by the pooling layer, and performs category prediction at the same time. The pooling layer obtains n training set data, where represents the text feature vector, represents the text category. Suppose that through the function h(x) Given a text vector x The class probability p The function formula is as follows:

[0058] in, Represents the model parameters, and the minimum cost function is as follows:

[0059]

[0060] .

[0061] In some optional implementations of the embodiments of the present application, the above-mentioned step of calling the initial question-answering model and inputting the target knowledge data into the initial question-answering model to perform a first text generation operation to obtain preliminary reference parameters specifically includes the following steps: Performing vectorization processing on the target knowledge data and the input text data respectively to obtain the target knowledge vector data and the input text vector data; Performing a similarity comparison operation on the target knowledge vector data and the input text vector data to obtain a similarity comparison result; The target knowledge data corresponding to the similarity comparison result with the highest similarity and the input text data are input into the initial question-answering model to perform the first text generation operation to obtain preliminary reference parameters.

[0062] In an embodiment of the present application, the text of the knowledge base is divided and then vectorized, and the user's questions are similarly vectorized, the two are compared for similarity, the text block with the highest similarity is integrated with the question text, and the integrated data is transmitted as input to the large model to predict the answer to the question and form preliminary reference parameters.

[0063] In some optional implementations of the embodiments of the present application, the step of inputting the preliminary reference parameters and the input text data into the entity extraction model to perform entity extraction operations to obtain triple data specifically includes the following steps: Segmenting the input text data to obtain segmented text data; Acquire the user's real intention data based on preliminary reference parameters and segmented text data; Generate an execution vector path based on the real intent data and the node data of the service layer; The execution vector path is input into the entity layer of the entity extraction model to perform entity extraction operation and obtain triple data.

[0064] In an embodiment of the present application, data preprocessing is performed on the acquired input data, special characters and symbols in the text are removed, and the sentences are segmented. The actual intention of the user is obtained based on the preliminary reference parameters obtained in step 2, and an execution vector path is generated in combination with the node data of the service layer, which is then transmitted to the entity layer output to obtain the extraction of the data entity.

[0065] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. 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] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0067] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it 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).

[0068] 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.

[0069] Further references Figure 4 , as a response to the above Figure 2 The present application provides an embodiment of a reply text generation device applied to a customer service system. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0070] like Figure 4 As shown, the reply text generating device 200 applied to the customer service system of the embodiment of the present application includes: An input text acquisition module 210, used to receive input text data sent by a user terminal; The professional category identification module 220 is used to perform professional category identification operation on the input text data to obtain professional category data; The target knowledge acquisition module 230 is used to call the system knowledge base and acquire the target knowledge data corresponding to the professional category data in the system knowledge base; A first text generation module 240 is used to call the initial question-answering model and input the target knowledge data into the initial question-answering model to perform a first text generation operation to obtain preliminary reference parameters; The entity extraction module 250 is used to call the entity extraction model and input the preliminary reference parameters and the input text data into the entity extraction model to perform entity extraction operations to obtain triple data; The matching and associating module 260 is used to perform matching and associating operations on the triple data and the target knowledge data to obtain matching and associating data; A second text generation module 270, for inputting the matching associated data into the ERNIE-Gram-CharCNN model to perform a second text generation operation to obtain a target reply text; The reply text output module 280 is used to output the target reply text to the user terminal.

[0071] In an embodiment of the present application, a reply text generation device 200 applied to a customer service system is provided, including: an input text acquisition module 210, which is used to receive input text data sent by a user terminal; a professional category identification module 220, which is used to perform a professional category identification operation on the input text data to obtain professional category data; a target knowledge acquisition module 230, which is used to call a system knowledge base and obtain target knowledge data corresponding to the professional category data in the system knowledge base; a first text generation module 240, which is used to call an initial question-answer model, and input the target knowledge data into the initial question-answer model to perform a first text generation operation to obtain preliminary reference parameters; an entity extraction module 250, which is used to call an entity extraction model, and input preliminary reference parameters and input text data into the entity extraction model to perform an entity extraction operation to obtain triple data; a matching association module 260, which is used to perform a matching association operation on the triple data and the target knowledge data to obtain matching association data; a second text generation module 270, which is used to input the matching association data into the ERNIE-Gram-CharCNN model to perform a second text generation operation to obtain a target reply text; and a reply text output module 280, which is used to output the target reply text to the user terminal. Compared with the prior art, this application identifies and analyzes the questions raised by users, combines with the knowledge base, searches for knowledge related to the text of the customer's query, and builds a large model. This is used as an aggregation of triple elements of the knowledge graph, and is extracted and matched from top to bottom. The ERNIE-Gram-CharCNN model is then used to train the final matching answer to the question. This application improves the question matching rate and the accuracy of the answer through the aggregation of two large model constructions. At the same time, the system can perform learning optimization for the user's question records, continuously enrich the coupling, and dynamically optimize the accuracy of the answer.

[0072] In some optional implementations of the embodiments of the present application, the professional category identification module includes: The preprocessing submodule is used to perform preprocessing operations on the input text data to obtain preprocessed text data; The position encoding submodule is used to input the preprocessed text data into the ERNIE-Gram model for segmentation and position encoding operations to obtain an embedding vector; The category prediction submodule is used to input the embedded vector into the CharCNN model for category prediction operation to obtain professional category data.

[0073] In some optional implementations of the embodiments of the present application, the above-mentioned category prediction submodule includes: A first feature extraction unit, used for inputting the embedded vector into the convolution layer of the CharCNN model to perform a first feature extraction operation to obtain first feature extraction data; A second feature extraction unit is used to input the first feature extraction data into the pooling layer of the CharCNN model to perform a second feature extraction operation to obtain second feature extraction data; An integration unit, used for integrating the first feature extraction data and the second feature extraction data to obtain integrated feature extraction data; The category prediction unit is used to input the integrated feature extraction data into the fully connected layer of the CharCNN model for category prediction operations to obtain professional category data.

[0074] To solve the above technical problems, the present application also provides a computer device. Figure 5 , Figure 5 This is a basic structural block diagram of a computer device according to an embodiment of the present application.

[0075] The computer device 300 includes a memory 310, a processor 320, and a network interface 330 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 300 having components 310-330, 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), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0076] 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.

[0077] The memory 310 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, magnetic disk, optical disk, etc. In some embodiments, the memory 310 can be an internal storage unit of the computer device 300, such as a hard disk or memory of the computer device 300. In other embodiments, the memory 310 can also be an external storage device of the computer device 300, such as a plug-in hard disk equipped on the computer device 300, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Of course, the memory 310 can also include both the internal storage unit of the computer device 300 and its external storage device. In the embodiment of the present application, the memory 310 is generally used to store the operating system and various application software installed on the computer device 300, such as computer-readable instructions for the reply text generation method applied to the customer service system. In addition, the memory 310 can also be used to temporarily store various data that have been output or are to be output.

[0078] The processor 320 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 320 is generally used to control the overall operation of the computer device 300. In the embodiment of the present application, the processor 320 is used to run the computer-readable instructions stored in the memory 310 or process data, such as running the computer-readable instructions of the reply text generation method applied to the customer service system.

[0079] The network interface 330 may include a wireless network interface or a wired network interface. The network interface 330 is generally used to establish a communication connection between the computer device 300 and other electronic devices.

[0080] The computer device provided by this application recognizes and analyzes the questions raised by the user, searches for knowledge related to the text of the customer's query in combination with the knowledge base, and builds a large model. This is used as an aggregation of triple elements of the knowledge graph, and is extracted and matched from top to bottom. The answer to the final matching question is then trained through the ERNIE-Gram-CharCNN model. This application improves the question matching rate and the accuracy of the answer through the construction and aggregation of two large models. At the same time, for the user's question records, the system can perform learning optimization, continuously enrich coupling, and dynamically optimize the accuracy of the answer.

[0081] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which 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 reply text generation method applied to the customer service system as described above.

[0082] The computer-readable storage medium provided by the present application, after identifying and analyzing the questions raised by the user, searches for knowledge related to the text of the customer's query question in combination with the knowledge base, builds a large model, uses this as an aggregation of the triple elements of the knowledge graph, extracts and matches the construction from top to bottom, and then trains the final matching answer to the question through the ERNIE-Gram-CharCNN model. The present application improves the question matching rate and the accuracy of the answer through the construction and aggregation of two large models. At the same time, for the user's question records, the system can perform learning optimization, continuously enrich the coupling, and dynamically optimize the accuracy of the answer.

[0083] 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, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0084] 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 generating a reply text applied to a customer service system, characterized in that: The steps include: Receiving input text data sent by a user terminal; Performing a professional category recognition operation on the input text data to obtain professional category data; Calling a system knowledge base, and acquiring target knowledge data corresponding to the professional category data in the system knowledge base; Calling an initial question-answering model, and inputting the target knowledge data into the initial question-answering model to perform a first text generation operation to obtain preliminary reference parameters; Calling an entity extraction model, and inputting the preliminary reference parameters and the input text data into the entity extraction model to perform an entity extraction operation to obtain triple data; Perform matching and associating operations on the triple data and the target knowledge data to obtain matching and associating data; Inputting the matching associated data into the ERNIE-Gram-CharCNN model to perform a second text generation operation to obtain a target reply text; The target reply text is output to the user terminal.

2. The method for generating a reply text applied to a customer service system according to claim 1, characterized in that: The step of performing a professional category recognition operation on the input text data to obtain professional category data specifically includes the following steps: Performing a preprocessing operation on the input text data to obtain preprocessed text data; Input the preprocessed text data into the ERNIE-Gram model for segmentation and position encoding operations to obtain an embedding vector; The embedding vector is input into the CharCNN model to perform category prediction operation to obtain the professional category data.

3. The method for generating a reply text applied to a customer service system according to claim 2, characterized in that: The step of inputting the embedding vector into the CharCNN model to perform a category prediction operation to obtain the professional category data specifically includes the following steps: Inputting the embedding vector into the convolutional layer of the CharCNN model to perform a first feature extraction operation to obtain first feature extraction data; Inputting the first feature extraction data into the pooling layer of the CharCNN model to perform a second feature extraction operation to obtain second feature extraction data; Integrating the first feature extraction data and the second feature extraction data to obtain integrated feature extraction data; The integrated feature extraction data is input into the fully connected layer of the CharCNN model to perform category prediction operation to obtain the professional category data.

4. The method for generating a reply text applied to a customer service system according to claim 1, characterized in that: The step of calling the initial question-answering model and inputting the target knowledge data into the initial question-answering model to perform a first text generation operation to obtain preliminary reference parameters specifically includes the following steps: Performing vectorization processing on the target knowledge data and the input text data respectively to obtain target knowledge vector data and input text vector data; Performing a similarity comparison operation on the target knowledge vector data and the input text vector data to obtain a similarity comparison result; The target knowledge data and input text data corresponding to the similarity comparison result with the highest similarity are input into the initial question-answering model to perform a first text generation operation to obtain the preliminary reference parameters.

5. The method for generating a reply text applied to a customer service system according to claim 1, characterized in that: The step of inputting the preliminary reference parameters and the input text data into the entity extraction model to perform entity extraction operation to obtain triple data specifically includes the following steps: Segmenting the input text data to obtain segmented text data; Acquire the user's real intention data according to the preliminary reference parameters and the segmented text data; Generate an execution vector path according to the real intent data and the node data of the service layer; The execution vector path is input into the entity layer of the entity extraction model to perform entity extraction operation to obtain the triple data.

6. A reply text generating device applied to a customer service system, characterized in that: include: An input text acquisition module, used to receive input text data sent by a user terminal; A professional category recognition module, used to perform a professional category recognition operation on the input text data to obtain professional category data; A target knowledge acquisition module, used for calling a system knowledge base and acquiring target knowledge data corresponding to the professional category data in the system knowledge base; A first text generation module is used to call the initial question-answering model and input the target knowledge data into the initial question-answering model to perform a first text generation operation to obtain preliminary reference parameters; An entity extraction module, used for calling an entity extraction model, and inputting the preliminary reference parameters and the input text data into the entity extraction model to perform entity extraction operation, thereby obtaining triple data; A matching and associating module, used for performing matching and associating operations on the triple data and the target knowledge data to obtain matching and associating data; A second text generation module, used for inputting the matching associated data into the ERNIE-Gram-CharCNN model to perform a second text generation operation to obtain a target reply text; A reply text output module is used to output the target reply text to the user terminal.

7. The reply text generating device applied to the customer service system according to claim 6, characterized in that: The professional category identification module includes: A preprocessing submodule, used for performing a preprocessing operation on the input text data to obtain preprocessed text data; A position encoding submodule, used for inputting the preprocessed text data into the ERNIE-Gram model for segmentation and position encoding operations to obtain an embedding vector; The category prediction submodule is used to input the embedding vector into the CharCNN model to perform a category prediction operation to obtain the professional category data.

8. The reply text generating device applied to the customer service system according to claim 6, characterized in that: The category prediction submodule includes: A first feature extraction unit, used for inputting the embedding vector into the convolution layer of the CharCNN model to perform a first feature extraction operation to obtain first feature extraction data; A second feature extraction unit, used for inputting the first feature extraction data into the pooling layer of the CharCNN model to perform a second feature extraction operation to obtain second feature extraction data; an integration unit, configured to integrate the first feature extraction data and the second feature extraction data to obtain integrated feature extraction data; The category prediction unit is used to input the integrated feature extraction data into the fully connected layer of the CharCNN model to perform a category prediction operation to obtain the professional category data.

9. A computer device comprising a memory and a processor, characterized in that: The memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the reply text generation method applied to a customer service system as described in any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of a method for generating a reply text applied to a customer service system as described in any one of claims 1 to 5.