Intention translation method and electronic device
Through the joint model, the business type identification and slot filling processing of user intentions is solved, and the problem of inability to understand natural language intentions in the prior art is realized, intelligent translation of user's natural language expression intentions and multiple business types recognition are realized, which simplifies the The processing process improves efficiency.
Patent Information
- Application Number
- CN202210002913.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-04
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-01-04
AI Technical Summary
Existing intent translation methods cannot understand the semantic level of user intention expressed in natural language. Users need to use specific templates to express their intentions, and the intention expression is restricted.
A pre-built joint model, including the LDA model and the BERT model, uses a service type identification and slot filling process for user intentions, calculates network link weights, and then determines the routing target address to realize intent translation.
It realizes intelligent translation of users' natural language expression intentions, does not require specific template expression, supports multiple business types recognition, simplifies processing processes, and improves efficiency.
Smart Images

Figure CN114528843B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of network communication and machine learning, and in particular to an intent translation method and electronic device. Background Art
[0002] Intent-Based Networking (IBN) is an emerging network paradigm that can simplify network management without the need for network administrators. The IBN workflow mainly involves intent translation, policy verification, policy issuance and execution, and real-time feedback. Existing intent translation methods mainly identify user intent by extracting keywords based on rules or dictionaries, but fail to understand the semantic level. Users need to use specific templates to express their intent, and the expression of intent is limited. Summary of the invention
[0003] In view of this, the purpose of this application is to provide an intention translation method and electronic device.
[0004] Based on the above objectives, the present application provides an intention translation method, comprising:
[0005] Obtain the user's intended expression as the text to be tested;
[0006] Using a pre-built joint model to perform business type recognition and slot filling processing on the text to be tested, to obtain a target business type and slot filling result of the text to be tested;
[0007] Determine a routing target address according to the slot filling result;
[0008] The network link weight is calculated by a pre-built routing decision model based on the service quality performance configuration requirements corresponding to the target service type;
[0009] Based on the network link weight, the shortest path between the routing source address and the routing target address is calculated and used as the intention translation result of the text to be tested.
[0010] Furthermore, the joint model includes an LDA model and a BERT model;
[0011] The method of using the pre-built joint model to perform business type identification and slot filling processing on the text to be tested to obtain the target business type and slot filling result of the text to be tested includes:
[0012] Performing feature expansion on the text to be tested by using the LDA model to obtain an expanded text;
[0013] Converting the extended text into a vector to obtain a feature extension vector;
[0014] Perform semantic extraction on the text to be tested by using the BERT model to obtain a full-text information vector;
[0015] The full-text information vector and the feature extension vector are concatenated, and softmax classification is performed on the concatenated vector to obtain the service type distribution probability and the slot filling result;
[0016] The service type corresponding to the maximum probability value in the service type distribution probability is used as the target service type.
[0017] Furthermore, the semantic extraction of the text to be tested by the BERT model to obtain a full-text information vector includes:
[0018] Adding a first label to the head of the text to be tested, and adding a second label to the end of each sentence of the text to be tested, to obtain a text sequence;
[0019] Generate an original word vector, a position vector, and a segmentation vector corresponding to each element based on the text sequence;
[0020] The original word vector, the position vector and the segmentation vector corresponding to each element of the text sequence are summed, the summed vector is processed by the Transformer layer, and the target vector of the first label, the target vector of the second label and the target vector of the text to be tested are output, and the target vector of the first label, the target vector of the second label and the target vector of the text to be tested are used as the full-text information vector.
[0021] Furthermore, the softmax classification process includes:
[0022] Calculate the probability of the text to be tested being predicted as each business type based on the target vector of the first label to obtain a business type distribution probability;
[0023] Based on the target vector of the second label, the target vector of the text to be tested and the feature extension vector, slot filling annotation is performed on the text to be tested and the extended text to obtain a slot filling result.
[0024] Furthermore, before performing softmax classification processing on the concatenated vector to obtain the business type distribution probability and the slot filling result, the concatenated vector is input into a fully connected layer for processing, and the output of the fully connected layer is used as the input of the softmax classification processing.
[0025] Furthermore, the LDA model is a model pre-trained using training texts, and the pre-training process is:
[0026] Randomly assigning one of the business types to each word in the training text;
[0027] The training text is traversed, all the business types are sampled using the Gibbs sampling method, and the business type corresponding to each word is updated until the sampling results converge, thereby obtaining the LDA model.
[0028] Furthermore, the shortest path between the routing source address and the routing target address is calculated using the Dijkstra algorithm.
[0029] Furthermore, before using the pre-built joint model to perform business type recognition and slot filling processing on the text to be tested, the text to be tested is preprocessed, and the preprocessing includes at least one of the following:
[0030] Performing word segmentation on the text to be tested;
[0031] Removing punctuation marks from the text to be tested;
[0032] Filtering stop words in the text to be tested;
[0033] Unifying the upper and lower case in the text to be tested;
[0034] The traditional and simplified fonts in the text to be tested are unified.
[0035] Furthermore, the routing decision model is constructed according to the DDPG algorithm.
[0036] Based on the same inventive concept, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor implements an intent translation method when executing the program.
[0037] From the above, it can be seen that the intent translation method and electronic device provided by the present application have the following beneficial effects: it realizes the translation of the intent expressed by the user in natural language, does not require the user to use a specific template to express the intent, and the expression form of the user's intent is not restricted and is more intelligent; at the same time, the joint model can be used to obtain the target business type and slot filling results at the same time, which simplifies the processing process and improves efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 A schematic diagram of an intention translation method according to an embodiment of the present application;
[0040] Figure 2 Schematic diagram of semantic extraction of the test text by the BERT model of the embodiment of the present application Figure 1 ;
[0041] Figure 3 Schematic diagram of semantic extraction of the test text by the BERT model of the embodiment of the present application Figure 2 ;
[0042] Figure 4 A schematic diagram of an intention translation device according to an embodiment of the present application;
[0043] Figure 5 A schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0045] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0046] With the rapid development of the Internet, the era of digital transformation has arrived, and the emerging network paradigm IBN has emerged. IBN is an autonomous network that can predict changes and adapt to user behavior on its own, abstracting user needs into intents without the intervention of network administrators, that is, without manually describing network policies to achieve intents, thereby simplifying network management and reducing operating costs. The IBN workflow mainly involves intent translation, policy verification, policy issuance and execution, and real-time feedback, among which intent translation is a particularly important step in IBN work. Intent translation refers to the process of converting user intent into corresponding network configuration policies based on user intent and current network status during actual network operation. Existing intent translation methods mainly identify user intent by extracting keywords based on rules or dictionaries, without understanding at the semantic level, and cannot translate user intent expressed in natural language. Users need to use specific templates to express their intent, and their expression is limited.
[0047] Based on the above situation, this application provides an intention translation method, such as Figure 1 As shown, the user's intention expressed in natural language is translated, including:
[0048] S101: Acquire the user's intended expression as a text to be tested;
[0049] S102: using a pre-built joint model to perform business type recognition and slot filling processing on the text to be tested, to obtain a target business type and slot filling result of the text to be tested;
[0050] S103: Determine a routing target address according to the slot filling result;
[0051] S104: Calculating a network link weight through a pre-built routing decision model based on the service quality performance configuration requirements corresponding to the target service type;
[0052] S105: Based on the network link weight, the shortest path between the routing source address and the routing target address is calculated and used as the intention translation result of the text to be tested.
[0053] The purpose of intent translation is to convert the user's intent into a corresponding network configuration strategy based on the content of the intent and the current network status. In this application, the process of obtaining the routing target address is converted into a slot filling process. The target business type and the routing target address of the user's intent are obtained simultaneously through the joint model. The network link weight is calculated according to the service quality performance configuration requirements corresponding to the target business type, and then the shortest path is calculated according to the network link weight. The shortest path is the final network configuration strategy, which realizes the translation of the user's intention expressed in natural language. The user does not need to use a specific template to express it. The expression form is not restricted, and it is more intelligent. It supports the identification of multiple business types, such as video business, audio business, email business, etc., and has a wide range of applications. At the same time, in the current natural language processing process, business type identification and slot filling processing are usually two independent steps, which need to be processed separately using different models. In this application, the joint model is used for simultaneous processing, which simplifies the processing process and improves processing efficiency.
[0054] When building a joint model in advance, the service type is pre-set, such as video service, audio service, email service, etc., and then the joint model is used to identify the service type of the text to be tested to determine the target service type. For example, if the user's intention is expressed as "I want to watch videos on iQiyi", the target service type is video service, and then compared with the pre-set service quality performance configuration requirements to determine the service quality performance configuration requirements required for the video service, and then the network link weight is calculated based on the service quality performance configuration requirements.
[0055] When building the joint model in advance, the semantic slots that need to be filled in the slot filling process are pre-set. In the process of intent translation, the purpose of the slot filling process is to obtain the user's target address, so the "target address" can be set as the semantic slot that needs to be filled. For example, if the user's intent is expressed as "I want to go to iQiyi to watch videos", the user's target address is "iQiyi", and the slot filling process is the process of filling "iQiyi" in the "target address" semantic slot. The final slot filling result is output as "iQiyi", and then the routing target address is determined through "iQiyi".
[0056] In some embodiments, the joint model includes an LDA model and a BERT model; S102 includes:
[0057] Performing feature expansion on the text to be tested by using the LDA model to obtain an expanded text;
[0058] Converting the extended text into a vector to obtain a feature extension vector;
[0059] Perform semantic extraction on the text to be tested by using the BERT model to obtain a full-text information vector;
[0060] The full-text information vector and the feature extension vector are concatenated, and softmax classification is performed on the concatenated vector to obtain the service type distribution probability and the slot filling result;
[0061] The service type corresponding to the maximum probability value in the service type distribution probability is used as the target service type.
[0062] The expression of user intention may be a short sentence or a long sentence. When the expression of user intention is a short sentence, there are problems such as sparse features and lack of information. Therefore, by performing feature expansion on the text to be tested through the LDA model, the features and information of the text to be tested can be effectively expanded, and the accuracy of business type identification and slot filling processing can be improved. Using the BERT model for semantic extraction can effectively capture the bidirectional semantic feature information of the text, achieve deep semantic understanding, and effectively improve the accuracy of natural language processing. Optionally, the extended text is converted into a vector through the Word2Vec model to obtain a feature extension vector. Other methods or tools that can realize the conversion of words or texts into vectors can also be applied to this application, without specific limitation.
[0063] In some embodiments, Figure 2 and Figure 3 As shown, the semantic extraction of the text to be tested is performed by the BERT model to obtain a full-text information vector, including:
[0064] Adding a first label to the head of the text to be tested, and adding a second label to the end of each sentence of the text to be tested, to obtain a text sequence;
[0065] Generate an original word vector, a position vector, and a segmentation vector corresponding to each element based on the text sequence;
[0066] The original word vector, the position vector and the segmentation vector corresponding to each element of the text sequence are summed, the summed vector is processed by the Transformer layer, and the target vector of the first label, the target vector of the second label and the target vector of the text to be tested are output, and the target vector of the first label, the target vector of the second label and the target vector of the text to be tested are used as the full-text information vector.
[0067] In some embodiments, the first tag is a [CLS] tag and the second tag is a [SEP] tag.
[0068] like Figure 2 and Figure 3As shown in the figure, taking "I want to go to iQiyi to watch videos" as an example, after the sentence is input into the BERT model as the test text, the [CLS] tag and the [SEP] tag are added to the sentence to become "[CLS] I want to go to iQiyi to watch videos [SEP]", and then the sentence "[CLS] I want to go to iQiyi to watch videos [SEP]" is used as a text sequence, and the text sequence is processed to obtain the original word vector, position vector and segmentation vector of each element, and then the original word vector, position vector and segmentation vector of each element are summed up. After the summation, the text to be tested is deeply modeled through the Transformer layer, and the deep grammatical semantic information of the text to be tested is extracted to obtain the full-text information vector. The target vector of the first label aggregates the sentence representation information, and the characteristics of the entire text to be tested can be learned. By summing the original word vector, position vector and segmentation vector, the semantic information can be dynamically adjusted so that the final full-text information vector contains richer semantic information.
[0069] In some embodiments, the softmax classification process includes:
[0070] Calculate the probability of the text to be tested being predicted as each business type based on the target vector of the first label to obtain a business type distribution probability;
[0071] Based on the target vector of the second label, the target vector of the text to be tested and the feature extension vector, slot filling annotation is performed on the text to be tested and the extended text to obtain a slot filling result.
[0072] The target vector of the first label learns the features of the entire text to be tested. Therefore, by performing softmax classification on the vector of the first label, the probability of the text to be tested being predicted as each business type can be obtained, and the business type corresponding to the maximum probability value is selected as the target business type of the text to be tested. In the softmax classification process, the extended text is used as one of the targets of slot filling annotation to achieve the expansion of the text to be tested, solve the problems of lack of features and information in the text to be tested, and improve the accuracy of softmax classification processing.
[0073] In some embodiments, the slot filling annotation adopts BIO annotation method. Optionally, the slot filling annotation may also adopt BIOES annotation method. Other methods that can realize slot filling annotation may also be applied in this application, and are not specifically limited.
[0074] The process of slot filling and annotation is explained in detail by taking the BIO annotation method as an example. In this application, the purpose of slot filling and annotation is to obtain the user's target address, and then obtain the routing target address through the target address. The B in the BIO annotation method stands for Begin, which means the beginning; I stands for Intermediate, which means the middle; O stands for Other, which is used to mark irrelevant characters. During the softmax classification process, the probability of each word in the test text and the extended text being marked as B, I or O is calculated, and then the label corresponding to the maximum probability (i.e. B, I or O) is selected to mark the corresponding word. After all words are marked, the words corresponding to the B label and the I label are output as the slot filling results.
[0075] In some embodiments, before the concatenated vector is subjected to softmax classification processing to obtain the business type distribution probability and the slot filling result, the concatenated vector is input into a fully connected layer for processing, and the output of the fully connected layer is used as the input of the softmax classification processing. Through the processing of the fully connected layer, the influence of the feature position on the softmax classification processing is reduced, and the accuracy of the softmax classification processing is improved.
[0076] In some embodiments, the LDA model is a model pre-trained using training texts, and the pre-training process is:
[0077] Randomly assigning one of the business types to each word in the training text;
[0078] The training text is traversed, all the business types are sampled using the Gibbs sampling method, and the business type corresponding to each word is updated until the sampling results converge, thereby obtaining the LDA model.
[0079] Optionally, the training text includes a text sequence and a word set.
[0080] During the pre-training process of the LDA model, the Gibbs sampling method is used to sample all business types until the sampling converges; the text-business type distribution matrix θ is obtained by statistics based on the data recorded during the Gibbs sampling process. m,t and business type-word distribution matrix
[0081]
[0082]
[0083] in, represents the total number of words sampled as business type t in the mth text in the training text, T represents the number of business types, α and β are hyperparameters, is the total number of times word i is sampled as business type t, and V is the size of the word set.
[0084] In some embodiments, the step of performing feature expansion on the text to be tested by using the LDA model to obtain the expanded text includes:
[0085] The text to be tested is input into the LDA model, and the text-business type distribution matrix θ is used to calculate the text-business type distribution matrix θ. m,t Determine the initial business type of the text to be tested, and then use the business type-word distribution matrix Initial expansion words are determined, and K words with the highest probability are selected from the initial expansion words as expansion texts of the text to be tested.
[0086] By using the LDA model to expand the features of the text to be tested, we can effectively solve the problems of sparse features and lack of information in the text to be tested, effectively expand the features and information of the text to be tested, and improve the accuracy of slot filling processing.
[0087] In some embodiments, the shortest path between the routing source address and the routing target address is calculated using the Dijkstra algorithm.
[0088] Dijstra's algorithm is used to calculate the shortest path from one vertex to the remaining vertices. It is a method for solving the problem of finding the shortest path in a weighted graph. In this application, the entire intent network is regarded as a weighted graph, the routing target address and the routing source address are nodes in the weighted graph, and the network link weight is the weight of the weighted graph. Then, the shortest path from the routing source address to the routing target address is calculated by the Dijstra algorithm to obtain a network configuration strategy. Network resources are efficiently and reasonably allocated on the basis of meeting user intentions, so as to achieve effective operation of the network, avoid network congestion, and improve the resource utilization of the overall network.
[0089] In some embodiments, before using the pre-built joint model to perform business type recognition and slot filling processing on the text to be tested, the text to be tested is pre-processed, and the pre-processing includes at least one of the following:
[0090] Performing word segmentation on the text to be tested;
[0091] Removing punctuation marks from the text to be tested;
[0092] Filtering stop words in the text to be tested;
[0093] Unifying the upper and lower case in the text to be tested;
[0094] The traditional and simplified fonts in the text to be tested are unified.
[0095] Optionally, the training text is preprocessed text.
[0096] In some embodiments, the routing decision model is constructed according to the DDPG algorithm. Optionally, the routing decision model is a trained model.
[0097] The full name of the DDPG algorithm is Deep Deterministic Policy Gradient, which is a machine learning algorithm that combines the actor-critic structure with the Deep Q-Learning (DQN) structure to output specific behaviors rather than behavior probabilities. It can output actions in the continuous action space according to the learned strategy. It is better than DQN in the continuous action space and converges faster. It has the characteristics of self-learning, self-adaptation, and real-time. During the training process, the routing decision model uses the link weight of the network as the learning target, conducts deep reinforcement learning, and then uses the trained routing decision model to obtain the optimal network link weight, and the routing weight distribution is more reasonable.
[0098] In some embodiments, S104 includes:
[0099] Inputting the real-time network load as a state into the routing decision model;
[0100] inputting the quality of service performance configuration requirements as rewards into the routing decision model;
[0101] The routing decision model outputs the network link weight as an action according to the state and the reward. Optionally, the quality of service performance configuration requirements include bandwidth requirements, delay requirements and packet loss rate requirements.
[0102] Taking the service quality performance configuration requirements as the reward input, the routing decision model can comprehensively consider the bandwidth requirements, delay requirements and packet loss rate requirements to achieve the target business type. At the same time, the network link weight is obtained by combining the network load representing the current network environment. On the basis of meeting the user's target business type requirements, network resources are reasonably allocated to improve the resource utilization of the overall network.
[0103] The present invention discloses an intention translation method, which uses a joint model to process the user's intention expression, does not require the user to use a specific template expression, so that the expression form is not restricted, and supports users to express their intentions in natural language; uses a joint model to achieve deep semantic understanding, so that the translation result of the intention is more accurate, and the target business type and slot filling result can be obtained at the same time, which simplifies the processing process and improves efficiency; uses the LDA model for feature expansion, effectively expands the features and information of the text to be tested, and improves the accuracy of slot filling processing; uses the DDPG routing decision model to calculate the network link weight, realizes the intelligent allocation of routing weights, and reasonably allocates network resources on the basis of meeting the user's target business type requirements, and improves the resource utilization of the overall network; and then calculates the shortest path between the routing source address and the routing target address through the Dijkstra algorithm, obtains the network configuration strategy, and realizes the translation of the user's intention. The whole process realizes the translation of the user's intention expressed in natural language, the user's expression is not restricted, and the network resources can be reasonably allocated to improve the resource utilization of the overall network.
[0104] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.
[0105] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0106] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides an intent translation device.
[0107] refer to Figure 4 , the intention translation device comprises:
[0108] A first acquisition module 401 is used to acquire the user's intention expression as a text to be tested;
[0109] A joint processing module 402 is used to use a pre-built joint model to perform business type recognition and slot filling processing on the text to be tested, and obtain a target business type and slot filling result of the text to be tested;
[0110] A second acquisition module 403, used to determine a routing target address according to the slot filling result;
[0111] A first calculation module 404 is used to calculate the network link weight based on the service quality performance configuration requirements corresponding to the target service type through a pre-built routing decision model;
[0112] The second calculation module 405 is used to calculate the shortest path between the routing source address and the routing target address based on the network link weight, and use it as the intention translation result of the text to be tested.
[0113] In some embodiments, the joint model includes an LDA model and a BERT model;
[0114] The joint processing module 402 is configured to:
[0115] Performing feature expansion on the text to be tested by using the LDA model to obtain an expanded text;
[0116] Converting the extended text into a vector to obtain a feature extension vector;
[0117] Perform semantic extraction on the text to be tested by using the BERT model to obtain a full-text information vector;
[0118] The full-text information vector and the feature extension vector are concatenated, and softmax classification is performed on the concatenated vector to obtain the service type distribution probability and the slot filling result;
[0119] The service type corresponding to the maximum probability value in the service type distribution probability is used as the target service type.
[0120] In some embodiments, the semantic extraction of the text to be tested by the BERT model to obtain a full-text information vector includes:
[0121] Adding a first label to the head of the text to be tested, and adding a second label to the end of each sentence of the text to be tested, to obtain a text sequence;
[0122] Generate an original word vector, a position vector, and a segmentation vector corresponding to each element based on the text sequence;
[0123] The original word vector, the position vector and the segmentation vector corresponding to each element of the text sequence are summed, the summed vector is processed by the Transformer layer, and the target vector of the first label, the target vector of the second label and the target vector of the text to be tested are output, and the target vector of the first label, the target vector of the second label and the target vector of the text to be tested are used as the full-text information vector.
[0124] In some embodiments, the softmax classification process includes:
[0125] Calculate the probability of the text to be tested being predicted as each business type based on the target vector of the first label to obtain a business type distribution probability;
[0126] Based on the target vector of the second label, the target vector of the text to be tested and the feature extension vector, slot filling annotation is performed on the text to be tested and the extended text to obtain a slot filling result.
[0127] In some embodiments, before performing softmax classification processing on the concatenated vector to obtain the business type distribution probability and the slot filling result, the concatenated vector is input into a fully connected layer for processing, and the output of the fully connected layer is used as the input of the softmax classification processing.
[0128] In some embodiments, the LDA model is a model pre-trained using training texts, and the pre-training process is:
[0129] Randomly assigning one of the business types to each word in the training text;
[0130] The training text is traversed, all the business types are sampled using the Gibbs sampling method, and the business type corresponding to each word is updated until the sampling results converge, thereby obtaining the LDA model.
[0131] In some embodiments, the shortest path between the routing source address and the routing target address is calculated using the Dijkstra algorithm.
[0132] In some embodiments, before using the pre-built joint model to perform business type recognition and slot filling processing on the text to be tested, the text to be tested is pre-processed, and the pre-processing includes at least one of the following:
[0133] Performing word segmentation on the text to be tested;
[0134] Removing punctuation marks from the text to be tested;
[0135] Filtering stop words in the text to be tested;
[0136] Unifying the upper and lower case in the text to be tested;
[0137] The traditional and simplified fonts in the text to be tested are unified.
[0138] In some embodiments, the routing decision model is constructed according to the DDPG algorithm.
[0139] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0140] The device of the above embodiment is used to implement a corresponding intention translation method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0141] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, an intention translation method described in any of the above embodiments is implemented.
[0142] Figure 5 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0143] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0144] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0145] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0146] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0147] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0148] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0149] The electronic device of the above embodiment is used to implement a corresponding intention translation method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0150] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute an intention translation method as described in any of the above embodiments.
[0151] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0152] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute an intention translation method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0153] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0154] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0155] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0156] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.
Claims
1. A method for translating intent, characterized in that: include: Obtain the user's intended expression as the text to be tested; Using a pre-built joint model to perform business type recognition and slot filling processing on the text to be tested, to obtain a target business type and slot filling result of the text to be tested; determining a routing target address according to the slot filling result; Calculating the network link weights based on the quality of service performance configuration requirements corresponding to the target service type through a pre-built routing decision model; Based on the network link weight, the shortest path between the routing source address and the routing target address is calculated and used as the intention translation result of the text to be tested; Wherein, the joint model includes an LDA model and a BERT model; The method of using the pre-built joint model to perform business type identification and slot filling processing on the text to be tested to obtain the target business type and slot filling result of the text to be tested includes: Perform feature expansion on the text to be tested using the LDA model to obtain an expanded text; Converting the extended text into a vector to obtain a feature extension vector; Perform semantic extraction on the text to be tested using the BERT model to obtain a full-text information vector; Splicing the full-text information vector and the feature extension vector, performing softmax classification processing on the spliced vector to obtain the business type distribution probability and the slot filling result; The service type corresponding to the maximum probability value in the service type distribution probability is used as the target service type.
2. The method according to claim 1, characterized in that The semantic extraction of the text to be tested by the BERT model to obtain a full-text information vector includes: Adding a first label to the head of the text to be tested, and adding a second label to the end of each sentence of the text to be tested, to obtain a text sequence; Generate an original word vector, a position vector, and a segmentation vector corresponding to each element based on the text sequence; The original word vector, the position vector, and the segmentation vector corresponding to each element of the text sequence are summed, and the summed vector is processed by the Transformer layer to output the target vector of the first label, the target vector of the second label, and the target vector of the text to be tested. The target vector of the first label, the target vector of the second label, and the target vector of the text to be tested are used as the full-text information vector.
3. The method according to claim 2, characterized in that The softmax classification process includes: Calculating the probability of the text to be tested being predicted as each business type based on the target vector of the first label to obtain a business type distribution probability; The text to be tested and the extended text are annotated with slot filling based on the target vector of the second label, the target vector of the text to be tested, and the feature extension vector to obtain a slot filling result.
4. The method according to claim 1, wherein Before performing softmax classification processing on the concatenated vector to obtain the business type distribution probability and the slot filling result, the concatenated vector is input into a fully connected layer for processing, and the output of the fully connected layer is used as the input of the softmax classification processing.
5. The method according to claim 1, wherein The LDA model is a model that is pre-trained using training text. The pre-training process is as follows: Randomly assigning one of the business types to each word in the training text; The training text is traversed, all the business types are sampled using the Gibbs sampling method, and the business type corresponding to each word is updated until the sampling results converge, thereby obtaining the LDA model.
6. The method according to any one of claims 1 to 5, characterized in that The shortest path between the routing source address and the routing target address is calculated using the Dijkstra algorithm.
7. The method according to any one of claims 1 to 5, characterized in that Before using the pre-built joint model to perform business type identification and slot filling processing on the text to be tested, the text to be tested is preprocessed, and the preprocessing includes at least one of the following: Performing word segmentation on the text to be tested; Removing punctuation marks from the text to be tested; Filtering stop words in the text to be tested; Unifying the capitalization of the text to be tested; The traditional and simplified Chinese characters in the text to be tested are standardized.
8. The method according to any one of claims 1 to 5, characterized in that The routing decision model is constructed according to the DDPG algorithm.
9. 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 according to any one of claims 1 to 8 is implemented.
