Slot prediction method

By using the small sample data under the target intention in the slot prediction model with different intentions to obtain the target slot model, the problem of independence of intention training and insufficient data in the prior art is solved, and the training efficiency and data utilization of the model are improved.

CN113901176BActive Publication Date: 2025-04-29KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111223064.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-20
Publication Date
2025-04-29
Estimated Expiration
2041-10-20

AI Technical Summary

Technical Problem

Existing slot prediction techniques train independently of each other under different consents, resulting in a large number of work repetitions and significantly reduced model effects when data is insufficient.

Method used

By utilizing similar correlations between different consents and combining small sample data under the target intention, the target slot model is obtained, thereby improving the semantic richness of pre-trained vectors, improving model training efficiency and data utilization.

Benefits of technology

Based on the slot model with different consents, the intent similar correlation and small sample data are used to improve the training efficiency and data utilization of the model, reduce work repetition, and maintain high model effect when data is insufficient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113901176B_ABST
    Figure CN113901176B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a slot prediction method. The slot prediction method includes: obtaining a second preset number of target slot models under the target intent of the sentence to be predicted based on the initial slot models under multiple initial intents and a first preset number of sentence samples; performing slot prediction on the sentence to be detected based on the second preset number of target slot models to obtain the second preset number of prediction results; and determining the slot information of the target slot of the sentence to be predicted based on the weight of the target slot model and the corresponding prediction result. Based on the slot models under different intents, the present invention utilizes the similar associations between intents and combines the small sample data under the target intent to mine and improve the semantic richness of the pre-trained vector, thereby improving the model training efficiency and data utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] An embodiment of the present invention relates to a slot prediction method. Background Art

[0002] In intelligent human-computer interaction, slot prediction is a very important technology, which aims to identify the user's more fine-grained needs (such as the destination under the travel intention, the name of the skit under the play intention, etc.) under the coarse-grained dialogue intent classification. At present, the common method in the industry is to first use a pre-trained model (such as BERT, etc.) to extract word pre-trained vectors for one intent, and then use the recurrent neural network (RNN) algorithm to extract different types of slots from the sentence; then reuse the above training process for other intents to independently train their slot prediction models.

[0003] At present, the industry's transformation of this technical process mainly focuses on upgrading the pre-training model (such as replacing the BERT model with the abbreviated BERT (ALBERT)), or providing a larger corpus for pre-training. However, the disadvantages of this improvement method are mainly manifested in the following two aspects: (1) The slot training under multiple intents is independent of each other, and a lot of work is repeated; (2) When data cannot be supplemented, the model effect is greatly reduced. Summary of the invention

[0004] The purpose of the present invention is to provide a slot prediction method, which, based on the slot models under different intentions, utilizes the similar associations between intentions and combines small sample data under the target intention to mine and improve the semantic richness of the pre-trained vector, thereby improving the model training efficiency and data utilization.

[0005] In order to achieve the above-mentioned purpose, the first aspect of the present invention provides a slot prediction method, which includes: based on initial slot models under multiple initial intentions and a first preset number of sentence samples, obtaining a second preset number of target slot models under the target intent of the sentence to be predicted, wherein the first preset number of sentence samples are samples under the target intent, and the second preset number is less than the number of the multiple initial intentions; based on the second preset number of target slot models, performing slot prediction on the sentence to be detected to obtain the second preset number of prediction results; and determining the slot information of the target slot of the sentence to be predicted based on the weight of the target slot model and the corresponding prediction result.

[0006] In at least one embodiment, obtaining a second preset number of target slot models under the target intent of the sentence to be predicted includes: based on the intent similarity between the multiple initial intents and the target intent, screening the third preset number of intents ranked top in intent similarity from the multiple initial intents; based on the slot similarity between the slots predicted by the multiple initial slot models and the target slots of the sentence samples, screening the second preset number of initial slot models ranked top in slot similarity from the initial slot models under the third preset number of intents ranked top in intent similarity; and training the second preset number of initial slot models ranked top in slot similarity based on the first preset number of sentence samples to obtain the second preset number of target slot models.

[0007] In at least one embodiment, before executing the step of screening the initial slot models under the third preset number of intents ranked before the intent similarity with the second preset number of initial slot models ranked before the slot similarity, the step of obtaining the second preset number of target slot models under the target intent of the sentence to be predicted also includes: determining the slot semantic similarity between the slots predicted by the multiple initial slot models and the target slots of the sentence sample; determining the slot value similarity between the slots predicted by the multiple initial slot models and the target slots of the sentence sample; and based on the slot semantic similarity and the slot value similarity, determining the slot similarity between the slots predicted by the multiple initial slot models and the target slots of the sentence sample.

[0008] In at least one embodiment, determining the slot semantic similarity between the slots predicted by the multiple initial slot models and the target slot of the sentence sample includes: determining the slot semantic similarity between the slot predicted by each of the multiple initial slot models and the target slot of the sentence sample through the cosine similarity formula, the word vector of the slot name of the slot predicted by each of the multiple initial slot models and the word vector of the slot name of the target slot of the sentence sample.

[0009] In at least one embodiment, determining the slot value similarity between the slots predicted by the multiple initial slot models and the target slots of the sentence sample includes: determining the slot value similarity between the slot predicted by each of the multiple initial slot models and the target slot of the sentence sample based on the intersection and union between the slot value set of the slot predicted by each of the multiple initial slot models and the slot value set of the target slot of the sentence sample.

[0010] In at least one embodiment, before executing the step of determining the slot information of the target slot of the sentence to be predicted, the slot prediction method also includes: determining the weights of the second preset number of initial slot models ranked before the slot similarity based on the intention similarity and slot similarity corresponding to the second preset number of initial slot models ranked before the slot similarity; and determining the weights of the second preset number of initial slot models ranked before the slot similarity as the weight of the corresponding target slot model.

[0011] In at least one embodiment, determining the slot information of the target slot of the sentence to be predicted includes: obtaining the weight of the prediction result corresponding to each character in each prediction result based on the weight of the target slot model and the corresponding prediction result; determining the sum of the weights of various types of prediction results for each character based on the weights of the prediction results of each character; for each character, filtering a specific type of prediction result with the largest sum of weights from the various types of prediction results; and determining the slot information of the target slot based on the specific type of prediction result for each character.

[0012] In at least one embodiment, the initial slot model has been trained based on a fourth preset number of dialogue samples under the initial intent, and the first preset number is less than the fourth preset number.

[0013] Through the above technical scheme, the present invention creatively first obtains a second preset number of target slot models based on multiple initial slot models under initial intents and a small number of sentence samples under target intents; then performs slot prediction on the sentences to be detected based on the second preset number of target slot models; and then determines the slot information of the target slot of the sentence to be predicted based on the weight of the target slot model and the corresponding prediction result. Therefore, the present invention can mine and improve the semantic richness of pre-trained vectors based on slot models under different intents, using similar associations between intents and combining small sample data under target intent, thereby improving model training efficiency and data utilization.

[0014] A second aspect of the present invention provides a machine-readable storage medium, on which instructions are stored, the instructions being used to enable a machine to execute the above-mentioned slot prediction method.

[0015] A third aspect of the present invention provides an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the above-mentioned slot prediction method.

[0016] A fourth aspect of the present invention provides a computer program product, comprising a computer program, which implements the above-mentioned slot prediction method when executed by a processor.

[0017] Other features and advantages of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:

[0019] Figure 1 is a flow chart of a slot prediction method provided by an embodiment of the present invention;

[0020] Figure 2 is a flow chart of obtaining a second preset number of target slot models under target intent provided by an embodiment of the present invention; and

[0021] Figure 3 It is a schematic diagram of obtaining a target slot model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0022] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.

[0023] Figure 1 FIG. 1 is a flow chart of a slot prediction method provided by an embodiment of the present invention. Figure 1 As shown, the slot prediction method may include the following steps S101-S104.

[0024] Step S101, based on the initial slot models under multiple initial intents and a first preset number of sentence samples, obtain a second preset number of target slot models under the target intent of the sentence to be predicted.

[0025] Among them, the first preset number of sentence samples are samples under the target intention; and the second preset number is less than the number of the multiple initial intentions.

[0026] For example, the multiple initial intents are "listen to the radio", "play video", "update alarm", "check calendar", "play music", etc.; the sentence to be predicted is "review the 26th episode of The Heroes of Fearless" broadcast on CCTV11 at 11 o'clock yesterday", and its target intent is "play TV series". In this embodiment, based on the initial slot models under the multiple initial intents, a first preset number (e.g., a small number) of sentence samples under the intent of "play TV series" (e.g., Figure 3 As shown, that is, a small sample, which can be prepared in advance according to actual needs), obtain several (for example, M) target slot models based on the initial slot models under several (for example, M) initial intentions among the multiple (for example, a large number) initial intentions.

[0027] The initial slot model has been trained based on a fourth preset number of dialogue samples under the initial intent, and the first preset number is less than the fourth preset number. A small sample intent refers to an intent whose training data volume is much smaller than that of other intents (generally the ratio may be less than 1:10).

[0028] Specifically, according to the number of samples of each intent, an intent with a larger sample size is selected to learn the slot prediction model (which can be referred to as the slot model) under its intent. The initial slot model under the intents such as "listen to the radio", "play video", "update alarm", "query calendar", and "play music" can be trained based on existing methods. For example, BERT (Bidirectional Encoding Representation based on Transformers) is first used to pre-train the word vectors under each intent, and then for a sentence of text, a bidirectional long short-term memory network (LSTM) model is combined with a conditional random field (CRF) model to extract the slot identifier. In other words, the slot model under each intent is trained independently in a parallel manner and combined with a large number of sentence samples. For the learning of the slot prediction model of the above-mentioned large sample intent, due to the sufficient sample size, there is no need to specially handle its training process.

[0029] Furthermore, based on the intent similarity between the initial intent and the target intent and the slot similarity between the slot predicted by the initial slot model and the target slot, several initial slot models with higher similarity can be screened from multiple initial slot models; then, on the basis of training the initial slot models under multiple initial intents using the above-mentioned large sample method, the initial slot models are further trained using small samples under the target intent, so as to obtain the target slot model under the target intent migrated from several initial intents, and the specific methods include but are not limited to the following specific embodiments.

[0030] For step S101, Figure 2 As shown, the process of obtaining a second preset number of target slot models under the target intent of the sentence to be predicted may include steps S201-S203.

[0031] Specifically, from a task perspective, this embodiment first uses an intent with a relatively rich corpus to learn a slot prediction model for the intent from the corpus data; then, when learning slot prediction models for other new intents similar to the intent, based on the previously learned slot prediction model, a small number of new intent samples are used to fine-tune the model, thereby learning a small sample model, as described below.

[0032] Before executing step S201, the obtaining of a second preset number of target slot models under the target intent of the sentence to be predicted also includes: obtaining the intent similarity between the multiple initial intents and the target intent.

[0033] For the calculation of intent similarity, the BERT model is first used to calculate the average-pooling of the class (CLS) sentence vectors under a certain intent to represent the intent vector of this intent; then, for multiple initial intent vectors and target intent vectors, the cosine similarity between the two vectors is calculated to cluster similar intents (if the similarity is greater than a certain threshold, the two intents are considered similar). Specifically, the intent similarity can be obtained through the cosine similarity formula, the intent vector of the initial intent, and the intent vector of the target intent.

[0034] Among them, the intention vector I of the initial intention T T It can be calculated based on the following formula (1):

[0035]

[0036] In the above formula (1), |S T | represents the set of sentences S in the corpus about the initial intention T T The number of; s represents the statement S T any sentence in ; and CLS(s) represents the class vector (i.e., CLS vector) of any sentence s. Similarly, the target intent I can be calculated based on the above formula (1): T’ The intention vector I T’ Then based on the following formula (2), the intention vector I of the initial intention T and the intention vector I of the target intention T’ Get the intention similarity Sim intent (T,T'):

[0037] Sim intent (T,T')=Cosine(I T ,I T’ ). (2)

[0038] Step S201 , based on the intent similarities between the multiple initial intents and the target intent, filter the intents that are ranked top third preset number in terms of intent similarity from the multiple initial intents.

[0039] Specifically, the above-mentioned intent similarity calculation method is used to find the K initial intents (i.e., large sample intents) that are most similar to the target intent (i.e., small sample intent). For example, multiple intents are sorted in descending order of intent similarity, and the top four initial intents ("listen to the radio", "play video", "query calendar", "play music") with the highest similarity to "play TV series" are selected. In an exemplary embodiment, the above-mentioned intent similarity calculation method is used to find the K initial intents (i.e., large sample intents) that are most similar to the target intent (i.e., small sample intent) and whose similarity exceeds a threshold.

[0040] Before executing step S202, obtaining a second preset number of target slot models under the target intent of the sentence to be predicted also includes: determining the slot semantic similarity between the slots predicted by the multiple initial slot models and the target slots of the sentence sample; determining the slot value similarity between the slots predicted by the multiple initial slot models and the target slots of the sentence sample; and based on the slot semantic similarity and the slot value similarity, determining the slot similarity between the slots predicted by the multiple initial slot models and the target slots of the sentence sample.

[0041] For the calculation of slot similarity, two types of similarities are considered: one is the semantic similarity of the slot itself (using the semantic vector pre-trained by BERT), and the other is to directly calculate the cosine similarity between the slot names.

[0042] Among them, determining the slot semantic similarity between the slots predicted by the multiple initial slot models and the target slots of the sentence sample may include: determining the slot semantic similarity between the slot predicted by each of the multiple initial slot models and the target slot of the sentence sample through the cosine similarity formula, the word vector of the slot name of the slot predicted by each of the multiple initial slot models and the word vector of the slot name of the target slot of the sentence sample.

[0043] Specifically, the word vector W of the slot name of slot L (e.g., "date", "artist") predicted by the following formula (3) and a certain initial slot model (the slot model under the intent of "listen to the radio", the slot model under the intent of "play video", the slot model under the intent of "query calendar", and the slot model under the intent of "play music") is: L and the word vector W of the slot name of the target slot L' (e.g., "date", which can be obtained according to the existing method) of the sentence sample L’ , determine the slot semantic similarity Sim between the slot predicted by the initial slot model and the target slot of the sentence sample name (L,L'),

[0044] Sim name (L,L')=Cosine(W L ,W L’ ), (3)

[0045] W in the above formula L ,W L’ The determination can be made in an existing manner (for example, by a BERT model). In various embodiments of the present invention, the slots predicted by the multiple initial slot models can refer to the slot results predicted by each initial slot model for the conversation samples under the fourth preset number of initial intents.

[0046] Among them, determining the slot value similarity between the slots predicted by the multiple initial slot models and the target slots of the sentence sample may include: determining the slot value similarity between the slot predicted by each of the multiple initial slot models and the target slot of the sentence sample based on the intersection and union between the slot value set of the slot predicted by each of the multiple initial slot models and the slot value set of the target slot of the sentence sample.

[0047] If two slots under different intents have more identical slot values, they are more similar. For example, "date" is similar to "era (or date)" and has many similar slot values ​​(such as "Sunday" or "next Tuesday", etc.); "artist" and "date" have almost no identical slot values. Here, the Jaccard similarity can be used to calculate the similarity of the slot values ​​of the slots. Specifically, the slot value set S of the slot L (for example, "date") predicted by the following formula (4) and a certain initial slot model (any of the slot models predicted by the slot model under the intent of "listening to the radio", the slot model under the intent of "playing video", the slot model under the intent of "querying the calendar", and the slot model under the intent of "playing music"). L and the slot value set S of the target slot (e.g., "date") of the sentence sample L’ The intersection S L ∩S L’ and the union S L ∪S L’ , determine the slot value similarity Sim between the slot predicted by the initial slot model and the target slot of the sentence sample value (L,L'),

[0048]

[0049] In the above formula, |S L ∩S L’ |,|S L ∪S L’| represents the number of elements in the intersection and the number of elements in the union, respectively.

[0050] Of course, based on the above formulas, reasonable settings can be made (for example, multiplying each formula by a suitable weight) to achieve the purpose of similarly calculating the corresponding similarities. In addition, in other embodiments, the slot name or slot value can be used alone to calculate the slot similarity.

[0051] Then, based on the slot semantic similarity Sim name (L, L') and the slot value similarity Sim value (L, L') and the following formula (5) to determine the slot similarity Sim between the slot predicted by a certain initial slot model and the target slot of the sentence sample slot (L, L'),

[0052] Sim slot (L, L') = W name *Sim name (L,L')+W value *Sim value (L,L'), (5)

[0053] W in the above formula name , W value They represent the weights of slot semantics and slot value respectively, which can be obtained through existing learning methods.

[0054] Step S202, based on the slot similarity between the slots predicted by the multiple initial slot models and the target slots of the sentence sample, select the initial slot models with the second preset number of slot similarities ranked top from the initial slot models under the third preset number of intentions ranked top in terms of intention similarity.

[0055] Specifically, the above-mentioned slot similarity calculation method is used to find the M initial slot models (e.g., "listen to the radio / date", "play video / date", "play music / date") that are most similar to the target slot (e.g., "play TV series / date"). For example, the initial slot models (e.g., "listen to the radio / date", "play video / date", "play music / date") under the top 4 initial intents ("listen to the radio", "play video", "query calendar", "play music") with the top 4 similarities to "play TV series" are sorted in descending order of slot similarity, and the top 3 initial slot models (e.g., "listen to the radio / date", "play video / date", "play music / date") with the top 3 similarities to "play TV series / date" are screened. Figure 3 shown).

[0056] Step S203: training a second preset number of initial slot models ranked before the slot similarity based on the first preset number of sentence samples to obtain the second preset number of target slot models.

[0057] For the learning of the target slot prediction model (i.e., the slot prediction model of the small sample), due to the small sample size under its intent, the initial slot prediction model (i.e., the large sample slot model) with similar intent is used for fine-tuning learning. Specifically, using the small sample data under the target intent, the iterative training is continued on the initial slot models with the top three similarities to "play TV series / date" (e.g., "listen to the radio / date", "play video / date", "play music / date") to obtain three target slot models (e.g., "listen to the radio / date-play TV series / date", "play video / date-play TV series / date", "play music / date-play TV series / date").

[0058] Different from the existing independent parallel learning framework of slot prediction models, the above embodiment (step S101) proposes an associated serial learning framework: the slot model under the large sample intent is learned first, and then the slot model under the small sample intent similar to the large sample intent is learned. The specific learning method can refer to the existing method and will not be repeated here. In other words, the slot prediction model learned from similar intent is used to feed back into the training and learning process of the slot prediction model under the target intent, thereby improving the accuracy of slot learning.

[0059] Step S102: Perform slot prediction on the sentence to be detected based on the second preset number of target slot models to obtain the second preset number of prediction results.

[0060] Specifically, using the three target slot models obtained in step S101 (specifically step S203) (for example, "listen to the radio / date-play TV series / date", "play video / date-play TV series / date", "play music / date-play TV series / date", as shown in FIG. Figure 3 As shown in the figure, the slot prediction is performed on the sentence to be detected, so that three prediction results can be obtained. For example, for the sentence to be detected "Watching the 26th episode of The Hero Huo Yuanjia broadcast on CCTV11 at 11 o'clock yesterday", the prediction results of the "Listen to the radio / date-Play TV series / date" model are {"B", "I"}; the prediction results of the "Play video / date-Play TV series / date" model are {"B", "E"}; the prediction results of the "Play music / date-Play TV series / date" model are {"B", "E"}, where the prediction result "B" represents the "start" mark, the prediction result "E" represents the "end" mark, and the prediction result "I" represents the "middle" mark.

[0061] Before executing step S103, the slot prediction method may also include: determining the weights of the second preset number of initial slot models ranked before the slot similarity based on the intention similarity and slot similarity corresponding to the second preset number of initial slot models ranked before the slot similarity; and determining the weights of the second preset number of initial slot models ranked before the slot similarity as the weights of the corresponding target slot models.

[0062] In one embodiment, the intention similarity Sim of each of the second predetermined number of initial slot models ranked before the slot similarity may be calculated. intent (T, T') and slot similarity Sim slot (L, L') and the following formula (6), calculate the weight W of each of the second preset number of initial slot models ranked before the slot similarity pred ,

[0063] W pred =Sim slot (L,L')*Sim intent (T, T'), (6)

[0064] Since the second preset number of target slot models under the target intent finally obtained corresponds one-to-one to the second preset number of initial slot models ranked before the slot similarity, and each target slot model is trained based on the corresponding initial slot model, the weight of the initial slot model can be used as the weight of the corresponding target slot model.

[0065] Specifically, the three target slot models (for example, "listen to the radio / date-play TV series / date", "play video / date-play TV series / date", and "play music / date-play TV series / date") are trained based on the top three initial slot models with similarity to "play TV series / date" (for example, "listen to the radio / date", "play video / date", and "play music / date"). Therefore, the weight of each of the three initial slot models can be calculated through the intention similarity and slot similarity of each of the three initial slot models (for example, the weight of "listen to the radio / date" is 0.5, the weight of "play video / date" is 0.9, and the weight of "play music / date" is 0.7), and used as the weight of the corresponding target slot model (the weight of the "listen to the radio / date-play TV series / date" model is 0.5; the weight of the "play video / date-play TV series / date" model is 0.9; the weight of the "play music / date-play TV series / date" model is 0.7).

[0066] Step S103, determining the slot information of the target slot of the statement to be predicted based on the weight of the target slot model and the corresponding prediction result.

[0067] For step S103, determining the slot information of the target slot of the sentence to be predicted may include: obtaining the weight of the prediction result corresponding to each character in each prediction result based on the weight of the target slot model and the corresponding prediction result; determining the sum of the weights of various types of prediction results of each character based on the weight of the prediction result of each character; for each character, filtering a specific type of prediction result with the largest sum of weights from the various types of prediction results; and determining the slot information of the target slot based on the specific type of prediction result for each character.

[0068] For example, for the sentence to be detected "Watch the 26th episode of The Heroes of Huo Yuanjia broadcast on CCTV11 at 11 o'clock yesterday", the prediction results of the "Listen to the radio / date-Play TV series / date" model are {"B", "I"}, with a weight of 0.5; the prediction results of the "Play video / date-Play TV series / date" model are {"B", "E"}, with a weight of 0.9; the prediction results of the "Play music / date-Play TV series / date" model are {"B", "E"}, with a weight of 0.7. Therefore, the prediction result "B" for "yesterday" has a sum of weights of 2.1; the prediction result "I" for "day" has a sum of weights of 0.5, and the prediction result "E" has a sum of weights of 1.6. For "yesterday", since the prediction results are all "B", it shows that "yesterday" is the start mark of the date; for "day", since the sum of the weights of the prediction result "E" is greater than the prediction result "I", it shows that "day" is the end mark of the date, so it can be determined that the slot information of the target slot "play TV series / period" of the sentence to be predicted is "yesterday".

[0069] Compared with the conventional "majority obeys minority" voting rule, this embodiment takes into account the weight of each target slot model, which performs weighted voting on the prediction results.

[0070] For the sentence to be detected, "Watch the 26th episode of The Great Swordsman Huo Yuanjia broadcast on CCTV11 at 11 o'clock yesterday", a similar process to the above can be used to determine that the slot information of the target slot "Play TV series / channel" is "CCTV11", the slot information of "Play TV series / title" is "The Great Swordsman Huo Yuanjia", and the slot information of "Play TV series / time" is "11 o'clock".

[0071] In summary, the present invention first obtains a second preset number of target slot models based on multiple initial slot models under initial intents and a small number of sentence samples under target intents; then performs slot prediction on the sentence to be detected based on the second preset number of target slot models; and then determines the slot information of the target slot of the sentence to be predicted based on the weight of the target slot model and the corresponding prediction result. Therefore, the present invention can mine and improve the semantic richness of the pre-trained vector based on the slot prediction models under different intents by utilizing the similar associations between intents and combining with the small sample data under the target intent, thereby improving the model training efficiency and data utilization.

[0072] An embodiment of the present invention further provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the above-mentioned slot prediction method.

[0073] An embodiment of the present invention further provides an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the above-mentioned slot prediction method.

[0074] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the above-mentioned slot prediction method when executed by a processor.

[0075] The optional implementation modes of the embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details in the above implementation modes. Within the technical concept of the embodiments of the present invention, various simple modifications can be made to the technical scheme of the embodiments of the present invention, and these simple modifications all belong to the protection scope of the embodiments of the present invention.

[0076] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the embodiments of the present invention will not further describe various possible combinations.

[0077] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a single-chip microcomputer, a chip or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0078] In addition, various implementation modes of the embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the embodiments of the present invention, they should also be regarded as the contents disclosed by the embodiments of the present invention.

Claims

1. A slot prediction method, characterized in that: The slot prediction method comprises: Based on the initial slot models under the multiple initial intents and the first preset number of sentence samples, obtaining a second preset number of target slot models under the target intent of the sentence to be predicted, wherein the first preset number of sentence samples are samples under the target intent, and the second preset number is less than the number of the multiple initial intents; Performing slot prediction on the sentence to be detected based on the second preset number of target slot models to obtain the second preset number of prediction results; and Based on the weight of the target slot model and the corresponding prediction result, determine the slot information of the target slot of the sentence to be predicted, The step of obtaining a second preset number of target slot models under the target intent of the sentence to be predicted includes: Based on the intent similarities between the multiple initial intents and the target intent, selecting a third preset number of intents ranked top in intent similarity from the multiple initial intents; Based on the slot similarities between the slots predicted by the multiple initial slot models and the target slots of the sentence sample, selecting the initial slot models with the second preset number of slot similarities from the initial slot models under the third preset number of intents ranked top in terms of intent similarity; and Based on the first preset number of sentence samples, the second preset number of initial slot models ranked before the slot similarity are trained to obtain the second preset number of target slot models.

2. The slot prediction method according to claim 1, characterized in that: Before executing the step of selecting the initial slot models with the second preset number of slot similarity rankings from the initial slot models under the third preset number of intents ranked first in terms of intent similarity, the step of obtaining the second preset number of target slot models under the target intent of the sentence to be predicted also includes: Determining the slot semantic similarity between the slots predicted by the multiple initial slot models and the target slot of the sentence sample; Determining the slot value similarity between the slots predicted by the multiple initial slot models and the target slot of the sentence sample; and Based on the slot semantic similarity and the slot value similarity, the slot similarity between the slots predicted by the multiple initial slot models and the target slot of the sentence sample is determined.

3. The slot prediction method according to claim 2, characterized in that: Determining the slot semantic similarity between the slots predicted by the multiple initial slot models and the target slot of the sentence sample includes: The slot semantic similarity between the slot predicted by each of the multiple initial slot models and the target slot of the sentence sample is determined by the cosine similarity formula, the word vector of the slot name of the slot predicted by each of the multiple initial slot models and the word vector of the slot name of the target slot of the sentence sample.

4. The slot prediction method according to claim 2, characterized in that: Determining the slot value similarity between the slots predicted by the multiple initial slot models and the target slot of the sentence sample includes: Based on the intersection and union of the slot value set of the slot predicted by each of the initial multiple slot models and the slot value set of the target slot of the sentence sample, the slot value similarity between the slot predicted by each of the multiple initial slot models and the target slot of the sentence sample is determined.

5. The slot prediction method according to claim 1, characterized in that: Before executing the step of determining the slot information of the target slot of the statement to be predicted, the slot prediction method further includes: Determining weights of the second preset number of initial slot models ranked before the slot similarity based on the intention similarities and slot similarities corresponding to the second preset number of initial slot models ranked before the slot similarity; and The weights of the second preset number of initial slot models ranked before the slot similarity are determined as the weights of the corresponding target slot models.

6. The slot prediction method according to claim 1, characterized in that: The slot information for determining the target slot of the sentence to be predicted includes: Based on the weight of the target slot model and the corresponding prediction result, obtaining the weight of the prediction result corresponding to each character in each prediction result; Based on the weights of the prediction results of the respective characters, determining the sum of the weights of the various types of prediction results of the respective characters; For each of the characters, selecting a specific type of prediction result having the largest sum of weights from the various types of prediction results; and Based on the specific type prediction results for the respective characters, slot information of the target slot is determined.

7. The slot prediction method according to claim 1, characterized in that: The initial slot model has been trained based on a fourth preset number of dialogue samples under initial intent, and the first preset number is less than the fourth preset number.

8. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions for causing a machine to execute the slot prediction method according to any one of claims 1 to 7.

9. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the slot prediction method described in any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the slot prediction method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Information retrieval method based on convolutional neural network and related equipment thereof

    CN110825949A

  • Semantic analysis method and device, computer readable storage medium and electronic equipment

    CN111985249A