Online text customer service reply generation method and device
By combining user history, preference information, context information and semantic features of the pending text, extracting multiple features and inputting language models to generate answers, the inefficient accuracy problem of intelligent online customer service systems in the prior art is solved, and more efficient intention recognition and customized services are achieved.
Patent Information
- Application Number
- CN202411798350.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-11
AI Technical Summary
The lack of efficient and accurate intelligent online customer service system in the prior art makes it difficult to effectively identify user intentions and provide accurate responses.
By combining the user's history, preference information, context information, and semantic characteristics of the text itself, user text features, context context features, static knowledge features and dynamic knowledge features are extracted, and the language model is input to generate answers.
It significantly improves the accuracy of intention recognition, provides a customized service experience, and ensures the accuracy and efficiency of responses.
Smart Images

Figure CN119807350A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a method and device for generating a reply of an online text customer service. Background Art
[0002] Online text customer service, as a communication bridge connecting users and enterprises, plays an important role in the customer service process.
[0003] Traditional manual online customer service has limited response speed and is unable to cope with the large number of user consultation needs during business peak periods. Therefore, intelligent customer service systems came into being.
[0004] Intelligent customer service technology is usually based on simple keyword matching algorithms and predetermined correspondences between questions and answers. When it is identified that the user's question contains specific keywords, the corresponding answer is pushed.
[0005] Although with the development of natural language processing technology, some intelligent customer service have improved the quality and speed of response generation, there is still a lack of efficient and accurate intelligent online customer service systems. Summary of the invention
[0006] The present invention provides a method and device for generating a reply of an online text customer service, so as to solve the defect of the prior art that there is a lack of an efficient and accurate intelligent online customer service system, and realize a method for generating a reply of an online text customer service with clearer intention recognition and more accurate reply.
[0007] The present invention provides a method for generating a reply of an online text customer service, comprising: Weighting the text feature vector of the text to be processed based on the intention of the text to be processed input by the user to obtain the user text feature; Extracting context features based on the context of the text to be processed; Extracting static knowledge features based on the search results of the text to be processed in a pre-built knowledge base; Extracting dynamic knowledge features based on the user's behavior data on products and services within a previously preset time period; Input the user text features, the context features, the static knowledge features and the dynamic knowledge features into a language model to obtain the answer text output by the language model According to a method for generating a reply to online text customer service provided by the present invention, the step of extracting dynamic knowledge features based on the user's behavior data on products and services within a preset time period specifically includes: In the case where the user's behavior information points to a product, risk data of the product in a previously preset time period is obtained, and product statistical features are extracted based on the risk data, product time series features of the risk data are extracted using a time window, and the product statistical features and the product time series features are used as the dynamic knowledge features; In the case where the user's behavior information points to a service, the user behavior data of the user within a previously preset time period is obtained, and user statistical features are extracted based on the user behavior data. A time window is applied to extract user time series features of the user behavior data, and the user statistical features and the user time series features are used as the dynamic knowledge features.
[0008] According to a method for generating a reply of online text customer service provided by the present invention, the step of weighting the text feature vector of the text to be processed based on the intention of the text to be processed input by the user to obtain the user text feature specifically includes: After preprocessing the text to be processed input by the user, the text features are extracted; Intent recognition is performed on the text to be processed to obtain an intent label of the text to be processed, and the text feature is weighted based on the similarity between the intent label and the text feature.
[0009] According to a method for generating a reply of online text customer service provided by the present invention, the step of performing intent recognition on the text to be processed and obtaining an intent label of the text to be processed specifically includes: Extracting word frequency features of the text to be processed based on a word frequency-inverse document frequency algorithm; Extracting keywords of the text to be processed based on a Latent Dirichlet Allocation (LDA) topic model; Extracting named entities from the text to be processed; The word frequency feature, the keyword and the named entity are input into an intention recognition model to obtain an intention label of the text to be processed output by the intention recognition model.
[0010] According to a method for generating a reply to online text customer service provided by the present invention, the pre-built knowledge base includes a product and service document base and a bank knowledge base.
[0011] According to a method for generating a reply to online text customer service provided by the present invention, the step of extracting static knowledge features based on the search results of the text to be processed in a pre-built knowledge base specifically includes: Retrieving a first candidate text in the product and service document library based on the text to be processed, and weighting a text feature vector of the first candidate text based on the intention of the first candidate text to obtain a first knowledge feature; Retrieving a second candidate text from the bank knowledge base based on the text to be processed, and weighting a text feature vector of the second candidate text based on the intention of the second candidate text to obtain a second knowledge feature; The first knowledge feature and the second knowledge feature are used together as the static knowledge feature.
[0012] The present invention also provides a reply generating device for online text customer service, comprising: A first extraction module, configured to weight a text feature vector of the text to be processed based on the intention of the text to be processed input by the user, so as to obtain a user text feature; A second extraction module is used to extract context features based on the context of the text to be processed; A third extraction module is used to extract static knowledge features based on the search results of the text to be processed in the pre-built knowledge base; A fourth extraction module, configured to extract dynamic knowledge features based on the user's behavior data on products and services within a previously preset time period; The answer generation module inputs the user text features, the context features, the static knowledge features and the dynamic knowledge features into a language model to obtain an answer text output by the language model.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a reply generation method for online text customer service as described in any one of the above-mentioned methods is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for generating a reply to online text customer service as described in any one of the above.
[0015] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned methods for generating a reply to online text customer service.
[0016] The online text customer service reply generation method and device provided by the present invention generate the online intelligent customer service's reply by combining the user's historical records, preference information, context information and the semantic features of the text to be processed itself, and combine with multimodal data fusion technology to significantly improve the accuracy of intent recognition and provide customized service experience for different users. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is a flow chart of a method for generating a reply of online text customer service provided by the present invention; Figure 2 It is a structural schematic diagram of a reply generating device for online text customer service provided by the present invention; Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] Combine the following Figure 1 The present invention introduces a method for generating a reply to online text customer service, such as Figure 1 As shown, including: Step 101, weighting the text feature vector of the text to be processed based on the intention of the text to be processed input by the user to obtain the user text feature; The text to be processed input by the user is the text content input by the user this time.
[0021] Before feature extraction, the text to be processed input by the user is first preprocessed to convert the original text data into a format suitable for model processing, reduce the noise in the data, and improve the generalization ability and processing efficiency of the model.
[0022] Optionally, preprocessing includes operations such as word segmentation, part-of-speech tagging, and stop word removal, etc. Preprocessing provides high-quality data input for subsequent feature extraction steps.
[0023] Furthermore, the preprocessed text is extracted through word embedding to obtain a text feature vector.
[0024] On this basis, the intent is identified based on the preprocessed text.
[0025] Optionally, the intent of the preprocessed text to be processed may be extracted using an intent classification model in NLP (Natural Language Processing).
[0026] It can be understood that the text feature vector of the text to be processed is obtained based on the word segmentation result of the text to be processed, and the intent represents the subject of the text to be processed. The text feature vector is weighted using the intent so that the word features related to the subject are more emphasized in the obtained user text features.
[0027] Step 102, extracting context features based on the context of the text to be processed; Obtain the context information of the text to be processed, extract the context intent and semantic slots to supplement the context.
[0028] It is understandable that when users interact with intelligent customer service, multiple rounds of questions and answers often occur. When it is recognized that the content of multiple rounds of questions and answers points to the same topic, for example, contains common keywords, the text entered by the user first is used as the context information of this question and answer.
[0029] In addition, if the response to the previous round of questions and answers has not been generated, but the user's next question, that is, the user has entered the next text to be processed, it will be used as the context information generated for this reply.
[0030] Context information is obtained and extracted to obtain contextual features, which are used to enhance the model's understanding of user intent when generating responses.
[0031] In this implementation, the method of extracting context features is the same as the method of extracting user text features, so it will not be repeated here.
[0032] Step 103, extracting static knowledge features based on the search results of the text to be processed in the pre-built knowledge base; Since the method is mainly used in a bank customer service system, the pre-built knowledge base is a bank knowledge base that stores knowledge related to banking services.
[0033] The bank knowledge base is designed in a structured or semi-structured form, including FAQ lists, business rules, etc. Each knowledge point contains keywords, category tags, etc. to facilitate quick retrieval.
[0034] In a feasible implementation, the word segmentation results after preprocessing of the text to be processed are used to search in a pre-built knowledge base, and the multiple knowledge points with the highest matching degree are used as the search results.
[0035] Optionally, based on the result of intent recognition, multiple words with the highest relevance to the topic are selected as keywords.
[0036] Optionally, the keywords obtained by word segmentation are combined and then searched.
[0037] Optionally, a matching degree threshold is preset, and a knowledge point with a matching degree greater than the matching degree threshold is determined as the knowledge point with the highest matching degree.
[0038] Optionally, when a gap occurs in the matching degree value, the knowledge point before the gap is determined as the knowledge point with the highest matching degree.
[0039] On this basis, feature extraction is performed on the search results to obtain static knowledge features. It can be understood that static knowledge features are features that are directly semantically related to the user's text to be processed.
[0040] Step 104, extracting dynamic knowledge features based on the user's behavior data on products and services within a preset time period; Optionally, the time point when the user inputs the text to be processed is used as the time basis to obtain the user's behavior data within a previously preset time period, for example, the record data generated when the user browses or visits a web page, application and / or physical door point.
[0041] Optionally, the preset time period is set based on experience, and is determined to be three months in this embodiment, and the user behavior data of each day in the first three months is obtained.
[0042] Based on the user's behavioral data, it is determined that the user's intention is biased towards products, such as a bank's various financial products, or services, such as inquiry or processing.
[0043] Dynamic knowledge features are extracted based on behavioral data. It can be understood that dynamic knowledge features are features that contain time information, reflecting the user's intention preferences in the current time period. They are features that are semantically indirectly related to the user's text to be processed, and can also be used to assist in understanding the content of the user's question.
[0044] Step 105: input the user text features, the context features, the static knowledge features and the dynamic knowledge features into a language model to obtain a response text output by the language model.
[0045] The extracted user text features, contextual features, static knowledge features and dynamic knowledge features are input into the pre-trained language model to obtain the answer text output by the language model as the answer text of the online intelligent customer service.
[0046] Among them, the language model is based on the large language model, and its input layer is adjusted according to the characteristics of the actual input. The text interaction records of multiple users with real customer service in a historical time period are collected as a data set for training.
[0047] On this basis, user text features are used to provide the language model with the user's current demand information, contextual features are used to provide the language model with the user's demand information within a certain question-and-answer round, static knowledge features are used to provide the language model with answer information that directly corresponds to the user's needs, and dynamic knowledge features are used to provide the language model with answer information that indirectly reflects the user's needs, so that the language model can more accurately identify the user's intentions based on the above information and make more accurate and complete responses.
[0048] The present invention generates answers from online intelligent customer service by combining the user's historical records, preference information, contextual information and the semantic features of the text to be processed itself, and combines multimodal data fusion technology to significantly improve the accuracy of intent recognition and provide customized service experience for different users.
[0049] In the online text customer service reply generation method of the present invention, the step of extracting dynamic knowledge features based on the user's behavior data on products and services within a preset time period specifically includes: In the case where the user's behavior information points to a product, risk data of the product in a previously preset time period is obtained, and product statistical features are extracted based on the risk data, product time series features of the risk data are extracted using a time window, and the product statistical features and the product time series features are used as the dynamic knowledge features; User behavior information includes user behavior records on bank websites, applications, mini-programs or offline outlets, including the frequency, time and quantity of user browsing, inquiry, purchasing behavior or offline service records.
[0050] Based on the user's behavior information, it is determined that the current user's recent behavior tends to be inclined to understand financial products and / or financial services.
[0051] For example, if a user browses one or more financial products in an application multiple times in the past week, it is considered that the user's recent behavior tends to be inclined to learn about financial products. If a user queries income and expenditure information through an application in the past week, it is considered that the user's recent behavior tends to be inclined to learn about financial services. If the user has no operation in the past week, or the operation has no obvious bias, it can also be determined that the user wants to learn about both products and services, that is, no distinction is made between their importance.
[0052] When the user's behavior information points to a product, that is, the user's recent behavior tends to purchase the product, the risk data of the product browsed by the user is collected, which may specifically include the product's historical rate of return, volatility, risk level and other data.
[0053] Arrange the collected risk data in chronological order and extract useful features from the time series data.
[0054] First, the mean, variance, maximum, minimum, skewness, peak, etc. of risk data are calculated as product statistical features; second, risk data is extracted based on the time window to obtain the product time series features of each risk data. For example, when the preset time period is 28 days, 7 days is used as a time window, and the sliding window technology is used to extract the time series features of each window.
[0055] It can be understood that the product statistical characteristics reflect the overall characteristics of the product's risk data within a certain time period, while the product time series characteristics reflect the fluctuation information of the product's risk data within a certain time period.
[0056] Product statistical features and product time series features are used together as dynamic knowledge features to more accurately provide the language model with product features that users are interested in recently, which serve as the information basis for the language model to generate responses.
[0057] In the case where the user's behavior information points to a service, the user behavior data of the user within a previously preset time period is obtained, and user statistical features are extracted based on the user behavior data. A time window is applied to extract user time series features of the user behavior data, and the user statistical features and the user time series features are used as the dynamic knowledge features.
[0058] When the user's behavior information points to services, that is, the user's recent behavior tends to obtain financial services, the user's behavior data within a preset time period is collected, which may specifically include the frequency, time, and other data of the user's query, browsing, and access to financial services, and may include time series data indirectly related to financial services.
[0059] For example, a user has recently browsed a number of large deposit products, so it is determined that the user's behavior information points to financial services, specifically the purchase of deposit products. At this time, the deposit information and income and expenditure data of the user's own account are also collected as user behavior data.
[0060] It should be noted that the user behavior data collected at this time is the behavior data related to the service pointed to by the user, rather than all the behavior data of the user in the preset time period.
[0061] Arrange the collected user behavior data in chronological order and extract useful features from the time series.
[0062] The feature extraction method is the same as the method of extracting product statistical features and product time series features, so it will not be repeated here.
[0063] Product statistical features and product time series features are used together as dynamic knowledge features to more accurately provide the language model with service features that users are interested in recently, which serve as the information basis for the language model to generate responses.
[0064] In addition, it should be noted that this method can better help the model understand the user's true intention. This is because when users enter the text to be processed, they often enter high-level content. This is because users are not familiar with the specific categories of banking services. Take the user's need to open an account as an example. The "text to be processed" entered by the user is mostly "I need to open an account" or "I need to open a new account". This type of content only contains the high-level service "open an account". However, when actually processing the account opening service, the corresponding processes and required information are different for opening a new ordinary savings account, a new credit card account, a new salary card account, or a new corporate account.
[0065] Therefore, by extracting dynamic knowledge features and combining them with the user's recent behavior to assist the language model in better understanding the user's true intentions and refining the user's intentions, answers that are closer to the user's real needs can be placed in a more important position in the generated replies, and more personalized answers can be generated for the current user.
[0066] At the same time, it is understandable that when multiple answers are retrieved from the bank's knowledge base that match the question, for example, based on the user's input of "opening an account", the knowledge points of newly opening an ordinary savings account, newly opening a credit card account, newly opening a salary card account or newly opening a corporate account are retrieved, and the matching degree of the remaining keywords of "opening an account" is the same. In order to avoid the generated reply content being too cumbersome, you can generate the answer text according to pre-set rules, such as generating the answer text based on the knowledge point with the highest query frequency, and use other knowledge points as subsequent link content of the text. For example, answer the process and information of "newly opening an ordinary savings account", and generate links "Do you still need to apply for a new credit card account?" and "Do you still need to apply for a new salary card account" after the answer, and generate corresponding answers when the user clicks.
[0067] Therefore, the accuracy of the first answer displayed to the user is improved, the probability that the user needs to ask further questions or click to get a reply is reduced, and the computational pressure of the language model during peak hours is relieved, thereby improving the user experience.
[0068] In the reply generation method of online text customer service of the present invention, the step of weighting the text feature vector of the text to be processed based on the intention of the text to be processed input by the user to obtain the user text feature specifically includes: After preprocessing the text to be processed input by the user, the text features are extracted; Intent recognition is performed on the text to be processed to obtain an intent label of the text to be processed, and the text feature is weighted based on the similarity between the intent label and the text feature.
[0069] Optionally, after the text to be processed input by the user is preprocessed by means of word segmentation, part-of-speech tagging, removal of stop words, etc., feature extraction is performed on the preprocessed text by means of word embedding to obtain text features.
[0070] At the same time, the preprocessed text is subjected to intent recognition to obtain the intent label of the text to be processed.
[0071] Optionally, an existing intent recognition model can be used to recognize the intent of the text to be processed, and the output of the model can be used as the intent label. Other methods can also be used, such as using an LDA (Latent Dirichlet Allocation) topic model to extract the main body of the text to be processed as the intent label of the text to be processed.
[0072] On this basis, the similarity between each word and the intent label in the word segmentation of the text to be processed obtained after preprocessing is calculated, and the similarity results are normalized as the weight corresponding to each text feature. The weight is used to weight the text features to obtain the user text features.
[0073] In the method for generating a reply of online text customer service of the present invention, the step of performing intent recognition on the text to be processed and obtaining the intent label of the text to be processed specifically includes: Extracting word frequency features of the text to be processed based on a word frequency-inverse document frequency algorithm; Keyword extraction based on TF-IDF (term frequency-inverse document frequency) algorithm. The importance of words is evaluated by counting the frequency of occurrence of words in the text and their distribution in the entire document collection as word frequency features.
[0074] Extracting keywords of the text to be processed based on a Latent Dirichlet Allocation (LDA) topic model; Keyword extraction based on the LDA topic model uses the co-occurrence relationship of words in the text to be processed to cluster words by topic and extract keywords related to the topic.
[0075] Extracting named entities from the text to be processed; The biLSTM-CRF-based NER (Named Entity Recognition) method identifies named entities by counting the co-occurrence information of characters or words in the text. It divides the questions more finely, such as "this month" and "credit card bill details" in "query this month's credit card bill details", which are key information and help to accurately locate the type of question.
[0076] The word frequency feature, the keyword and the named entity are input into an intention recognition model to obtain an intention label of the text to be processed output by the intention recognition model.
[0077] The word frequency features, keyword features and named entities are input into the pre-trained intent recognition model to obtain the intent label of the text to be processed output by the intent recognition model.
[0078] The intent recognition model is trained by using a deep learning-based classification model in NLP and a data set constructed by collecting multiple user historical interaction records with online live customer service.
[0079] In the online text customer service reply generation method of the present invention, the pre-built knowledge base includes a product and service document base and a bank knowledge base.
[0080] Among them, the product and service document library is a database established by the bank itself for each product and service, mainly including descriptions of each product and service itself and its standardized processes.
[0081] The bank knowledge base is a structured database compiled and constructed by real customer service based on historical interaction records with users. It is in the form of a FAQ (Frequently Asked Questions) list, storing standard questions and answers from real customer service.
[0082] Searches are performed simultaneously in the product and service document library and the bank knowledge base so that the static knowledge features can represent the knowledge points corresponding to the answers and the corresponding customer service scripts.
[0083] In the method for generating a reply of online text customer service of the present invention, the step of extracting static knowledge features based on the search results of the text to be processed in a pre-built knowledge base specifically includes: Retrieving a first candidate text in the product and service document library based on the text to be processed, and weighting a text feature vector of the first candidate text based on the intention of the first candidate text to obtain a first knowledge feature; Optionally, after the text to be processed is segmented, or after the keywords of the text to be processed are extracted, a search is performed in the product and service document library to obtain a plurality of knowledge points with a high matching degree as the first candidate text.
[0084] The text feature vector of the first candidate text is weighted based on the intention of the first candidate text. This weighting method is the same as the method of obtaining the user text feature, so it is not repeated here.
[0085] Retrieving a second candidate text from the bank knowledge base based on the text to be processed, and weighting a text feature vector of the second candidate text based on the intention of the second candidate text to obtain a second knowledge feature; Optionally, after the text to be processed is segmented, or after the keywords of the text to be processed are extracted, a search is performed in the bank knowledge base to obtain a plurality of knowledge points with a high matching degree as the second candidate text.
[0086] The text feature vector of the first candidate text is weighted based on the intention of the second candidate text. This weighting method is the same as the method of obtaining the user text feature, so it will not be repeated here.
[0087] The first knowledge feature and the second knowledge feature are used together as the static knowledge feature.
[0088] By inputting the first knowledge feature and the second knowledge feature as static knowledge features into the language model, the language model can learn standard customer service scripts while learning knowledge, which can be used to generate more vivid answers to improve user experience.
[0089] On this basis, the generated answer text is output to the user, and the user's satisfaction feedback on the answer is collected for subsequent system optimization and improvement. User feedback and interaction data are analyzed regularly. According to the evaluation results, the intent recognition model and language model are adjusted and optimized. By continuously learning user feedback and interaction data, the system performance and service quality are continuously optimized.
[0090] The following is a description of the reply generation device for the online text customer service provided by the present invention. The reply generation device for the online text customer service described below and the reply generation method for the online text customer service described above can be referenced to each other.
[0091] like Figure 2 As shown, the reply generation device of the online text customer service includes a first extraction module 201, a second extraction module 202, a third extraction module 203, a fourth extraction module 204 and a reply generation module 205; A first extraction module 201 is used to weight the text feature vector of the text to be processed based on the intention of the text to be processed input by the user to obtain the user text feature; The text to be processed input by the user is the text content input by the user this time.
[0092] Before feature extraction, the text to be processed input by the user is first preprocessed to convert the original text data into a format suitable for model processing, reduce the noise in the data, and improve the generalization ability and processing efficiency of the model.
[0093] Optionally, preprocessing includes operations such as word segmentation, part-of-speech tagging, and stop word removal, etc. Preprocessing provides high-quality data input for subsequent feature extraction steps.
[0094] Furthermore, the preprocessed text is extracted through word embedding to obtain a text feature vector.
[0095] On this basis, the intent is identified based on the preprocessed text.
[0096] Optionally, the intent of the preprocessed text to be processed may be extracted using an intent classification model in NLP (Natural Language Processing).
[0097] It can be understood that the text feature vector of the text to be processed is obtained based on the word segmentation result of the text to be processed, and the intent represents the subject of the text to be processed. The text feature vector is weighted using the intent so that the word features related to the subject are more emphasized in the obtained user text features.
[0098] A second extraction module 202 is used to extract context features based on the context of the text to be processed; Obtain the context information of the text to be processed, extract the context intent and semantic slots to supplement the context.
[0099] It is understandable that when users interact with intelligent customer service, multiple rounds of questions and answers often occur. When it is recognized that the content of multiple rounds of questions and answers points to the same topic, for example, contains common keywords, the text entered by the user first is used as the context information of this question and answer.
[0100] In addition, if the response to the previous round of questions and answers has not been generated, but the user's next question, that is, the user has entered the next text to be processed, it will be used as the context information generated for this reply.
[0101] Context information is obtained and extracted to obtain contextual features, which are used to enhance the model's understanding of user intent when generating responses.
[0102] In this implementation, the method of extracting context features is the same as the method of extracting user text features, so it will not be repeated here.
[0103] The third extraction module 203 is used to extract static knowledge features based on the search results of the text to be processed in the pre-built knowledge base; Since the method is mainly used in a bank customer service system, the pre-built knowledge base is a bank knowledge base that stores knowledge related to banking services.
[0104] The bank knowledge base is designed in a structured or semi-structured form, including FAQ lists, business rules, etc. Each knowledge point contains keywords, category tags, etc. to facilitate quick retrieval.
[0105] In a feasible implementation, the word segmentation results after preprocessing of the text to be processed are used to search in a pre-built knowledge base, and the multiple knowledge points with the highest matching degree are used as the search results.
[0106] Optionally, based on the result of intent recognition, multiple words with the highest relevance to the topic are selected as keywords.
[0107] Optionally, the keywords obtained by word segmentation are combined and then searched.
[0108] Optionally, a matching degree threshold is preset, and a knowledge point with a matching degree greater than the matching degree threshold is determined as the knowledge point with the highest matching degree.
[0109] Optionally, when a gap occurs in the matching degree value, the knowledge point before the gap is determined as the knowledge point with the highest matching degree.
[0110] On this basis, feature extraction is performed on the search results to obtain static knowledge features. It can be understood that static knowledge features are features that are directly semantically related to the user's text to be processed.
[0111] A fourth extraction module 204 is used to extract dynamic knowledge features based on the user's behavior data on products and services within a preset time period; Optionally, the time point when the user inputs the text to be processed is used as the time basis to obtain the user's behavior data within a previously preset time period, for example, the record data generated when the user browses or visits a web page, application and / or physical door point.
[0112] Optionally, the preset time period is set based on experience, and is determined to be three months in this embodiment, and the user behavior data of each day in the first three months is obtained.
[0113] Based on the user's behavioral data, it is determined that the user's intention is biased towards products, such as a bank's various financial products, or services, such as inquiry or processing.
[0114] Dynamic knowledge features are extracted based on behavioral data. It can be understood that dynamic knowledge features are features that contain time information, reflecting the user's intention preferences in the current time period. They are features that are semantically indirectly related to the user's text to be processed, and can also be used to assist in understanding the content of the user's question.
[0115] The answer generation module 205 inputs the user text features, the context features, the static knowledge features and the dynamic knowledge features into a language model to obtain an answer text output by the language model.
[0116] The extracted user text features, contextual features, static knowledge features and dynamic knowledge features are input into the pre-trained language model to obtain the answer text output by the language model as the answer text of the online intelligent customer service.
[0117] Among them, the language model is based on the large language model, and its input layer is adjusted according to the characteristics of the actual input. The text interaction records of multiple users with real customer service in a historical time period are collected as a data set for training.
[0118] On this basis, user text features are used to provide the language model with the user's current demand information, contextual features are used to provide the language model with the user's demand information within a certain question-and-answer round, static knowledge features are used to provide the language model with answer information that directly corresponds to the user's needs, and dynamic knowledge features are used to provide the language model with answer information that indirectly reflects the user's needs, so that the language model can more accurately identify the user's intentions based on the above information and make more accurate and complete responses.
[0119] The present invention generates answers from online intelligent customer service by combining the user's historical records, preference information, contextual information and the semantic features of the text to be processed itself, and combines multimodal data fusion technology to significantly improve the accuracy of intent recognition and provide customized service experience for different users.
[0120] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the reply generation method of the online text customer service, the method comprising: weighting the text feature vector of the to-be-processed text based on the intention of the to-be-processed text input by the user to obtain the user text feature; extracting the context feature based on the context of the to-be-processed text; extracting the static knowledge feature based on the search result of the to-be-processed text in the pre-built knowledge base; extracting the dynamic knowledge feature based on the user's behavior data on products and services in the previous preset time period; inputting the user text feature, the context feature, the static knowledge feature and the dynamic knowledge feature into the language model to obtain the answer text output by the language model.
[0121] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0122] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the online text customer service reply generation method provided by the above methods, which method includes: weighting the text feature vector of the text to be processed based on the intention of the text to be processed input by the user to obtain user text features; extracting contextual features based on the context of the text to be processed; extracting static knowledge features based on the search results of the text to be processed in a pre-built knowledge base; extracting dynamic knowledge features based on the user's behavior data on products and services within a preset time period; inputting the user text features, the contextual features, the static knowledge features and the dynamic knowledge features into a language model to obtain the answer text output by the language model.
[0123] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the online text customer service reply generation method provided by the above-mentioned methods, the method comprising: weighting the text feature vector of the text to be processed based on the intention of the text to be processed input by the user to obtain user text features; extracting contextual features based on the context of the text to be processed; extracting static knowledge features based on the search results of the text to be processed in a pre-built knowledge base; extracting dynamic knowledge features based on the user's behavior data on products and services within a preset time period; inputting the user text features, the contextual features, the static knowledge features and the dynamic knowledge features into a language model to obtain the answer text output by the language model.
[0124] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0125] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating a reply for online text customer service, characterized in that: include: Weighting the text feature vector of the text to be processed based on the intention of the text to be processed input by the user to obtain the user text feature; Extracting context features based on the context of the text to be processed; Extracting static knowledge features based on the search results of the text to be processed in a pre-built knowledge base; Extracting dynamic knowledge features based on the user's behavior data on products and services within a preset time period; The user text features, the context features, the static knowledge features and the dynamic knowledge features are input into a language model to obtain a response text output by the language model.
2. The method for generating a reply to online text customer service according to claim 1, characterized in that: The step of extracting dynamic knowledge features based on the user's behavior data on products and services within a preset time period specifically includes: In the case where the user's behavior information points to a product, risk data of the product in a previously preset time period is obtained, and product statistical features are extracted based on the risk data, product time series features of the risk data are extracted using a time window, and the product statistical features and the product time series features are used as the dynamic knowledge features; In the case where the user's behavior information points to a service, the user behavior data of the user within a previously preset time period is obtained, and user statistical features are extracted based on the user behavior data. A time window is applied to extract user time series features of the user behavior data, and the user statistical features and the user time series features are used as the dynamic knowledge features.
3. The method for generating a reply to online text customer service according to claim 1, characterized in that: The step of weighting the text feature vector of the text to be processed based on the intention of the text to be processed input by the user to obtain the user text feature specifically includes: After preprocessing the text to be processed input by the user, the text features are extracted; Intent recognition is performed on the text to be processed to obtain an intent label of the text to be processed, and the text feature is weighted based on the similarity between the intent label and the text feature.
4. The method for generating a reply of online text customer service according to claim 3, characterized in that: The step of performing intent recognition on the text to be processed to obtain the intent label of the text to be processed specifically includes: Extracting word frequency features of the text to be processed based on a word frequency-inverse document frequency algorithm; Extracting keywords of the text to be processed based on a Latent Dirichlet Allocation (LDA) topic model; Extracting named entities from the text to be processed; The word frequency feature, the keyword and the named entity are input into an intention recognition model to obtain an intention label of the text to be processed output by the intention recognition model.
5. The method for generating a reply to online text customer service according to claim 1, characterized in that: The pre-built knowledge base includes a product and service document base and a bank knowledge base.
6. The method for generating a reply of online text customer service according to claim 5, characterized in that: The step of extracting static knowledge features based on the search results of the text to be processed in the pre-built knowledge base specifically includes: Retrieving a first candidate text in the product and service document library based on the text to be processed, and weighting a text feature vector of the first candidate text based on the intention of the first candidate text to obtain a first knowledge feature; Retrieving a second candidate text from the bank knowledge base based on the text to be processed, and weighting a text feature vector of the second candidate text based on the intention of the second candidate text to obtain a second knowledge feature; The first knowledge feature and the second knowledge feature are used together as the static knowledge feature.
7. A reply generation device for online text customer service, characterized in that: include: A first extraction module, configured to weight a text feature vector of the text to be processed based on the intention of the text to be processed input by the user, so as to obtain a user text feature; A second extraction module is used to extract context features based on the context of the text to be processed; A third extraction module is used to extract static knowledge features based on the search results of the text to be processed in the pre-built knowledge base; A fourth extraction module, configured to extract dynamic knowledge features based on the user's behavior data on products and services within a previously preset time period; The answer generation module inputs the user text features, the context features, the static knowledge features and the dynamic knowledge features into a language model to obtain an answer text output by the language model.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for generating a reply of the online text customer service as described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating a reply for online text customer service as claimed in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for generating a reply for online text customer service as claimed in any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Semantic analysis-based studio question and answer method and system
CN122242752A
A live broadcast room question and answer method and system based on semantic analysis
CN122242752B