End-to-end entity fuzzy method and system, electronic device, and computer storage medium
Through the end-to-end entity fuzzy method, the model independently learns features, solving the problems of artificially computed feature complexity and deep sub-hidden feature learning in the prior art, and achieving more efficient entity fuzzy processing.
Patent Information
- Application Number
- CN202210176436.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-24
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2042-02-24
AI Technical Summary
The existing solid fuzzy technology relies on manual computing features, resulting in the complex engineering of the model and the inability to learn deep sub-hidden features, and the inability to effectively handle noise and recognition errors after speech recognition.
Using end-to-end entity fuzzy method, the model can learn features independently, obtain user request information and multiple preset candidate information for entity fuzzy processing, use feature self-training and attention processing to generate similarity, abandon manual summary of features, and realize model autonomy Learn deep-seated features.
The complexity of model engineering is simplified, the model's learning ability of potential hidden features is enhanced, and the accuracy and efficiency of entity fuzziness are improved.
Smart Images

Figure CN114722792B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of natural language processing, and more specifically, particularly relates to an end-to-end entity fuzzy method and system, electronic equipment, and computer storage medium. Background Art
[0002] Natural language processing mainly solves the problem of being able to match the most similar entities based on the entity candidate list when the text after speech recognition contains noise, recognition errors, or incomplete user expression during the natural language processing process.
[0003] Existing entity fuzzy technology mainly relies on feature engineering solutions. Before model inference, features need to be manually calculated, such as prefix matching, suffix matching, edit distance, etc. This model solution is not an end-to-end model solution, and the engineering is more complicated; and the manually summarized features may be incomplete, making it impossible for the model to learn more deeply hidden features. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide an end-to-end entity fuzzy method and system, electronic device, and computer storage medium, which are used to abandon the existing manual summary and calculation feature methods, and adopt the model autonomous learning feature method, so that the model can autonomously learn more in-depth feature information.
[0005] The first aspect of the present application discloses an end-to-end entity fuzzy method, comprising:
[0006] Get the user's request information;
[0007] Perform entity fuzzy processing on the request information and multiple preset candidate information respectively to obtain multiple similarities;
[0008] The value with the highest similarity among the multiple similarities is taken as the final similarity after the entity is blurred.
[0009] Optionally, performing entity fuzzy processing on the request information and the preset candidate information to obtain the similarity includes:
[0010] Performing part-of-speech analysis on the request information and the preset candidate information to obtain text information of the request information, part-of-speech information of the request information, text information of the candidate information, and part-of-speech information of the candidate information;
[0011] Performing feature self-training on the text information of the request information and the text information of the candidate information to obtain feature similarity; and performing attention processing on the text information of the request information, the part-of-speech information of the request information, the text information of the candidate information, and the part-of-speech information of the candidate information to obtain attention similarity;
[0012] The feature similarity and the attention similarity are concatenated and then matrix operated to obtain the similarity between the text information of the request information and the text information of the candidate information.
[0013] Optionally, performing feature self-training on the text information of the request information and the text information of the candidate information to obtain feature similarity includes:
[0014] The text information of the request information remains stationary, the text information of the candidate information is sequentially shifted to the right, and the superposition vector of the two text information after each shift is calculated; and the text information of the request information remains stationary, the text information of the candidate information is sequentially shifted to the left, and the superposition vector of the two text information after each shift is calculated;
[0015] Taking each of the superimposed vectors as a local similarity segment;
[0016] Each of the local segments is processed by a linear function to obtain feature similarity.
[0017] Optionally, the text information of the request information remains unchanged, the text information of the candidate information is sequentially translated to the right, and the superposition vector of the two text information after each translation is calculated; and the text information of the request information remains unchanged, the text information of the candidate information is sequentially translated to the left, and the superposition vector of the two text information after each translation is calculated, and the formula used includes:
[0018]
[0019] Among them, pos is the left-right translation position code; when translated to the left n times, pos is 0, -1, -2, -n respectively; when translated to the right n times, pos is 0, 1, 2, n respectively; d is the dimension of the position coding matrix; PE(pos,2i) is the position coding matrix for learning even positions; PE(pos,2i+1) is the position coding matrix for learning odd positions;
[0020] The formula used in the linear function processing is:
[0021] feat_mat=w1*(feat_left_mat+left_posi_emb)+w2*(feat_right_mat+right_posi_emb); Formula (2)
[0022] final_feat_mat=linear(feat_mat);
[0023] Among them, w1 and w2 represent the parameters of model learning, linear represents a linear function, feat_left_mat is the left-shifted feature matrix, feat_right_mat is the right-shifted feature matrix, right_posi_emb is the value of formula (1) shifted to the right n times, left_posi_emb is the value of formula (1) shifted to the left n times, feat_mat is the feature matrix after learning, and final_feat_mat is the matrix after linear processing.
[0024] Optionally, the formula used to perform attention processing on the text information of the request information, the part-of-speech information of the request information, the text information of the candidate information, and the part-of-speech information of the candidate information to obtain the attention similarity is:
[0025]
[0026] Among them, attmat is the attention similarity, q_n represents the part-of-speech information of the request information, c_n represents the part-of-speech information of the candidate information; q represents the text information of the request information; c represents the text information of the candidate information; d is the number of heads of multi-head attention, which is a fixed value; Q and V are matrices that integrate the text information and part-of-speech information in the request information, and K is a matrix that integrates the text information and part-of-speech information in the candidate information; concat represents the concatenation of two matrices.
[0027] The second aspect of the present application discloses an end-to-end entity fuzzy system, comprising:
[0028] The acquisition module is used to obtain the user's request information;
[0029] The entity fuzzy model is used to perform entity fuzzy processing on the request information and multiple preset candidate information respectively to obtain multiple similarities; the highest similarity among the multiple similarities is taken as the final similarity after entity fuzzification.
[0030] Optional, entity fuzzy model, including:
[0031] A parsing module, used for performing part-of-speech parsing on the request information and the preset candidate information to obtain text information of the request information, part-of-speech information of the request information, text information of the candidate information and part-of-speech information of the candidate information;
[0032] A feature self-training module, used for performing feature self-training on the text information of the request information and the text information of the candidate information to obtain feature similarity;
[0033] an attention module, configured to perform attention processing on the text information of the request information, the part-of-speech information of the request information, the text information of the candidate information, and the part-of-speech information of the candidate information to obtain attention similarity;
[0034] The matrix splicing linear module is used to splice the feature similarity and the attention similarity and then perform matrix operation to obtain the similarity between the text information of the request information and the text information of the candidate information.
[0035] Optionally, it further includes: a construction unit of the entity fuzzy model; the construction unit includes:
[0036] A sample acquisition unit, used to acquire a request information sample;
[0037] An entity fuzzy processing unit, configured to perform entity fuzzy processing on the request information sample and first preset candidate information to obtain a first similarity, and perform entity fuzzy processing on the request information and second preset candidate information to obtain a second similarity;
[0038] The loss function calculation unit is used to calculate the loss function for two similarities to obtain the loss degree after the entity is blurred; when the loss degree meets the preset conditions, the construction of the entity fuzzy model is completed.
[0039] The third aspect of the present application discloses an electronic device, comprising:
[0040] one or more processors;
[0041] a storage system having one or more programs stored thereon;
[0042] When the one or more programs are executed by the one or more processors, the one or more processors implement the end-to-end entity fuzzy method as described in any one of the first aspects of the present application.
[0043] The fourth aspect of the present application discloses a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the end-to-end entity fuzzy method as described in any one of the first aspects of the present application is implemented.
[0044] It can be seen from the above technical scheme that an end-to-end entity fuzzification method provided by the present invention includes: obtaining user request information; performing entity fuzzification processing on the request information and multiple preset candidate information respectively to obtain multiple similarities; taking the highest similarity among the multiple similarities as the final similarity after entity fuzzification; there is no need to manually calculate prefix matching, suffix matching, NGram, CLS and other manually summarized and calculated feature methods, and a model autonomous learning feature method is adopted to allow the model to autonomously learn more in-depth feature information, that is, to reduce the complexity of model engineering, and allow the model to autonomously learn more potential and hidden features. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 is a flow chart of an end-to-end entity fuzzy method provided by an embodiment of the present invention;
[0047] Figure 2 is a flow chart of another end-to-end entity fuzzy method provided by an embodiment of the present invention;
[0048] Figure 3 is a flow chart of another end-to-end entity fuzzy method provided by an embodiment of the present invention;
[0049] Figure 4 is a schematic diagram of an end-to-end entity fuzzy system provided by an embodiment of the present invention;
[0050] Figure 5 is a schematic diagram of a physical fuzzy model in an end-to-end physical fuzzy system provided by an embodiment of the present invention;
[0051] Figure 6 is a schematic diagram of a feature self-training module in an end-to-end entity fuzzy system provided by an embodiment of the present invention;
[0052] Figure 7 It is a training schematic diagram of a feature self-training module in an end-to-end entity fuzzy system provided by an embodiment of the present invention;
[0053] Figure 8 It is a training schematic diagram of a feature self-training module in an end-to-end entity fuzzy system provided by an embodiment of the present invention;
[0054] Fig. 9 It is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] In this application, the terms "comprises", "comprising" or any other variation thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0057] The embodiment of the present application provides an end-to-end entity fuzzy method for solving the problem that the model solution in the prior art is not end-to-end and the engineering is relatively complex; and the manually summarized features may be incomplete, making it impossible for the model to learn more deeply hidden features.
[0058] See also Figure 1 , the end-to-end entity fuzzification method, comprising:
[0059] S101: Obtain user request information.
[0060] It should be noted that when a user needs to perform a corresponding operation, the user will send a request message.
[0061] The request information input in the search engine is obtained; of course, the request information is not limited to this, and will not be described here one by one. It depends on the actual situation and is within the protection scope of this application.
[0062] S102: Perform entity fuzzy processing on the request information and multiple preset candidate information respectively to obtain multiple similarities.
[0063] Among them, the multiple preset candidate information are different; that is, the request information and the multiple different candidate information are respectively subjected to entity fuzzy processing.
[0064] The number of candidate information is not described here one by one, and it can be determined according to the actual situation, all of which are within the protection scope of this application.
[0065] The candidate information may be stored in a database, and when the user request information is obtained, the corresponding candidate information is selected.
[0066] It should be noted that the request information and the first candidate information are subjected to entity fuzzy processing to obtain the first similarity; the request information and the second candidate information are subjected to entity fuzzy processing to obtain the second similarity; the request information and the third candidate information are subjected to entity fuzzy processing to obtain the third similarity, and so on, the request information and the nth candidate information are subjected to entity fuzzy processing to obtain the nth similarity; n is the total number of candidate information. The specific value of n will not be described here one by one, and it can be determined according to the actual situation, and all are within the protection scope of this application.
[0067] S103: taking the value with the highest similarity among the multiple similarities as the final similarity after the entity is blurred.
[0068] Specifically, multiple similarities may be sorted from small to large to obtain the value with the highest similarity, and the value is used as the final similarity after the entity is blurred.
[0069] Alternatively, multiple similarities may be sorted from large to small to obtain the value with the highest similarity, and the value is used as the final similarity after entity blurring.
[0070] For example, the value with the highest similarity is selected from the n similarities as the final similarity after entity blurring. The specific value of n will not be described here one by one, and it can be determined according to the actual situation, and all of them are within the protection scope of this application.
[0071] In this embodiment, the user's request information is obtained; the request information is subjected to entity fuzzy processing with multiple preset candidate information respectively to obtain multiple similarities; the highest similarity among the multiple similarities is taken as the final similarity after entity fuzzification; there is no need to manually calculate the existing manually summarized and calculated feature methods such as prefix matching, suffix matching, NGram, CLS, etc., and a model autonomous learning feature method is adopted to allow the model to autonomously learn more in-depth feature information, that is, to reduce the complexity of model engineering, and allow the model to autonomously learn more potential and hidden features; at the same time, combined with the part-of-speech information of the entity's word segmentation, the model is assisted to focus on the part of the entity with greater information weight.
[0072] In practical applications, see Figure 2 Step S102: Entity fuzzy processing is performed on the request information and the preset candidate information to obtain similarity, including:
[0073] S201 , performing part-of-speech analysis on request information and preset candidate information to obtain text information of the request information, part-of-speech information of the request information, text information of the candidate information, and part-of-speech information of the candidate information.
[0074] Specifically, Figure 5 As shown, the beautiful bride is the original request text, that is, the text information of the request information; Ba, la, la, Bn, ln are the part-of-speech information of the original request text, that is, the part-of-speech information of the request information; Hefei bride is the candidate text, that is, the text information of the candidate information; B-nl, l-nl, Bn, ln are the part-of-speech information of the candidate text, that is, the part-of-speech information of the candidate information.
[0075] S202, perform feature self-training on the text information of the request information and the text information of the candidate information to obtain feature similarity; and perform attention processing on the text information of the request information, the part-of-speech information of the request information, the text information of the candidate information, and the part-of-speech information of the candidate information to obtain attention similarity.
[0076] like Figure 5 As shown, the original request text and the candidate text are sent to the feature self-training module. The main function of the feature self-training module is to allow the entity fuzzy model to learn features such as prefix matching, suffix matching, and edit distance by itself, and to mine more potential features based on the learning ability of the entity fuzzy model itself.
[0077] The part-of-speech information of the original request text, the part-of-speech information of the original request text, the candidate text, and the part-of-speech information of the candidate text are sent to the attention module.
[0078] S203: Concatenate the feature similarity and the attention similarity and perform matrix operation to obtain the similarity between the text information of the request information and the text information of the candidate information.
[0079] like Figure 5 As shown in the figure, the matrix representation output by the feature self-training module and the matrix representation output by the attention module are concatenated and then input into the linear layer. The output result is the similarity score between the original request text and the candidate text.
[0080] In this embodiment, the features of text part of speech are introduced to make it easier for the entity fuzzy model to learn the emphasis of part of speech in entity fuzziness.
[0081] In practical applications, Figure 3 The step S202 involves performing feature self-training on the text information of the request information and the text information of the candidate information to obtain feature similarity, including:
[0082] S301, the text information of the request information remains stationary, the text information of the candidate information is sequentially shifted to the right, and the superposition vector of the two text information after each shift is calculated; and, the text information of the request information remains stationary, the text information of the candidate information is sequentially shifted to the left, and the superposition vector of the two text information after each shift is calculated.
[0083] As Figure 6 shown, taking the text of the request information as an example; word_id represents the text content, for example, 1 represents "beautiful", 2 represents "graceful", 3 represents "of", 4 represents "new", 5 represents "bride"; position_id represents the serial number of the text; for example, the serial number of "beautiful" is 0, the serial number of "graceful" is 1, the serial number of "of" is 3, the serial number of "new" is 4, and the serial number of "bride" is 5; similarly, in the text of the candidate information, word_id represents the text content, for example, 6 represents "hefei", 7 represents "city", 4 represents "new", 5 represents "bride"; position_id represents the serial number of the text; for example, the serial number of "hefei" is 0, the serial number of "city" is 1, the serial number of "new" is 3, and the serial number of "bride" is 4.
[0084] Specifically, the word_id of the request text remains unchanged, and the word_id of the candidate text is shifted to the right one by one, where each shift is one position; then, the shifted vectors are judged bit by bit whether they are the same, and the calculation rule is: the same is marked as 1, and the different is marked as 0.
[0085] As Figure 7 shown, in the first time, that is, when the two texts remain in their original forms, 1 is different from 6, 2 is different from 7, 3 is different from 4, 4 is different from 5, 5 is different from 0; all are marked as 0, and the vector [0, 0, 0, 0, 0] of feature_right_matrix1 is obtained.
[0086] In the second time, that is, after the candidate text is shifted to the right by one position, 1 is different from null, 2 is different from 6, 3 is different from 7, all are marked as 0, 4 is the same as 4, 5 is the same as 5, all are marked as 1, and the vector [0, 0, 0, 1, 1] of feature_right_matrix2 is obtained.
[0087] In the fifth time, that is, after the candidate text is shifted to the right by four positions, 1 is different from null, 2 is different from null, 3 is different from null, 4 is different from null, 5 is different from 6, all are marked as 0, and the vector [0, 0, 0, 0, 0] of feature_right_matrix3 is obtained.
[0088] That is, shift to the right bit by bit to generate feature_right_matrix (i = 1, 2, 3, 4, 5).
[0089] Similarly, shift to the left bit by bit to generate feature_left_matrix (i = 1, 2, 3, 4, 5).
[0090] As Figure 8As shown, in the first time, that is, the two texts keep the prototype, 1 is different from 6, 2 is different from 7, 3 is different from 4, 4 is different from 5, and 5 is different from 0; all are recorded as 0, and the vector [0, 0, 0, 0] of feature_left_matrix1 is obtained.
[0091] In the second time, that is, after the candidate text is shifted one place to the left, 1 is different from 7, 2 is different from 4, 3 is different from 5, 4 is different from 0, and 5 is different from blank, all of which are recorded as 1, and the vector [0, 0, 0, 1, 1] of feature_left_matrix2 is obtained.
[0092] In the fifth time, that is, after the candidate text is shifted four places to the right, 1 is different from 0, 2 is different from blank, 3 is different from blank, 4 is different from blank, and 5 is different from blank, all of which are recorded as 0, and the vector [0, 0, 0, 0] of feature_left_matrix3 is obtained.
[0093] S302: taking each superimposed vector as a local similarity segment.
[0094] From the above description, it can be seen that in the process of left and right translation calculation of text word_id, local similar fragments can be obtained, among which the same fragment refers to the part marked as 1 in feature_left_matrix or feature_left_matrix; and these local similar fragments are caused by translation; so this paper proposes SlipRelative PositionEncodings.
[0095] In practical applications, the text information of the request information remains unchanged, the text information of the candidate information is sequentially shifted to the right, and the superposition vector of the two text information after each shift is calculated; and the text information of the request information remains unchanged, the text information of the candidate information is sequentially shifted to the left, and the superposition vector of the two text information after each shift is calculated. The formulas used include:
[0096]
[0097] Among them, pos is the left-right translation position code; when translated to the left n times, pos is 0, -1, -2, -n respectively; when translated to the right n times, pos is 0, 1, 2, n respectively; d is the dimension of the position coding matrix; PE(pos,2i) is the position coding matrix for learning even positions; PE(pos,2i+1) is the position coding matrix for learning odd positions.
[0098] It should be noted that by referencing the translation position encoding, the entity fuzzy model can observe the information weights under different translations when learning local features. This is because as the translation increases, the local feature similarity decreases, and the similar parts of the two text strings may be less.
[0099] S303: Perform linear function processing on each local segment to obtain feature similarity.
[0100] In practical applications, the formula used for linear function processing is:
[0101] feat_mat=w1*(feat_left_mat+left_posi_emb)+w2*(feat_right_mat+right_posi_emb); Formula (2)
[0102] final_feat_mat=linear(feat_mat);
[0103] Among them, w1 and w2 represent the parameters of model learning, linear represents the linear function, feat_left_mat is the left-shifted feature matrix, feat_right_mat is the right-shifted feature matrix, right_posi_emb is the value of formula (1) shifted to the right n times, left_posi_emb is the value of formula (1) shifted to the left n times, feat_mat is the feature matrix after learning, and final_feat_mat is the matrix after linear processing.
[0104] That is, right_posi_emb and left_posi_emb are both calculated by formula (1).
[0105] In practical applications, the formula used to obtain attention similarity by performing attention processing on the text information of the request information, the part-of-speech information of the request information, the text information of the candidate information, and the part-of-speech information of the candidate information is:
[0106]
[0107]
[0108] Among them, att mat is the attention similarity, q_n represents the part-of-speech information of the request information, and c_n represents the part-of-speech information of the candidate information; q is the text information of the request information; c is the text information of the candidate information; d is the number of heads of multi-head attention, which is a fixed value; Q and V are matrices that integrate the text information and part-of-speech information in the request information, and K is the matrix that integrates the text information and part-of-speech information in the candidate information; concat represents the concatenation of two matrices.
[0109] Another embodiment of the present application provides an end-to-end entity fuzzy system.
[0110] The end-to-end entity fuzzy system includes:
[0111] The acquisition module is used to obtain the user's request information.
[0112] The entity fuzzy model is used to perform entity fuzzy processing on the request information and multiple preset candidate information respectively to obtain multiple similarities; the highest similarity among the multiple similarities is taken as the final similarity after entity fuzzification.
[0113] The working process and principle of each module and model are detailed in the end-to-end entity fuzzy method provided in the above embodiment, which will not be described here one by one. It depends on the actual situation and is within the scope of protection of this application.
[0114] In this embodiment, the acquisition module obtains the user's request information; the entity fuzzy model performs entity fuzzy processing on the request information and multiple preset candidate information respectively to obtain multiple similarities; the highest similarity among the multiple similarities is taken as the final similarity after the entity is blurred; there is no need to manually calculate the existing manual summary and calculation feature methods such as prefix matching, suffix matching, NGram, CLS, etc., and the model autonomous learning feature method is adopted to allow the model to autonomously learn more in-depth feature information, that is, to reduce the complexity of model engineering, and allow the model to autonomously learn more potential and hidden features; at the same time, combined with the part-of-speech information of the entity's word segmentation, the auxiliary model focuses on the part of the entity with greater information weight.
[0115] In practical applications, see Figure 4 The end-to-end entity fuzzy system further includes: a construction unit of the entity fuzzy model; the construction unit includes:
[0116] The sample acquisition unit (not shown in the figure) is used to acquire the user's request information sample.
[0117] Entity fuzzy processing unit (such as Figure 4 The entity fuzzy model shown in the figure is used to perform entity fuzzy processing on the request information sample and the first preset candidate information to obtain a first similarity, and to perform entity fuzzy processing on the request information and the second preset candidate information to obtain a second similarity.
[0118] It should be noted that Figure 4 The entity fuzzy model shown is different from the above entity fuzzy model. Figure 4 The entity fuzzy model shown is the model during training, and the entity fuzzy model mentioned above is the model after training.
[0119] Specifically, Figure 4As shown, the user request information q and the first preset candidate information c1 are entity-fuzzy processed; the user request information q and the second preset candidate information c2 are entity-fuzzy processed.
[0120] It should be noted that each candidate information can be obtained based on the request information, which is not a fixed value. Different request information corresponds to different candidate information.
[0121] The candidate information may be stored in a database, and when the user request information is obtained, the corresponding candidate information is selected.
[0122] The specific process of selecting corresponding candidate information based on the request information will not be described here one by one. It will depend on the actual situation and is within the scope of protection of this application.
[0123] The loss function calculation unit is used to calculate the loss function for two similarities to obtain the loss degree after the entity is blurred; when the loss degree meets the preset conditions, the construction of the entity fuzzy model is completed.
[0124] The loss function is calculated for the two similarities to obtain the final similarity after entity blurring to improve the accuracy of the detected similarity.
[0125] Specifically, the formula used to calculate the loss function is:
[0126] S(q,c1)-S(q,ci)>Gap(Gap=0.2);
[0127] Loss1=S(q,c1)-S(q,ci)-Gap;
[0128] Loss2 = 1 - S (q, c1);
[0129] Loss3 = S(q, ci);
[0130] Loss=abs(Loss1)+aLoss2+βLoss3;
[0131] Among them, abs represents the absolute value, loss represents the loss function, S(q, c1) and S(q, ci) represent the similarity between two texts; Ci represents the i-th candidate information; Gap represents the difference, which is an artificial experience value.
[0132] In practical applications, see Figure 5 , entity fuzzy model, including:
[0133] The parsing module (not shown) is used to perform part-of-speech parsing on the request information and the preset candidate information to obtain text information of the request information, part-of-speech information of the request information, text information of the candidate information, and part-of-speech information of the candidate information.
[0134] The feature self-training module is used to perform feature self-training on the text information of the request information and the text information of the candidate information to obtain feature similarity.
[0135] The attention module is used to perform attention processing on the text information of the request information, the part-of-speech information of the request information, the text information of the candidate information and the part-of-speech information of the candidate information to obtain attention similarity.
[0136] The matrix splicing linear module is used to splice the feature similarity and the attention similarity and then perform matrix operation to obtain the similarity between the text information of the request information and the text information of the candidate information.
[0137] The working process and principle of each module are detailed in the end-to-end entity fuzzy method provided in the above embodiment, which will not be described here one by one. It depends on the actual situation and is within the protection scope of this application.
[0138] In practical applications, such as Figure 6-8 As shown, the feature self-training module is used to perform feature self-training on the text information of the request information and the text information of the candidate information, and when the feature similarity is obtained, it is specifically used for:
[0139] The text information of the request information remains unchanged, the text information of the candidate information is sequentially shifted to the right, and the superposition vector of the two text information after each shift is calculated; and the text information of the candidate information is sequentially shifted to the left, and the superposition vector of the two text information after each shift is calculated.
[0140] Each superimposed vector is regarded as a local similarity segment.
[0141] The working process and principle of each module are detailed in the end-to-end entity fuzzy method provided in the above embodiment, which will not be described here one by one. It depends on the actual situation and is within the protection scope of this application.
[0142] Another embodiment of the present application provides a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the end-to-end entity fuzzy method as described in any one of the above embodiments is implemented.
[0143] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0144] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0145] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0146] Another embodiment of the present invention provides an electronic device, such as Fig. 9 As shown, including:
[0147] One or more processors 601 .
[0148] The storage device 602 stores one or more programs.
[0149] When one or more programs are executed by one or more processors 601, one or more processors 601 implement an end-to-end entity fuzzy method as described in any one of the above embodiments.
[0150] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart.
[0151] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
[0152] Although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Certain features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination.
[0153] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0154] The features recorded in the various embodiments in this specification can be replaced or combined with each other, and the same and similar parts between the various embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0155] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0156] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An end-to-end entity fuzzy method, characterized in that: include: Get the user's request information; Perform entity fuzzy processing on the request information and multiple preset candidate information respectively to obtain multiple similarities; The entity fuzzy processing of the request information and the preset candidate information to obtain the similarity includes: performing part-of-speech analysis on the request information and the preset candidate information to obtain text information of the request information, part-of-speech information of the request information, text information of the candidate information and part-of-speech information of the candidate information; performing feature self-training on the text information of the request information and the text information of the candidate information to obtain feature similarity; and performing attention processing on the text information of the request information, the part-of-speech information of the request information, the text information of the candidate information and the part-of-speech information of the candidate information to obtain attention similarity; concatenating the feature similarity and the attention similarity and performing matrix operation to obtain the similarity between the text information of the request information and the text information of the candidate information; The value with the highest similarity among the multiple similarities is taken as the final similarity after the entity is blurred.
2. The end-to-end entity fuzzy method according to claim 1, characterized in that: Performing feature self-training on the text information of the request information and the text information of the candidate information to obtain feature similarity includes: The text information of the request information remains stationary, the text information of the candidate information is sequentially shifted to the right, and the superposition vector of the two text information after each shift is calculated; and the text information of the request information remains stationary, the text information of the candidate information is sequentially shifted to the left, and the superposition vector of the two text information after each shift is calculated; Taking each of the superimposed vectors as a local similarity segment; Each of the local similar segments is processed by a linear function to obtain feature similarity.
3. The end-to-end entity fuzzy method according to claim 2, characterized in that: The text information of the request information remains unchanged, the text information of the candidate information is sequentially shifted to the right, and the superposition vector of the two text information after each shift is calculated; and the text information of the request information remains unchanged, the text information of the candidate information is sequentially shifted to the left, and the superposition vector of the two text information after each shift is calculated, and the formula used includes: Among them, pos is the left-right translation position code; when translated to the left n times, pos is 0, -1, -2, -n respectively; when translated to the right n times, pos is 0, 1, 2, n respectively; d is the dimension of the position coding matrix; PE(pos,2i) is the position coding matrix for learning even positions; PE(pos,2i+1) is the position coding matrix for learning odd positions; The formula used in the linear function processing is: Among them, w1 and w2 represent the parameters of model learning, linear represents a linear function, feat_left_mat is the left-shifted feature matrix, feat_right_mat is the right-shifted feature matrix, right_posi_emb is the value of formula (1) shifted to the right n times, left_posi_emb is the value of formula (1) shifted to the left n times, feat_mat is the feature matrix after learning, and final_feat_mat is the matrix after linear processing.
4. The end-to-end entity fuzzy method according to claim 2, characterized in that: The formula used to obtain the attention similarity by performing attention processing on the text information of the request information, the part-of-speech information of the request information, the text information of the candidate information, and the part-of-speech information of the candidate information is: Among them, att mat is the attention similarity, q_n represents the part-of-speech information of the request information, c_n represents the part-of-speech information of the candidate information; q represents the text information of the request information; c represents the text information of the candidate information; d is the number of heads of multi-head attention, which is a fixed value; Q and V are matrices that integrate the text information and part-of-speech information in the request information, and K is a matrix that integrates the text information and part-of-speech information in the candidate information; concat represents the concatenation of two matrices.
5. An end-to-end entity fuzzy system, characterized in that: include: The acquisition module is used to obtain the user's request information; An entity fuzzy model is used to perform entity fuzzy processing on the request information and multiple preset candidate information respectively to obtain multiple similarities; The highest similarity among multiple similarities is taken as the final similarity after entity blurring; The entity fuzzy model comprises: A parsing module, used to perform part-of-speech parsing on the request information and the preset candidate information to obtain text information of the request information, part-of-speech information of the request information, text information of the candidate information, and part-of-speech information of the candidate information; A feature self-training module, used for performing feature self-training on the text information of the request information and the text information of the candidate information to obtain feature similarity; an attention module, configured to perform attention processing on the text information of the request information, the part-of-speech information of the request information, the text information of the candidate information, and the part-of-speech information of the candidate information to obtain attention similarity; The matrix splicing linear module is used to splice the feature similarity and the attention similarity and then perform matrix operation to obtain the similarity between the text information of the request information and the text information of the candidate information.
6. The end-to-end entity fuzzy system according to claim 5, characterized in that: Also includes: The building blocks of entity-fuzzy models; The building block comprises: A sample acquisition unit, used to acquire a request information sample; An entity fuzzy processing unit, configured to perform entity fuzzy processing on the request information sample and first preset candidate information to obtain a first similarity, and perform entity fuzzy processing on the request information and second preset candidate information to obtain a second similarity; The loss function calculation unit is used to calculate the loss function for two similarities to obtain the loss degree after the entity is blurred; when the loss degree meets the preset conditions, the construction of the entity fuzzy model is completed.
7. An electronic device, characterized in that: include: one or more processors; a storage system having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the end-to-end entity fuzziness method according to any one of claims 1 to 4.
8. A computer storage medium, characterized in that A computer program is stored thereon, wherein when the computer program is executed by a processor, the end-to-end entity fuzzy method according to any one of claims 1 to 4 is implemented.
