A corpus understanding method and device
By training a corpus understanding model for different length conditions, combining the trunk and corpus intention information, the problem of comprehension of short sentences in the prior art is solved, and the accuracy and applicability of corpus comprehension is improved.
Patent Information
- Application Number
- CN202010691228.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-17
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2040-07-17
AI Technical Summary
Existing corpus comprehension models have difficulty obtaining sufficient information when dealing with short sentences that omit non-trabecular components in sentences, resulting in comprehension errors.
By training the first understanding model and the second understanding model, the intention understanding is carried out according to the length conditions of the specified corpus, and the main intention information and corpus intention information are integrated to obtain more accurate intention information.
It improves the accuracy of corpus comprehension and can obtain high-accurate intention information under different expression methods. It is suitable for fields such as intelligent customer service.
Smart Images

Figure CN111985206B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of corpus processing, and in particular to a corpus understanding method and device. Background Art
[0002] Semantic understanding usually refers to parsing corpus into structured, machine-readable intent and word slot information so that the machine can better understand and meet user needs. Existing corpus understanding models usually judge user intent based on the user's input corpus. However, different people have different input habits. When people are accustomed to inputting short sentences that omit non-main components in the sentence, the existing semantic understanding model is difficult to obtain sufficient information content and is prone to misunderstanding. Summary of the invention
[0003] The embodiments of the present invention provide a method and device for understanding corpus, which have the effect of improving the accuracy of corpus understanding.
[0004] On the one hand, an embodiment of the present invention provides a corpus understanding method, the method comprising: obtaining a corpus sample for characterizing user intent; performing trunk extraction on the corpus sample through a syntactic analyzer to obtain a trunk sample, the trunk sample being used to characterize trunk information in the corpus sample; training a classification model based on the trunk sample to obtain a first understanding model; training a semantic understanding model based on the corpus sample to obtain a second understanding model; wherein the first understanding model is used to perform intent understanding on the specified corpus when the specified corpus meets a first condition to obtain trunk intent information; the second understanding model is used to perform intent understanding on the specified corpus when the specified corpus meets a second condition to obtain corpus intent information; the first condition and the second condition are different.
[0005] In one possible implementation, the first condition is a specific length range; accordingly, the method further includes: obtaining a specified corpus; when it is determined that the specified corpus meets the specific length range, performing intent understanding on the specified corpus through a first understanding model to obtain first main intent information; the first main intent information is one of the main intent information.
[0006] In one possible implementation, the method also includes: when it is determined that the designated corpus does not meet a specific length range, performing trunk extraction on the designated corpus through a syntactic analyzer to obtain a trunk text; performing intent understanding on the trunk text through a first understanding model to obtain second trunk intent information; the second trunk intent information is one of the trunk intent information.
[0007] In one possible implementation, the second condition is a non-specific length range; accordingly, the method further includes: when it is determined that the designated corpus satisfies the non-specific length range, performing intent understanding on the designated corpus through a second understanding model to obtain first corpus intent information; the first corpus intent information is one of the corpus intent information.
[0008] In one possible implementation, the second condition is that the specified corpus has been processed by the first understanding model; accordingly, the method further includes: after determining that the specified corpus has been processed by the first understanding model, processing the specified corpus through the second understanding model to obtain second corpus intention information; the second corpus intention information is one of the corpus intention information.
[0009] In one possible implementation, the method further includes: integrating the corpus intention information and the trunk intention information to obtain first designated intention information corresponding to the designated corpus.
[0010] In one possible implementation, the method also includes: training the intent understanding model based on the trunk intent information sample corresponding to the trunk sample and the corpus intent information sample corresponding to the corpus sample to obtain a third understanding model; the third understanding model is used to predict the corpus intent information and the trunk intent information to obtain the first specified intent information corresponding to the specified corpus.
[0011] On the other hand, an embodiment of the present invention provides a corpus understanding device, which includes: an acquisition module, used to obtain a corpus sample for characterizing user intention; an extraction module, used to perform trunk extraction on the corpus sample through a syntactic analyzer to obtain a trunk sample, and the trunk sample is used to characterize the trunk information in the corpus sample; a training module, used to train a classification model according to the trunk sample to obtain a first understanding model; the training module is used to train a semantic understanding model according to the corpus sample to obtain a second understanding model; wherein the first understanding model is used to perform intent understanding on the specified corpus when the specified corpus meets a first condition to obtain trunk intent information; the second understanding model is used to perform intent understanding on the specified corpus when the specified corpus meets a second condition to obtain corpus intent information; the first condition and the second condition are different.
[0012] In one possible implementation, the first condition is a specific length range; accordingly, the acquisition module is also used to obtain a specified corpus; the device also includes: an understanding module, which is used to understand the intent of the specified corpus through a first understanding model when it is determined that the specified corpus meets the specific length range, and obtain the first main intent information; the first main intent information is one of the main intent information.
[0013] In one possible implementation, the extraction module is further used to perform trunk extraction on the designated corpus through a syntactic analyzer to obtain a trunk text when it is determined that the designated corpus does not meet a specific length range; the understanding module is used to perform intent understanding on the trunk text through a first understanding model to obtain second trunk intent information; the second trunk intent information is one of the trunk intent information.
[0014] In one possible implementation, the second condition is a non-specific length range; accordingly, the understanding module is also used to, when it is determined that the designated corpus meets the non-specific length range, perform intent understanding on the designated corpus through a second understanding model to obtain first corpus intent information; the first corpus intent information is one of the corpus intent information.
[0015] In one possible implementation mode, the second condition is that the specified corpus has been processed by the first understanding model; accordingly, the device also includes: a processing module, which is used to process the specified corpus through the second understanding model after determining that the specified corpus has been processed by the first understanding model to obtain second corpus intention information; the second corpus intention information is one of the corpus intention information.
[0016] In one possible implementation, the device further includes: an integration module, configured to integrate the corpus intention information and the trunk intention information to obtain first designated intention information corresponding to the designated corpus.
[0017] In one possible implementation, the training module is also used to train the intent understanding model based on the trunk intent information samples corresponding to the trunk samples and the corpus intent information samples corresponding to the corpus samples to obtain a third understanding model; the third understanding model is used to predict the corpus intent information and the trunk intent information to obtain the first specified intent information corresponding to the specified corpus.
[0018] The corpus understanding method and device provided by the embodiment of the present invention train a first understanding model and a second understanding model, and determine a targeted model in the first understanding model and the second understanding model based on the conditions met by the specified corpus, and use the targeted model to understand the intent of the specified corpus, thereby improving the model's understanding rate of the specified corpus and obtaining more accurate intent information for understanding the intent of the specified corpus. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:
[0020] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0021] Figure 1 A schematic diagram of the implementation flow of a corpus understanding method according to an embodiment of the present invention;
[0022] Figure 2 A schematic diagram of a process flow for implementing intention understanding of a corpus understanding method according to an embodiment of the present invention;
[0023] Figure 3 A schematic diagram of a process flow for implementing intention understanding of a corpus understanding method according to another embodiment of the present invention;
[0024] Figure 4 The present invention is a schematic diagram of an implementation module of a corpus understanding device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0026] Figure 1 The present invention is a flowchart of a method for understanding corpus according to an embodiment of the present invention.
[0027] refer to Figure 1 On the one hand, an embodiment of the present invention provides a corpus understanding method, the method comprising: operation 101, obtaining a corpus sample for representing user intent; operation 102, performing trunk extraction on the corpus sample through a syntactic analyzer to obtain a trunk sample, the trunk sample being used to represent trunk information in the corpus sample; operation 103, training a classification model according to the trunk sample to obtain a first understanding model; operation 104, training a semantic understanding model according to the corpus sample to obtain a second understanding model; wherein the first understanding model is used to perform intent understanding on the specified corpus when the specified corpus meets a first condition to obtain trunk intent information; the second understanding model is used to perform intent understanding on the specified corpus when the specified corpus meets a second condition to obtain corpus intent information; the first condition and the second condition are different.
[0028] The corpus understanding method provided in the embodiment of the present invention trains a first understanding model and a second understanding model, and determines a targeted model in the first understanding model and the second understanding model according to the conditions satisfied by the specified corpus, and uses the targeted model to understand the intent of the specified corpus, thereby improving the model's understanding rate of the specified corpus and obtaining more accurate intent information for the intent understanding of the specified corpus. The corpus understanding scheme of this method is suitable for intelligent customer service. By selecting a targeted model, it is possible to obtain intent information with a high accuracy rate when the user adopts various expressions.
[0029] In operation 101 of the present method, the corpus sample can come from a database, or can be written manually or by a machine, can be a corpus sample containing a main component, can be a corpus sample containing a non-main component, or can be a corpus sample containing both a main component and a non-main component. The present method can use various types of corpus as corpus samples. Corpus samples are used to characterize user intentions; corpus samples can be specifically used to characterize user questions, instructions, and the like. It is understandable that when the present method is applied to targeted fields, such as the express delivery field, the smart home field, and the smart customer service field, the corpus samples can be adjusted in a targeted manner according to the field.
[0030] In operation 102 of the present method, the syntactic analyzer is used to determine the main components in the corpus sample, so as to extract the main components in the corpus sample and obtain the main sample. It can be understood that the syntactic analyzer is mainly used to extract the main components of the corpus sample, and specifically, it can be used to extract the main components of the corpus sample containing non-main components. The present method can extract the main components of all corpus samples through the syntactic analyzer to obtain the main samples. The present method can also first determine whether the corpus sample belongs to the corpus sample containing non-main components, and extract the main components of the corpus sample determined to contain non-main components through the syntactic analyzer to obtain the main samples. Among them, the determination of whether the sample belongs to the corpus sample containing non-main components can be based on the length of the corpus sample, that is, when the length of the corpus sample exceeds the set length threshold, the corpus sample is determined to be a corpus sample containing non-main components. It is understandable that a corpus sample containing non-stem components may contain information such as stem information, auxiliary words, modal particles, adjectives, etc., while a stem sample only contains stem information, wherein the stem information includes at least a predicate and an object, and may also include a subject. For example, when the corpus sample is "I need to buy some milk", after the corpus sample is analyzed by a syntactic analyzer, the stem sample obtained is "I buy milk" or "buy milk".
[0031] In operation 103 of the present method, the classification model is trained through the backbone sample so that the classification model can understand the intent information corresponding to the backbone sample, thereby obtaining a first understanding model. It can be understood that the first understanding model can accurately analyze the corpus containing only the backbone information and obtain the corresponding backbone intent information. Compared with the understanding model obtained by training with the corpus sample, the first understanding model can determine the corresponding backbone intent information when the amount of input information is small. Among them, the classification model can adopt various classification models that can be applicable to the field of semantic understanding.
[0032] In operation 104 of the present method, the semantic understanding model is trained through all corpus samples so that the semantic understanding model can understand the intention information corresponding to the corpus samples, thereby obtaining a second understanding model. It is understandable that the second understanding model can accurately analyze various types of corpus samples to obtain the corresponding corpus intention information. In another case, before training the semantic understanding model through corpus samples, the present method can first classify the corpus samples through a syntactic analyzer, screen out corpus samples containing only trunk information, and train the semantic understanding model through corpus samples containing non-trunk components so that the semantic understanding model can understand the corpus intention information of the corpus samples containing non-trunk components, thereby making the complementarity between the first understanding model and the second understanding model stronger. Among them, the semantic understanding model can adopt any type of model, such as DSSM model, LSTM-DSSM model, RNN model, LSTM model, etc. It should be further supplemented that the first understanding model and the second understanding model can adopt the same type of model or different types of models.
[0033] The designated corpus refers to the corpus that the method needs to understand the intent. The designated corpus can come from a user, a smart appliance, or a terminal used by the user. When the designated corpus is obtained, the method first analyzes the designated corpus to determine whether it meets the first condition and the second condition. It should be noted that the first condition is a condition related to whether the designated corpus only contains the main components. Therefore, when the designated corpus meets the first condition, the designated corpus can be understood by the first understanding model to obtain the main intent information. The second condition can be a condition related to whether the designated corpus contains non-main components, or it can be any other condition, and the first condition and the second condition are different. Therefore, when the second condition is met, the second understanding model can be used to understand the intent of the designated corpus to obtain the corpus intent information. In one case, the first condition and the second condition are mutually exclusive conditions, that is, when the first condition is met, the second condition is not met. At this time, when the first condition is met, the main intent information output by the first understanding model is the intent information corresponding to the designated corpus. When the second condition is met, the corpus intent information output by the second understanding model is the intent information corresponding to the designated corpus. In another case, the first condition and the second condition may be unrelated conditions, that is, when the first condition is met, the second condition may be met or may not be met. In this case, when the specified corpus satisfies both the first condition and the second condition, the trunk intent information and the corpus intent information may be reprocessed to determine the intent information corresponding to the specified corpus.
[0034] Figure 2 The present invention is a schematic diagram of the implementation process of a corpus understanding method for understanding intent.
[0035] See also Figure 2 In an embodiment of the present invention, the first condition is a specific length range; accordingly, the method also includes: operation 201, obtaining a specified corpus; operation 202, when it is determined that the specified corpus meets the specific length range, performing intent understanding on the specified corpus through a first understanding model to obtain a first trunk intent information; the first trunk intent information is one of the trunk intent information.
[0036] In general, corpora containing only trunk structures are usually short sentences, while corpora containing non-trunk structures are usually long sentences, and their sentence lengths are usually longer than those containing only trunk structures. Therefore, this method uses the length of the sentence as the basis for determining whether the corpus is the trunk, that is, the first condition of this method is set to a specific length range. Specifically, the specific length range can be determined by counting the sentence lengths of the trunk samples and determining the specific length range based on the statistical results. For example, if the statistical results show that the sentence lengths of 80% of the trunk samples do not exceed 10 words, the specific length range is set to less than 10 words.
[0037] In this method, the specified corpus can be obtained in the form of voice or text. When the device collects voice, it converts it into text to obtain the specified corpus. Then determine the sentence length of the specified corpus. When it is judged that the sentence length of the specified corpus meets a specific length range, it can be considered that the specified corpus belongs to a corpus with only a trunk structure. At this time, the first understanding model can be used to understand the intent of the specified corpus to obtain the first trunk intent information that understands the intent more accurately. It can be understood that the first trunk intent information is used to refer to the intent information obtained by predicting the specified corpus by the first understanding model when the first condition is within a specific length range. The first trunk intent information is one of the trunk intent information.
[0038] Figure 3 The present invention is another embodiment of a corpus understanding method for realizing the intention understanding process.
[0039] See also Figure 3 In one possible implementation, the method further includes: operation 301, when it is determined that the specified corpus does not meet a specific length range, performing trunk extraction on the specified corpus through a syntactic analyzer to obtain a trunk text; operation 302, performing intent understanding on the trunk text through a first understanding model to obtain second trunk intent information; the second trunk intent information is one of the trunk intent information.
[0040] In the case where the specified corpus does not meet the specific length range, the method can also perform trunk extraction on the specified corpus through a syntactic analyzer to obtain the trunk text corresponding to the specified corpus. It can be understood that the first understanding model is then used to understand the intent of the trunk text to obtain the second trunk intent information. It should be noted that the first trunk intent information and the second trunk intent information are only used to distinguish the prediction results obtained by applying the first understanding model in different scenarios. The second trunk intent information is also one of the trunk intent information, and the first trunk intent information and the second trunk intent information may be the same or different. It should be further supplemented that after the specified corpus is subjected to trunk extraction by a syntactic analyzer, it can be obviously determined that the obtained text is the trunk text. At this time, it is not necessary to judge whether the trunk text meets the specific length range, and the trunk text can be directly understood by the first understanding model.
[0041] In one possible implementation, the second condition is a non-specific length range; accordingly, the method also includes: first, when it is determined that the specified corpus meets the non-specific length range, the intent of the specified corpus is understood through a second understanding model to obtain the first corpus intent information; then, the first corpus intent information is one of the corpus intent information.
[0042] It should be explained that the non-specific length in the second condition can be understood as any length, or it can be understood as all length ranges except the specific length corresponding to the first understanding model. That is, when the second condition is understood as any length, the obtained designated corpus will be understood through the second understanding model to obtain the first corpus intention information. After obtaining the first corpus intention information, it is integrated with the trunk intention information obtained by other implementation methods to obtain the intention information corresponding to the designated corpus.
[0043] When the second condition is understood as removing all length ranges except the specific length corresponding to the first understanding model, when the designated corpus is judged to not meet the first condition, the second understanding model can be used to predict the designated corpus to obtain the first corpus intention information. Similarly, when the first corpus intention information is obtained, the method can directly determine the first corpus intention information as the intention information corresponding to the designated corpus. It is also possible to perform trunk extraction on the designated corpus through a syntactic analyzer, and perform intent understanding on the extracted trunk text through the first understanding model to obtain the second trunk intention information, and then analyze and integrate the first corpus intention information and the second trunk intention information to obtain the intention information corresponding to the designated corpus.
[0044] In one possible implementation, the second condition is that the corpus has been processed by the first understanding model; accordingly, the method also includes: first, after determining that the specified corpus has been processed by the first understanding model, the specified corpus is processed by the second understanding model to obtain second corpus intention information; then, the second corpus intention information is one type of corpus intention information.
[0045] In another case, the second condition may be processed by the first understanding model. It is understandable that all designated corpora need to be processed by the first understanding model and the second understanding model in sequence to obtain the main intention information and the second corpus intention information, and the main intention information and the second corpus intention information are integrated to obtain the intention information corresponding to the designated corpus.
[0046] In another case, the second condition may be not being processed by the first understanding model. That is, it can be understood that when the designated corpus does not meet the first condition, the designated corpus is processed by the second understanding model, and the corpus intention information obtained by the second understanding model is determined as the intention information.
[0047] In one possible implementation, the method further includes: integrating the corpus intention information and the trunk intention information to obtain first designated intention information corresponding to the designated corpus.
[0048] Specifically, after the intent understanding is completed through the first understanding model and the second understanding model, the corpus intent information and the main intent information can be processed by integration processing to obtain the first specified intent information. In addition to the integration processing, the corpus intent information and the main intent information can also be judged for confidence, so as to determine the corpus intent information and the main intent information with higher credibility as the intent information.
[0049] In one possible implementation, the method also includes: training the intent understanding model based on the trunk intent information samples corresponding to the trunk samples and the corpus intent information samples corresponding to the corpus samples to obtain a third understanding model; the third understanding model is used to predict the corpus intent information and the trunk intent information to obtain the first specified intent information corresponding to the specified corpus.
[0050] Specifically, the integration of corpus intent information and trunk intent information can be processed by a third understanding model. The third understanding model is trained by trunk intent information samples corresponding to trunk samples and corpus intent information samples corresponding to corpus samples, thereby realizing the integration of corpus intent information and trunk intent information and obtaining the first specified intent information corresponding to the specified corpus.
[0051] To facilitate the understanding of the above-mentioned implementation methods, several specific implementation scenarios are provided below for illustration. In one implementation scenario, the method is applied to the intelligent customer service of a store, which is trained through corpus samples associated with store shopping. First, a syntactic analyzer is used to extract the trunk of all corpus to obtain a trunk sample, and then the classification model is trained through the trunk sample to obtain a first understanding model. Then, the semantic understanding model is trained through the corpus sample to obtain a second understanding model. The first condition is set to that the sentence length of the specified corpus does not exceed 8 words, and the second condition is set to that the sentence length of the specified corpus exceeds 8 words.
[0052] When the intelligent customer service collects the user's voice information "Hello, do you have milk in your store? I want to buy some milk." The intelligent customer service determines that the length of the voice information is more than 8 words, inputs the voice information into the second understanding model for intent understanding, and obtains the intent understanding information corresponding to "buy milk". When the user's voice information is "buy milk", the intelligent customer service determines that the length of the voice information is no more than 8 words, inputs the voice information into the first understanding model for intent understanding, and obtains the intent understanding information corresponding to "buy milk".
[0053] In another implementation scenario, this method is applied to intelligent customer service in the express delivery field. It is trained through corpus samples related to express delivery. First, the syntactic analyzer extracts the trunk of all corpus to obtain the trunk sample, and then the classification model is trained through the trunk sample to obtain the first understanding model. Then the semantic understanding model is trained through the corpus sample to obtain the second understanding model. Then the intention understanding model is trained through the trunk intention information sample corresponding to the trunk sample and the corpus intention information sample corresponding to the corpus sample to obtain the third understanding model. The first condition is set to that the sentence length of the specified corpus does not exceed 8 words, and the second condition is set to be predicted by the first understanding model.
[0054] During the work, the intelligent customer service collects the user's voice information "Hello, I want to send a courier." The intelligent customer service determines that the length of the voice information is more than 8 words, inputs the voice information into the syntactic analyzer for trunk extraction, obtains the trunk text "send a courier", inputs the trunk text "send a courier" into the first understanding model for intent understanding, and obtains the trunk intent understanding information corresponding to "send a courier". Then the voice information "Hello, I want to send a courier." is input into the second understanding model for intent understanding, and the corpus intent understanding information is obtained. Then the trunk intent understanding information and the corpus intent understanding information are input into the third understanding model for prediction, and the intent understanding information corresponding to the voice information is obtained.
[0055] When the voice message collected from the user is "send a courier", the intelligent customer service determines that the length of the voice message is no more than 8 characters, and inputs the main text "send a courier" into the first understanding model for intent understanding, and obtains the main intention understanding information corresponding to "send a courier". Then, the voice message "Hello, I want to send a courier." is input into the second understanding model for intent understanding, and the corpus intention understanding information is obtained. Then, the main intention understanding information and the corpus intention understanding information are input into the third understanding model for prediction, and the intention understanding information corresponding to the voice message is obtained.
[0056] In another implementation scenario, the method is applied to a smart housekeeper in the field of smart home, which is trained by using corpus samples associated with smart home. First, the syntactic analyzer extracts the trunk of all corpus to obtain the trunk sample, and then the classification model is trained by the trunk sample to obtain the first understanding model. Then, the semantic understanding model is trained by the corpus sample and the trunk intention information sample corresponding to the trunk sample to obtain the second understanding model. The first condition is set to specify that the sentence length of the corpus does not exceed 8 words, and the second condition is set to be predicted by the first understanding model.
[0057] When the smart butler collects the user's voice information "Please turn on the kitchen light for me, the one near the sink." during the work process, the smart customer service determines that the length of the voice information is more than 8 words, and inputs the voice information into the syntactic analyzer for trunk extraction, and obtains the trunk text "Turn on the kitchen light". The trunk text "Turn on the kitchen light" is input into the first understanding model for intent understanding, and the trunk intent understanding information corresponding to "Turn on the kitchen light" is obtained. Then the voice information "Please turn on the kitchen light for me, the one near the sink." and the trunk intent understanding information corresponding to "Turn on the kitchen light" are input into the second understanding model for intent understanding, and the corpus intent understanding information corresponding to the voice information is obtained.
[0058] Figure 4 The present invention is a schematic diagram of an implementation module of a corpus understanding device according to an embodiment of the present invention.
[0059] See also Figure 4 On the other hand, an embodiment of the present invention provides a corpus understanding device, the device includes: an acquisition module 401, used to obtain a corpus sample for representing user intention; an extraction module 402, used to perform trunk extraction on the corpus sample through a syntactic analyzer to obtain a trunk sample, and the trunk sample is used to represent the trunk information in the corpus sample; a training module 403, used to train a classification model according to the trunk sample to obtain a first understanding model; the training module 403 is used to train a semantic understanding model according to the corpus sample to obtain a second understanding model; wherein the first understanding model is used to perform intent understanding on the specified corpus when the specified corpus meets a first condition to obtain trunk intent information; the second understanding model is used to perform intent understanding on the specified corpus when the specified corpus meets a second condition to obtain corpus intent information; the first condition and the second condition are different.
[0060] In one possible implementation, the first condition is a specific length range; accordingly, the acquisition module is also used to obtain a specified corpus; the device also includes: an understanding module 404, which is used to understand the intent of the specified corpus through a first understanding model when it is determined that the specified corpus meets the specific length range, and obtain the first trunk intent information; the first trunk intent information is one of the trunk intent information.
[0061] In one possible implementation, the extraction module 402 is also used to perform trunk extraction on the specified corpus through a syntactic analyzer to obtain a trunk text when it is determined that the specified corpus does not meet a specific length range; the understanding module 404 is used to perform intent understanding on the trunk text through a first understanding model to obtain second trunk intent information; the second trunk intent information is one of the trunk intent information.
[0062] In one possible implementation, the second condition is a non-specific length range; accordingly, the understanding module 404 is also used to, when it is determined that the specified corpus meets the non-specific length range, perform intent understanding on the specified corpus through the second understanding model to obtain the first corpus intent information; the first corpus intent information is one of the corpus intent information.
[0063] In one possible implementation, the second condition is that the specified corpus has been processed by the first understanding model; accordingly, the device also includes: a processing module 405, which is used to process the specified corpus through the second understanding model after determining that the specified corpus has been processed by the first understanding model to obtain second corpus intention information; the second corpus intention information is one type of corpus intention information.
[0064] In one possible implementation, the device further includes: an integration module 406, configured to integrate the corpus intention information and the trunk intention information to obtain first designated intention information corresponding to the designated corpus.
[0065] In one possible implementation, the training module 403 is also used to train the intent understanding model based on the trunk intent information samples corresponding to the trunk samples and the corpus intent information samples corresponding to the corpus samples to obtain a third understanding model; the third understanding model is used to predict the corpus intent information and the trunk intent information to obtain the first specified intent information corresponding to the specified corpus.
[0066] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0067] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0068] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A corpus understanding method, characterized in that: The method comprises: Obtain corpus samples for representing user intent; Performing trunk extraction on the corpus sample through a syntactic analyzer to obtain a trunk sample, wherein the trunk sample is used to characterize trunk information in the corpus sample; wherein the trunk information only includes a predicate and an object or a subject, a predicate and an object; Training the classification model according to the backbone samples to obtain a first understanding model; Training the semantic understanding model according to the corpus sample to obtain a second understanding model; Wherein, the first understanding model is used to understand the intent of the specified corpus when the specified corpus meets the first condition, so as to obtain the main intent information; The second understanding model is used to understand the intent of the specified corpus when the specified corpus meets the second condition, so as to obtain the corpus intent information; The first condition and the second condition are different.
2. The method according to claim 1, characterized in that The first condition is a specific length range; Accordingly, the method further includes: Get the specified corpus; When it is determined that the designated corpus meets the specific length range, the designated corpus is understood by using a first understanding model to obtain first main intention information; The first trunk intent information is one of the trunk intent information; The specific length range is determined by counting the sentence lengths of the trunk samples and based on the statistical results.
3. The method according to claim 2, characterized in that The method further comprises: When it is determined that the designated corpus does not meet the specific length range, a syntactic analyzer is used to extract the main text of the designated corpus to obtain the main text; The first understanding model is used to understand the intention of the main text to obtain the second main text intention information; The second trunk intention information is one of the trunk intention information.
4. The method according to claim 2, characterized in that: The second condition is a non-specific length range; Accordingly, the method further includes: When it is determined that the designated corpus meets the non-specific length range, the designated corpus is understood by the second understanding model to obtain the first corpus intention information; The first corpus intention information is one of the corpus intention information; The non-specific length range is all length ranges except the specific length range.
5. The method according to claim 1 or 3, characterized in that: The second condition is processed by the first understanding model; Accordingly, the method further includes: After determining that the designated corpus has been processed by the first understanding model, the designated corpus is processed by the second understanding model to obtain the second corpus intention information; The second corpus intention information is one type of the corpus intention information.
6. The method according to claim 1, characterized in that The method further comprises: The corpus intention information and the trunk intention information are integrated to obtain first designated intention information corresponding to the designated corpus.
7. The method according to claim 1, characterized in that The method further comprises: Training the intent understanding model according to the trunk intent information sample corresponding to the trunk sample and the corpus intent information sample corresponding to the corpus sample to obtain a third understanding model; The third understanding model is used to predict the corpus intention information and the trunk intention information to obtain the first specified intention information corresponding to the specified corpus.
8. A corpus understanding device, characterized in that: The device comprises: An acquisition module, used to obtain a corpus sample for representing user intention; An extraction module, used for performing trunk extraction on the corpus sample through a syntactic analyzer to obtain a trunk sample, wherein the trunk sample is used to characterize trunk information in the corpus sample; wherein the trunk information only includes a predicate and an object or a subject, a predicate and an object; A training module, used for training the classification model according to the backbone samples to obtain a first understanding model; The training module is used to train the semantic understanding model according to the corpus sample to obtain a second understanding model; Wherein, the first understanding model is used to understand the intent of the specified corpus when the specified corpus meets the first condition, so as to obtain the main intent information; The second understanding model is used to understand the intent of the specified corpus when the specified corpus meets the second condition, so as to obtain the corpus intent information; The first condition and the second condition are different.
9. The device according to claim 8, characterized in that The first condition is a specific length range; accordingly, The obtaining module is further used to obtain the specified corpus; The device also includes: An understanding module, configured to, when it is determined that the designated corpus meets a specific length range, understand the intent of the designated corpus through a first understanding model to obtain first trunk intent information; The first trunk intent information is one of the trunk intent information; The specific length range is determined by counting the sentence lengths of the trunk samples and based on the statistical results.
10. The device according to claim 9, characterized in that The extraction module is further configured to, when it is determined that the designated corpus does not meet a specific length range, perform trunk extraction on the designated corpus through a syntactic analyzer to obtain a trunk text; The understanding module is used to understand the intent of the main text through the first understanding model to obtain second main text intent information; The second trunk intention information is one of the trunk intention information.
