Method, device, equipment and storage medium for determining text semantic information
By performing feature fusion on the text in the task-based dialogue system and calculating the fusion correlation coefficient, the problem of low text recognition accuracy in the existing technology is solved and the accuracy of text recognition is improved.
Patent Information
- Application Number
- CN202011346527.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-25
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2040-11-25
AI Technical Summary
In the existing technology, the accuracy of text recognition in task-based dialogue systems is low, mainly because the correlation between each two feature information corresponding to each word is not considered, resulting in a low accuracy of text recognition by the natural language understanding module. .
Through word segmentation processing of the target text, multiple feature information of each word is obtained, feature fusion is performed based on the feature information set of each word, and the fusion correlation coefficient is calculated, including the first sub-correlation coefficient and the second sub-correlation coefficient. Coefficient, combined with feature value correlation and feature type, determines the fused feature information, thereby improving word recognition accuracy.
By considering the correlation between the two feature information in the feature information pair, the calculated fusion correlation coefficient is more accurate, improving the accuracy of word recognition, thereby improving the accuracy of text recognition.
Smart Images

Figure CN112487162B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, device and storage medium for determining text semantic information. Background Art
[0002] With the advancement of technology, task-based dialogue systems are increasingly being applied to real-world scenarios, such as products like Siri and Ali Xiaomi. In task-based dialogue systems, the natural language understanding module has made a significant contribution to task-based dialogue systems. The natural language understanding module is mainly used to process the text input by the user or the text generated by speech recognition to determine the semantic information corresponding to the text, and then recommend relevant content to the user.
[0003] In the related art, the acquired text can be segmented, and multiple feature information corresponding to each word can be extracted, and at least one feature information obtained can be input into a pre-trained natural language understanding module, thereby outputting semantic information corresponding to the text. In the process of implementing this application, the inventor found that the accuracy of text recognition in the related art is low. Summary of the invention
[0004] In order to solve the technical problems existing in the related art, the embodiments of the present application provide a method, apparatus, device and storage medium for determining text semantic information. The technical solution of the present application is as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for determining text semantic information, the method comprising:
[0006] Perform word segmentation on the target text to obtain multiple words;
[0007] Obtain multiple feature information corresponding to each word, and obtain a feature information set corresponding to each word;
[0008] For each word, the following feature fusion steps are performed on the word according to the feature information set of the word to obtain each fused feature information of the word:
[0009] Determine each piece of feature information corresponding to the word as target feature information, and group the target feature information with each piece of feature information of the word into a feature information pair;
[0010] Determine a fusion correlation coefficient of two feature information in the feature information pair;
[0011] Determine fused feature information corresponding to the target feature information based on each feature information of the word and a fusion correlation coefficient between each feature information and the target feature information;
[0012] Based on the fused feature information of each word, the semantic information corresponding to the target text is determined.
[0013] Optionally, determining a fusion correlation coefficient of two feature information in the feature information pair includes:
[0014] Determine a first sub-correlation coefficient of two pieces of feature information in the feature information pair, and determine a second sub-correlation coefficient of the two pieces of feature information in the feature information pair; wherein the first sub-correlation coefficient is used to indicate the degree of association between the two pieces of feature information in terms of feature values, and the second sub-correlation coefficient is used to indicate the feature categories of the two pieces of feature information;
[0015] The first sub-correlation coefficient of the two feature information in the feature information pair is fused with the second sub-correlation coefficient of the two feature information in the feature information pair to obtain a fused correlation coefficient of the two feature information in the feature information pair.
[0016] Optionally, determining the first sub-correlation coefficient of two feature information in the feature information pair includes:
[0017] Linearly mapping two pieces of feature information in the feature information pair to obtain feature values of the two pieces of feature information;
[0018] The mutual information of the characteristic values of the two characteristic information is calculated to obtain the first sub-correlation coefficient of the two characteristic information in the characteristic information pair.
[0019] Optionally, determining the second sub-correlation coefficient of two feature information in the feature information pair includes:
[0020] According to the feature type numbers of the two feature information in the feature information pair, obtaining the encoding vectors of the two feature information in the feature information pair in a pre-trained feature interaction embedding matrix;
[0021] Based on the target feature information in the feature information pair and the encoding vector, a second sub-correlation coefficient of two feature information in the feature information pair is determined.
[0022] Optionally, determining the second sub-correlation coefficient of two feature information in the feature information pair based on the target feature information in the feature information pair and the encoding vector includes:
[0023] According to the formula fea_no ij =fea_key_i T *W no *fea_cross_embed (i-i)*n+j-1 Wno∈R d*dCalculate the second sub-correlation coefficient of the two feature information in the feature information pair; assume that the two feature information in the feature information pair are fea_i and fea_j, fea_i is the target feature information, i is the feature type number of the target feature information, fea_key_i is the feature value of the target feature information fea_i, fea_no ij Indicates the second sub-correlation coefficient of the target feature information fea_i and the feature information fea_j, j is the feature type number of the feature information fea_j, fea_cross_embed (i-i)*n+j-1 represents the encoding vector with the subscript (i-1)*n+j-1 in the feature interaction embedding matrix, n represents the number of feature information in the feature information set of the word, W no Represents the mapping space, R represents a constant, and d represents the dimension of the mapping space.
[0024] Optionally, determining the fused feature information corresponding to the target feature information based on each feature information of the word and a fusion correlation coefficient between each feature information and the target feature information includes:
[0025] Calculate the product of each feature information of the word and the fusion correlation coefficient of the feature information and the target feature information;
[0026] The products of the target feature information are added together to obtain fused feature information of the target feature information.
[0027] In a second aspect, an embodiment of the present application provides a device for determining text semantic information, the device comprising:
[0028] A segmentation module is configured to perform word segmentation processing on the target text to obtain a plurality of words;
[0029] The extraction module is configured to obtain a plurality of feature information corresponding to each word, and obtain a feature information set corresponding to each word;
[0030] The first determination module is configured to perform the following feature fusion steps on each word according to the feature information set of the word to obtain each fused feature information of the word: determine each feature information corresponding to the word as target feature information, and group the target feature information with each feature information of the word into a feature information pair; determine the fusion correlation coefficient of two feature information in the feature information pair; determine the fusion feature information corresponding to the target feature information based on each feature information of the word and the fusion correlation coefficient of each feature information with the target feature information;
[0031] The second determination module is configured to determine the semantic information corresponding to the target text based on the fused feature information of each word.
[0032] Optionally, the first determining module is configured to:
[0033] Determine a first sub-correlation coefficient of two pieces of feature information in the feature information pair, and determine a second sub-correlation coefficient of the two pieces of feature information in the feature information pair; wherein the first sub-correlation coefficient is used to indicate the degree of association between the two pieces of feature information in terms of feature values, and the second sub-correlation coefficient is used to indicate the feature categories of the two pieces of feature information;
[0034] The first sub-correlation coefficient of the two feature information in the feature information pair is fused with the second sub-correlation coefficient of the two feature information in the feature information pair to obtain a fused correlation coefficient of the two feature information in the feature information pair.
[0035] Optionally, the first determining module is configured to:
[0036] Linearly mapping two pieces of feature information in the feature information pair to obtain feature values of the two pieces of feature information;
[0037] The mutual information of the characteristic values of the two characteristic information is calculated to obtain the first sub-correlation coefficient of the two characteristic information in the characteristic information pair.
[0038] Optionally, the first determining module is configured to:
[0039] According to the feature type numbers of the two feature information in the feature information pair, obtaining the encoding vectors of the two feature information in the feature information pair in a pre-trained feature interaction embedding matrix;
[0040] Based on the target feature information in the feature information pair and the encoding vector, a second sub-correlation coefficient of two feature information in the feature information pair is determined.
[0041] Optionally, the first determining module is configured to:
[0042] According to the formula fea_no ij =fea_key_i T *W no *fea_cross_embed (i-i)*n+j-1 Wno∈R d*d Calculate the second sub-correlation coefficient of the two feature information in the feature information pair; wherein, assuming that the two feature information in the feature information pair are fea_i and fea_j, fea_i is the target feature information, i is the feature type number of the target feature information, fea_key_i is the feature value of the target feature information fea_i, fea_no ijIndicates the second sub-correlation coefficient of the target feature information fea_i and the feature information fea_j, j is the feature type number of the feature information fea_j, fea_cross_embed (i-i)*n+j-1 represents the encoding vector with the subscript (i-1)*n+j-1 in the feature interaction embedding matrix, n represents the number of feature information in the feature information set of the word, W no Represents the mapping space, R represents a constant, and d represents the dimension of the mapping space.
[0043] Optionally, the first determining module is configured to:
[0044] Calculate the product of each feature information of the word and the fusion correlation coefficient of the feature information and the target feature information;
[0045] The products of the target feature information are added together to obtain fused feature information of the target feature information.
[0046] In a third aspect, an embodiment of the present application provides a computer device, comprising a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the operations performed by the method for determining text semantic information as described in the first aspect.
[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the operations performed by the method for determining text semantic information as described in the first aspect.
[0048] The beneficial effects of the technical solution provided by the embodiment of the present application are:
[0049] Each fused feature information of a word in the embodiment of the present application is determined based on the fusion correlation coefficient of each feature information of the word and each feature information and the target feature information, and the fusion correlation coefficient is determined by the first sub-correlation coefficient and the second sub-correlation coefficient of the two feature information in the feature information pair, wherein the first sub-correlation coefficient takes into account the relationship between the two feature information in the feature information pair in terms of feature value, and the second sub-correlation coefficient takes into account the feature type of the two feature information in the feature information pair. It can be seen that when calculating the fusion correlation coefficient, the present application not only takes into account the similarity of the feature value of the two feature information in the feature information pair, but also takes into account the feature type of the two feature information, so that the calculated fusion correlation coefficient is more accurate, which improves the recognition accuracy of the word, thereby improving the accuracy of recognizing the text. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0051] Figure 1 It is a schematic diagram of an implementation environment for determining text semantic information provided by an embodiment of the present application;
[0052] Figure 2 is a flow chart of a method for determining text semantic information provided by an embodiment of the present application;
[0053] Figure 3 is a schematic diagram of determining text semantic information provided by an embodiment of the present application;
[0054] Figure 4 is a schematic diagram of determining text semantic information provided by an embodiment of the present application;
[0055] Figure 5 is a schematic diagram of determining text semantic information provided by an embodiment of the present application;
[0056] Figure 6 is a schematic diagram of determining text semantic information provided by an embodiment of the present application;
[0057] Figure 7 is a schematic diagram of determining text semantic information provided by an embodiment of the present application;
[0058] Figure 8 It is a schematic diagram of the structure of a device for determining text semantic information provided by an embodiment of the present application;
[0059] Fig. 9 This is a schematic diagram of a terminal structure provided by an embodiment of the present application;
[0060] Fig.10 It is a schematic diagram of a server structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0062] In the process of implementing the related technology, the inventor found that the accuracy of the text recognized by the related technology was low. After analysis, it was determined that one of the causes of the technical problem was that since a text includes multiple words, each word corresponds to multiple feature information, and there is a certain correlation between each two feature information corresponding to each word, the related technology did not take into account the correlation between each two feature information corresponding to each word, and directly input each word into the pre-trained natural language understanding module, which resulted in the low accuracy of the pre-trained natural language understanding module in text recognition.
[0063] In order to solve the above technical problems, an embodiment of the present application provides a method for determining text semantic information. Figure 1 is a schematic diagram of an implementation environment of a method for determining text semantic information provided by an embodiment of the present application. Figure 1 , the implementation environment includes: terminal 101.
[0064] Terminal 101 may be at least one of a smart phone, a smart watch, a desktop computer, a laptop, a virtual reality terminal, an augmented reality terminal, a wireless terminal, and a laptop computer. Terminal 101 has a communication function and can access the Internet. Terminal 101 may generally refer to one of a plurality of terminals, and the embodiment of the present application is only illustrated by terminal 101. Those skilled in the art may know that the number of the above terminals may be more or less. Terminal 101 may be equipped with a microphone and an application with a text recognition function. Among them, the microphone on terminal 101 is used to collect the user's voice signal, and the application with a text recognition function may convert the user's voice signal into text, and then obtain the semantic information corresponding to the text according to the method provided in the embodiment of the present application. Or the input device installed in terminal 101 includes a text input module to directly obtain the text input by the user, so that the text input by the user can be directly processed according to the method provided in the embodiment of the present application to obtain the semantic information corresponding to the text input by the user.
[0065] In the method provided in the embodiment of the present application, the process of determining the semantic information corresponding to the text by the terminal 101 can be described as follows: after the terminal receives the instruction to obtain the voice signal, the terminal obtains the voice signal and converts the obtained voice signal into text. Alternatively, the terminal directly obtains the text entered by the user on the terminal. The terminal performs word segmentation processing on the obtained text and obtains multiple feature information corresponding to each word. According to the fusion correlation coefficient between each two feature information corresponding to each word, the multiple feature information corresponding to each word is fused to determine each fused feature information of each word. Since the present application not only takes into account the similarity of the feature values of the two feature information in the feature information pair when calculating the fusion correlation coefficient, but also takes into account the feature types of the two feature information, so that the calculated fusion correlation coefficient is more accurate, the recognition accuracy of the word is improved, and thus the accuracy of the recognized text is improved.
[0066] Alternatively, the method for determining text semantic information may be implemented by a server.
[0067] Alternatively, the method for determining text semantic information can be implemented by the terminal and the server together. Exemplarily, the terminal is provided with a voice input module and a communication module, and after obtaining the voice signal input by the user, the voice signal can be converted into text data, and the text data is sent to the server through the communication module, or the terminal directly sends the voice signal to the server, which is converted into text data by the server. Alternatively, the terminal is provided with a text input module and a communication module, and after obtaining the text data input by the user, the text data is directly sent to the server through the communication module. The server can be a single server or a server group. If it is a single server, the server can be responsible for all the processing in the following scheme. If it is a server group, different servers in the server group can be responsible for different processing in the following scheme respectively. The specific processing distribution can be arbitrarily set by the technical personnel according to actual needs, and will not be repeated here.
[0068] Figure 2 is a flow chart of a method for determining text semantic information provided by an embodiment of the present application. Figure 2 , the embodiment comprises:
[0069] Step 201: Perform word segmentation processing on the target text to obtain multiple words.
[0070] The target text is the text to be recognized, which can be a text converted from a speech signal or a text input by a user. In the implementation, a text to be segmented is obtained, and in the text, words identical to words in a pre-stored word library are determined, and these words are used as the result of the segmentation of the text. Alternatively, the text to be segmented is input into a pre-trained segmentation module, and the output multiple words are used as the result of the segmentation of the text.
[0071] Optionally, the step of obtaining the text includes: when the user wants to control the terminal by voice, the terminal detects whether a voice command of specific content is received. When the terminal detects the voice command of specific content, the voiceprint feature corresponding to the voice command is obtained, and it is determined whether the user corresponding to the voiceprint feature has the authority to control the terminal. When the user corresponding to the voiceprint feature has the authority to control the terminal, it is determined whether a voice signal is detected within a preset time. When the terminal detects a voice signal within the preset time, the voice signal is converted into text, and the text is used as the text to be recognized.
[0072] The voiceprint feature corresponding to the voice command is compared with the voiceprint feature pre-stored in the terminal. When the voiceprint feature corresponding to the voice command is the same as the pre-stored voiceprint feature, it is determined that the user corresponding to the voiceprint feature has the authority to control the terminal. When the voiceprint feature corresponding to the voice command is different from the pre-stored voiceprint feature, it is determined that the user corresponding to the voiceprint feature does not have the authority to control the terminal.
[0073] It should be noted that after the terminal detects a voice signal within a preset time, it may also include: extracting the voiceprint features of the voice signal, comparing the voiceprint features corresponding to the voice signal with the pre-stored voiceprint features, or comparing the voiceprint features corresponding to the voice signal with the voiceprint features corresponding to the voice command. When the voiceprint features corresponding to the sound signal are the same as the pre-stored voiceprint features, or the voiceprint features corresponding to the voice signal are the same as the voiceprint features corresponding to the voice command, the voice signal is converted into text. When the voiceprint features corresponding to the voice signal are different from the pre-stored voiceprint features, or the voiceprint features corresponding to the voice signal are different from the voiceprint features corresponding to the voice command, the voice signal is not converted. The embodiment of the present application can prevent the terminal from executing control instructions of other users by detecting the voiceprint features of the sound signal.
[0074] Optionally, the text may be obtained in the following manner: the user opens an application with a query function on the terminal and enters text in a search bar on the application, so that the terminal obtains the text entered by the user. The application with a query function may be a search engine, a music application, a video application, a shopping application, etc. Alternatively, after the user opens the application with a query function, the text may be obtained through a voice signal, and the text may be used as the text entered in the search bar.
[0075] Step 202: Obtain multiple feature information corresponding to each word to obtain a feature information set corresponding to each word.
[0076] The multiple feature information corresponding to each word may be feature information obtained from multiple feature categories. For example, the multiple feature information corresponding to a word includes feature information of the word in terms of meaning, feature information of the word in terms of context, and feature information of the word in terms of position in the target text.
[0077] In implementation, each word is input into a feature extraction module, and multiple feature information of each word is output. The multiple feature information corresponding to the word is taken as a feature information set corresponding to the word.
[0078] Step 203, for each word, perform the following feature fusion steps on the word according to the feature information set of the word to obtain each fused feature information of the word: determine each feature information corresponding to the word as the target feature information, and group the target feature information with each feature information of the word into a feature information pair; determine the fusion correlation coefficient of two feature information in the feature information pair; determine the fusion feature information corresponding to the target feature information based on each feature information of the word and the fusion correlation coefficient of each feature information with the target feature information.
[0079] In the implementation, each feature information corresponding to a word is determined as target feature information, and the target feature information is grouped with each feature information of the word into feature information pairs, thereby obtaining multiple feature information pairs corresponding to each word. In other words, each feature information of a word is grouped with each feature information to obtain multiple feature information pairs. For each feature information pair, the fusion correlation coefficient of the two feature information in each feature information pair is calculated. According to each feature information of the word and the fusion correlation coefficient of each feature information with the target feature information, the fusion feature information corresponding to the target feature information is determined.
[0080] For example, word A corresponds to three feature information, namely feature information 1, feature information 2 and feature information 3. For feature information 1, feature information pair 11 consisting of feature information 1 and feature information 1, feature information pair 12 consisting of feature information 1 and feature information 2, and feature information pair 13 consisting of feature information 1 and feature information 3 are obtained. The fusion correlation coefficient 11 of feature information 1 and feature information 1 in feature information pair 11, the fusion correlation coefficient 12 of feature information 1 and feature information 2 in feature information pair 12, and the fusion correlation coefficient 13 of feature information 1 and feature information 3 in feature information pair 13 are calculated. According to feature information 1, fusion correlation coefficient 11, feature information 2, fusion correlation coefficient 12, feature information 3 and fusion correlation coefficient 13, the fusion feature information corresponding to feature information 1 is determined. Through the above method, the fusion feature information corresponding to feature information 2 and feature information 3 is calculated. It can be understood that each word has multiple feature information, and each feature information can obtain its own corresponding fusion feature information, so that each word will correspond to multiple fusion feature information. For example, a word corresponds to n feature information, and also corresponds to n fused feature information.
[0081] Optionally, the fusion correlation coefficient in the embodiment of the present application is composed of two parts, one part is the first sub-correlation coefficient, and the other part is the second sub-correlation coefficient, wherein the specific process may be to determine the first sub-correlation coefficient of the two feature information in the feature information pair, and determine the second sub-correlation coefficient of the two feature information in the feature information pair; the first sub-correlation coefficient refers to the degree of association between the two feature information in terms of feature values, and the second sub-correlation coefficient refers to the feature category to which the two feature information belong. The first sub-correlation coefficient of the two feature information in the feature information pair is fused with the second sub-correlation coefficient of the two feature information in the feature information pair to obtain the fusion correlation coefficient of the two feature information in the feature information pair.
[0082] The first sub-correlation coefficient and the second sub-correlation coefficient can be calculated by the self-attention learning module. Figure 3As shown, an example of a self-attention learning module includes a linear mapping layer, a merge layer, a lookup layer, and an add layer. The linear layer is used to perform a linear transformation on multiple feature information of each word to obtain a feature value of each feature information. The merge layer is used to determine the first sub-correlation coefficient of the two feature information in each feature information pair corresponding to the word. The lookup_and_linear layer is used to determine the second sub-correlation coefficient of the two feature information in each feature information pair corresponding to the word, and the add layer is used to add the first sub-correlation coefficient and the second sub-correlation coefficient of the two feature information in the feature information pair to obtain a fused correlation coefficient of the two feature information in the feature information pair.
[0083] Specifically, multiple feature information corresponding to each word and the feature type number of each feature information are input into the self-attention learning module. The linear layer in the self-attention learning module performs a linear transformation on each feature information to obtain the feature value corresponding to each feature information. Each feature information corresponding to a word is used as the target feature information. For each target feature information, the fusion correlation coefficient between the target feature information and each feature information in the feature information set to which the target feature information belongs is obtained according to the following method.
[0084] The merge layer in the self-attention learning module calculates the first sub-correlation coefficient of the two feature information in each feature information pair. The lookup_and_linear layer in the self-attention learning module determines the second sub-correlation coefficient of the two feature information in the feature information pair. The add layer in the self-attention learning module fuses the first sub-correlation coefficient of the two feature information in the feature information pair with the second sub-correlation coefficient of the two feature information in the feature information pair to obtain the fused correlation coefficient of the two feature information in the feature information pair. After obtaining the fused correlation coefficient of the two feature information in each feature information pair, the following operation can also be performed: according to each feature information of the word and the corresponding fused correlation coefficient, determine the fused feature information corresponding to each feature information. According to the above method, the fused feature information corresponding to other words in the target text is determined, so that the self-attention learning module outputs the fused feature information corresponding to each word.
[0085] The following describes how to obtain the first sub-correlation coefficient and the second sub-correlation coefficient respectively.
[0086] In one implementation, two pieces of feature information in the feature information pair are linearly mapped to obtain feature values of the two pieces of feature information; and mutual information of the feature values of the two pieces of feature information is calculated to obtain a first sub-correlation coefficient of the two pieces of feature information in the feature information pair.
[0087] Before obtaining the feature values of the two feature information, it is necessary to perform a linear transformation on the feature information of the word, and then map the feature information corresponding to each word to the same mapping space to obtain the feature value of each feature information. This process can be done by Figure 3 The linear layer implementation in .
[0088] Taking the mapping of two feature information of a word to the same mapping space as an example, the specific steps are: The target feature information fea_i and the feature information fea_j are mapped to the same mapping space, and then the feature values fea_key_i and fea_key_j are obtained.
[0089] Among them, fea_key_i represents the feature value corresponding to the target feature information fea_i, fea_key_j represents the feature value corresponding to the feature information fea_j, fea_i represents the i-th feature information corresponding to the word, fea_j represents the j-th feature information corresponding to the word, W ki It is the mapping space required to map the target feature information fea_i to the feature value fea_key_i, W kj Indicates the mapping space required to map feature information fea_j to feature value fea_key_j, d*d i Represents the mapping space W ki The dimension of d*d j Represents the mapping space W kj dimension, R is a constant.
[0090] After the above transformation, the dimension of the eigenvalue fea_key_i is the same as the dimension of the eigenvalue fea_key_j. Use the same method to map each feature information corresponding to the word to the same mapping space, and determine the eigenvalue corresponding to each feature information.
[0091] Further, the mutual information between the eigenvalues of the two feature information, that is, the correlation between the eigenvalues of the two feature information, is calculated to obtain the first sub-correlation coefficient of the two feature information in the feature information pair. For example, the embodiment of the present application can determine the mutual information between the eigenvalues of the two feature information in the feature information pair in the following three ways. The process can be performed by Figure 3 The merge layer implementation in .
[0092] In the first method, the mutual information between the feature values of two feature information in the feature information pair is determined by the first formula. Assuming that the two feature information in the feature information pair are fea_i and fea_j, where fea_i is the target feature information, the first formula can be Among them, fea_key_i is the characteristic value of the target characteristic information fea_i, fea_key_j is the characteristic value of the characteristic information fea_j, fea_rel ij Indicates the interaction information between the eigenvalue fea_key_i and the eigenvalue fea_key_j, fea_key_i T represents the transpose of the eigenvalue fea_key_i, and d represents the dimension of the eigenvalue fea_key_i.
[0093] In the second method, the interaction information between the eigenvalues of two eigenvalues in the eigenvalue pair is determined by a second formula. The second formula may be fea_rel ij =W rel *tanh(W[fea_key_i,fea_key_j])(W∈R d*2d ,W rel ∈R 1*d ), where W rel It means mapping the feature information corresponding to tanh(W[fea_key_i,fea_key_j]) to the mapping space required for the one-dimensional mapping space, W means mapping the combination of the eigenvalue fea_key_i and the eigenvalue fea_key_j to the mapping space required for the one-dimensional mapping space, d means the dimension of the eigenvalue fea_key_i, and other parameters can be found in the description of the first formula above.
[0094] In the third way, the interaction information between the feature values of two feature information in the feature information pair is determined by a third formula, wherein the third formula may be fea_rel ij =fea_key_i T *W*fea_key_j, where W represents the mapping space required to map the eigenvalue fea_key_i. For other parameters, refer to the description of the first formula above.
[0095] The first sub-correlation coefficient of the two feature information can be obtained by any of the above formulas. One calculation process of the second sub-correlation coefficient is to obtain the encoding vectors of the two feature information in the feature information pair in the pre-trained feature interaction embedding matrix according to the feature type numbers of the two feature information in the feature information pair; based on the target feature information and the encoding vector in the feature information pair, determine the second sub-correlation coefficient of the two feature information in the feature information pair. This process can be obtained by Figure 3The lookup_and_linear layer implementation in .
[0096] It should be noted that the steps for obtaining the feature type number corresponding to each feature information are as follows: input each word into the feature extraction module, and output the feature information corresponding to each word and the feature type number corresponding to each feature information. It should be noted that each feature information and each feature type number are in a one-to-one correspondence, that is, if there are n feature information, the feature type number can be 1 to n.
[0097] It should be noted that the pre-trained feature interaction embedding matrix includes at least one encoding vector, and the subscript corresponding to each encoding vector is related to the feature type number corresponding to the two feature information corresponding to the encoding vector. In implementation, according to the feature type number of the two feature information in the feature information pair, the encoding vectors of the two feature information in the feature information pair are obtained in the feature interaction embedding matrix. The encoding vector is multiplied by the transpose of the eigenvalue of the target feature information to determine the second sub-correlation coefficient of the two feature information in the feature information pair.
[0098] It should be noted that, for a word, the feature extraction model can extract the feature information of the word in the first feature category, the feature information in the second feature category... and the feature information in the nth feature category. For example, feature information of the word in terms of context, feature information of the word in terms of part of speech, etc. can be extracted. The feature extraction model can set the feature type number corresponding to the feature information extracted in the first feature category to 1, the feature type number corresponding to the feature information extracted in the second feature category to 2... the feature type number corresponding to the feature information extracted in the nth feature category to n, etc. Through the above method, after each word is input into the feature extraction module, multiple feature information and the feature type number corresponding to each feature information will be output.
[0099] Furthermore, the formula fea_no can be calculated based on the correlation coefficient of the feature information ij =fea_key_i T *W no *fea_cross_embed (i-i)*n+j-1 Wno∈R d*d Calculate the second sub-correlation coefficient of the two feature information in the feature information pair; where, assuming that the two feature information in the feature information pair are fea_i and fea_j, fea_i is the target feature information, i is the feature type number of the target feature information, fea_key_i is the feature value of the target feature information fea_i, fea_no ijIndicates the second sub-correlation coefficient of the target feature information fea_i and the feature information fea_j, j is the feature type number of the feature information fea_j, fea_cross_embed (i-i)*n+j-1 represents the encoding vector with the subscript (i-1)*n+j-1 in the feature interaction embedding matrix, n represents the number of feature information in the feature information set of the word, W no Represents the mapping space, R represents a constant, and d represents the dimension of the mapping space.
[0100] It should be noted that the target feature information corresponding to the eigenvalue fea_key_i and the feature information corresponding to the eigenvalue fea_key_j can be the same feature information. The pre-trained feature interaction embedding matrix can be set in the lookup_and_linear layer. It should be noted that Figure 3 The two boxes at the bottom of the lookup_and_linear layer correspond to the feature type numbers of the two feature information, the middle box corresponds to the encoding vector of the two feature information found from the feature interaction embedding matrix according to the feature type number, and the box next to the middle box corresponds to the eigenvalue corresponding to the feature information fea_i, where it is assumed that the feature information fea_i is the target feature information, and the box above the middle box corresponds to the second sub-correlation coefficient fea_no ji correspond.
[0101] After determining the first sub-correlation coefficient of the two feature information in the feature information pair and the second sub-correlation coefficient of the two feature information according to the above method, the fusion correlation coefficient of the two feature information in the feature information pair can be further obtained based on the sum of the first sub-correlation coefficient and the second sub-correlation coefficient.
[0102] In practice, according to the formula Determine the sum of the first sub-correlation coefficient and the second sub-correlation coefficient of the two feature information in the feature information pair, where it is assumed that the two feature information in the feature information pair are fea_i and fea_j, where fea_i is the target feature information, fea_rel ij Indicates the first sub-correlation coefficient of the two feature information, fea_no ij The second sub-correlation coefficient representing the two feature information, represents the sum of the first sub-correlation coefficient of the two feature information and the second sub-correlation coefficient of the two feature information. According to the formula Get the fusion correlation coefficient of the two feature information, where n represents the total number of feature information corresponding to a word, and k ranges from 1 to n. Any feature information corresponding to the word can be recorded as fea_k. Represents the sum of the first sub-correlation coefficient between the target feature information fea_i and the any feature information fea_k and the second sub-correlation coefficient between the target feature information fea_i and the any feature information fea_k.
[0103] Optionally, the product of each feature information of the word and the fusion correlation coefficient of the feature information and the target feature information is calculated; and each product corresponding to the target feature information is added to obtain the fusion feature information of the target feature information.
[0104] In implementation, it is assumed that a word has multiple feature information, any of which can be recorded as fea_k, and one of which is used as target feature information, which is recorded as fea_i. Determine the fused feature information of the target feature information fea_i. Among them, fea_attn_i represents the fused feature information of the target feature information fea_i, fea_key_k is the feature value of any feature information fea_k, It represents the fusion correlation coefficient of the target feature information fea_i and any feature information fea_k, and n represents the total number of feature information corresponding to the word.
[0105] Input a word into the feature extraction module to obtain feature information fea_1, feature information fea_2, feature information fea_3 and feature information fea_4, and the feature types corresponding to feature information fea_1, feature information fea_2, feature information fea_3 and feature information fea_4 are numbered 1, 2, 3 and 4 respectively. Figure 4 As shown, the feature type number 1 corresponding to fea_1 and fea_1, the feature type number 2 corresponding to fea_2 and fea_2, the feature type number 3 corresponding to fea_3 and fea_3, and the feature type number 4 corresponding to fea_4 and fea_4 are input into the self-attention learning module, and the fused feature information of feature information fea_1, the fused feature information of feature information fea_2, the fused feature information of feature information fea_3, and the fused feature information of feature information fea_4 are output. Based on the same method, the fused feature information of each other word is obtained. The fused feature information corresponding to each word in the target text is input into the natural language understanding module for semantic recognition.
[0106] It should be noted that in order to simplify the calculation, for each word, each feature information can be linearly transformed to obtain multiple linearly transformed feature information (i.e., the feature values of the feature information), and the product of the linearly transformed feature information and the corresponding fusion correlation coefficient is calculated, and each product is added to obtain the fused feature information of the target feature information.
[0107] Optional, such as Figure 5 The self-attention learning module can be further divided according to its function. The self-attention learning module can include a first sub-correlation determination module, a second sub-correlation determination module and a fusion module, wherein the first sub-correlation determination module is used to determine the first sub-correlation coefficient between every two feature information, the second sub-correlation determination module is used to determine the second sub-correlation coefficient between every two feature information, and the fusion module is used to fuse the first sub-correlation coefficient and the second sub-correlation coefficient to generate a correlation coefficient and obtain each fused feature information of each word.
[0108] Step 204: Determine the semantic information corresponding to the target text based on the fused feature information of each word.
[0109] After obtaining the fused feature information of each word, the fused feature information of each word can be input into the combine layer to output the feature vector corresponding to each word, wherein the combine layer is used to map the fused feature information of each word into a vector of fixed length, and the mapping method can be to concatenate, fuse gates or pool the fused feature information of each word. The feature vector corresponding to each word is input into the upper layer to obtain the output result of the upper layer, wherein the upper layer is used to process the feature vector corresponding to each word to obtain the processing result. For example, the feature vector corresponding to each word is iteratively processed to obtain the semantic information corresponding to the target text. It should be noted that the combine layer and the upper layer can be set in the natural language understanding module, and the natural language understanding module can include LSTM, GRU, CNN, Transformerde and other modules.
[0110] In one embodiment, the semantic information may be an instruction, and the terminal may perform a corresponding operation according to the instruction. The semantic information may include an instruction type and an instruction parameter, where the instruction type is the operation to be performed and the instruction parameter is the content of the operation to be performed. For example, the instruction type may be "make a phone call" and the instruction parameter may be "Xiao Ming".
[0111] Optionally, when the user wants to control the terminal through voice signals, the terminal determines whether a voice command of specific content is detected. After the terminal detects a voice command of specific content, the voiceprint feature corresponding to the voice command is obtained, and it is determined whether the user corresponding to the voiceprint feature has the authority to control the terminal. When the user corresponding to the voiceprint feature has the authority to control the terminal, it is determined whether the terminal has detected the voice signal within a preset time. If the terminal detects the voice signal within the preset time, the obtained voice signal is converted into text. Figure 6 As shown, the text is input into the word segmentation module to obtain n words. The n words are input into the feature extraction module to obtain multiple feature information corresponding to each word and the feature type number corresponding to each feature information. The multiple feature information corresponding to each word and the feature type number corresponding to each feature information are input into the self-attention learning module to output the fused feature information of each word. The fused feature information of each word is input into the natural language understanding module to output the instruction corresponding to the speech signal (i.e. Figure 6 The terminal performs the operation corresponding to the instruction according to the instruction corresponding to the voice signal.
[0112] For example, when the terminal detects a voice command "siri" with specific content, the voiceprint feature corresponding to "siri" is detected to determine whether the user corresponding to the voiceprint feature has the authority to control the terminal. When the user corresponding to the voiceprint feature has the authority to control the terminal, the terminal records the sound signal within a preset time and converts the recorded sound signal into the text "Call Xiaoming". The text "Call Xiaoming" is segmented to obtain "Xiaoming" and "call". "Xiaoming" and "call" are input into the feature extraction module, and multiple feature information corresponding to "Xiaoming" and "call" are obtained. The multiple feature information corresponding to "Xiaoming" and "call" are input into the self-attention learning module, and the multiple fused feature information corresponding to "Xiaoming" and "call" are output. The multiple fused feature information corresponding to "Xiaoming" and "call" are input into the natural language understanding module, and the instruction type and instruction parameter corresponding to "Call Xiaoming" are output, where the instruction type can be "call" and the instruction parameter is "Xiaoming". The terminal calls Xiaoming according to the determined instruction type and instruction parameter.
[0113] It should be noted that the voice signal obtained within the preset time can be uploaded to the server, the server determines the instruction type and instruction parameters, and sends the instruction type and instruction parameters to the terminal, so that the terminal executes the operation of the instruction type and instruction parameters.
[0114] Optional, such as Figure 7As shown, in a training process, any sample text is randomly selected from the sample text library, and based on human experience, the semantic information of the sample text is determined, and it is used as the benchmark semantic information of the sample text. The sample text is input into the word segmentation module to obtain multiple sample words. Each sample word is input into the feature extraction module to obtain multiple sample feature information corresponding to each sample word, and the feature type number corresponding to each sample feature information of each sample word. The original sample feature information corresponding to each sample word and the feature type number corresponding to each original sample feature information are input into the self-attention learning module, and each sample fusion feature information of each sample word is output. The sample fusion feature information of each sample word is input into the natural language understanding module together, and the semantic information of the sample text is output. According to the output semantic information, the benchmark semantic information and the pre-set loss function, the loss information between the output semantic information and the benchmark semantic information is determined. Based on the loss information, the initial encoding vector in the initial feature interaction embedding matrix in the self-attention learning module and the parameters in the self-attention learning module are adjusted to obtain the trained feature interaction embedding matrix and the trained self-attention learning module. Other sample texts are selected from the sample text library, and the trained feature interaction embedding matrix and the trained self-attention learning module are trained based on the above method, so as to obtain a pre-trained reference feature information set and a pre-trained self-attention learning module.
[0115] It should be noted that, during the training process, the method provided in the embodiment of the present application fully considers the correlation between each two feature information of the multiple feature information corresponding to the same word, so that the trained machine learning model has a higher accuracy in recognizing text.
[0116] The individual fusion feature information of each word in the embodiment of the present application is determined based on the fusion correlation coefficient of each feature information and each feature information and the target feature information, and the fusion correlation coefficient of the two feature information in the feature information pair is determined by the first sub-correlation coefficient of the two feature information in the feature information pair and the second sub-correlation coefficient of the two feature information in the feature information pair, wherein the first sub-correlation coefficient takes into account the relationship between the two feature information in the feature information pair in terms of feature value, and the second sub-correlation coefficient takes into account the feature type of the two feature information in the feature information pair. Therefore, the fusion correlation coefficient calculated in this way is more accurate, making the recognition accuracy of the word higher, thereby improving the accuracy of recognizing the target text.
[0117] Based on the same technical concept, the embodiment of the present application also provides a device, which is used for a server or a terminal, such as Figure 8 As shown, the device comprises:
[0118] The segmentation module 801 is configured to perform word segmentation processing on the target text to obtain a plurality of words;
[0119] The extraction module 802 is configured to obtain multiple feature information corresponding to each word, and obtain a feature information set corresponding to each word;
[0120] The first determination module 803 is configured to perform the following feature fusion steps on each word according to the feature information set of the word to obtain each fused feature information of the word: determine each feature information corresponding to the word as target feature information, and group the target feature information with each feature information of the word into a feature information pair; determine the fusion correlation coefficient of two feature information in the feature information pair; determine the fusion feature information corresponding to the target feature information based on each feature information of the word and the fusion correlation coefficient of each feature information with the target feature information;
[0121] The second determination module 804 is configured to determine the semantic information corresponding to the target text based on the fused feature information of each word.
[0122] Optionally, the first determining module 803 is configured to:
[0123] Determine a first sub-correlation coefficient of two pieces of feature information in the feature information pair, and determine a second sub-correlation coefficient of the two pieces of feature information in the feature information pair; wherein the first sub-correlation coefficient is used to indicate the degree of association between the two pieces of feature information in terms of feature values, and the second sub-correlation coefficient is used to indicate the feature categories of the two pieces of feature information;
[0124] The first sub-correlation coefficient of the two feature information in the feature information pair is fused with the second sub-correlation coefficient of the two feature information in the feature information pair to obtain a fused correlation coefficient of the two feature information in the feature information pair.
[0125] Optionally, the first determining module 803 is configured to:
[0126] Linearly mapping two pieces of feature information in the feature information pair to obtain feature values of the two pieces of feature information;
[0127] The mutual information of the characteristic values of the two characteristic information is calculated to obtain the first sub-correlation coefficient of the two characteristic information in the characteristic information pair.
[0128] Optionally, the first determining module 803 is configured to:
[0129] According to the feature type numbers of the two feature information in the feature information pair, obtaining the encoding vectors of the two feature information in the feature information pair in a pre-trained feature interaction embedding matrix;
[0130] Based on the target feature information in the feature information pair and the encoding vector, a second sub-correlation coefficient of two feature information in the feature information pair is determined.
[0131] Optionally, the first determining module 803 is configured to:
[0132] According to the formula fea_no ij =fea_key_i T *W no *fea_cross_embed (i-i)*n+j-1 Wno∈R d*d Calculate the second sub-correlation coefficient of the two feature information in the feature information pair; assume that the two feature information in the feature information pair are fea_i and fea_j, fea_i is the target feature information, i is the feature type number of the target feature information, fea_key_i is the feature value of the target feature information fea_i, fea_no ij Indicates the second sub-correlation coefficient of the target feature information fea_i and the feature information fea_j, j is the feature type number of the feature information fea_j, fea_cross_embed (i-i)*n+j-1 represents the encoding vector with the subscript (i-1)*n+j-1 in the feature interaction embedding matrix, n represents the number of feature information in the feature information set of the word, W no Represents the mapping space, R represents a constant, and d represents the dimension of the mapping space.
[0133] Optionally, the first determining module 803 is configured to:
[0134] Calculate the product of each feature information of the word and the fusion correlation coefficient of the feature information and the target feature information;
[0135] The products corresponding to the target feature information are added together to obtain fused feature information of the target feature information.
[0136] It should be noted that: the device for determining text semantic information provided in the above embodiment only uses the division of the above functional modules as an example when determining text semantic information. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device for determining text semantic information provided in the above embodiment belongs to the same concept as the method embodiment for determining text semantic information. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0137] Fig. 9 The structure block diagram of a terminal 900 provided by an exemplary embodiment of the present application is shown. The terminal 900 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4), a laptop computer or a desktop computer. The terminal 900 may also be called an account device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0138] Typically, the terminal 900 includes a processor 901 and a memory 902 .
[0139] The processor 901 may include one or more processing cores, such as a 4-core processor, a 9-core processor, etc. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0140] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 is used to store at least one instruction, which is used to be executed by the processor 901 to implement the method for determining text semantic information provided in the method embodiment of the present application.
[0141] In some embodiments, the terminal 900 may also optionally include: a peripheral device interface 903 and at least one peripheral device. The processor 901, the memory 902 and the peripheral device interface 903 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 903 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 904, a touch display screen 905, a camera 906, an audio circuit 907, a positioning component 909 and a power supply 909.
[0142] The peripheral device interface 903 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902, and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902, and the peripheral device interface 903 may be implemented on a separate chip or circuit board, which is not limited in the embodiments of the present application.
[0143] The radio frequency circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 904 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, an account identity module card, and the like. The radio frequency circuit 904 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 904 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0144] The display screen 905 is used to display the UI (User Interface, account interface). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 905 is a touch display screen, the display screen 905 also has the ability to collect touch signals on the surface or above the surface of the display screen 905. The touch signal can be input to the processor 901 as a control signal for processing. At this time, the display screen 905 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 905 can be one, and the front panel of the terminal 900 is set; in other embodiments, the display screen 905 can be at least two, which are respectively set on different surfaces of the terminal 900 or are folded; in some other embodiments, the display screen 905 can be a flexible display screen, which is set on the curved surface or folded surface of the terminal 900. Even, the display screen 905 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 905 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).
[0145] The camera assembly 906 is used to capture images or videos. Optionally, the camera assembly 906 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 906 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0146] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves from the account and the environment, and convert the sound waves into electrical signals and input them into the processor 901 for processing, or input them into the radio frequency circuit 904 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there can be multiple microphones, which are respectively arranged at different parts of the terminal 900. The microphone can also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker can be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 907 may also include a headphone jack.
[0147] The positioning component 908 is used to locate the current geographical location of the terminal 900 to implement navigation or LBS (Location Based Service). The positioning component 908 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas system or the European Union's Galileo system.
[0148] The power supply 909 is used to power various components in the terminal 900. The power supply 909 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 909 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0149] In some embodiments, the terminal 900 further includes one or more sensors 910 , including but not limited to: an acceleration sensor 911 , a gyroscope sensor 912 , a pressure sensor 913 , a fingerprint sensor 914 , an optical sensor 915 , and a proximity sensor 916 .
[0150] The acceleration sensor 911 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 900. For example, the acceleration sensor 911 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 901 can control the touch screen 905 to display the account interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 911. The acceleration sensor 911 can also be used to collect motion data of games or accounts.
[0151] The gyro sensor 912 can detect the body direction and rotation angle of the terminal 900, and the gyro sensor 912 can cooperate with the acceleration sensor 911 to collect the 3D action of the account on the terminal 900. The processor 901 can implement the following functions based on the data collected by the gyro sensor 912: motion sensing (such as changing the UI according to the tilt operation of the account), image stabilization during shooting, game control, and inertial navigation.
[0152] The pressure sensor 913 can be set on the side frame of the terminal 900 and / or the lower layer of the touch display screen 905. When the pressure sensor 913 is set on the side frame of the terminal 900, the holding signal of the account on the terminal 900 can be detected, and the processor 901 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 913. When the pressure sensor 913 is set on the lower layer of the touch display screen 905, the processor 901 controls the operability controls on the UI interface according to the pressure operation of the account on the touch display screen 905. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0153] The fingerprint sensor 914 is used to collect the fingerprint of the account, and the processor 901 identifies the identity of the account based on the fingerprint collected by the fingerprint sensor 914, or the fingerprint sensor 914 identifies the identity of the account based on the collected fingerprint. When the identity of the account is identified as a trusted identity, the processor 901 authorizes the account to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 914 can be set on the front, back or side of the terminal 900. When a physical button or a manufacturer logo is set on the terminal 900, the fingerprint sensor 914 can be integrated with the physical button or the manufacturer logo.
[0154] The optical sensor 915 is used to collect the ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the touch display screen 905 according to the ambient light intensity collected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 905 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 905 is reduced. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera component 906 according to the ambient light intensity collected by the optical sensor 915.
[0155] The proximity sensor 916, also called a distance sensor, is usually arranged on the front panel of the terminal 900. The proximity sensor 916 is used to collect the distance between the account and the front of the terminal 900. In one embodiment, when the proximity sensor 916 detects that the distance between the account and the front of the terminal 900 is gradually decreasing, the processor 901 controls the touch display screen 905 to switch from the screen-on state to the screen-off state; when the proximity sensor 916 detects that the distance between the account and the front of the terminal 900 is gradually increasing, the processor 901 controls the touch display screen 905 to switch from the screen-off state to the screen-on state.
[0156] Those skilled in the art will understand that Fig. 9 The structure shown in the figure does not constitute a limitation on the terminal 900, and the terminal 900 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0157] Fig.10 1 is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 1000 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 1001 and one or more memories 1002, wherein the memory 1002 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 1001 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the server may also include other components for implementing device functions, which will not be described in detail here.
[0158] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, and the instructions can be executed by a processor in a terminal to complete the method for determining text semantic information in the above embodiment. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0159] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0160] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for determining text semantic information, characterized in that: The method comprises: Perform word segmentation on the target text to obtain multiple words; Acquire multiple feature information corresponding to each word to obtain a feature information set corresponding to each word, wherein the multiple feature information is feature information acquired in multiple feature categories, and the feature category includes at least one of the following: features of the word in context, features of the word in meaning, or features of the word in position in the target text; For each word, the following feature fusion steps are performed on the word according to the feature information set of the word to obtain each fused feature information of the word: Determine each piece of feature information corresponding to the word as target feature information, and group the target feature information with each piece of feature information of the word into a feature information pair; Determine a fusion correlation coefficient of two feature information in the feature information pair; Determine fused feature information corresponding to the target feature information based on each feature information of the word and a fusion correlation coefficient between each feature information and the target feature information; Based on the fused feature information of each word, the semantic information corresponding to the target text is determined.
2. The method according to claim 1, characterized in that The determining of the fusion correlation coefficient of two feature information in the feature information pair includes: Determine a first sub-correlation coefficient of two pieces of feature information in the feature information pair, and determine a second sub-correlation coefficient of the two pieces of feature information in the feature information pair; wherein the first sub-correlation coefficient is used to indicate the degree of association between the two pieces of feature information in terms of feature values, and the second sub-correlation coefficient is used to indicate the feature categories of the two pieces of feature information; The first sub-correlation coefficient of the two feature information in the feature information pair is fused with the second sub-correlation coefficient of the two feature information in the feature information pair to obtain a fused correlation coefficient of the two feature information in the feature information pair.
3. The method according to claim 2, characterized in that The determining of the first sub-correlation coefficient of two feature information in the feature information pair comprises: Linearly mapping two pieces of feature information in the feature information pair to obtain feature values of the two pieces of feature information; The mutual information of the characteristic values of the two characteristic information is calculated to obtain the first sub-correlation coefficient of the two characteristic information in the characteristic information pair.
4. The method according to claim 2, characterized in that: The determining of the second sub-correlation coefficient of the two feature information in the feature information pair comprises: According to the feature type numbers of the two feature information in the feature information pair, obtaining the encoding vectors of the two feature information in the feature information pair in a pre-trained feature interaction embedding matrix; Based on the target feature information in the feature information pair and the encoding vector, a second sub-correlation coefficient of two feature information in the feature information pair is determined.
5. The method according to claim 4, characterized in that The determining, based on the target feature information in the feature information pair and the encoding vector, a second sub-correlation coefficient of two feature information in the feature information pair comprises: According to the formula fea_no ij =fea_key_i T *W no *fea_cross_embed (i-i)*n+j-1 Wno∈R d*d Calculate the second sub-correlation coefficient of the two feature information in the feature information pair; assume that the two feature information in the feature information pair are fea_i and fea_j, fea_i is the target feature information, i is the feature type number of the target feature information, fea_key_i is the feature value of the target feature information fea_i, fea_no ij Indicates the second sub-correlation coefficient of the target feature information fea_i and the feature information fea_j, j is the feature type number of the feature information fea_j, fea_cross_embed (i-i)*n+j-1 represents the encoding vector with the subscript (i-1)*n+j-1 in the feature interaction embedding matrix, n represents the number of feature information in the feature information set of the word, W no Represents the mapping space, R represents a constant, and d represents the dimension of the mapping space.
6. The method according to claim 1, characterized in that The determining, based on each feature information of the word and the fusion correlation coefficient between each feature information and the target feature information, fusion feature information corresponding to the target feature information includes: Calculate the product of each feature information of the word and the fusion correlation coefficient of the feature information and the target feature information; The products of the target feature information are added together to obtain fused feature information of the target feature information.
7. A device for determining text semantic information, characterized in that: The device comprises: A segmentation module is configured to perform word segmentation processing on the target text to obtain a plurality of words; The extraction module is configured to obtain a plurality of feature information corresponding to each word, and obtain a feature information set corresponding to each word, wherein the plurality of feature information is feature information obtained in a plurality of feature categories, and the feature categories include at least one of the following: a feature of the word in context, a feature of the word in meaning, or a feature of the word in position in the target text; The first determination module is configured to perform the following feature fusion steps on each word according to the feature information set of the word to obtain each fused feature information of the word: determine each feature information corresponding to the word as target feature information, and group the target feature information with each feature information of the word into a feature information pair; determine the fusion correlation coefficient of two feature information in the feature information pair; determine the fusion feature information corresponding to the target feature information based on each feature information of the word and the fusion correlation coefficient of each feature information with the target feature information; The second determination module is configured to determine the semantic information corresponding to the target text based on the fused feature information of each word.
8. The device according to claim 7, characterized in that The first determining module is configured to: Determine a first sub-correlation coefficient of two pieces of feature information in the feature information pair, and determine a second sub-correlation coefficient of the two pieces of feature information in the feature information pair; wherein the first sub-correlation coefficient is used to indicate the degree of association between the two pieces of feature information in terms of feature values, and the second sub-correlation coefficient is used to indicate the feature categories of the two pieces of feature information; The first sub-correlation coefficient of the two feature information in the feature information pair is fused with the second sub-correlation coefficient of the two feature information in the feature information pair to obtain a fused correlation coefficient of the two feature information in the feature information pair.
9. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the operation performed by the method for determining text semantic information according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, which is loaded and executed by the processor to implement the operation performed by the method for determining text semantic information according to any one of claims 1 to 6.
