Semantic recognition method, apparatus, device, medium, and program product

CN117975946BActive Publication Date: 2026-11-03GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311796113.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-25
Publication Date
2026-11-03
Estimated Expiration
2043-12-25

AI Technical Summary

Technical Problem

传统语义识别方法的准确性不高,难以准确识别用户的意图。

Method used

By acquiring the user's voice information while the voice recognition function of the smart device is awake, performing word segmentation, updating word vectors using word vector models and knowledge graphs or collinear matrices, and combining attention mechanisms and syntactic semantic role analysis, semantic recognition is performed to obtain more accurate semantic recognition results, and corresponding control operations are executed.

Benefits of technology

It improves the accuracy of semantic recognition, enabling better understanding of user intent and enhancing the responsiveness and security of smart devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117975946B_ABST
    Figure CN117975946B_ABST
Patent Text Reader

Abstract

The application relates to a semantic recognition method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: acquiring voice information of a user under the condition that a voice recognition function of a smart device is in a wake-up state; acquiring input text information based on the voice information; performing word segmentation processing on the input text information to acquire an initial word vector corresponding to each word after the word segmentation processing; acquiring an updated word vector of each word based on a to-be-combined word corresponding to each word in the input text information; performing semantic recognition according to the updated word vector of each word in the input text information to acquire a semantic recognition result; and controlling the smart device to perform a corresponding operation based on the semantic recognition result. The method can improve the accuracy of semantic recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a semantic recognition method, apparatus, computer device, storage medium, and computer program product. Background Technology

[0002] With the development of artificial intelligence technology, smart devices are increasingly being used in people's daily lives. For example, smart devices can be used in smart homes, and these smart devices are usually equipped with voice recognition capabilities, enabling them to interact with users through voice commands.

[0003] However, traditional semantic recognition methods often suffer from low recognition accuracy. Summary of the Invention

[0004] Therefore, it is necessary to provide a semantic recognition method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the accuracy of semantic recognition in response to the above-mentioned technical problems.

[0005] Firstly, this application provides a semantic recognition method. The method includes:

[0006] When the voice recognition function of a smart device is activated, the user's voice information is obtained.

[0007] Based on the voice information, obtain the input text information;

[0008] The input text information is segmented into words to obtain the initial word vector for each word after segmentation.

[0009] Based on the words to be combined corresponding to each word in the input text information, obtain the updated word vector for each word;

[0010] Based on the updated word vectors of each word in the input text information, semantic recognition is performed to obtain the semantic recognition results;

[0011] Based on the semantic recognition results, corresponding control operations are performed.

[0012] In one embodiment, obtaining input text information based on the user's voice information includes:

[0013] Based on the user's voice information, the user's voiceprint information is identified;

[0014] Determine whether a user has permission to control smart devices based on voiceprint information;

[0015] If a user has permission to control a smart device, obtain the input text information of the user with permission to control the smart device.

[0016] In one embodiment, obtaining the updated word vector for each word based on the corresponding word to be combined in the input text information includes:

[0017] Obtain knowledge graphs or collinearity matrices for smart devices;

[0018] Based on the knowledge graph or the collinearity matrix, candidate words are determined for each word;

[0019] The initial word vector corresponding to each word and the word vector of the corresponding candidate word are concatenated to obtain the first word vector after the update for each word.

[0020] In one embodiment, the method further includes:

[0021] Based on the attention mechanism, the weight of each word's context unit is obtained; the context unit is obtained by dividing the input text information into different combinations of units;

[0022] Based on the weights, a weighted average or vector concatenation operation is performed on the initial word vector of each word and the initial word vector of the context unit of each word to obtain the updated second word vector of each word.

[0023] In one embodiment, the method further includes:

[0024] Obtain the syntactic role and semantic role corresponding to each word; the syntactic role and the semantic role are obtained based on syntactic analysis and semantic role annotation of the input text information;

[0025] Based on the corresponding syntactic and semantic roles of each word, determine the corresponding combination of each word, and determine at least one of the rhetorical words or the words being rhetorically referred to for each word;

[0026] Based on the corresponding combination method of each word, the initial word vector of each word is combined with the initial word vector of the corresponding rhetorical word or the word being rhetorically described to obtain the updated third word vector of each word.

[0027] In one embodiment, the method further includes:

[0028] Perform vector concatenation on the first word vector, the second word vector, and the third word vector to obtain the updated word vector for each word.

[0029] Secondly, this application also provides a semantic recognition device. The device includes:

[0030] The voice information acquisition module is used to acquire the user's voice information when the voice recognition function of the smart device is in the awake state;

[0031] The text information acquisition module is used to acquire input text information based on the voice information;

[0032] The initial vector acquisition module performs word segmentation on the input text information and acquires the initial word vector corresponding to each word after word segmentation.

[0033] The updated vector acquisition module is used to acquire the updated word vector of each word based on the corresponding words to be combined in the input text information.

[0034] The recognition result acquisition module is used to perform semantic recognition based on the updated word vector of each word in the input text information and to obtain the semantic recognition result;

[0035] The operation execution module is used to perform corresponding control operations based on the semantic recognition results.

[0036] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0037] When the voice recognition function of a smart device is activated, the user's voice information is obtained.

[0038] Based on the voice information, obtain the input text information;

[0039] The input text information is segmented into words to obtain the initial word vector for each word after segmentation.

[0040] Based on the words to be combined corresponding to each word in the input text information, obtain the updated word vector for each word;

[0041] Based on the updated word vectors of each word in the input text information, semantic recognition is performed to obtain the semantic recognition results;

[0042] Based on the semantic recognition results, corresponding control operations are performed.

[0043] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0044] When the voice recognition function of a smart device is activated, the user's voice information is obtained.

[0045] Based on the voice information, obtain the input text information;

[0046] The input text information is segmented into words to obtain the initial word vector for each word after segmentation.

[0047] Based on the words to be combined corresponding to each word in the input text information, obtain the updated word vector for each word;

[0048] Based on the updated word vectors of each word in the input text information, semantic recognition is performed to obtain the semantic recognition results;

[0049] Based on the semantic recognition results, corresponding control operations are performed.

[0050] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0051] When the voice recognition function of a smart device is activated, the user's voice information is obtained.

[0052] Based on the voice information, obtain the input text information;

[0053] The input text information is segmented into words to obtain the initial word vector for each word after segmentation.

[0054] Based on the words to be combined corresponding to each word in the input text information, obtain the updated word vector for each word;

[0055] Based on the updated word vectors of each word in the input text information, semantic recognition is performed to obtain the semantic recognition results;

[0056] Based on the semantic recognition results, corresponding control operations are performed.

[0057] The aforementioned semantic recognition method, apparatus, computer equipment, storage medium, and computer program product, when the voice recognition function of a smart device is in an active state, acquire the user's voice information; acquire input text information based on the voice information; perform word segmentation on the input text information to acquire the initial word vector for each word after segmentation; acquire the updated word vector for each word based on the corresponding words to be combined in the input text information; perform semantic recognition based on the updated word vectors of each word in the input text information to acquire the semantic recognition result; and execute corresponding control operations based on the semantic recognition result. By acquiring the user's voice information and performing word segmentation and word vector update processing based on this information, the user's intent can be more accurately identified and understood, thereby improving the accuracy of semantic recognition. Attached Figure Description

[0058] Figure 1This is a flowchart illustrating a semantic recognition method in one embodiment;

[0059] Figure 2 This is a schematic diagram of the word vector update process in one embodiment;

[0060] Figure 3 This is a flowchart illustrating the semantic recognition method in another embodiment;

[0061] Figure 4 This is a structural block diagram of a semantic recognition device in one embodiment;

[0062] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0064] In one embodiment, such as Figure 1 As shown, a semantic recognition method is provided, including the following steps:

[0065] Step 102: With the voice recognition function of the smart device in a wake-up state, obtain the user's voice information.

[0066] It should be noted that the semantic recognition method provided in this application embodiment can be applied to smart devices or smart device control platforms, and the smart device control platform can connect multiple smart devices. Smart devices can be smart home devices, such as air conditioners, televisions, washing machines, and refrigerators, or smart office equipment, such as printers and smart chairs.

[0067] In practice, users can activate the voice recognition function of smart devices using specific voice commands, thus putting the voice recognition function into a wake-up state. Alternatively, users can activate the voice recognition function using the accompanying remote control or a button on the smart device itself.

[0068] The user's voice information can be the language information of one or more users. Specifically, it is the language information acquired over a certain period of time.

[0069] For example, the smart device has a voice recognition function. When the voice recognition function of the smart device is activated, it can acquire the user's voice information.

[0070] Step 104: Based on the voice information, obtain the input text information.

[0071] The input text information can be obtained through speech recognition of the speech information. The input text information can be phrases, short phrases, or complete sentences.

[0072] For example, the voice information may include the voice information of at least one user, and the voice information may be processed to obtain the corresponding text information of the user as input text information.

[0073] Step 106: Perform word segmentation on the input text information to obtain the initial word vector for each word after word segmentation.

[0074] In some embodiments, the input text information needs to be preprocessed. Preprocessing may include removing punctuation marks, stop words, special characters, etc., to reduce the impact on subsequent word segmentation and word vector calculation.

[0075] For example, the input text information can be segmented into words. Specifically, a word segmentation tool can be used to segment the input text information into words, and each word in the input text information is segmented.

[0076] For example, for each word after word segmentation, an initial word vector is obtained for each word. Specifically, a trained word vector model can be used to convert each word after segmentation into a corresponding initial word vector. In practice, the initial word vector for each word can be set to a fixed length vector. The trained word vector model can be a common word vector model such as word2vec, glove, or BERT.

[0077] Step 108: Based on the words to be combined corresponding to each word in the input text information, obtain the updated word vector for each word.

[0078] Among them, the words to be combined can be words that have a certain correlation with the word.

[0079] In some embodiments, for each word in the input text information, the corresponding word to be combined can be a synonym or a related word in the input text information.

[0080] For example, for each word in the input text, the corresponding word to be combined is obtained, thereby obtaining the updated word vector for each word. Specifically, the corresponding word to be combined and the initial word vector of each word can be processed to obtain the updated word vector for each word.

[0081] Step 110: Perform semantic recognition based on the updated word vectors of each word in the input text information to obtain the semantic recognition results.

[0082] In some embodiments, the updated word vectors of each word in the input text can be integrated, and the integrated word vectors can be used to perform semantic recognition through a trained semantic recognition model to obtain the semantic recognition result. Specifically, the trained semantic recognition model can be implemented based on machine learning or deep learning models, such as logistic regression, support vector machine (SVM), neural networks, etc. During the training of the semantic recognition model, an appropriate loss function can be selected, and a suitable optimization algorithm can be used to optimize the loss function.

[0083] In practice, semantic recognition models are generally designed based on the semantic task to be identified. A semantic recognition model can be a classifier, a matcher, or a generator, adapted to the specific semantic task. For example, in the case of an air conditioner as a smart device, the semantic recognition model can be a generator to determine the control commands the user needs to use to operate the smart air conditioner.

[0084] Step 112: Based on the semantic recognition result, perform the corresponding control operation.

[0085] Specifically, in scenarios applied to a single smart device, the smart device can be equipped with a trained word vector model and a semantic recognition model, thereby executing corresponding control operations based on the semantic recognition results output by the semantic recognition model.

[0086] In scenarios where smart device control platforms are used to connect multiple smart devices, the platform can determine the smart device to be executed based on semantic recognition results and control the smart device to be executed to perform the corresponding control operations.

[0087] In practical applications, when used in a smart device control platform that connects multiple smart devices, the platform interprets the semantic recognition result as an executable operation. For example, if the semantic recognition result is "turn on the air conditioner," the smart device control platform sends the corresponding control command to the air conditioner to turn it on.

[0088] In the aforementioned semantic recognition method, when the voice recognition function of the smart device is activated, the user's voice information is acquired; based on the voice information, input text information is acquired; the input text information is segmented into words to obtain the initial word vector for each word after segmentation; based on the words to be combined for each word in the input text information, the updated word vector for each word is obtained; semantic recognition is performed based on the updated word vectors for each word in the input text information to obtain the semantic recognition result; and based on the semantic recognition result, corresponding control operations are executed. By acquiring the user's voice information and performing word segmentation and word vector update processing based on this information, the user's intent can be more accurately identified and understood, thereby improving the accuracy of semantic recognition.

[0089] In one embodiment, step 104 includes:

[0090] Step 1042: Based on the user's voice information, identify the user's voiceprint information.

[0091] For example, a user's voiceprint information can be identified through their speech information. Specifically, a user's voiceprint information can be identified using a trained voiceprint recognition model. The voiceprint recognition model can be an identity vector (i-vector) model, such as an x-vector model based on a time-delay neural network, a residual network, or other neural network models.

[0092] Step 1044: Determine whether the user has permission to control the smart device based on the voiceprint information.

[0093] In practice, a user's voice information may contain speech from multiple users. Therefore, voiceprint recognition is necessary to determine whether a user has the authority to control smart devices. Specifically, this can be achieved by storing the voiceprint information of authorized users in a voiceprint database.

[0094] Step 1046: If a user has permission to control the smart device, obtain the input text information of the user with permission to control the smart device.

[0095] For example, by using a voiceprint database and voiceprint information, if it is determined that a user has the authority to control a smart device, the user's corresponding voice information is identified and converted into input text information.

[0096] In the above embodiments, determining whether a user has permission to control the smart device based on voiceprint information can effectively protect control of the smart device, prevent unauthorized users from operating the smart device, and improve the security of smart device use. Furthermore, by obtaining the input text information of a user with permission to control the smart device, control commands can be obtained more quickly, improving response speed and efficiency.

[0097] In one embodiment, reference Figure 2 The diagram illustrates a flowchart of word vector updating in one embodiment. Step 108 includes:

[0098] Step 202: Obtain the knowledge graph or collinear matrix for smart devices.

[0099] Among them, a knowledge graph or collinear matrix for smart devices can be pre-deployed to store text information for smart devices through the knowledge graph or collinear matrix.

[0100] Specifically, the process of constructing a knowledge graph for smart devices can be as follows: First, collect data from smart devices, primarily including their functions, operations, parameters, and user feedback. Then, preprocess the collected data using natural language processing techniques to extract structured information such as entities and relationships, thereby constructing a knowledge graph for the smart devices.

[0101] Specifically, the collinearity matrix of smart devices can be obtained through a well-constructed knowledge graph of smart devices.

[0102] Step 204: Based on the knowledge graph or the collinearity matrix, determine the corresponding candidate words for each word.

[0103] In this context, the candidate words for each word can be synonyms or related words obtained based on knowledge graphs or collinear matrices.

[0104] Specifically, taking a knowledge graph as an example, related words for each word can be obtained based on the knowledge graph. Similarity or relevance can be calculated based on the initial word vector of each word and the word vectors of related words to obtain a predetermined number of candidate words. The similarity calculation can be implemented using a cosine similarity algorithm. The predetermined number of candidate words can be obtained in descending order of the calculated similarity scores. Specifically, the predetermined number can be determined based on actual circumstances, and this invention does not impose any limitations on it.

[0105] Step 206: Concatenate the initial word vector and the word vector of the corresponding candidate word for each word to obtain the updated first word vector for each word.

[0106] For example, the initial word vector corresponding to each word and the word vector of the corresponding candidate word can be concatenated to obtain the updated first word vector for each word. Specifically, the weight of each candidate word can be determined based on the similarity between the candidate words, and a weighted average can be performed on the initial word vector and the word vector of the corresponding candidate word based on the weight of each candidate word. Alternatively, the initial word vector and the word vector of the corresponding candidate word can be directly concatenated to obtain the updated first word vector for each word.

[0107] In the above embodiments, obtaining a knowledge graph or collinear matrix for smart devices and determining candidate words for each word based on them can enrich the semantic information of each word, thereby improving the accuracy of semantic recognition.

[0108] In one embodiment, the method further includes:

[0109] Based on the attention mechanism, the weight of each word's context unit is obtained; the context unit is obtained by dividing the input text information into different combinations of units;

[0110] Based on the weights, a weighted average or vector concatenation operation is performed on the initial word vector of each word and the initial word vector of the context unit of each word to obtain the updated second word vector of each word.

[0111] For example, the input text information can be divided into different contextual units. These contextual units can be different combinations at the word, phrase, or sentence level.

[0112] Based on the attention mechanism, the weights of each word's context units are obtained. Specifically, the attention mechanism can be based on different methods, calculating the degree of association between each context unit and the current word according to the context of each word in the input text, and obtaining the corresponding weights.

[0113] For example, for each word, a weighted average or vector concatenation operation is performed on its initial word vector and the initial word vector of each context unit according to the corresponding weight. The weighted average operation sums the word vectors of different context units according to the weight. The vector concatenation operation concatenates the word vectors of different context units with the initial word vector of the current word.

[0114] In the above embodiments, the attention mechanism dynamically adjusts the weights of different parts of the input text, enabling the differentiation of polysemous or ambiguous words with different meanings and uses in different scenarios through contextual information. This allows for better capture of key information and semantic relationships in the text, thereby improving the accuracy of semantic recognition.

[0115] In one embodiment, the method further includes:

[0116] Obtain the syntactic role and semantic role corresponding to each word; the syntactic role and the semantic role are obtained based on syntactic analysis and semantic role annotation of the input text information;

[0117] Based on the corresponding syntactic and semantic roles of each word, determine the corresponding combination of each word, and determine at least one of the rhetorical words or the words being rhetorically referred to for each word;

[0118] Based on the corresponding combination method of each word, the initial word vector of each word is combined with the initial word vector of the corresponding rhetorical word or the word being rhetorically described to obtain the updated third word vector of each word.

[0119] The syntactic and semantic roles of each word can be obtained through syntactic analysis and semantic role labeling of the input text. Specifically, based on the sentence structure in which each word appears in the input text, syntactic analysis and semantic role labeling are performed on the sentence to obtain the corresponding syntactic and semantic roles for each word. Syntactic roles include, but are not limited to, subject, predicate, object, and attributive. Semantic roles are used to define the semantic relationships between words.

[0120] For example, the combination method for each word can be determined based on its corresponding syntactic and semantic roles, and at least one of the rhetorical word or the word being rhetorically modified can be determined for each word. Specifically, different combination methods can be selected for the syntactic and semantic roles corresponding to each word, such as addition, multiplication, concatenation, attention, etc. The rhetorical word or the word being rhetorically modified for each word is a word in the input text information.

[0121] For example, based on the corresponding combination method for each word, the initial word vector of each word can be combined with the initial word vector of the corresponding rhetorical word or the word being rhetorically described. Specifically, when there are multiple rhetorical words or the word being rhetorically described for each word, the initial word vector of each word is combined with the initial word vector of each rhetorical word or the word being rhetorically described, and then vector concatenation is performed to obtain the updated third word vector for each word.

[0122] In the above embodiments, by obtaining the syntactic and semantic roles of each word, a deeper understanding of the function and semantics of words in sentences can be achieved, thereby enhancing the semantic understanding of the entire input text information. By performing vector combination operations between the initial word vector of each word and the initial word vector of the corresponding rhetorical word or the rhetorically used word, the updated third word vector of each word can be obtained, enhancing the representational ability of the input text information, enabling better handling of complex natural language tasks, and thus improving the accuracy of semantic recognition.

[0123] In one embodiment, the method further includes:

[0124] Perform vector concatenation on the first word vector, the second word vector, and the third word vector to obtain the updated word vector for each word.

[0125] Among them, the first word vector mainly reflects the basic semantics of words, the second word vector is updated by taking into account contextual information, and the third word vector is updated by combining syntactic roles and rhetorical information.

[0126] For example, the first word vector, the second word vector, and the third word vector can also be concatenated to obtain the updated word vector for each word.

[0127] In some embodiments, based on the requirements of the semantic recognition task, two word vectors can be selected from the first word vector, the second word vector, and the third word vector for vector concatenation.

[0128] In the above embodiments, by concatenating the first word vector, the second word vector, and the third word vector, the semantic information of the word is captured more comprehensively, and the semantic consistency is improved, making the updated word vector of each word more stable and reliable, thereby improving the accuracy of semantic recognition.

[0129] To better understand the complete process of the semantic recognition method in the embodiments of the present invention, a complete example is provided for illustration. (Refer to...) Figure 3 The diagram illustrates a flowchart of a semantic recognition method in another embodiment, including the following steps:

[0130] Step 302: With the voice recognition function of the smart device in a wake-up state, acquire the user's voice information.

[0131] Step 304: Based on the user's voice information, identify the user's voiceprint information; determine whether the user has permission to control the smart device based on the voiceprint information; if the user has permission to control the smart device, obtain the input text information of the user with permission to control the smart device.

[0132] Step 306: Obtain a knowledge graph or collinear matrix for smart devices; based on the knowledge graph or collinear matrix, determine the corresponding candidate words for each word.

[0133] Step 308: Concatenate the initial word vector and the word vector of the corresponding candidate word for each word to obtain the updated first word vector for each word.

[0134] Step 310: Based on the attention mechanism, obtain the weight of each word's context unit for each word.

[0135] Step 312: Based on the weights, perform a weighted average or vector concatenation operation on the initial word vector of each word and the initial word vector of the context unit of each word to obtain the updated second word vector of each word.

[0136] Step 314: Obtain the syntactic role and semantic role of each word; based on the syntactic role and semantic role of each word, determine the corresponding combination method of each word, and determine at least one of the rhetorical word or the rhetorically used word for each word.

[0137] Step 316: Based on the corresponding combination method of each word, perform vector combination operation on the initial word vector of each word and the initial word vector of the corresponding rhetorical word or the rhetorically used word to obtain the updated third word vector of each word.

[0138] Step 318: Perform vector concatenation on the first word vector, the second word vector, and the third word vector to obtain the updated word vector for each word.

[0139] Step 320: Perform semantic recognition based on the updated word vector of each word in the input text information to obtain the semantic recognition result; and execute the corresponding control operation based on the semantic recognition result.

[0140] In this embodiment, when the voice recognition function of the smart device is in an active state, the user's voice information is acquired; based on the voice information, input text information is acquired; the input text information is segmented into words to acquire the initial word vector for each word after segmentation; based on the words to be combined for each word in the input text information, the updated word vector for each word is acquired; semantic recognition is performed based on the updated word vectors for each word in the input text information to acquire the semantic recognition result; and based on the semantic recognition result, corresponding control operations are executed. By acquiring the user's voice information and performing word segmentation and word vector update processing based on this information, the user's intent can be more accurately identified and understood, thereby improving the accuracy of semantic recognition.

[0141] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0142] Based on the same inventive concept, this application also provides a semantic recognition device for implementing the semantic recognition method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more semantic recognition device embodiments provided below can be found in the limitations of the semantic recognition method described above, and will not be repeated here.

[0143] In one embodiment, such as Figure 4 As shown, a semantic recognition device is provided, including: a voice information acquisition module 402, a text information acquisition module 404, an initial vector acquisition module 406, an update vector acquisition module 408, a recognition result acquisition module 410, and an operation execution module 412, wherein:

[0144] The voice information acquisition module 402 is used to acquire the user's voice information when the voice recognition function of the smart device is in the awake state;

[0145] The text information acquisition module 404 is used to acquire input text information based on the voice information;

[0146] The initial vector acquisition module 406 performs word segmentation on the input text information and acquires the initial word vector corresponding to each word after word segmentation.

[0147] The update vector acquisition module 408 is used to acquire the updated word vector of each word based on the word to be combined corresponding to each word in the input text information;

[0148] The recognition result acquisition module 410 is used to perform semantic recognition based on the updated word vector of each word in the input text information and to acquire the semantic recognition result;

[0149] The operation execution module 412 is used to perform corresponding control operations based on the semantic recognition results.

[0150] In some embodiments, the text information acquisition module 404 includes:

[0151] The voiceprint information recognition unit is used to identify the user's voiceprint information based on the user's voice information;

[0152] The permission determination unit is used to determine whether a user has permission to control smart devices based on voiceprint information.

[0153] The text information acquisition unit is used to acquire the input text information of a user who has the authority to control a smart device, when such a user does.

[0154] In some embodiments, the updated vector acquisition module 408 includes:

[0155] Obtain knowledge graphs or collinearity matrices for smart devices;

[0156] Based on the knowledge graph or the collinearity matrix, candidate words are determined for each word;

[0157] The initial word vector corresponding to each word and the word vector of the corresponding candidate word are concatenated to obtain the first word vector after the update for each word.

[0158] In some embodiments, the semantic recognition device is further configured to: obtain the weight of the context unit of each word for each word based on an attention mechanism; the context unit is obtained by dividing the input text information into different combinations of units; and based on the weight, perform a weighted average or vector concatenation operation on the initial word vector of each word and the initial word vector of the context unit of each word to obtain the updated second word vector of each word.

[0159] In some embodiments, the semantic recognition device is further configured to: obtain the syntactic role and semantic role corresponding to each word; the syntactic role and the semantic role are obtained based on syntactic analysis and semantic role annotation of the input text information;

[0160] Based on the corresponding syntactic and semantic roles of each word, determine the corresponding combination of each word, and determine at least one of the rhetorical words or the words being rhetorically referred to for each word;

[0161] Based on the corresponding combination method of each word, the initial word vector of each word is combined with the initial word vector of the corresponding rhetorical word or the word being rhetorically described to obtain the updated third word vector of each word.

[0162] In some embodiments, the semantic recognition device is further configured to:

[0163] Perform vector concatenation on the first word vector, the second word vector, and the third word vector to obtain the updated word vector for each word.

[0164] Each module in the aforementioned semantic recognition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0165] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores and retrieves knowledge graphs or collinearity matrices for intelligent devices. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When executed by the processor, the computer program implements a semantic recognition method.

[0166] The display unit of this computer device is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of this computer device can be a touch layer covering the display screen, or buttons, a trackball, or a touchpad set on the casing of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0167] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0168] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0169] When the voice recognition function of a smart device is activated, the user's voice information is obtained.

[0170] Based on the voice information, obtain the input text information;

[0171] The input text information is segmented into words to obtain the initial word vector for each word after segmentation.

[0172] Based on the words to be combined corresponding to each word in the input text information, obtain the updated word vector for each word;

[0173] Based on the updated word vectors of each word in the input text information, semantic recognition is performed to obtain the semantic recognition results;

[0174] Based on the semantic recognition results, corresponding control operations are performed.

[0175] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0176] Obtain knowledge graphs or collinearity matrices for smart devices;

[0177] Based on the knowledge graph or the collinearity matrix, candidate words are determined for each word;

[0178] The initial word vector corresponding to each word and the word vector of the corresponding candidate word are concatenated to obtain the first word vector after the update for each word.

[0179] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0180] Based on the attention mechanism, the weight of each word's context unit is obtained; the context unit is obtained by dividing the input text information into different combinations of units;

[0181] Based on the weights, a weighted average or vector concatenation operation is performed on the initial word vector of each word and the initial word vector of the context unit of each word to obtain the updated second word vector of each word.

[0182] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0183] Obtain the syntactic role and semantic role corresponding to each word; the syntactic role and the semantic role are obtained based on syntactic analysis and semantic role annotation of the input text information;

[0184] Based on the corresponding syntactic and semantic roles of each word, determine the corresponding combination of each word, and determine at least one of the rhetorical words or the words being rhetorically referred to for each word;

[0185] Based on the corresponding combination method of each word, the initial word vector of each word is combined with the initial word vector of the corresponding rhetorical word or the word being rhetorically described to obtain the updated third word vector of each word.

[0186] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0187] When the voice recognition function of a smart device is activated, the user's voice information is obtained.

[0188] Based on the voice information, obtain the input text information;

[0189] The input text information is segmented into words to obtain the initial word vector for each word after segmentation.

[0190] Based on the words to be combined corresponding to each word in the input text information, obtain the updated word vector for each word;

[0191] Based on the updated word vectors of each word in the input text information, semantic recognition is performed to obtain the semantic recognition results;

[0192] Based on the semantic recognition results, corresponding control operations are performed.

[0193] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0194] Obtain knowledge graphs or collinearity matrices for smart devices;

[0195] Based on the knowledge graph or the collinearity matrix, candidate words are determined for each word;

[0196] The initial word vector corresponding to each word and the word vector of the corresponding candidate word are concatenated to obtain the first word vector after the update for each word.

[0197] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0198] Based on the attention mechanism, the weight of each word's context unit is obtained; the context unit is obtained by dividing the input text information into different combinations of units;

[0199] Based on the weights, a weighted average or vector concatenation operation is performed on the initial word vector of each word and the initial word vector of the context unit of each word to obtain the updated second word vector of each word.

[0200] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0201] Obtain the syntactic role and semantic role corresponding to each word; the syntactic role and the semantic role are obtained based on syntactic analysis and semantic role annotation of the input text information;

[0202] Based on the corresponding syntactic and semantic roles of each word, determine the corresponding combination of each word, and determine at least one of the rhetorical words or the words being rhetorically referred to for each word;

[0203] Based on the corresponding combination method of each word, the initial word vector of each word is combined with the initial word vector of the corresponding rhetorical word or the word being rhetorically described to obtain the updated third word vector of each word.

[0204] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0205] When the voice recognition function of a smart device is activated, the user's voice information is obtained.

[0206] Based on the voice information, obtain the input text information;

[0207] The input text information is segmented into words to obtain the initial word vector for each word after segmentation.

[0208] Based on the words to be combined corresponding to each word in the input text information, obtain the updated word vector for each word;

[0209] Based on the updated word vectors of each word in the input text information, semantic recognition is performed to obtain the semantic recognition results;

[0210] Based on the semantic recognition results, corresponding control operations are performed.

[0211] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0212] Obtain knowledge graphs or collinearity matrices for smart devices;

[0213] Based on the knowledge graph or the collinearity matrix, candidate words are determined for each word;

[0214] The initial word vector corresponding to each word and the word vector of the corresponding candidate word are concatenated to obtain the first word vector after the update for each word.

[0215] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0216] Based on the attention mechanism, the weight of each word's context unit is obtained; the context unit is obtained by dividing the input text information into different combinations of units;

[0217] Based on the weights, a weighted average or vector concatenation operation is performed on the initial word vector of each word and the initial word vector of the context unit of each word to obtain the updated second word vector of each word.

[0218] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0219] Obtain the syntactic role and semantic role corresponding to each word; the syntactic role and the semantic role are obtained based on syntactic analysis and semantic role annotation of the input text information;

[0220] Based on the corresponding syntactic and semantic roles of each word, determine the corresponding combination of each word, and determine at least one of the rhetorical words or the words being rhetorically referred to for each word;

[0221] Based on the corresponding combination method of each word, the initial word vector of each word is combined with the initial word vector of the corresponding rhetorical word or the word being rhetorically described to obtain the updated third word vector of each word.

[0222] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant regions.

[0223] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0224] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0225] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A semantic recognition method, characterized in that, The method includes: When the voice recognition function of a smart device is activated, the user's voice information is obtained. Based on the voice information, obtain the input text information; The input text information is segmented into words to obtain the initial word vector for each word after segmentation. Based on the words to be combined corresponding to each word in the input text information, the updated word vector for each word is obtained; this includes: Obtain knowledge graphs or collinearity matrices for smart devices; Based on the knowledge graph or the collinearity matrix, candidate words are determined for each word; The initial word vector corresponding to each word and the word vector of the corresponding candidate word are concatenated to obtain the first word vector after the update for each word; Based on the updated word vectors of each word in the input text information, semantic recognition is performed to obtain the semantic recognition results; Based on the semantic recognition results, execute the corresponding control operations; Based on the attention mechanism, the weight of each word's context unit is obtained; the context unit is obtained by dividing the input text information into different combinations of units; Based on the weights, a weighted average or vector concatenation operation is performed on the initial word vector of each word and the initial word vector of the context unit of each word to obtain the updated second word vector of each word. Obtain the syntactic role and semantic role corresponding to each word; the syntactic role and the semantic role are obtained based on syntactic analysis and semantic role annotation of the input text information; Based on the corresponding syntactic and semantic roles of each word, determine the corresponding combination of each word, and determine at least one of the rhetorical words or the words being rhetorically referred to for each word; Based on the corresponding combination method of each word, the initial word vector of each word is combined with the initial word vector of the corresponding rhetorical word or the rhetorically used word to obtain the updated third word vector of each word; Perform vector concatenation on the first word vector, the second word vector, and the third word vector to obtain the updated word vector for each word.

2. The method according to claim 1, characterized in that, The step of obtaining input text information based on the voice information includes: Based on the user's voice information, the user's voiceprint information is identified; Determine whether a user has permission to control smart devices based on voiceprint information; If a user has permission to control a smart device, obtain the input text information of the user with permission to control the smart device.

3. A semantic recognition device, characterized in that, The device includes: The voice information acquisition module is used to acquire the user's voice information when the voice recognition function of the smart device is in the awake state; The text information acquisition module is used to acquire input text information based on the voice information; The initial vector acquisition module performs word segmentation on the input text information and acquires the initial word vector corresponding to each word after word segmentation. The updated vector acquisition module is used to obtain the updated word vector of each word based on the corresponding words to be combined in the input text information; and is also used to obtain a knowledge graph or collinear matrix for smart devices; determine the corresponding candidate words for each word based on the knowledge graph or the collinear matrix; and concatenate the initial word vector of each word and the word vector of the corresponding candidate words to obtain the updated first word vector of each word. The recognition result acquisition module is used to perform semantic recognition based on the updated word vector of each word in the input text information and to obtain the semantic recognition result; The operation execution module is used to perform corresponding control operations based on the semantic recognition results; The semantic recognition device is also used to obtain the weight of each word's context unit for each word based on an attention mechanism; the context unit is obtained by dividing the input text information into different combinations of units; Based on the weights, a weighted average or vector concatenation operation is performed on the initial word vector of each word and the initial word vector of the context unit of each word to obtain the updated second word vector of each word. Obtain the syntactic role and semantic role corresponding to each word; the syntactic role and the semantic role are obtained based on syntactic analysis and semantic role annotation of the input text information; Based on the corresponding syntactic and semantic roles of each word, determine the corresponding combination of each word, and determine at least one of the rhetorical words or the words being rhetorically referred to for each word; Based on the corresponding combination method of each word, the initial word vector of each word is combined with the initial word vector of the corresponding rhetorical word or the rhetorically used word to obtain the updated third word vector of each word; Perform vector concatenation on the first word vector, the second word vector, and the third word vector to obtain the updated word vector for each word.

4. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 2.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 2.

6. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • A semantic extraction method and device

    CN109684640A

  • Semantic abstraction representation method and device for sentences

    CN111737974A