Confidentiality detection methods, model training methods and devices
By combining a pre-trained intent recognition model and a confidentiality detection model with keyword and confidentiality reason detection, the problem of inaccurate text confidentiality detection in dialogue scenarios is solved, achieving accurate judgment of confidentiality and information security.
Patent Information
- Application Number
- CN202310375924.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-10
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-04-10
AI Technical Summary
In dialogue scenarios, existing technologies cannot accurately detect the confidentiality of text content, which may lead to the leakage of confidential information, and different agents have subjective biases in their understanding of confidential content.
A pre-trained intent recognition model and confidentiality detection model are used to detect keywords and reasons for confidentiality through intent classification information. Combined with the weights of the preset confidentiality value, the confidentiality of the text to be recognized is determined comprehensively.
It achieves accurate detection of text confidentiality, avoids subjective bias, and ensures the security of confidential information and the objectivity of dialogue content.
Smart Images

Figure CN117494179B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of model training, and in particular to a confidentiality detection method, a model training method, and an apparatus. Background Technology
[0002] In dialogue scenarios, the specific content of the conversation is influenced by the subjectivity of the participants. In some scenarios, participants may disclose confidential information during the conversation. For example, in a user-agent dialogue, the user may ask a question involving confidential information, and the agent may disclose confidential information in their answer. Moreover, for the same question involving confidential information, different agents may have subjective biases in their understanding of the confidentiality.
[0003] How to effectively detect the confidentiality of the content in a text is the technical problem that this application aims to solve. Summary of the Invention
[0004] The purpose of this application is to provide a confidentiality detection method, a model training method, and an apparatus to solve the problem of inaccurate confidentiality detection of the content involved in the text.
[0005] Firstly, a confidentiality detection method is provided, including:
[0006] Obtain the text to be recognized;
[0007] The text to be identified is input into a pre-trained intent recognition model to obtain predicted intent classification information;
[0008] The predicted intent classification information is input into a pre-trained confidentiality detection model to obtain the predicted confidentiality value;
[0009] The confidentiality of the text to be identified is determined based on the predicted confidentiality value;
[0010] The confidentiality detection model includes a first detection model, a second detection model, and a prediction module. The first detection model is used to perform keyword detection on the intent classification information to obtain predicted confidential keywords. The second detection model is used to perform confidentiality reason detection on the intent classification information to obtain predicted confidentiality reason information. The prediction module is used to obtain the predicted confidentiality value based on the keyword confidentiality weight value corresponding to the predicted confidential keywords in the preset confidentiality value, and the reason confidentiality weight value corresponding to the predicted confidentiality reason information in the preset confidentiality value. The preset confidentiality value includes the reason confidentiality weight value corresponding to the confidentiality reason information and the keyword confidentiality weight value corresponding to the confidential keywords.
[0011] Secondly, a training method for a confidentiality detection model is provided, including:
[0012] Multiple confidential data groups are acquired. Each confidential data group includes intent classification information and confidentiality reason information, confidentiality keywords, and confidentiality values corresponding to the intent classification information. The confidentiality values include the reason confidentiality weight value corresponding to the confidentiality reason information and the keyword confidentiality weight value corresponding to the confidentiality keywords. The intent classification information is the output result of the intent recognition model recognizing the text.
[0013] The intent classification information in the confidential data group is used as the first training sample, and the confidential keywords corresponding to the first training sample are used as the first training labels to train the first detection model.
[0014] The intent classification information in the confidential data group is used as the second training sample, and the confidentiality reason information corresponding to the second training sample is used as the second training label to train the second detection model.
[0015] A confidentiality detection model is constructed based on the first detection model and the second detection model. The confidentiality detection model is used to obtain a predicted confidentiality value based on the keyword confidentiality weight value corresponding to the predicted confidentiality keyword output by the first detection model and the reason confidentiality weight value corresponding to the predicted confidentiality reason information output by the second detection model.
[0016] Thirdly, a confidentiality detection device is provided, comprising:
[0017] The acquisition module acquires the text to be recognized;
[0018] The first input module inputs the text to be recognized into a pre-trained intent recognition model to obtain predicted intent classification information;
[0019] The second input module inputs the predicted intent classification information into a pre-trained confidentiality detection model to obtain the predicted confidentiality value;
[0020] The determination module determines the confidentiality of the text to be identified based on the predicted confidentiality value;
[0021] The confidentiality detection model includes a first detection model, a second detection model, and a prediction module. The first detection model is used to perform keyword detection on the intent classification information to obtain predicted confidential keywords. The second detection model is used to perform confidentiality reason detection on the intent classification information to obtain predicted confidentiality reason information. The prediction module is used to obtain the predicted confidentiality value based on the keyword confidentiality weight value corresponding to the predicted confidential keywords in the preset confidentiality value, and the reason confidentiality weight value corresponding to the predicted confidentiality reason information in the preset confidentiality value. The preset confidentiality value includes the reason confidentiality weight value corresponding to the confidentiality reason information and the keyword confidentiality weight value corresponding to the confidential keywords.
[0022] Fourthly, a training device for a confidentiality detection model is provided, comprising:
[0023] The acquisition module acquires multiple confidential data groups, each confidential data group including intent classification information and confidentiality reason information, confidential keywords, and confidentiality values corresponding to the intent classification information. The confidentiality values include the reason confidentiality weight value corresponding to the confidentiality reason information and the keyword confidentiality weight value corresponding to the confidential keywords. The intent classification information is the output result of the intent recognition model recognizing the text.
[0024] The first training module uses the intent classification information in the confidential data group as the first training sample and the confidential keyword corresponding to the first training sample as the first training label to train the first detection model.
[0025] The second training module uses the intent classification information in the confidential data group as the second training sample and the confidentiality reason information corresponding to the second training sample as the second training label to train the second detection model.
[0026] The construction module constructs a confidentiality detection model based on the first detection model and the second detection model. The confidentiality detection model is used to obtain a predicted confidentiality value based on the keyword confidentiality weight value corresponding to the predicted confidentiality keyword output by the first detection model and the reason confidentiality weight value corresponding to the predicted confidentiality reason information output by the second detection model.
[0027] Fifthly, an electronic device is provided, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method as described in the first or second aspect.
[0028] In a sixth aspect, a computer-readable storage medium is provided on which a computer program is stored, which, when executed by a processor, implements the steps of the method as described in the first or second aspect.
[0029] In this embodiment, firstly, the text to be identified is obtained; then, the text to be identified is input into a pre-trained intent recognition model to obtain predicted intent classification information; next, the predicted intent classification information is input into a pre-trained confidentiality detection model to obtain a predicted confidentiality value; finally, the confidentiality of the text to be identified is determined based on the predicted confidentiality value. The confidentiality detection model includes a first detection model, a second detection model, and a prediction module. The first detection model is used to perform keyword detection on the intent classification information to obtain predicted confidentiality keywords; the second detection model is used to perform confidentiality reason detection on the intent classification information to obtain predicted confidentiality reason information; the prediction module is used to obtain a predicted confidentiality value based on the keyword confidentiality weight value corresponding to the predicted confidentiality keywords in the preset confidentiality value, and the reason confidentiality weight value corresponding to the predicted confidentiality reason information in the preset confidentiality value. The preset confidentiality value includes the reason confidentiality weight value corresponding to the confidentiality reason information and the keyword confidentiality weight value corresponding to the confidentiality keywords. This solution performs confidentiality detection on the text to be identified, recognizing its intent classification information. Based on this intent classification, a predicted confidentiality value is obtained, objectively expressing the confidentiality of the text as a value. This achieves accurate detection of the text's confidentiality, avoiding the problem of inaccurate judgment due to subjective bias. The confidentiality detection model includes a first detection model and a second detection model, which detect confidentiality keywords and reasons for confidentiality, respectively. The predicted confidentiality value of the text is then comprehensively determined based on a preset confidentiality value, improving the effectiveness of the predicted confidentiality value. Attached Figure Description
[0030] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0031] Figure 1 This is one of the flowcharts illustrating a confidentiality detection method according to this application;
[0032] Figure 2 This is a flowchart illustrating a training method for a confidentiality detection model according to this application;
[0033] Figure 3 This is the second flowchart of a confidentiality detection method according to this application;
[0034] Figure 4 This is the third flowchart of a confidentiality detection method according to this application;
[0035] Figure 5 This is the fourth flowchart of a confidentiality detection method according to this application;
[0036] Figure 6This is the fifth flowchart of a confidentiality detection method according to this application;
[0037] Figure 7 This is the sixth flowchart of a confidentiality detection method according to this application;
[0038] Figure 8 This is the seventh flowchart of a confidentiality detection method according to this application;
[0039] Figure 9 This is the eighth flowchart of a confidentiality detection method according to this application;
[0040] Figure 10 This is a schematic diagram of the structure of a confidentiality detection device according to this application;
[0041] Figure 11 This is a schematic diagram of the structure of a training device for a confidentiality detection model according to this application;
[0042] Figure 12 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation
[0043] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. The drawing numbers in this application are only used to distinguish the various steps in the solution and are not used to limit the execution order of the various steps. The specific execution order is subject to the description in the specification.
[0044] In the field of Natural Language Processing (NLP), NLP tasks often involve understanding and processing the basic semantics of language. In practical applications, major NLP tasks include semantic similarity, text classification, and natural language inference. Natural language inference, in particular, involves reasoning about unknown information from existing text.
[0045] Natural Language Processing (NLP) can also be used in customer service conversations to automatically generate responses based on user text, thus enabling conversational functionality. Current conversation flows often focus on providing accurate and precise answers. However, in some scenarios, users may ask confidential questions or use manipulative tactics; automatically generated responses could potentially leak confidential information, leading to losses.
[0046] Based on this, the solution provided in this application is used to solve the problem of inaccurate detection of the confidentiality of the content involved in the text. It can help maintain a good conversational atmosphere with customers and achieve the purpose of avoiding clichés while ensuring that the generated response is not irrelevant. It can also help to deeply explore user needs.
[0047] To address the problems existing in the prior art, this application provides a confidentiality detection method. This method can be applied in dialogue scenarios to perform confidentiality detection on the text output by users participating in the dialogue, or it can be applied to perform confidentiality detection on the content of paragraphs or articles. Figure 1 As shown, the solutions provided in this application include:
[0048] S11: Obtain the text to be recognized.
[0049] The text to be recognized can be a single sentence or multiple sentences. For example, it can be the text output by a character participating in a dialogue in a dialogue application scenario.
[0050] Optionally, a standardization check can be performed on the text to be recognized to determine whether there are grammatical errors, formatting errors, etc. Errors in the text to be recognized can be corrected to obtain grammatically correct text, thus improving the accuracy of subsequent detection steps.
[0051] S12: Input the text to be recognized into the pre-trained intent recognition model to obtain predicted intent classification information.
[0052] The intent recognition model can be a model pre-trained with text samples and corresponding text intent classification labels. After the text to be recognized is input into the pre-trained intent recognition model, the intent recognition model performs intent recognition on the text to obtain the output predicted intent classification information. This predicted intent classification information can be in the form of intent labels, used to represent the intent expressed by the semantics of the text to be recognized.
[0053] The following explanation uses intent tags as an example to illustrate the predicted intent classification information. It should be understood that this intent classification information can also be displayed in other forms besides intent tags.
[0054] If the text to be recognized is "Hello, I have a loan, how can I repay it early?", this step inputs the text into a pre-trained intent recognition model. The intent recognition model then identifies the intent of the text and outputs intent classification information in the form of intent labels. In this example, the output intent classification information could specifically be "repay early".
[0055] For example, if the text to be recognized is "I want to repay the loan early.", after inputting the text to be recognized into a pre-trained intent recognition model, the intent classification information in the form of intent labels output by the model can specifically be "repay the loan early".
[0056] Based on the above examples, this step uses a pre-trained intent recognition model to identify the intent of the text to be recognized, thus obtaining the core intent expressed semantically in the text. In practical applications, the intent recognition model can be pre-trained based on a real-world application scenario. For example, if the application scenario is in the financial services field, dialogues during the financial services process can be used as training corpus. Intents related to financial services in the dialogue can be labeled, and the intent recognition model can be trained using the financial services dialogue and its corresponding financial services-related intent labels to obtain a pre-trained intent recognition model for application in the financial services field. In practical applications, this pre-trained intent recognition model can identify and output the financial services-related intents semantically expressed in the input text to be recognized. For example, specific financial services-related intent labels could be "borrowing money," "extending repayment," or "inquiring about loan information."
[0057] It should be understood that this solution is not limited to the financial services sector, but can also be applied to other sectors, such as medical services, pre-sales and after-sales services for online shopping, etc.
[0058] S13: Input the predicted intent classification information into the pre-trained confidentiality detection model to obtain the predicted confidentiality value.
[0059] The confidentiality detection model includes a first detection model, a second detection model, and a prediction module. The first detection model is used to detect keywords in the intent classification information to obtain predicted confidential keywords. The second detection model is used to detect confidentiality reasons in the intent classification information to obtain predicted confidentiality reason information. The prediction module is used to obtain a predicted confidentiality value based on the keyword confidentiality weight value corresponding to the predicted confidential keywords in the preset confidentiality value, and the reason confidentiality weight value corresponding to the predicted confidentiality reason information in the preset confidentiality value. The preset confidentiality value includes the reason confidentiality weight value corresponding to the confidentiality reason information and the keyword confidentiality weight value corresponding to the confidential keywords.
[0060] Specifically, the first detection model detects the intent classification information and identifies keywords involving confidential content within the intent classification information as predicted confidential keywords. Specifically, the first detection model can query keywords in the intent classification information from a pre-set confidential keyword database. If the database contains synonyms for keywords in the intent classification information, the retrieved keywords are identified as predicted confidential keywords. For example, suppose the intent classification information includes "repayment method" and "core technology." Through keyword detection by the first detection model, "core technology" is found to be confidential information, while "repayment method" is not. Therefore, the output predicted confidential keyword is "core technology."
[0061] The second detection model described above is used to detect confidentiality reasons for intent classification information, obtaining predicted confidentiality reason information. This predicted confidentiality reason information expresses the confidentiality reason for the classified information within the intent classification information. In practical applications, there can be various confidentiality reasons. For example, a confidentiality reason could be "core competitiveness," where leakage might reduce competitiveness. A confidentiality reason could be "user-set confidentiality," where information cannot be disclosed arbitrarily due to the user setting confidentiality. A confidentiality reason could also be "unreleased product," where information cannot be disclosed prematurely because the product has not yet been released, and so on.
[0062] The aforementioned preset confidentiality values include the confidentiality weight value corresponding to the reason for confidentiality and the confidentiality weight value corresponding to the keyword. These weight values can be preset according to actual needs, and the corresponding relationships can be predetermined. The reason confidentiality weight value and the keyword confidentiality weight value can be used to combine the confidentiality of the reason for confidentiality and the confidentiality of the keyword to comprehensively determine the predicted confidentiality value. In practical applications, both the reason confidentiality weight value and the keyword confidentiality weight value can be values greater than 0 and less than 1.
[0063] S14: Determine the confidentiality of the text to be identified based on the predicted confidentiality value.
[0064] The predicted confidentiality value indicates the degree of confidentiality required for the corresponding text to be identified. In this scheme, the predicted confidentiality value, determined comprehensively based on both the reasons for confidentiality and the confidential keywords, reflects the degree of confidentiality required for the corresponding text to be identified. Furthermore, in this step, the determined confidentiality level is used to express the confidentiality of the intent expressed by the text to be identified. Specifically, confidentiality can indicate the importance of the keywords in the intent expressed by the text to be identified as needing to be kept confidential, as well as the importance of the reasons for confidentiality.
[0065] In practical applications, this solution can determine that text intended to be identified possesses a certain degree of confidentiality if it expresses at least one of the following: confidential keywords or confidentiality reasons. For example, if the confidentiality level of the keywords in the text to be identified is high (i.e., the keyword confidentiality weight is large), but the confidentiality level of the confidentiality reason is low (i.e., the reason confidentiality weight is small), this solution can determine a non-zero predicted confidentiality value, and thus determine the confidentiality level of the text to be identified based on the magnitude of the predicted confidentiality value. Therefore, applying this solution in practical scenarios can accurately identify text intended to be identified that expresses confidential keywords or involves important confidentiality reasons, identifying classified text at the semantic level, improving the accuracy of identifying classified content from both keyword and confidentiality reason perspectives, and achieving accurate identification of texts that veilly inquire about classified content.
[0066] For example, the confidentiality of the text to be identified can be determined based on the correspondence between pre-defined confidentiality levels and predicted confidentiality values. Assuming the predicted confidentiality value is a value greater than 0 and less than 1, then a predicted confidentiality value greater than 0.8 indicates Level 1 confidentiality, a predicted confidentiality value greater than 0.2 and not greater than 0.8 indicates Level 2 confidentiality, a predicted confidentiality value greater than 0 and not greater than 0.2 indicates Level 3 confidentiality, and a predicted confidentiality value of 0 indicates no confidentiality.
[0067] Optionally, confidentiality judgment rules can be flexibly set according to actual application scenarios. Based on the predicted confidentiality value, the confidentiality of the text to be identified can also be determined by combining multiple factors such as the number of words, format, and keywords contained in the text.
[0068] This solution performs confidentiality detection on the text to be identified, recognizing its intent classification information. Based on this intent classification, a predicted confidentiality value is obtained, objectively expressing the confidentiality of the text as a value. This achieves accurate detection of the text's confidentiality, avoiding the problem of inaccurate judgment due to subjective bias. The confidentiality detection model includes a first detection model and a second detection model, which detect confidentiality keywords and reasons for confidentiality, respectively. The predicted confidentiality value of the text is then comprehensively determined based on a preset confidentiality value, improving the effectiveness of the predicted confidentiality value.
[0069] The aforementioned confidentiality detection model can be pre-trained using the following method for training confidentiality detection models. This example provides a training method for a confidentiality detection model, such as... Figure 2 As shown, it includes:
[0070] S21: Obtain multiple confidential data groups, wherein the confidential data groups include intent classification information and confidentiality reason information, confidentiality keywords and confidentiality values corresponding to the intent classification information, wherein the confidentiality values include the reason confidentiality weight value corresponding to the confidentiality reason information and the keyword confidentiality weight value corresponding to the confidentiality keywords, and the intent classification information is the output result of the intent recognition model recognizing the text.
[0071] The confidential data group described in this application embodiment can be pre-generated by manual annotation, or it can be automatically generated by collecting historical data and summarizing it. This confidential data group can be stored in a business confidentiality keyword library.
[0072] Confidential data sets can be stored in tables or other easily readable and writable formats. Each confidential data set must contain at least four pieces of information: intent classification information, reason for confidentiality information, confidentiality keywords, and confidentiality value.
[0073] Intent classification information is the output of the intent recognition model when it recognizes text. In other words, intent classification information is the training label used when training the intent recognition model. Alternatively, it can be the phrase or sentence generated after the intent classification information begins to semantically express the above output or training label.
[0074] The confidentiality reasons and keywords mentioned above all correspond to the intent classification information. The confidentiality value includes at least a reason confidentiality weight and a keyword confidentiality weight, which can be set in various ways. In this example, a higher confidentiality value indicates a higher level of confidentiality for the corresponding information and that the information involved is more important. For clarity, an example will be provided below.
[0075] Assume the confidential data group is as follows:
[0076]
[0077] In this context, "inquire about our company's core technology strategy" can be a prediction result obtained by the intent recognition model based on the user's input text, used to express the intent conveyed by the user's input text. In this example, the core technology strategy could be information such as the advanced technology content and technology development strategy applied to unreleased new products.
[0078] "Core technology strategy is our company's core competitiveness" can be pre-edited and generated manually, or it can be automatically generated based on historical data processing and summarization. The reason for confidentiality can be a phrase or sentence, readable, and used to express the reason why the corresponding categorized information is confidential.
[0079] "['Core Technology', 'Strategy']" represents the confidential keywords corresponding to the intent classification information, which contain multiple keywords. In practical applications, other key elements can also be expressed in other forms. Specifically, confidential keywords can be keywords contained within the corresponding intent classification information, or keywords output after semantic understanding processing of the corresponding intent classification information by a semantic model. The keywords in this confidential keyword are used to express the core content of the corresponding intent classification information. Generally, confidential keywords contain classified keywords.
[0080] In this example, the confidentiality value can be a value within the range [0,1]. This confidentiality value can be set in various ways, such as setting the weight w1 corresponding to the confidentiality reason, the initial confidentiality value of the confidentiality reason, the weight w2 corresponding to the confidentiality keyword, the initial confidentiality value of the confidentiality keyword, and the weight corresponding to the initial confidentiality value of the confidentiality keyword, etc. Taking the above example as an illustration, the confidentiality value 0.96 in this confidential data group = the weight w1 corresponding to the confidentiality reason information × the initial confidentiality value of "core technology strategy is our company's core competitiveness" + the weight w2 corresponding to the confidentiality keyword × (the initial confidentiality value corresponding to "core technology" × the weight w3 corresponding to the initial confidentiality value of "core technology" + the initial confidentiality value corresponding to "strategy" × the weight w4 corresponding to the initial confidentiality value of "strategy".
[0081] Specifically, the confidentiality weight corresponding to the reason for confidentiality information can be the product of the weight corresponding to the reason for confidentiality information and the initial confidentiality value corresponding to the reason for confidentiality information. Similarly, the confidentiality weight corresponding to the keyword can be the product of the weight corresponding to the keyword, the initial confidentiality value corresponding to the keyword, and the weight corresponding to the initial confidentiality value.
[0082] S22: Use the intent classification information in the confidential data group as the first training sample, and use the confidential keywords corresponding to the first training sample as the first training label to train the first detection model.
[0083] In this step, a first training sample and a corresponding first training label are generated based on the confidential data set. The first training sample is intent classification information, and the first training label is a confidential keyword belonging to the same confidential data set as the first training sample.
[0084] Optionally, the first training samples and the first training labels are input into a pre-trained language annotation model based on their correspondence to perform sequence annotation training, thereby obtaining the first detection model.
[0085] In this step, a pre-trained language model can be applied, such as using the BART (Bidirectional and Auto-Regressive Transformer) model for training, with the training task set as sequence labeling.
[0086] Based on the above example, the first training sample could be, for example, “inquire about our company’s core technology strategy”, and the corresponding first training label would be ['core technology', 'strategy'].
[0087] S23: Use the intent classification information in the confidential data group as the second training sample, and use the confidentiality reason information corresponding to the second training sample as the second training label to train the second detection model.
[0088] In this step, a second training sample and a corresponding second training label are generated based on the confidential data set. The second training sample is intent classification information, and the second training label is confidentiality reason information belonging to the same confidential data set as the second training sample.
[0089] Optionally, the second training samples and the second training labels are input into a pre-trained language classification model based on their correspondence to perform a classification task training, thereby obtaining the second detection model.
[0090] In this step, a pre-trained language model can be applied, such as using the BART model to perform training, and the model training task can be set as a classification task.
[0091] Based on the above example, the second training sample could be, for example, "inquire about our company's core technology strategy", and the corresponding second training label would be "core technology strategy is our company's core competitiveness".
[0092] Optionally, in practical applications, multiple confidential data groups can be split to obtain an equal amount of corpus for training the first detection model and corpus for training the second detection model. Then, the first detection model and the second detection model can be trained separately, so that the two detection models can be trained in parallel, which can help improve the training efficiency of the models.
[0093] S24: Construct a confidentiality detection model based on the first detection model and the second detection model. The confidentiality detection model is used to obtain a predicted confidentiality value based on the keyword confidentiality weight value corresponding to the predicted confidentiality keyword output by the first detection model and the reason confidentiality weight value corresponding to the predicted confidentiality reason information output by the second detection model.
[0094] After obtaining the trained first and second detection models, this step constructs a confidentiality detection model. Based on the above training, the first detection model can output predicted confidential keywords according to the input intent classification information, and the second detection model can output predicted confidentiality reasons according to the input intent classification information. The confidentiality detection model is used to comprehensively determine the predicted confidentiality value by combining the keyword confidentiality weight corresponding to the predicted confidentiality keyword and the reason confidentiality weight corresponding to the predicted confidentiality reason. Specifically, the keyword confidentiality weight and reason confidentiality weight can be obtained by searching for confidential keywords and reasons in the pre-stored confidentiality data set, respectively.
[0095] Optionally, the sum of the keyword confidentiality weight and the reason confidentiality weight can be directly determined as the predicted confidentiality value. Alternatively, the sum can be normalized and then determined as the predicted confidentiality value.
[0096] The solution provided in this application constructs a confidentiality detection model by training a first detection model for predicting confidential keywords and a second detection model for predicting confidentiality reason information, based on the correspondence between intent classification information, confidentiality reason information, confidential keywords, and confidentiality values in a confidential data set. The confidentiality detection model trained using this solution determines the predicted confidentiality value based on a weighted comprehensive analysis of confidential keywords and confidentiality reason information, thus improving the effectiveness of the predicted confidentiality value. Furthermore, the confidentiality weights objectively and accurately reflect the confidentiality involved in the text's intent in numerical form, avoiding the problem of inaccurate determination of the confidentiality level due to subjective bias.
[0097] Optionally, before acquiring multiple confidential data groups, the following steps may also be included:
[0098] The intention text and the corresponding intention classification information are obtained; and the intention text is used as a training sample, the corresponding intention classification information is used as a training label, and the pre-trained language model is input to perform classification task training to obtain an intention recognition model.
[0099] The intent text mentioned above can be the dialogue text output by the user participating in the dialogue scenario. This intent text can be a single sentence or multiple sentences.
[0100] In practical applications, historical dialogue text can be obtained and split into multiple intent texts.
[0101] Optionally, the intent text can be selected from the same user's output in the historical dialogue text.
[0102] Optionally, the historical dialogue text can be split first. The expression of the split text can then be modified to generate multiple intent texts with the same intent but different expressions. For example, suppose the split text includes "I want to repay early." In this step, the intent expressed by this statement can be translated, for example, to "How to repay early." Thus, two intent texts are generated based on one split text. Semantically, both intent texts express the meaning of "repay early."
[0103] Multiple intent texts can be manually annotated to generate corresponding intent classification information. For example, the intent classification information corresponding to "I want to repay early" and "How to repay early" is the same: "repay early".
[0104] Specifically, a pre-trained language model can be used to perform classification task training, such as the BART model. The trained intent recognition model can predict the expressed intent based on the input text.
[0105] In this scheme, the output of the intent recognition model can be connected with the input of the first detection model and the input of the second detection model, so that the output of the intent recognition model flows into the first detection model and the second detection model, thereby achieving confidentiality detection.
[0106] Based on the solutions provided in the above embodiments, optionally, such as Figure 3 As shown, after inputting the predicted intent classification information into the pre-trained confidentiality detection model to obtain the predicted confidentiality value, step S13 above further includes:
[0107] S31: Generate a response text that matches the text to be identified based on the predicted confidentiality value.
[0108] In dialogue applications, corresponding response texts are generated based on predicted confidentiality values, thus enabling automatic replies while avoiding the leakage of confidential information. Specifically, the method of generating response texts can be determined based on the magnitude of the predicted confidentiality value. If the predicted confidentiality value is high, indicating that the text content involves highly confidential information, processing can be transferred to a manual module. Alternatively, after generating multiple candidate response texts, a manual review process can be used to select the actual response text to be sent, further preventing the leakage of confidential information.
[0109] Based on the solutions provided in the above embodiments, optionally, such as Figure 4 As shown, step S31 above, which generates a response text matching the text to be identified based on the predicted confidentiality value, includes:
[0110] S41: If the predicted confidentiality value is less than or equal to the preset confidentiality value, query the pre-built knowledge base for the response text that matches the predicted intent classification information.
[0111] The aforementioned preset confidentiality value can be set in advance, automatically generated based on historical data, or dynamically adjusted according to the actual application scenario.
[0112] If the predicted confidentiality value is less than or equal to the preset confidentiality value, it indicates that the text to be identified is not confidential or contains very little confidential content. In this step, a query is performed based on the pre-built knowledge base to determine the response text that matches the predicted intent classification information.
[0113] In practical applications, if high confidentiality is required, the aforementioned preset confidentiality value can be set to 0. That is, when the text to be identified does not involve any confidential content, the corresponding response text is retrieved from the pre-built knowledge base.
[0114] Optionally, the knowledge base in this solution can store complete sentences as response text for intent classification information matching, so that they can be directly read and sent as response text when automatic reply is needed. Alternatively, the knowledge base can also store response keywords or phrases, so that sentences can be generated based on the retrieved keywords or phrases in actual applications and sent as response text.
[0115] S42: When the predicted confidentiality value is greater than the preset confidentiality value, the predicted intent classification information is filtered for confidentiality keywords according to the preset confidentiality keyword library to obtain non-confidential information in the predicted intent classification information, and a response text is generated according to the non-confidential information, wherein the confidentiality keyword library includes multiple confidentiality keywords.
[0116] If the predicted confidentiality value is greater than the preset confidentiality value, it indicates that the text to be identified is confidential. In order to avoid leakage of the response text, non-confidential information is filtered out from the predicted intent classification information, and response text is generated based on the non-confidential information to avoid confidential content, thereby achieving the effect of avoiding leakage of the response text.
[0117] Optionally, after generating the response text, the response text can be manually reviewed and sent as the response text after the review is passed, further reducing the risk of response text leakage.
[0118] Based on the solutions provided in the above embodiments, optionally, such as Figure 5 As shown, in step S42 above, confidential keywords are filtered from the predicted intent classification information according to a preset confidential keyword library to obtain non-confidential information in the predicted intent classification information, and a response text is generated based on the non-confidential information, including:
[0119] S51: The predicted intent classification information is segmented into words to obtain multiple intent segments.
[0120] In this step, a pre-trained word segmentation model can be used to perform word segmentation on the above-mentioned predicted intent classification information. Alternatively, multiple strings can be extracted from the predicted intent classification information by sliding a slider of a preset length, and the intent words can be selected by word filtering.
[0121] S52: Based on the confidential keyword library, perform confidential keyword filtering on the intent segmentation to obtain non-confidential intent segmentation that does not contain confidential keywords.
[0122] The aforementioned confidential keyword database can be manually edited or automatically generated based on historical data. Specifically, multiple intent segmentations obtained in the above steps can be searched within the confidential keyword database to determine if the database contains confidential keywords that are identical or semantically similar to the intent segmentation. If identical or semantically similar confidential keywords are found, it indicates that the intent segmentation is a classified term. Through filtering, non-confidential intent segmentations are retained as corpus for generating the response text.
[0123] S53: Generate response text based on the non-confidential intent segmentation.
[0124] In this step, complete sentences can be generated based on non-confidential intent segmentation to serve as response text. If there are few non-confidential intent segments, the content can be expanded based on pre-set topics to generate response text for topic shifting.
[0125] The solution provided in this application performs word segmentation on the predicted intent classification information and filters out non-confidential intent words to generate response text. This avoids confidential content and prevents response text leakage while avoiding irrelevant answers. In dialogue application scenarios, it is beneficial for generating defensive response text.
[0126] Based on the solutions provided in the above embodiments, optionally, such as Figure 6 As shown, step S53 above, which generates response text based on the non-confidential intent word segmentation, includes:
[0127] S61: When there are multiple non-confidential intent segments, perform pairwise correlation analysis on the multiple non-confidential intent segments to obtain the first correlation score between each non-confidential intent segment and other non-confidential segments.
[0128] In this embodiment, pairwise correlation analysis is performed on multiple non-confidential intent word segments. The purpose of this correlation analysis is to determine the core content of these non-confidential intent word segments. For any given non-confidential intent word segment, the average of its correlation scores with the other multiple word segments can be used as its first correlation score. This first correlation score indicates the relationship between the corresponding non-confidential intent word segment and the other multiple word segments; generally, a higher correlation score indicates that the corresponding non-confidential intent word segment better expresses the core content.
[0129] S62: Select a first preset number of target non-confidential word segments to generate response text, wherein the first relevance score of any selected target non-confidential word segment is greater than the first relevance score of any unselected non-confidential word segment.
[0130] In this step, each non-confidential intent segment can be sorted according to its first relevance score, and a first preset number of target non-confidential segmentations with higher first relevance scores can be selected based on the sorting results. The first preset number can be set according to actual needs, for example, it could be three. Alternatively, it can be flexibly adjusted according to the actual number of non-confidential intent segmentations; for instance, one-third of the total number of non-confidential intent segmentations can be rounded down to determine the first preset number.
[0131] The first preset number of target non-confidential words selected in this step can express the core content of the non-confidential content in the corresponding predicted intent classification information. Based on these target non-confidential words, a response text is generated, achieving "the answer is exactly what was asked" while avoiding confidential content, thus enabling an appropriate response in the dialogue.
[0132] Based on the solutions provided in the above embodiments, optionally, such as Figure 7 As shown, step S62 above, selecting a first preset number of target non-confidential word segments to generate response text, includes:
[0133] S71: Input the first preset number of target non-confidential word segments into the pre-trained first sentence generation model to obtain multiple candidate first response sentences.
[0134] In practical applications, the aforementioned first preset number of target non-confidential word segments can be input into a pre-trained first sentence generation model to generate a first response sentence, which can then be sent as the response text. In practice, the pre-trained first sentence generation model can be a model trained based on multiple words and their corresponding sentences, used to generate complete sentences from these words. Optionally, the first sentence generation model can generate various types of sentences, such as interrogative sentences, rhetorical questions, declarative sentences, and inverted sentences.
[0135] S72: Input the first response statement into the sentence type detection model to obtain the sentence type corresponding to the first response statement.
[0136] In this step, the sentence class detection model can be a classification model trained based on sentences and their corresponding sentence types. In this step, the multiple first response statements generated in the previous steps are input into the sentence class detection model, and the model outputs the sentence type corresponding to each first response statement.
[0137] S73: The first response statement with a sentence type of question is identified as the response text.
[0138] In this step, the first response statement is filtered based on sentence type, and the first response statement of the question type is selected as the response text. If there are multiple first response statements of the question type, further filtering can be performed based on other factors such as word count and semantic sentiment to select the optimal response text.
[0139] Among these, question-based responses are more likely to elicit a reply from the user compared to other response types, thus encouraging them to continue the conversation based on the content outlined in the response text. Furthermore, questions, compared to other types of statements, more naturally introduce new topics and facilitate topic shifts. Upon receiving a question-based response, the user is often drawn in by the question's content, thus avoiding discussing sensitive information. This allows the conversation to continue while simultaneously avoiding sensitive topics, ensuring the response is relevant and maintaining a positive conversational atmosphere with the client, thus preventing clichés.
[0140] Based on the solutions provided in the above embodiments, optionally, such as Figure 8 As shown, step S53 above, which involves generating the response text based on the non-confidential intent through word segmentation, includes:
[0141] S81: Perform a correlation analysis between the non-confidential intent segmentation and the business keywords in the pre-built business keyword library to obtain a second correlation score between the non-confidential intent segmentation and the business keyword library.
[0142] Based on the non-confidential intent segmentation selected in the above examples, this example performs extended analysis on the non-confidential intent segmentation using a pre-built business keyword library. The business keyword library can be pre-generated manually or automatically generated based on historical data. The business keywords in the library can be selected according to the actual application scenario; for example, business keywords can include terms related to businesses under development, terms related to unrealized or yet-to-be-discovered business needs, and terms related to businesses requiring statistical analysis.
[0143] The second relevance score obtained through the relevance analysis in this step can express the degree of relevance between the non-confidential intent segment and the business keywords. Optionally, for any non-confidential intent segment, the relevance score between the non-confidential intent segment and multiple business keywords can be determined. Then, the average of the determined multiple relevance scores can be determined as the second relevance score, or the largest relevance score among the multiple relevance scores can be determined as the second relevance score.
[0144] S82: Select a second preset number of target non-confidential word segments to generate response text, wherein the second relevance score of any selected target non-confidential word segment is greater than the second relevance score of any unselected non-confidential word segment.
[0145] The second relevance score determined through the above steps can express the degree of association between the corresponding non-confidential intent segment and the business keyword library. In this step, a second preset number of non-confidential intent segmentations with larger values are used as the corpus for generating the response text.
[0146] Specifically, each non-confidential intent word segment can be sorted according to its second relevance score, and a second preset number of target non-confidential words with higher second relevance scores can be selected based on the sorting results. The second preset number can be set according to actual needs or flexibly adjusted according to the actual number of non-confidential intent words.
[0147] The second preset number of target non-confidential words selected in this step can express the core content related to the business keywords to be mined in non-confidential content. Generating response text based on these target non-confidential words can achieve "the answer is the question" while avoiding confidential content, thus generating appropriate response text and playing a role in demand mining to a certain extent.
[0148] Based on the solutions provided in the above embodiments, optionally, such as Figure 9 As shown, in step S82 above, selecting a second preset number of target non-confidential word segments to generate response text includes:
[0149] S91: Input the second preset number of target business keywords into the pre-trained second statement generation model to obtain multiple candidate second response statements.
[0150] In practical applications, the aforementioned second preset number of target non-confidential word segments can be input into a pre-trained second sentence generation model to generate a second response sentence, which can then be sent as the response text. In practical applications, the pre-trained second sentence generation model can be a model trained based on multiple words and their corresponding sentences, used to generate complete sentences from these words. Optionally, the second sentence generation model can generate various types of sentences, such as interrogative sentences, rhetorical questions, declarative sentences, and inverted sentences. The second sentence generation model can be the same as the first sentence generation model in the above example.
[0151] S92: Input the second response statement into the sentence type detection model to obtain the sentence type corresponding to the second response statement.
[0152] In this step, the sentence class detection model can be a classification model trained based on sentences and their corresponding sentence types. In this step, the multiple second response statements generated in the previous steps are input into the sentence class detection model, and the output is the sentence type corresponding to each second response statement.
[0153] S93: The second response statement with the sentence type of question is identified as the response text.
[0154] In this step, the second response statements are filtered based on sentence type, with question-type second response statements selected as the response text. Questions guide users to answer, thus facilitating the discovery of user needs and obtaining the required information. If there are multiple question-type second response statements, further filtering can be performed based on other factors such as word count and semantic sentiment to select the optimal response text.
[0155] Among these, question-based responses are more likely to elicit answers from users compared to other response types, thus encouraging them to continue the conversation based on the content outlined in the response text. Furthermore, questions, compared to other types of statements, more naturally introduce new topics and facilitate topic shifts. Upon receiving a question-based response, users are often drawn in by the question's content, thus avoiding discussing confidential information. This allows the conversation to continue while simultaneously avoiding sensitive topics, ensuring that the response is relevant and maintaining a positive conversational atmosphere. It also helps to uncover customer needs and enrich product features or selling points. This solution, therefore, effectively prevents leaks and protects confidential information while simultaneously uncovering customer needs.
[0156] To address the problems existing in the prior art, this application provides a confidentiality detection device 100, such as... Figure 10 As shown, it includes:
[0157] Module 101 acquires the text to be recognized;
[0158] The first input module 102 inputs the text to be recognized into a pre-trained intent recognition model to obtain predicted intent classification information;
[0159] The second input module 103 inputs the predicted intent classification information into the pre-trained confidentiality detection model to obtain the predicted confidentiality value;
[0160] The determination module 104 determines the confidentiality of the text to be identified based on the predicted confidentiality value;
[0161] The confidentiality detection model includes a first detection model, a second detection model, and a prediction module. The first detection model is used to perform keyword detection on the intent classification information to obtain predicted confidential keywords. The second detection model is used to perform confidentiality reason detection on the intent classification information to obtain predicted confidentiality reason information. The prediction module is used to obtain the predicted confidentiality value based on the keyword confidentiality weight value corresponding to the predicted confidential keywords in the preset confidentiality value, and the reason confidentiality weight value corresponding to the predicted confidentiality reason information in the preset confidentiality value. The preset confidentiality value includes the reason confidentiality weight value corresponding to the confidentiality reason information and the keyword confidentiality weight value corresponding to the confidential keywords.
[0162] The apparatus provided in this application first acquires the text to be recognized; then, it inputs the text to be recognized into a pre-trained intent recognition model to obtain predicted intent classification information; next, it inputs the predicted intent classification information into a pre-trained confidentiality detection model to obtain a predicted confidentiality value; finally, it determines the confidentiality of the text to be recognized based on the predicted confidentiality value. The confidentiality detection model includes a first detection model, a second detection model, and a prediction module. The first detection model performs keyword detection on the intent classification information to obtain predicted confidentiality keywords. The second detection model performs confidentiality reason detection on the intent classification information to obtain predicted confidentiality reason information. The prediction module obtains the predicted confidentiality value based on the keyword confidentiality weight value corresponding to the predicted confidentiality keywords in the preset confidentiality value, and the reason confidentiality weight value corresponding to the predicted confidentiality reason information in the preset confidentiality value. The preset confidentiality value includes the reason confidentiality weight value corresponding to the confidentiality reason information and the keyword confidentiality weight value corresponding to the confidentiality keywords. This solution performs confidentiality detection on the text to be identified, recognizing its intent classification information. Based on this intent classification, a predicted confidentiality value is obtained, objectively expressing the confidentiality of the text as a value. This achieves accurate detection of the text's confidentiality, avoiding the problem of inaccurate judgment due to subjective bias. The confidentiality detection model includes a first detection model and a second detection model, which detect confidentiality keywords and reasons for confidentiality, respectively. The predicted confidentiality value of the text is then comprehensively determined based on a preset confidentiality value, improving the effectiveness of the predicted confidentiality value.
[0163] In this application, the modules in the apparatus provided can also implement the method steps provided in the above-described confidentiality detection method embodiments. Alternatively, the apparatus provided in this application may include other modules besides those described above to implement the method steps provided in the above-described method embodiments. Furthermore, the apparatus provided in this application can achieve the technical effects achievable by the above-described method embodiments.
[0164] To address the problems existing in the prior art, embodiments of this application provide a training device 110 for a confidentiality detection model, such as... Figure 11 As shown, it includes:
[0165] The acquisition module 111 acquires multiple confidential data groups. The confidential data groups include intent classification information and confidentiality reason information, confidentiality keywords, and confidentiality values corresponding to the intent classification information. The confidentiality values include the reason confidentiality weight value corresponding to the confidentiality reason information and the keyword confidentiality weight value corresponding to the confidentiality keywords. The intent classification information is the output result of the intent recognition model recognizing the text.
[0166] The first training module 112 uses the intent classification information in the confidential data group as the first training sample and the confidential keyword corresponding to the first training sample as the first training label to train the first detection model.
[0167] The second training module 113 uses the intent classification information in the confidential data group as the second training sample and the confidentiality reason information corresponding to the second training sample as the second training label to train the second detection model.
[0168] The construction module 114 constructs a confidentiality detection model based on the first detection model and the second detection model. The confidentiality detection model is used to obtain a predicted confidentiality value based on the keyword confidentiality weight value corresponding to the predicted confidentiality keyword output by the first detection model and the reason confidentiality weight value corresponding to the predicted confidentiality reason information output by the second detection model.
[0169] The apparatus provided in this application can train a first detection model for predicting confidential keywords and a second detection model for predicting confidentiality reasons based on the correspondence between intent classification information, confidentiality reason information, confidential keywords, and confidentiality values in a confidential data set, thereby constructing a confidentiality detection model. The confidentiality detection model trained and constructed using this scheme determines the predicted confidentiality value based on a weighted comprehensive analysis of confidential keywords and confidentiality reason information, improving the effectiveness of the predicted confidentiality value. Furthermore, the confidentiality weights can objectively and accurately reflect the confidentiality involved in the text's intent in numerical form, avoiding the problem of inaccurate determination of the confidentiality level due to subjective bias.
[0170] In this application, the modules in the apparatus provided can also implement the method steps provided in the above-described method for training the confidentiality detection model. Alternatively, the apparatus provided in this application may include other modules besides those described above to implement the method steps provided in the above-described method embodiments. Furthermore, the apparatus provided in this application can achieve the technical effects achievable by the above-described method embodiments.
[0171] Figure 12 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this specification. Please refer to it. Figure 12 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0172] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 12 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0173] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0174] The processor reads the corresponding computer program from non-volatile memory into memory and then runs it, forming a text classification model training device at the logical level. The processor executes the program stored in memory and is specifically used to execute the confidentiality detection method or confidentiality detection model training method described in any of the above embodiments.
[0175] The confidentiality detection method or confidentiality detection model training method described in any of the above embodiments can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in one or more embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in one or more embodiments of this specification can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0176] The electronic device can also perform the confidentiality detection method or confidentiality detection model training method described in any of the embodiments, which will not be repeated here.
[0177] Of course, in addition to software implementation, the electronic device described in this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0178] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the above-described confidentiality detection method or confidentiality detection model training method embodiments, and achieves the same technical effect. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0179] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0180] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0181] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0182] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0183] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0184] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0185] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0186] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0187] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0188] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method of detecting privacy comprising: include: Obtain the text to be recognized; The text to be identified is input into a pre-trained intent recognition model to obtain predicted intent classification information, which is used to represent the intent expressed by the semantics of the text to be identified. The predicted intent classification information is input into a pre-trained confidentiality detection model to obtain the predicted confidentiality value; The confidentiality of the text to be identified is determined based on the predicted confidentiality value; The confidentiality detection model includes a first detection model, a second detection model, and a prediction module. The first detection model is used to perform keyword detection on the intent classification information to obtain predicted confidential keywords. The second detection model is used to perform confidentiality reason detection on the intent classification information to obtain predicted confidentiality reason information. The prediction module is used to obtain the predicted confidentiality value based on the keyword confidentiality weight value corresponding to the predicted confidential keywords in the preset confidentiality value, and the reason confidentiality weight value corresponding to the predicted confidentiality reason information in the preset confidentiality value. The preset confidentiality value includes the reason confidentiality weight value corresponding to the confidentiality reason information and the keyword confidentiality weight value corresponding to the confidential keywords.
2. The method of claim 1, wherein, After inputting the predicted intent classification information into a pre-trained confidentiality detection model to obtain the predicted confidentiality value, the method further includes: A response text matching the text to be identified is generated based on the predicted confidentiality value.
3. The method of claim 2, wherein, Generate a response text that matches the text to be identified based on the predicted confidentiality value, including: If the predicted confidentiality value is less than or equal to the preset confidentiality value, query the pre-built knowledge base for the response text that matches the predicted intent classification information; If the predicted confidentiality value is greater than the preset confidentiality value, the predicted intent classification information is filtered for confidential keywords according to the preset confidentiality keyword library to obtain non-confidential information in the predicted intent classification information, and a response text is generated based on the non-confidential information. The confidentiality keyword library includes multiple confidential keywords.
4. The method of claim 3, wherein, The predicted intent classification information is filtered for confidential keywords based on a preset confidential keyword library to obtain non-confidential information from the predicted intent classification information, and a response text is generated based on the non-confidential information, including: The predicted intent classification information is segmented into words to obtain multiple intent words; Based on the confidential keyword library, the intent segmentation is filtered for confidential keywords to obtain non-confidential intent segmentation that does not contain confidential keywords. The response text is generated based on the non-confidential intent segmentation.
5. The method of claim 4, wherein, Generate response text based on the non-confidential intent word segmentation, including: When there are multiple non-confidential intent words, perform pairwise correlation analysis on the multiple non-confidential intent words to obtain the first correlation score between each non-confidential intent word and other non-confidential words; Select a first preset number of target non-confidential words to generate response text, wherein the first relevance score of any selected target non-confidential word is greater than the first relevance score of any unselected non-confidential word.
6. The method of claim 5, wherein, Select a first preset number of target non-confidential word segmentation to generate response text, including: Input the first preset number of target non-confidential word segments into the pre-trained first sentence generation model to obtain multiple candidate first response sentences; The first response statement is input into the sentence type detection model to obtain the sentence type corresponding to the first response statement; The first response statement with a sentence type of question is identified as the response text.
7. The method of claim 4, wherein, The step of generating the response text based on the non-confidential intent word segmentation includes: Perform a correlation analysis between the non-confidential intent word segmentation and the business keywords in the pre-built business keyword library to obtain a second correlation score between the non-confidential intent word segmentation and the business keyword library. Select a second preset number of target non-confidential words to generate response text, wherein the second relevance score of any selected target non-confidential word is greater than the second relevance score of any unselected non-confidential word.
8. The method of claim 7, wherein, Select a second preset number of target non-confidential word segments to generate response text, including: The second preset number of target non-confidential word segments are input into the pre-trained second sentence generation model to obtain multiple candidate second response sentences; The second response statement is input into the sentence type detection model to obtain the sentence type corresponding to the second response statement; The second response statement, which is a question, is identified as the response text. 9.A method for training a privacy detection model, the method comprising: include: Multiple confidential data groups are acquired. Each confidential data group includes intent classification information and confidentiality reason information, confidentiality keywords, and confidentiality values corresponding to the intent classification information. The confidentiality values include the reason confidentiality weight value corresponding to the confidentiality reason information and the keyword confidentiality weight value corresponding to the confidentiality keywords. The intent classification information is the output result of the intent recognition model recognizing the text. The intent classification information is used to represent the intent expressed by the semantics of the text. The intent classification information in the confidential data group is used as the first training sample, and the confidential keywords corresponding to the first training sample are used as the first training labels to train the first detection model. The intent classification information in the confidential data group is used as the second training sample, and the confidentiality reason information corresponding to the second training sample is used as the second training label to train the second detection model. A confidentiality detection model is constructed based on the first detection model and the second detection model. The confidentiality detection model is used to obtain a predicted confidentiality value based on the keyword confidentiality weight value corresponding to the predicted confidentiality keyword output by the first detection model and the reason confidentiality weight value corresponding to the predicted confidentiality reason information output by the second detection model.
10. A privacy detection apparatus, characterized by comprising: include: The acquisition module acquires the text to be recognized; The first input module inputs the text to be recognized into a pre-trained intent recognition model to obtain predicted intent classification information, which is used to represent the intent expressed by the semantics of the text to be recognized. The second input module inputs the predicted intent classification information into a pre-trained confidentiality detection model to obtain the predicted confidentiality value; The determination module determines the confidentiality of the text to be identified based on the predicted confidentiality value; The confidentiality detection model includes a first detection model, a second detection model, and a prediction module. The first detection model is used to perform keyword detection on the intent classification information to obtain predicted confidential keywords. The second detection model is used to perform confidentiality reason detection on the intent classification information to obtain predicted confidentiality reason information. The prediction module is used to obtain the predicted confidentiality value based on the keyword confidentiality weight value corresponding to the predicted confidential keywords in the preset confidentiality value, and the reason confidentiality weight value corresponding to the predicted confidentiality reason information in the preset confidentiality value. The preset confidentiality value includes the reason confidentiality weight value corresponding to the confidentiality reason information and the keyword confidentiality weight value corresponding to the confidential keywords.
11. An electronic device, comprising: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Sample recognition model training method and malicious sample extraction method and device
CN111343203A
Knowledge base-based text geographic information security check method and system
CN115934871A
