A short message template generation method and device
Through intent recognition, semantic correction and sensitive word replacement, bank SMS templates are automatically generated, which solves the problems of low efficiency and lack of accuracy in existing technologies and realizes diversified and accurate SMS template generation.
Patent Information
- Application Number
- CN202311215949.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-20
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2043-09-20
AI Technical Summary
The existing method of generating bank SMS templates is inefficient, unable to meet the diverse needs of customers, and prone to errors.
SMS templates are generated through intent recognition and semantic correction, combined with sensitive word identification and customer information classification to automatically generate diverse and accurate SMS templates.
It achieves the diversification and accuracy of SMS templates, improves generation efficiency, reduces human participation, and ensures the logic and standardization of SMS content.
Smart Images

Figure CN119720978B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence, in particular to a short message template generation method and device. BACKGROUND
[0002] In order to better serve customers, banks need to send notification short message content to customers. Before that, short message content needs to be generated based on short message templates. The short message template is only a certain field vacancy in the short message content. These fields are usually customer information, such as customer name, customer bank card account number, etc. Therefore, the accuracy of generating short message template content is particularly important.
[0003] The existing short message template generation method is that the short message template application personnel applies for the short message template, then edits the short message template, and then submits it to the short message template review personnel for review. After the review is passed, the short message template can be stored in the database, so as to generate short message content and send it to the customer in real time.
[0004] However, with the increase of bank business types and the diversification of bank customer needs, the above-mentioned manual editing and template review method is inefficient. The existing automatic short message template generation method also needs to be configured manually. The configuration personnel cannot configure a short message template that can reflect the deep needs of bank customers, and the short message template is prone to errors. SUMMARY
[0005] In view of the problems in the prior art, the embodiments of the present application provide a short message template generation method and device, which can at least partially solve the problems in the prior art.
[0006] In one aspect, the present application provides a short message template generation method, comprising:
[0007] obtaining an initial statement in a short message template, and performing intent recognition on the initial statement;
[0008] generating a to-be-corrected connecting statement for connecting the initial statement according to the intent recognition result, performing semantic recognition correction on the to-be-corrected connecting statement, and obtaining a to-be-recommended connecting statement;
[0009] in response to a connecting statement for connecting the initial statement confirmed by a user according to the to-be-recommended connecting statement, splicing the initial statement and the connecting statement;
[0010] replacing the last connecting statement with a newly confirmed connecting statement, and performing intent recognition and subsequent steps until all statements are spliced to obtain a short message template;
[0011] wherein the first last connecting statement is the initial statement.
[0012] The step of obtaining the initial statement in the SMS template includes:
[0013] The initial sentence in the SMS template is generated according to the SMS message type of the customer notification SMS.
[0014] The performing of intent recognition on the initial sentence includes:
[0015] Performing intent recognition on the initial sentence based on a preset customer intent recognition model;
[0016] The preset customer intention recognition model is obtained by training a neural network model based on preset customer intention recognition sample data.
[0017] The step of performing semantic recognition and correction on the sentence to be corrected includes:
[0018] The semantic recognition and correction of the sentence to be corrected is performed based on the natural language processing N-gram model.
[0019] After the step of concatenating all the sentences and before the step of obtaining the SMS template, the SMS template generation method further includes:
[0020] Identify sensitive words in all the sentences that have been spliced together;
[0021] If it is determined that the sensitive word identification result contains a sensitive word, a replacement word that can replace the sensitive word is generated;
[0022] In response to a confirmation action triggered by the user according to the replacement word, the sensitive word is replaced with the replacement word.
[0023] The sensitive word identification of all the sentences after splicing includes:
[0024] Perform word segmentation on all the concatenated sentences to obtain each word;
[0025] Each segmented word is compared one by one with the preset sensitive words in the preset sensitive word library, and the segmented words found in the preset sensitive word library are used as sensitive words.
[0026] After obtaining the SMS template, the SMS template generation method further includes:
[0027] Acquire customer information, classify and identify the customer information, and obtain classified customer information;
[0028] Each category of information is added to the corresponding position in the SMS template to obtain the SMS content to be sent to the customer.
[0029] In one aspect, the present invention provides a device for generating a short message template, comprising:
[0030] an identification unit, configured to obtain an initial sentence in a text message template and perform intent recognition on the initial sentence;
[0031] a correction unit, configured to generate a follow-up sentence to be corrected for following the initial sentence according to the intention recognition result, and perform semantic recognition and correction on the follow-up sentence to be corrected to obtain a follow-up sentence to be recommended;
[0032] a splicing unit, configured to splice the initial sentence with the follow-up sentence in response to a follow-up sentence confirmed by the user based on the follow-up sentence to be recommended;
[0033] A generation unit is used to replace the previous continuation sentence with the newly confirmed continuation sentence one by one, and perform intent recognition and subsequent steps until all sentences are spliced together to obtain a text message template;
[0034] Among them, the first previous continuation statement is the initial statement.
[0035] On the other hand, an embodiment of the present invention provides an electronic device, comprising: a processor, a memory, and a bus, wherein:
[0036] The processor and the memory communicate with each other via the bus;
[0037] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the following method:
[0038] Obtaining an initial sentence in a text message template and performing intent recognition on the initial sentence;
[0039] generating a follow-up sentence to be corrected for following the initial sentence based on the intention recognition result, performing semantic recognition and correction on the follow-up sentence to be corrected to obtain a follow-up sentence to be recommended;
[0040] In response to a follow-up statement for following the initial statement confirmed by the user according to the follow-up statement to be recommended, splicing the initial statement and the follow-up statement;
[0041] Replace the previous continuation sentence with the newly confirmed continuation sentence one by one, and perform intent recognition and subsequent steps until all sentences are spliced together to obtain the SMS template;
[0042] Among them, the first previous continuation statement is the initial statement.
[0043] An embodiment of the present invention provides a non-transitory computer-readable storage medium, including:
[0044] The non-transitory computer-readable storage medium stores computer instructions, which cause the computer to execute the following method:
[0045] Obtaining an initial sentence in a text message template and performing intent recognition on the initial sentence;
[0046] generating a follow-up sentence to be corrected for following the initial sentence based on the intention recognition result, performing semantic recognition and correction on the follow-up sentence to be corrected to obtain a follow-up sentence to be recommended;
[0047] In response to a follow-up statement for following the initial statement confirmed by the user according to the follow-up statement to be recommended, splicing the initial statement and the follow-up statement;
[0048] Replace the previous continuation sentence with the newly confirmed continuation sentence one by one, and perform intent recognition and subsequent steps until all sentences are spliced together to obtain the SMS template;
[0049] Among them, the first previous continuation statement is the initial statement.
[0050] The SMS template generation method and device provided by the embodiment of the present invention obtain the initial sentence in the SMS template and perform intent recognition on the initial sentence; generate a to-be-corrected continuation sentence for continuing the initial sentence based on the intent recognition result, perform semantic recognition and correction on the to-be-corrected continuation sentence to obtain a to-be-recommended continuation sentence; in response to the continuation sentence for continuing the initial sentence confirmed by the user based on the to-be-recommended continuation sentence, splice the initial sentence and the continuation sentence; replace the previous continuation sentence with the newly confirmed continuation sentence one by one, and perform intent recognition and subsequent steps until all sentences are spliced together to obtain the SMS template; wherein, the first previous continuation sentence is the initial sentence, which can generate a variety of SMS templates and ensure the accuracy and timeliness of the generated SMS templates. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0052] Figure 1 The figure is a flowchart of a method for generating a short message template according to an embodiment of the present invention.
[0053] Figure 2 It is a structural diagram of a device for generating a short message template provided by one embodiment of the present invention.
[0054] Figure 3 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, further detailed description of the embodiments of the present application will be given below in conjunction with the accompanying drawings. Herein, the illustrative embodiments of the present application and the description thereof are used to explain the present application but not to limit the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other in any manner without conflict.
[0056] Figure 1 is a flowchart of a short message template generation method provided by an embodiment of the present application, as shown in Figure 1 The short message template generation method provided by the embodiment of the present application comprises the following steps.
[0057] Step S1: obtaining an initial statement in a short message template and performing intent recognition on the initial statement.
[0058] Step S2: generating a to-be-corrected connecting statement for connecting the initial statement according to the result of the intent recognition, performing semantic recognition correction on the to-be-corrected connecting statement, and obtaining a to-be-recommended connecting statement.
[0059] Step S3: in response to a connecting statement for connecting the initial statement confirmed by a user according to the to-be-recommended connecting statement, splicing the initial statement and the connecting statement.
[0060] Step S4: replacing a previous connecting statement with a newly confirmed connecting statement one by one and performing intent recognition and subsequent steps until all statements are spliced to obtain a short message template.
[0061] The first previous connecting statement is the initial statement.
[0062] In the above step S1, the device obtains an initial statement in a short message template and performs intent recognition on the initial statement. The device can be a computer device or the like executing the method. It should be noted that the customer-related data involved in the embodiments of the present application are all authorized by the user. The initial statement can be the first statement in the short message template. The intent recognition can be understood as the content thought by the customer after browsing the initial statement, for example, the customer can think of using the funds to purchase a financial product to increase the income after seeing the amount of the issued salary, or can think of using the funds to purchase the goods that the customer has always wanted to purchase, and the like.
[0063] The obtaining of the initial statement in the short message template comprises the following steps.
[0064] The initial statement in the short message template is generated according to a short message message type of a customer notification type short message. The short message message type can comprise a customer account balance change notification type and a customer care notification type, and the like.
[0065] Taking the customer account balance change notification type as an example, the initial statement in the generated SMS template can be as follows:
[0066] "You deposited xx yuan into your account ending in xxxx, and the current balance is xx yuan."
[0067] The performing intention recognition on the initial sentence includes:
[0068] The intention of the initial sentence is recognized based on a preset customer intention recognition model; the initial sentence can be input into the preset customer intention recognition model, and the output result of the preset customer intention recognition model is used as the customer intention recognition result.
[0069] The preset customer intent recognition model is obtained by training a neural network model based on preset customer intent recognition sample data. It should be noted that the preset customer intent recognition sample data is not limited to the data of a specific customer and can include data of customers from different backgrounds. For example, customer A, upon viewing a payout amount of 10,000 yuan, may intend to shop on a certain app; while customer B, upon viewing a payout amount of 30,000 yuan, may intend to shop at a certain offline mall and purchase fund products.
[0070] These sample data from different customers are more helpful in stimulating customers' diverse needs, encouraging them to try different consumption methods, and cultivating different consumption habits.
[0071] The sample data can be labeled and then the neural network model can be trained.
[0072] You can choose a convolutional neural network for subsequent feature extraction and training. Convolutional Neural Network (CNN): CNN is a neural network that can process text data. It extracts features from text data through convolution operations.
[0073] Feature extraction: Use four operations, including convolution, activation function, pooling, and dimensionality adjustment, to extract features for subsequent modeling and analysis.
[0074] Model training: The model is trained using labeled training data to learn the probability distribution of the model's intent for the text data. During training, the CNN continuously adjusts its internal parameters to improve the model's accuracy.
[0075] Model evaluation: The model is evaluated using test data to determine its performance and accuracy. It can be put into use when both the training accuracy and test accuracy exceed 99%.
[0076] Model deployment: Use the trained model to make predictions on new text data to identify its intent.
[0077] In step S2, the device generates a follow-up statement to be corrected based on the intent recognition result, and performs semantic recognition and correction on the follow-up statement to obtain a follow-up statement to be recommended. Each intent recognition result may correspond to at least one follow-up statement to be corrected. For example, if a customer wants to purchase a financial product, a follow-up statement to be corrected may be generated that provides the customer with the financial product; if the customer wants to purchase an item on an app, a recommended app name and download link may be generated.
[0078] Since the continuation sentence to be corrected may have problems such as incoherence, it needs to be subjected to semantic recognition and correction, and the continuation sentence to be corrected after correction is used as the continuation sentence to be recommended to the user.
[0079] The performing semantic recognition and correction on the sentence to be corrected includes:
[0080] The semantic recognition and correction of the sentence to be corrected is performed based on the natural language processing N-gram model. The natural language processing N-gram model is more suitable for judging whether the sentence content is smooth for a large-scale corpus.
[0081] N-gram is a sliding window operation of size N that operates on the content of the text according to the bytes, forming a sequence of byte segments of length N.
[0082] First, the text message content is divided into a phrase combination of length 1, a phrase combination of length 2, and a phrase combination of length 3. There are a total of 3 phrase combinations of different lengths.
[0083] Count the number of occurrences of each phrase in the corpus. First, calculate the probability of different combinations of phrases with a length of 1, such as: {"now", "at that time", "remaining", "amount", "for"}, which can be divided into {"the current balance is"}, {"the current balance at that time is"}, {"the current amount at that time is remaining"}, etc. Use the probability calculation formula to calculate its probability. The sentence with the highest probability is the normal sentence.
[0084] Similarly, the probability of different combinations of phrases of lengths 2 and 3 is calculated. The resulting normal sentences are compared to see if they are the same. If they are, the sentence is considered legitimate and the sentence recommendation is completed for the user to select from when generating SMS templates.
[0085] In step S3, the device splices the initial statement with the follow-up statement in response to the user confirming the follow-up statement for the initial statement based on the recommended follow-up statement. The user may be a bank staff member, specifically a person who applies for the SMS template or a person who reviews the SMS template.
[0086] Referring to the above example, the follow-up statement after "You deposited xx yuan into your account ending in xxxx, and the current balance is xx yuan" can be "Our bank currently has a wealth management product with an annualized return of XX, so hurry up if you want to purchase it", or "A certain APP is currently offering a thank-you event for new and old users. To participate, please click the link below to download it."
[0087] If the user confirms "Our bank currently has a financial product with a return of XX after the year, please hurry to purchase", the concatenated sentence will be "You have deposited XX yuan into your account ending in xxxx, and the current balance is XX yuan". "Our bank currently has a financial product with a return of XX after the year, please hurry to purchase".
[0088] In the above step S4, the device replaces the previous continuation sentence with the newly confirmed continuation sentence one by one, and performs intent recognition and subsequent steps until all sentences are spliced together to obtain the SMS template;
[0089] Among them, the first previous continuation statement is the initial statement. Referring to the above example, if a customer browses to "Our bank currently has a financial product with a return of XX after the year, buy it now", he or she may have a purchase demand, but also wants to know more about the detailed information of the product. In this case, the previous continuation statement "You deposited XX yuan into your account ending in xxxx, and the current balance is XX yuan" can be replaced with "Our bank currently has a financial product with a return of XX after the year, buy it now". The intention of "Our bank currently has a financial product with a return of XX after the year, buy it now" is recognized, and the semantic recognition and correction of the continuation statement to be corrected generated for the customer's possible purchase demand is performed. The continuation statement to be recommended can be "Our senior financial advisor will contact you later. Thank you for your support."
[0090] If the user confirms "A senior financial advisor from our bank will contact you later, thank you for your support", add "A senior financial advisor from our bank will contact you later, thank you for your support" after "Our bank currently has a financial product with a return of XX after years, please purchase as soon as possible."
[0091] Then replace the previous follow-up statement "Our bank currently has a financial product with a return of XX after the year. Hurry and buy it now" with "A senior financial advisor from our bank will contact you later. Thank you for your support." Perform intent recognition on "A senior financial advisor from our bank will contact you later. Thank you for your support." At this point, if the customer's intent cannot be recognized, the iterative replacement of the follow-up statement can be terminated. The complete spliced statements are as follows:
[0092] "You have deposited xx yuan into your account ending in xxxx, and the current balance is xx yuan. Our bank currently has a financial product with a return of XX after 2017. Please purchase it as soon as possible. A senior financial advisor from our bank will contact you shortly. Thank you for your support." The complete sentence above is the SMS template.
[0093] After the step of splicing all the sentences and before the step of obtaining the SMS template, the SMS template generation method further includes:
[0094] Perform sensitive word identification on all the sentences that have been spliced together; performing sensitive word identification on all the sentences that have been spliced together includes:
[0095] Perform word segmentation processing on all the concatenated sentences to obtain each word segmentation; the word segmentation processing can be performed using an existing word segmentation method.
[0096] Each segmented word is compared with the preset sensitive words in the preset sensitive word library, and the segmented words found in the preset sensitive word library are used as sensitive words. The preset sensitive word library can be added, deleted, and modified to maintain the preset sensitive words.
[0097] If it is determined that the sensitive word identification result contains a sensitive word, a replacement word that can replace the sensitive word is generated; the replacement word that can replace the sensitive word may include:
[0098] The sensitive word is input into the trained semantic analysis model, and at least one synonym of the sensitive word output by the semantic analysis model is used as a replacement word for the sensitive word.
[0099] In response to a confirmation action triggered by the user based on the replacement word, the sensitive word is replaced with the replacement word. The user can select and confirm a replacement word from at least one synonym to replace the sensitive word.
[0100] Before processing sensitive words, data preprocessing steps can be included, such as:
[0101] Clean and preprocess the raw data, including removing stop words, punctuation marks, numbers and other irrelevant information, and performing word segmentation and stemming on the character strings to facilitate subsequent keyword extraction and deduplication.
[0102] Keyword extraction: Extract keywords or phrases from cleaned text data. These keywords or phrases usually have semantic and contextual information and can be used for tasks such as search and ranking.
[0103] Deduplication: Deduplication of extracted keywords to avoid duplication and redundancy.
[0104] Sorting and filtering: Sort and filter the extracted keywords to determine whether sensitive words appear.
[0105] After the step of obtaining the SMS template, the SMS template generation method further includes:
[0106] Obtain customer information, classify and identify the customer information, and obtain classified customer information; the classified customer information may include customer name and customer account number, etc.
[0107] Each category of information is added to the corresponding position in the SMS template to obtain the SMS content to be sent to the customer. For example, the customer's name and customer account number are added to "xx" or "XX" in the SMS template to obtain the SMS content to be sent to the customer.
[0108] The SMS template generation method provided by the embodiment of the present invention has the following beneficial technical effects:
[0109] 1. Through intent recognition, a variety of SMS templates can be generated, which helps to generate a variety of SMS notification messages and better serve customers.
[0110] 2. Through intent recognition, semantic recognition correction and sensitive word recognition and replacement, the accuracy of the content in the SMS template can be greatly improved. Therefore, there is no need for both SMS template personnel and SMS template reviewers to participate in the SMS template generation work, saving manpower.
[0111] Furthermore, intent recognition is used to first determine the semantics of the sentences to be corrected, ensuring the logical correctness of the connection between adjacent sentences. Semantic recognition and correction are then used to ensure the logical correctness of each sentence in the recommended follow-up sentence. Once all sentences are connected, sensitive word identification and replacement are performed to ensure that the wording used in all sentences is reasonable and standardized. This orderly identification process, from between sentences to within each sentence, and then to all words, further improves the timeliness of SMS template generation.
[0112] 3. The method of using human participation in confirmation and automatic generation of SMS templates can take into account both the timeliness and accuracy of template generation.
[0113] The SMS template generation method provided by the embodiment of the present invention obtains the initial sentence in the SMS template and performs intent recognition on the initial sentence; generates a to-be-corrected continuation sentence for succeeding the initial sentence based on the intent recognition result, performs semantic recognition and correction on the to-be-corrected continuation sentence to obtain a to-be-recommended continuation sentence; in response to the continuation sentence for succeeding the initial sentence confirmed by the user based on the to-be-recommended continuation sentence, splices the initial sentence and the continuation sentence; replaces the previous continuation sentence with the newly confirmed continuation sentence one by one, and performs intent recognition and subsequent steps until all sentences are spliced together to obtain the SMS template; wherein, the first previous continuation sentence is the initial sentence, which can generate a variety of SMS templates and ensure the accuracy and timeliness of the generated SMS templates.
[0114] Furthermore, obtaining the initial statement in the SMS template includes:
[0115] The initial sentence in the SMS template is generated according to the SMS message type of the customer notification SMS.
[0116] The SMS template generation method provided by the embodiment of the present invention can ensure the accuracy of the initial sentence in the generated SMS template.
[0117] Furthermore, the performing intent recognition on the initial sentence includes:
[0118] The intention of the initial sentence is recognized based on a preset customer intention recognition model; please refer to the above embodiment for description and will not be repeated here.
[0119] The preset customer intention recognition model is obtained by training a neural network model based on preset customer intention recognition sample data.
[0120] The SMS template generation method provided by the embodiment of the present invention can accurately identify customer intentions.
[0121] Furthermore, the semantic recognition and correction of the sentence to be corrected includes:
[0122] The semantic recognition and correction of the sentence to be corrected is performed based on the natural language processing N-gram model.
[0123] The SMS template generation method provided by the embodiment of the present invention can ensure the semantic coherence of each sentence.
[0124] Furthermore, after the step of splicing all the sentences and before the step of obtaining the SMS template, the SMS template generation method further includes:
[0125] Sensitive words are identified for all the sentences that have been spliced together. This can be explained with reference to the above embodiment and will not be described in detail.
[0126] If it is determined that the sensitive word identification result contains a sensitive word, a replacement word that can replace the sensitive word is generated; please refer to the above embodiment for description and will not be repeated here.
[0127] In response to the confirmation action triggered by the user according to the replacement word, the sensitive word is replaced with the replacement word. Please refer to the above embodiment for description, which will not be repeated here.
[0128] The SMS template generation method provided by the embodiment of the present invention can ensure that every word used is accurate and compliant.
[0129] Furthermore, the sensitive word identification of all the sentences completed by splicing includes:
[0130] Perform word segmentation processing on all the concatenated sentences to obtain each word segment; refer to the above embodiment for description and no further details will be given.
[0131] Each segmented word is compared with the preset sensitive words in the preset sensitive word library, and the segmented words found in the preset sensitive word library are used as sensitive words.
[0132] The SMS template generation method provided by the embodiment of the present invention can efficiently complete sensitive word identification.
[0133] Furthermore, after the step of obtaining the SMS template, the SMS template generation method further includes:
[0134] Obtain customer information, classify and identify the customer information, and obtain classified customer information; refer to the above embodiment for description and will not be repeated here.
[0135] Each category of information is added to the corresponding position in the SMS template to obtain the SMS content to be sent to the customer.
[0136] The SMS template generation method provided by the embodiment of the present invention can efficiently obtain the content of the SMS to be sent to the customer.
[0137] It should be noted that the SMS template generation method provided in the embodiment of the present invention can be used in the financial field, and can also be used in any technical field other than the financial field. The embodiment of the present invention does not limit the application field of the SMS template generation method.
[0138] Figure 2 This is a schematic diagram of the structure of a device for generating a short message template according to an embodiment of the present invention. Figure 2 As shown, the SMS template generation device provided by the embodiment of the present invention includes an identification unit 201, a correction unit 202, a splicing unit 203 and a generation unit 204, wherein:
[0139] The identification unit 201 is used to obtain the initial sentence in the SMS template and perform intent recognition on the initial sentence; the correction unit 202 is used to generate a follow-up sentence to be corrected for following the initial sentence based on the intent recognition result, perform semantic recognition and correction on the follow-up sentence to be corrected, and obtain a follow-up sentence to be recommended; the splicing unit 203 is used to splice the initial sentence and the follow-up sentence in response to the follow-up sentence confirmed by the user for following the initial sentence based on the follow-up sentence to be recommended; the generation unit 204 is used to replace the previous follow-up sentence with the newly confirmed follow-up sentences one by one, and perform intent recognition and subsequent steps until all sentences are spliced together to obtain the SMS template; wherein, the first previous follow-up sentence is the initial sentence.
[0140] Specifically, the recognition unit 201 in the device is used to obtain the initial sentence in the SMS template and perform intent recognition on the initial sentence; the correction unit 202 is used to generate a to-be-corrected successor sentence for the initial sentence based on the intent recognition result, perform semantic recognition and correction on the to-be-corrected successor sentence, and obtain a to-be-recommended successor sentence; the splicing unit 203 is used to splice the initial sentence and the successor sentence in response to the successor sentence confirmed by the user based on the to-be-recommended successor sentence for the initial sentence; the generation unit 204 is used to replace the previous successor sentence with the newly confirmed successor sentences one by one, and perform intent recognition and subsequent steps until all sentences are spliced together to obtain the SMS template; wherein, the first previous successor sentence is the initial sentence.
[0141] The SMS template generation device provided by the embodiment of the present invention obtains the initial sentence in the SMS template, performs intent recognition on the initial sentence; generates a to-be-corrected continuation sentence for succeeding the initial sentence based on the intent recognition result, performs semantic recognition and correction on the to-be-corrected continuation sentence to obtain a to-be-recommended continuation sentence; in response to the continuation sentence for succeeding the initial sentence confirmed by the user based on the to-be-recommended continuation sentence, splices the initial sentence and the continuation sentence; replaces the previous continuation sentence with the newly confirmed continuation sentence one by one, and performs intent recognition and subsequent steps until all sentences are spliced together to obtain the SMS template; wherein, the first previous continuation sentence is the initial sentence, which can generate a variety of SMS templates and ensure the accuracy and timeliness of the generated SMS templates.
[0142] Furthermore, the identification unit 201 is specifically configured to:
[0143] The initial sentence in the SMS template is generated according to the SMS message type of the customer notification SMS.
[0144] The SMS template generation device provided by the embodiment of the present invention can ensure the accuracy of the initial sentence in the generated SMS template.
[0145] Furthermore, the identification unit 201 is specifically configured to:
[0146] Performing intent recognition on the initial sentence based on a preset customer intent recognition model;
[0147] The preset customer intention recognition model is obtained by training a neural network model based on preset customer intention recognition sample data.
[0148] The SMS template generation device provided by the embodiment of the present invention can accurately identify customer intentions.
[0149] Furthermore, the correction unit 202 is specifically configured to:
[0150] The semantic recognition and correction of the sentence to be corrected is performed based on the natural language processing N-gram model.
[0151] The SMS template generation device provided by the embodiment of the present invention can ensure the semantic fluency of each sentence.
[0152] Furthermore, after the step of splicing all the sentences and before the step of obtaining the SMS template, the SMS template generating device is further used to:
[0153] Identify sensitive words in all the sentences that have been spliced together;
[0154] If it is determined that the sensitive word identification result contains a sensitive word, a replacement word that can replace the sensitive word is generated;
[0155] In response to a confirmation action triggered by the user according to the replacement word, the sensitive word is replaced with the replacement word.
[0156] The SMS template generation device provided by the embodiment of the present invention can ensure that every word used is accurate and compliant.
[0157] Furthermore, the SMS template generating device is further specifically configured to:
[0158] Perform word segmentation on all the concatenated sentences to obtain each word;
[0159] Each segmented word is compared one by one with the preset sensitive words in the preset sensitive word library, and the segmented words found in the preset sensitive word library are used as sensitive words.
[0160] The SMS template generation device provided by the embodiment of the present invention can efficiently complete sensitive word identification.
[0161] Furthermore, after the step of obtaining the SMS template, the SMS template generating device is further configured to:
[0162] Acquire customer information, classify and identify the customer information, and obtain classified customer information;
[0163] Each category of information is added to the corresponding position in the SMS template to obtain the SMS content to be sent to the customer.
[0164] The SMS template generation device provided by the embodiment of the present invention can efficiently obtain the content of SMS messages to be sent to customers.
[0165] The embodiment of the present invention provides an embodiment of a text message template generation device which can be used to execute the processing flow of the above-mentioned method embodiments. Its functions are not described in detail here, and reference can be made to the detailed description of the above-mentioned method embodiments.
[0166] Figure 3A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as Figure 3 As shown, the electronic device includes: a processor 301, a memory 302 and a bus 303;
[0167] The processor 301 and the memory 302 communicate with each other via the bus 303.
[0168] The processor 301 is configured to call the program instructions in the memory 302 to execute the methods provided by the above method embodiments, for example, including:
[0169] Obtaining an initial sentence in a text message template and performing intent recognition on the initial sentence;
[0170] generating a follow-up sentence to be corrected for following the initial sentence based on the intention recognition result, performing semantic recognition and correction on the follow-up sentence to be corrected to obtain a follow-up sentence to be recommended;
[0171] In response to a follow-up statement for following the initial statement confirmed by the user according to the follow-up statement to be recommended, splicing the initial statement and the follow-up statement;
[0172] Replace the previous continuation sentence with the newly confirmed continuation sentence one by one, and perform intent recognition and subsequent steps until all sentences are spliced together to obtain the SMS template;
[0173] Among them, the first previous continuation statement is the initial statement.
[0174] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can perform the methods provided in the above-mentioned method embodiments, for example, including:
[0175] Obtaining an initial sentence in a text message template and performing intent recognition on the initial sentence;
[0176] generating a follow-up sentence to be corrected for following the initial sentence based on the intention recognition result, performing semantic recognition and correction on the follow-up sentence to be corrected to obtain a follow-up sentence to be recommended;
[0177] In response to a follow-up statement for following the initial statement confirmed by the user according to the follow-up statement to be recommended, splicing the initial statement and the follow-up statement;
[0178] Replace the previous continuation sentence with the newly confirmed continuation sentence one by one, and perform intent recognition and subsequent steps until all sentences are spliced together to obtain the SMS template;
[0179] Among them, the first previous continuation statement is the initial statement.
[0180] This embodiment provides a computer-readable storage medium storing a computer program. The computer program enables the computer to execute the methods provided in the above method embodiments, for example, including:
[0181] Obtaining an initial sentence in a text message template and performing intent recognition on the initial sentence;
[0182] generating a follow-up sentence to be corrected for following the initial sentence based on the intention recognition result, performing semantic recognition and correction on the follow-up sentence to be corrected to obtain a follow-up sentence to be recommended;
[0183] In response to a follow-up statement for following the initial statement confirmed by the user according to the follow-up statement to be recommended, splicing the initial statement and the follow-up statement;
[0184] Replace the previous continuation sentence with the newly confirmed continuation sentence one by one, and perform intent recognition and subsequent steps until all sentences are spliced together to obtain the SMS template;
[0185] Among them, the first previous continuation statement is the initial statement.
[0186] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0187] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0188] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0189] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.
[0190] Throughout this specification, reference to terms such as "one embodiment," "a specific embodiment," "some embodiments," "for example," "example," "specific example," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0191] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for generating a short message template, characterized in that: include: Obtaining an initial sentence in a text message template and performing intent recognition on the initial sentence; generating a follow-up sentence to be corrected for following the initial sentence based on the intention recognition result, performing semantic recognition and correction on the follow-up sentence to be corrected to obtain a follow-up sentence to be recommended; In response to a follow-up statement for following the initial statement confirmed by the user according to the follow-up statement to be recommended, splicing the initial statement and the follow-up statement; Replace the previous continuation sentence with the newly confirmed continuation sentence one by one, and perform intent recognition and subsequent steps until all sentences are spliced together to obtain the SMS template; The first preceding statement is the initial statement; The performing intention recognition on the initial sentence includes: Performing intent recognition on the initial sentence based on a preset customer intent recognition model; The preset customer intention recognition model is obtained by training a neural network model based on preset customer intention recognition sample data; The performing semantic recognition and correction on the sentence to be corrected includes: Performing semantic recognition and correction on the sentence to be corrected based on a natural language processing N-gram model; After the step of splicing all the sentences and before the step of obtaining the SMS template, the SMS template generation method further includes: Identify sensitive words in all the sentences that have been spliced together; If it is determined that the sensitive word identification result contains a sensitive word, a replacement word that can replace the sensitive word is generated; In response to a confirmation action triggered by the user according to the replacement word, the sensitive word is replaced with the replacement word.
2. The method for generating a short message template according to claim 1, wherein: The step of obtaining the initial statement in the SMS template includes: The initial sentence in the SMS template is generated according to the SMS message type of the customer notification SMS.
3. The method for generating a short message template according to claim 1, wherein: The sensitive word identification of all the spliced sentences includes: Perform word segmentation on all the concatenated sentences to obtain each word; Each segmented word is compared one by one with the preset sensitive words in the preset sensitive word library, and the segmented words found in the preset sensitive word library are used as sensitive words.
4. The method for generating a short message template according to any one of claims 1 to 3, wherein: After the step of obtaining the SMS template, the SMS template generation method further includes: Acquire customer information, classify and identify the customer information, and obtain classified customer information; Each category of information is added to the corresponding position in the SMS template to obtain the SMS content to be sent to the customer.
5. A device for generating a short message template, for executing the method according to any one of claims 1 to 4, characterized in that: The device comprises: an identification unit, configured to obtain an initial sentence in a text message template and perform intent recognition on the initial sentence; a correction unit, configured to generate a follow-up sentence to be corrected for following the initial sentence according to the intention recognition result, and perform semantic recognition and correction on the follow-up sentence to be corrected to obtain a follow-up sentence to be recommended; a splicing unit, configured to splice the initial sentence with the follow-up sentence in response to a follow-up sentence confirmed by the user based on the follow-up sentence to be recommended; A generation unit is used to replace the previous continuation sentence with the newly confirmed continuation sentence one by one, and perform intent recognition and subsequent steps until all sentences are spliced together to obtain a text message template; Among them, the first previous continuation statement is the initial statement.
6. 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 computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
8. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instructions are executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Article generation method and apparatus based on artificial intelligence
CN107193792A
Corpus generation method, apparatus and device, and computer readable storage medium
CN112597748A