Processing method and device of discriminator model for knowledge editing
By building a discriminant model for knowledge compliance, consistency and editing strategies, the problems of existing knowledge editors in terms of compliance, consistency and user experience are solved, and more efficient data compliance verification and Consistency guarantee improves user experience.
Patent Information
- Application Number
- CN202411510406.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-10-28
AI Technical Summary
The existing knowledge editor has flaws in compliance, consistency, and user experience, and cannot effectively solve the compliance and consistency problems of knowledge entries in the knowledge base, and has a poor user experience.
A discriminator model for knowledge editing was designed. By constructing three types of discriminant models for knowledge compliance, consistency and editing strategies, it is trained based on user behavior data, and provides compliance verification, consistency verification and Editorial strategy recommendations to improve the editor's compliance and consistency guarantee capabilities.
It improves the data compliance verification and consistency guarantee capabilities of customized editors, and improves the user's experience of the editor.
Smart Images

Figure CN119250180A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a processing method and device for a discriminator model for knowledge editing. Background Art
[0002] Large Language Models (LLMs) are widely used in a variety of natural language processing (NLP) tasks, such as translation tasks, question-answering tasks, etc. In order to improve the generalization, prediction accuracy, and prediction timeliness of large language models, it is often necessary to configure a knowledge base for context reference / prompt information query.
[0003] This type of knowledge base is usually composed of multiple knowledge items, and the data elements of each knowledge item can be roughly divided into two categories: 1) triple elements (s, r, o), which are fixedly composed of knowledge subject (subject), subject-object relationship (relation), and knowledge object (object); 2) additional feature elements; they can be customized in a diversified manner according to actual application needs, and usually include items such as item identification, creation / update time, knowledge weight, knowledge domain category, etc. This type of knowledge base will also define corresponding knowledge structure rules to standardize the data types of all elements (such as integer data type, floating point data type, character data type, time data type, etc.).
[0004] The editing tool that performs knowledge editing on this type of knowledge base is called a knowledge editor. Conventional knowledge editors should provide at least three basic editing functions: query, add, and modify: 1) When processing knowledge query tasks, the editor queries the knowledge base for matching knowledge entries based on the query text entered by the user side (such as individual users, other models, other tools, etc.); 2) When processing knowledge addition tasks, the editor adds knowledge entries to the knowledge base based on the knowledge text entered by the user side; 3) When processing knowledge modification tasks, the editor updates the entry content of the knowledge base based on the updated knowledge text entered by the user side. And when processing any type of editing task, the editor should preferably provide users with a variety of knowledge editing strategies / methods (such as graph structure editing methods, list structure editing methods, configuration structure editing methods, etc.) for selection.
[0005] Currently, there is no universal editor with complete functions on the market. Most LLMs model users need to customize and develop a private knowledge editor based on the characteristics of their own knowledge base. However, due to the limitations of developers' technical experience, such customized editors have more or less some problems: 1) Compliance issues: Some editors do not perform compliance checks on knowledge items, resulting in the knowledge items in the library not meeting the corresponding knowledge structure rules; 2) Consistency issues: Some editors only add / update the current item when adding / updating knowledge, and do not update the content of other items in the library that are similar or synonymous with the current item, resulting in inconsistent knowledge content of similar / synonymous items in the library; 3) User experience issues: Most customized editors do not actively recommend adaptive knowledge editing strategies based on user behavior habits, which also needs to be improved from the perspective of user experience.
[0006] In order to help custom developers improve editor performance, the present invention has trained three types of discriminant models (knowledge compliance discriminant model, knowledge consistency discriminant model, knowledge editing strategy discriminant model) based on a benchmark discriminator model structure. By applying these three types of discriminant models, developers can better solve or improve the compliance problems, consistency problems and user experience problems mentioned above. Summary of the invention
[0007] The purpose of the present invention is to provide a processing method, device, electronic device and computer-readable storage medium for a discriminator model for knowledge editing in view of the defects of the prior art. The present invention constructs a data set for training knowledge compliance verification tasks and a data set for training knowledge consistency verification tasks based on the target knowledge base, which are recorded as the first and second data sets; and the knowledge editor corresponding to the target knowledge base is recorded as the corresponding target editor, and the user behavior data of all users using the target editor are continuously tracked and the first user historical behavior data sequence corresponding to each user is refreshed based on the tracking results, and when all the first user historical behavior data sequences obtained can cover all knowledge domain categories of the target knowledge base and all knowledge editing strategies of the target editor, a data set for training knowledge editing strategy identification tasks is constructed based on all the first user historical behavior data sequences obtained and recorded as the corresponding third data set; and a benchmark discriminator model is designed, and then the benchmark discriminator model is trained based on the first, second and third data sets to obtain the corresponding knowledge compliance discriminant model, knowledge consistency discriminant model and knowledge editing strategy discriminant model; then, when any user uses the target editor to process the knowledge adding task, the knowledge items added at that time are identified. The target information is used as the corresponding current knowledge item, and a compliance check is performed based on the current knowledge item and the knowledge compliance discrimination model to obtain the corresponding test result, which is fed back to the target editor; and when any user uses the target editor to process a knowledge addition or modification task, the knowledge item information added or modified at that time is used as the corresponding current knowledge item, and a synonym item query is performed on the target knowledge base based on the current knowledge item to obtain the corresponding synonym item sequence, and when the synonym item sequence is not empty, a consistency check is performed based on the current knowledge item, the synonym item sequence and the knowledge consistency discrimination model to obtain the corresponding test result, which is fed back to the target editor; and when any user uses the target editor to complete a knowledge query and selects a knowledge item obtained by the query, the currently selected knowledge item information is used as the corresponding current knowledge item, and the first user historical behavior data sequence corresponding to the current user is used as the corresponding current user historical behavior data sequence, and an editing strategy recommendation process is performed based on the current knowledge item, the current user historical behavior data sequence and the knowledge editing strategy discrimination model to obtain the corresponding recommendation strategy, which is fed back to the target editor. Developers of custom editors can better solve or improve the compliance problems, consistency problems and user experience problems existing in conventional custom editors by using the three types of discrimination models (knowledge compliance discrimination model, knowledge consistency discrimination model, and knowledge editing strategy discrimination model) provided by the present invention; the present invention can not only improve the data compliance verification capability and data consistency assurance capability of the custom editor, but also improve the user experience of the custom editor.
[0008] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present invention provides a method for processing a discriminator model for knowledge editing, the method comprising:
[0009] Based on the preset target knowledge base, a data set for training the knowledge compliance verification task is constructed and recorded as the corresponding first data set; and based on the target knowledge base, a data set for training the knowledge consistency verification task is constructed and recorded as the corresponding second data set; and the knowledge editor corresponding to the target knowledge base is recorded as the corresponding target editor; and the user behavior data of all users using the target editor is continuously tracked and the first user historical behavior data sequence corresponding to each user is refreshed based on the tracking results; and when all the first user historical behavior data sequences obtained can cover all knowledge domain categories of the target knowledge base and all knowledge editing strategies of the target editor, a data set for training the knowledge editing strategy identification task is constructed based on all the first user historical behavior data sequences obtained and recorded as the corresponding third data set;
[0010] Design a benchmark discriminator model; and train the benchmark discriminator model based on the first data set to obtain a corresponding knowledge compliance discriminant model; and train the benchmark discriminator model based on the second data set to obtain a corresponding knowledge consistency discriminant model; and train the benchmark discriminator model based on the third data set to obtain a corresponding knowledge editing strategy discriminant model;
[0011] When any user uses the target editor to process a knowledge adding task, the knowledge item information added at that time is used as the corresponding current knowledge item; and a compliance check is performed based on the current knowledge item and the knowledge compliance discrimination model to obtain a corresponding first check result and feed it back to the target editor;
[0012] When any user uses the target editor to process a knowledge addition or modification task, the knowledge item information added or modified at that time is used as the corresponding current knowledge item; and based on the current knowledge item, a synonym item query is performed on the target knowledge base to obtain a corresponding synonym item sequence; and when the synonym item sequence is not empty, a consistency check is performed based on the current knowledge item, the synonym item sequence and the knowledge consistency judgment model to obtain a corresponding second check result and feed it back to the target editor;
[0013] When any user uses the target editor to complete a knowledge query and selects a knowledge item obtained by the query, the currently selected knowledge item information is used as the corresponding current knowledge item; and the first user historical behavior data sequence corresponding to the current user is used as the corresponding current user historical behavior data sequence; and based on the current knowledge item, the current user historical behavior data sequence and the knowledge editing strategy discrimination model, editing strategy recommendation processing is performed to obtain the corresponding strategy recommendation result and feedback to the target editor.
[0014] Preferably, the target knowledge base includes a plurality of first knowledge items; the data elements of the first knowledge items at least include a first item identifier, a first creation / update time, a first triple element, a first knowledge weight and a first knowledge domain category; the first triple element includes a first knowledge subject, a first subject-object relationship and a first knowledge object; the knowledge structure rules corresponding to the target knowledge base include a plurality of knowledge structure constraints; each of the knowledge structure constraints is used to constrain the data format or data type of a class of data elements of a knowledge item;
[0015] The first data set includes a plurality of first data records; the first data record includes a first training sequence and a first label vector; the first training sequence is a text sequence, which is sequentially spliced by a first training knowledge subject, the first separator, a first training subject-object relationship, the first separator and a first training knowledge object; the first label vector is composed of a plurality of first label probabilities, and the first label probabilities correspond one-to-one to the knowledge structure constraints; if the first training sequence satisfies a constraint condition of a certain knowledge structure constraint, the first label probability corresponding to the current knowledge structure constraint in the first label vector is 1; if the first training sequence does not satisfy a constraint condition of a certain knowledge structure constraint, the first label probability corresponding to the current knowledge structure constraint in the first label vector is 0;
[0016] The second data set includes a plurality of second data records; the second data records include a second training sequence and a second label vector; the second training sequence is formed by sorting a plurality of first training item element groups; the first item training element group includes a first item object and a first item knowledge domain category; the second label vector is composed of a plurality of second label probabilities, and the second label probabilities correspond to the first training item element groups one by one; if the content of one of the first training item element groups in the second training sequence is consistent with the content of all other first training item element groups, the corresponding second label probability is 1; if the content of one of the first training item element groups in the second training sequence is not consistent with the content of any other first training item element groups, the corresponding second label probability is 0;
[0017] The third data set includes multiple third data records; the third data record includes a third training sequence and a third label vector; the third training sequence is formed by sorting multiple first training behavior data in chronological order; the first training behavior data includes a first training knowledge domain selection and a first training editing strategy selection; the first training knowledge domain selection includes multiple categories of the knowledge domain categories, and the first training editing strategy selection includes multiple categories of the knowledge editing strategies; the third label vector is composed of multiple third label probabilities, each of which corresponds to a domain + strategy combination consisting of a class of the knowledge domain category and a class of the knowledge editing strategy; the value of the third label probability is 0 or 1, and there is only one third label probability of 1 in the third label vector; the third data set should cover all the knowledge domain categories of the target knowledge base and all the knowledge editing strategies of the target editor;
[0018] The first user historical behavior data sequence is composed of multiple first user historical behavior data sorted in chronological order; the first user historical behavior data includes a first user knowledge field selection and a first user editing strategy selection; the first user knowledge field selection includes multiple categories of the knowledge field categories, and the first user editing strategy selection includes multiple categories of the knowledge editing strategies.
[0019] Preferably, the benchmark discriminator model is used to perform classification discrimination processing according to the model input sequence and output the corresponding classification discrimination vector; the discrimination prediction vector is composed of multiple classification discrimination probabilities, and each classification discrimination probability corresponds to a discrimination type; the benchmark discriminator model includes a coding layer, a linear attention layer, a pooling layer, a fully connected network and a Softmax layer; the coding layer is implemented based on the Encoder model structure of the Transformer architecture; the input end of the coding layer is connected to the model input end, and the output end is connected to the input end of the linear attention layer; the output end of the linear attention layer is connected to the input end of the pooling layer; the output end of the pooling layer is connected to the input end of the fully connected network; the output end of the fully connected network is connected to the input end of the Softmax layer; the output end of the Softmax layer is connected to the output end of the model;
[0020] The knowledge compliance discrimination model is used to perform corresponding compliance classification discrimination processing on a type of input sequence input to the model and output a corresponding compliance classification discrimination vector; the type of input sequence is a text sequence, which is sequentially spliced by a knowledge subject, a first separator, a subject-object relationship, the first separator and a knowledge object; the first separator is a preset single character; the compliance classification discrimination vector is composed of multiple compliance classification discrimination probabilities; the compliance classification discrimination probabilities correspond one-to-one to the knowledge structure constraints;
[0021] The knowledge consistency discrimination model is used to perform corresponding consistency classification discrimination processing on the two-category input sequence of the model input and output a corresponding consistency classification discrimination vector; the two-category input sequence is formed by sorting a plurality of item element groups; the item element groups include item objects and item knowledge domain categories; the consistency classification discrimination vector is composed of a plurality of consistency classification discrimination probabilities; the consistency classification discrimination probabilities correspond one-to-one to the item element groups;
[0022] The knowledge editing strategy discrimination model is used to perform corresponding editing strategy classification and discrimination processing on the three types of input sequences input to the model and output corresponding domain strategy classification discrimination vectors; the three types of input sequences are composed of multiple historical behavior data of the same user sorted in chronological order; the historical behavior data include knowledge domain selection and editing strategy selection; the knowledge domain selection includes multiple types of knowledge domain categories, and the editing strategy selection includes multiple types of knowledge editing strategies; the domain strategy classification discrimination vector is composed of multiple domain strategy classification discrimination probabilities, each of the domain strategy classification discrimination probability corresponds to a domain + strategy combination composed of a class of the knowledge domain category and a class of the knowledge editing strategy; the total number of the domain strategy classification discrimination probabilities is consistent with the total number of combinations of the domain + strategy combinations of the target knowledge base and the target editor.
[0023] Preferably, the data set for knowledge compliance verification task training based on the preset target knowledge base is constructed as the corresponding first data set, which specifically includes:
[0024] Extract all the first knowledge items in the target knowledge base that satisfy the knowledge structure rule to form a corresponding first item set;
[0025] and performing a round of traversal on all the first knowledge items of the first item set; and in this round of traversal, taking the first knowledge item currently traversed as the corresponding current knowledge item; and performing a first positive sample record generation process based on the current knowledge item to obtain a corresponding first data record; and performing a first negative sample record generation process based on the current knowledge item to obtain a corresponding first data record; and at the end of this round of traversal, all the first data records obtained form the corresponding first data set;
[0026] in,
[0027] The first positive sample record generation process based on the current knowledge entry is performed to obtain a corresponding first data record, specifically: the first knowledge subject, the first subject-object relationship and the first knowledge object of the first triple element of the current knowledge entry are extracted as the corresponding first training knowledge subject, the first training subject-object relationship and the first training knowledge object; and the first training knowledge subject, the first separator, the first training subject-object relationship, the first separator and the first training knowledge object are sequentially spliced and the obtained spliced text sequence is used as the corresponding first training sequence; and a numerical vector with all vector data being 1 is constructed as the corresponding first label vector with the total number of the knowledge structure constraints of the knowledge structure rule as the vector length; and a corresponding first data record is composed of the first training sequence and the first label vector corresponding to the current knowledge entry;
[0028] The first negative sample record generation process based on the current knowledge entry obtains a corresponding first data record, specifically: extracting the first knowledge subject, the first subject-object relationship and the first knowledge object of the first triple element of the current knowledge entry as the corresponding first training knowledge subject, the first training subject-object relationship and the first training knowledge object; and randomly modifying the obtained first training knowledge subject and / or the first training subject-object relationship and / or the first training knowledge object in a violation modification manner that violates the knowledge structure rule; and after completing this violation modification, modifying each constraint condition in the knowledge structure rule that is caused by this violation modification to fail The satisfied knowledge structure constraints are recorded as corresponding violation constraints; and the latest first training knowledge subject, the first separator, the latest first training subject-object relationship, the first separator and the latest first training knowledge object are sequentially spliced and the obtained spliced text sequence is used as the corresponding first training sequence; and a numerical vector with all vector data being 1 is constructed with the total number of the knowledge structure constraints of the knowledge structure rules as the vector length as the corresponding first label vector; and the vector data corresponding to each violation constraint in the current first label vector is reset to 0; and the first training sequence and the first label vector finally obtained form a corresponding first data record.
[0029] Preferably, the data set for training the knowledge consistency verification task based on the target knowledge base is constructed as the corresponding second data set, which specifically includes:
[0030] Extract a group of the first knowledge items in the target knowledge base, whose first knowledge subjects are synonyms to each other, whose first subject-object relationships are synonyms to each other, whose contents of the first knowledge objects are consistent, and whose contents of the first knowledge domain categories are consistent, to form a corresponding first synonymous item sequence; and form a corresponding first sequence set from all the obtained first synonymous item sequences;
[0031] and performing a round of traversal on all the first synonymous item sequences of the first sequence set; and in the process of this round of traversal, taking the first synonymous item sequence currently traversed as the corresponding current synonymous item sequence; and performing a second positive sample record generation process based on the current synonymous item sequence to obtain a corresponding second data record; and performing a second negative sample record generation process based on the current synonymous item sequence to obtain a corresponding second data record; and at the end of this round of traversal, all the obtained second data records form a corresponding second data set;
[0032] in,
[0033] The second positive sample record generation process based on the current synonymous item sequence is performed to obtain a corresponding second data record, specifically: the first knowledge object and the first knowledge domain category of each first knowledge item in the current synonymous item sequence are extracted as the corresponding first item object and the first item knowledge domain category to form a corresponding first training item element group; and all the obtained first training item element groups are sequentially sorted to form a corresponding second training sequence; and a numerical vector with all vector data being 1 is constructed as the corresponding second label vector with the total number of the first knowledge items in the current synonymous item sequence as the vector length; and a corresponding second data record is formed by the second training sequence and the second label vector corresponding to the current synonymous item sequence;
[0034] The second negative sample record generation process based on the current synonymous item sequence is performed to obtain a corresponding second data record, specifically: the first knowledge object and the first knowledge domain category of each of the first knowledge items in the current synonymous item sequence are extracted as the corresponding first item object and the first item knowledge domain category to form a corresponding first training item element group; and all the obtained first training item element groups are sequentially sorted to form a corresponding second training sequence; and the first item object and / or the first item knowledge domain category of part or all of the first training item element groups of the obtained second training sequence are randomly modified, so that the data content of part or all of the first training item element groups of the second training sequence cannot be consistent; and after completing the sequence modification, the first training item element group in the second training sequence that is inconsistent with the data content of any other first training item element group is recorded as a corresponding inconsistent element group; and a numerical vector with all vector data being 1 is constructed as the corresponding second label vector with the total number of the first knowledge items in the current synonymous item sequence as the vector length; and the vector data corresponding to each of the inconsistent element groups in the second label vector is reset to 0; and the finally obtained second training sequence and the second label vector form a corresponding second data record.
[0035] Preferably, the step of continuously tracking the user behavior data of all users using the target editor and refreshing the first user historical behavior data sequence corresponding to each user based on the tracking result specifically includes:
[0036] When any user uses the target editor for the first time, an empty sequence is created for the current user as the corresponding historical behavior data sequence of the first user;
[0037] And every time any user uses the target editor to add knowledge or modify a first knowledge item in the target knowledge base, the first knowledge domain category of the first knowledge item being processed by the current user is extracted as the corresponding first user knowledge domain selection, and the knowledge editing strategy being used by the current user on the target editor is taken as the corresponding first user editing strategy selection, and the first user knowledge domain selection and the first user editing strategy selection obtained this time form a corresponding first user historical behavior data, which is added to the first user historical behavior data sequence corresponding to the current user.
[0038] Preferably, the data set for training the knowledge editing strategy identification task is constructed based on all the first user historical behavior data sequences obtained, and is recorded as the corresponding third data set, which specifically includes:
[0039] Perform a round of traversal on all the first user historical behavior data sequences obtained; and in this round of traversal, use the first user historical behavior data sequence currently traversed as the corresponding current data sequence; and count the total number of the first user historical behavior data of the current data sequence and use the statistical result as the corresponding current sequence length; and identify whether the current sequence length exceeds a preset first sequence length threshold; if not, use the current data sequence as a corresponding first data sequence; if so, use the first sequence length threshold as the corresponding maximum slice sequence length, and perform sliding slicing processing on the current data sequence based on a preset sliding step size and the maximum slice sequence length to obtain multiple corresponding slice data sequences, and use each of the slice data sequences as a corresponding first data sequence;
[0040] After the traversal of all the first user historical behavior data sequences is completed, continue to perform another round of traversal on all the obtained first data sequences; and in this round of traversal, take the currently traversed first data sequence as the corresponding current data sequence; and extract the first user knowledge field selection and the first user editing strategy selection of each of the first user historical behavior data in the current data sequence as the corresponding first training knowledge field selection and the first training editing strategy selection to form a corresponding first training behavior data; and sort all the obtained first training behavior data in chronological order to form a corresponding first temporary sequence; and record the last first training behavior data in the first temporary sequence as the corresponding target behavior data; and take the first temporary sequence with the target behavior data removed as a corresponding third training sequence; and Identify all the domain+strategy combinations of the target knowledge base and the target editor to obtain a corresponding domain+strategy combination set, and count the total number of combinations of the domain+strategy combination set to obtain a corresponding first total number of combinations; and construct a numerical vector with all vector data being 0 as the corresponding third label vector with the first total number of combinations as the vector length; and record the domain+strategy combination corresponding to the first training knowledge domain selection and the first training editing strategy selection of the target behavior data as the corresponding target combination; and reset the vector data corresponding to the target combination in the third label vector to 1; and after completing the vector reset, form a corresponding third data record by the third training sequence corresponding to the current data sequence and the third label vector; and at the end of this round of traversal, form a corresponding third data set by all the obtained third data records.
[0041] Preferably, the step of performing compliance checking based on the current knowledge item and the knowledge compliance discrimination model to obtain a corresponding first checking result and feeding it back to the target editor specifically includes:
[0042] Step 81, extracting the corresponding knowledge subject, subject-object relationship and knowledge object from the current knowledge entry as the corresponding current knowledge subject, current subject-object relationship and current knowledge object; and sequentially splicing the current knowledge subject, the first separator, the current subject-object relationship, the first separator and the current knowledge object into a corresponding text sequence as the corresponding first input sequence;
[0043] Step 82, inputting the first input sequence into the knowledge compliance discrimination model to perform corresponding compliance classification discrimination processing and using the output vector of the model as the corresponding first compliance classification discrimination vector;
[0044] Step 83, identifying whether each compliance classification discrimination probability in the first compliance classification discrimination vector exceeds a preset compliance probability threshold, if so, recording the current compliance classification discrimination probability as a corresponding first compliance probability, if not, recording the current compliance classification discrimination probability as a corresponding first violation probability;
[0045] Step 84, setting a corresponding first inspection state for each of the knowledge structure constraints of the knowledge structure rule; and when the total number of the first compliance probabilities is not zero, setting the first inspection state corresponding to each of the first compliance probabilities to inspection pass; and when the total number of the first violation probabilities is not zero, setting the first inspection state corresponding to each of the first violation probabilities to inspection fail;
[0046] Step 85, each of the first inspection states that have been set and the corresponding knowledge structure constraints form a corresponding first inspection record; and all the first inspection records obtained form the corresponding first inspection result and feed it back to the target editor.
[0047] Preferably, the performing consistency check based on the current knowledge item, the synonymous item sequence and the knowledge consistency judgment model to obtain a corresponding second check result and feeding it back to the target editor specifically includes:
[0048] Step 91, extracting the corresponding knowledge object and knowledge domain category from the current knowledge item to form a corresponding first item element group; extracting the first knowledge object and the first knowledge domain category of each of the first knowledge items in the synonymous item sequence to form a corresponding first item element group; and sequentially sorting all the obtained first item element groups to form a corresponding second input sequence;
[0049] Step 92, inputting the second input sequence into the knowledge consistency discrimination model to perform corresponding consistency classification discrimination processing and using the output vector of the model as the corresponding first consistency classification discrimination vector;
[0050] Step 93, identifying whether each consistency classification discrimination probability in the first consistency classification discrimination vector exceeds a preset consistency probability threshold, if so, recording the current consistency classification discrimination probability as a corresponding second compliance probability, if not, recording the current consistency classification discrimination probability as a corresponding second violation probability;
[0051] Step 94, setting a corresponding second inspection state for each knowledge item corresponding to each of the first item element groups of the second input sequence; and when the total number of the second compliance probabilities is not zero, setting the second inspection state corresponding to each of the second compliance probabilities to inspection passed; and when the total number of the second violation probabilities is not zero, setting the second inspection state corresponding to each of the second violation probabilities to inspection failed;
[0052] Step 95, each of the second inspection states that have been set and the corresponding knowledge items form a corresponding second inspection record; and all the second inspection records obtained form the corresponding second inspection result and feed it back to the target editor.
[0053] Preferably, the editing strategy recommendation process based on the current knowledge item, the current user historical behavior data sequence and the knowledge editing strategy discrimination model is performed to obtain a corresponding strategy recommendation result and to feed back to the target editor, specifically including:
[0054] Step 101, inputting the current user historical behavior data sequence into the knowledge editing strategy discrimination model to perform corresponding editing strategy classification and discrimination processing and using the output vector of the model as the corresponding first domain strategy classification and discrimination vector;
[0055] Step 102, taking the domain + strategy combination corresponding to the largest domain strategy classification discrimination probability in the first domain strategy classification discrimination vector as the corresponding predicted domain + strategy combination; and taking the knowledge domain category and the knowledge editing strategy corresponding to the predicted domain + strategy combination as the corresponding predicted knowledge domain category and predicted knowledge editing strategy;
[0056] Step 103, identifying whether the knowledge domain category corresponding to the current knowledge entry matches the predicted knowledge domain category; if so, taking the predicted knowledge editing strategy as the corresponding strategy recommendation result; if not, extracting a plurality of domain + strategy combinations whose knowledge domain categories match the knowledge domain category corresponding to the current knowledge entry from all the domain + strategy combinations corresponding to the target knowledge base and the target editor to form a corresponding first combination set, extracting the domain strategy classification discrimination probabilities corresponding to each of the domain + strategy combinations in the first combination set from the first domain strategy classification discrimination vector to form a corresponding first probability set, and taking the knowledge editing strategy corresponding to the domain + strategy combination corresponding to the maximum probability in the first probability set as the corresponding strategy recommendation result;
[0057] Step 104: Feedback the obtained strategy recommendation result to the target editor.
[0058] A second aspect of an embodiment of the present invention provides a device for implementing the processing method of the discriminator model for knowledge editing described in the first aspect above, the device comprising: a data set preparation module, a model construction and training module, a first model application module, a second model application module and a third model application module;
[0059] The data set preparation module is used to construct a data set for knowledge compliance verification task training based on a preset target knowledge base, which is recorded as the corresponding first data set; and to construct a data set for knowledge consistency verification task training based on the target knowledge base, which is recorded as the corresponding second data set; and to record the knowledge editor corresponding to the target knowledge base as the corresponding target editor; and to continuously track the user behavior data of all users using the target editor and refresh the first user historical behavior data sequence corresponding to each user based on the tracking results; and when all the first user historical behavior data sequences obtained can cover all knowledge domain categories of the target knowledge base and all knowledge editing strategies of the target editor, a data set for knowledge editing strategy identification task training is constructed based on all the first user historical behavior data sequences obtained, which is recorded as the corresponding third data set;
[0060] The model building and training module is used to design a benchmark discriminator model; and based on the first data set, the benchmark discriminator model is trained to obtain a corresponding knowledge compliance discriminant model; and based on the second data set, the benchmark discriminator model is trained to obtain a corresponding knowledge consistency discriminant model; and based on the third data set, the benchmark discriminator model is trained to obtain a corresponding knowledge editing strategy discriminant model;
[0061] The first model application module is used to use the knowledge item information added at that time as the corresponding current knowledge item when any user uses the target editor to process the knowledge adding task; and to perform compliance check based on the current knowledge item and the knowledge compliance discrimination model to obtain the corresponding first check result and feed it back to the target editor;
[0062] The second model application module is used to use the knowledge item information added or modified at that time as the corresponding current knowledge item when any user uses the target editor to process the knowledge addition or modification task; and based on the current knowledge item, perform a synonymous item query on the target knowledge base to obtain a corresponding synonymous item sequence; and when the synonymous item sequence is not empty, perform a consistency check based on the current knowledge item, the synonymous item sequence and the knowledge consistency judgment model to obtain a corresponding second check result and feed it back to the target editor;
[0063] The third model application module is used to use the currently selected knowledge entry information as the corresponding current knowledge entry when any user uses the target editor to complete a knowledge query and selects a knowledge entry obtained by the query; and use the first user historical behavior data sequence corresponding to the current user as the corresponding current user historical behavior data sequence; and perform editing strategy recommendation processing based on the current knowledge entry, the current user historical behavior data sequence and the knowledge editing strategy discrimination model to obtain the corresponding strategy recommendation result and feed it back to the target editor.
[0064] A third aspect of an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a transceiver;
[0065] The processor is used to be coupled to the memory, read and execute instructions in the memory, so as to implement the method steps described in the first aspect above;
[0066] The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
[0067] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed by a computer, the computer executes the instructions of the method described in the first aspect above.
[0068] The embodiment of the present invention provides a processing method, device, electronic device and computer-readable storage medium for a discriminator model for knowledge editing. As can be seen from the above content, the embodiment of the present invention constructs a data set for training knowledge compliance verification tasks and a data set for training knowledge consistency verification tasks based on the target knowledge base, which are recorded as the first and second data sets; and the knowledge editor corresponding to the target knowledge base is recorded as the corresponding target editor, and the user behavior data of all users using the target editor is continuously tracked and the first user historical behavior data sequence corresponding to each user is refreshed based on the tracking results, and when all the first user historical behavior data sequences obtained can cover all knowledge domain categories of the target knowledge base and all knowledge editing strategies of the target editor, a data set for training knowledge editing strategy identification tasks is constructed based on all the first user historical behavior data sequences obtained and recorded as the corresponding third data set; and a baseline discriminator model is designed, and then the baseline discriminator model is trained based on the first, second and third data sets to obtain the corresponding knowledge compliance discriminant model, knowledge consistency discriminant model and knowledge editing strategy discriminant model; then, when any user uses the target editor to process the knowledge addition task, the current time is recorded as the corresponding third data set. The added knowledge item information is taken as the corresponding current knowledge item, and a compliance check is performed based on the current knowledge item and the knowledge compliance discrimination model to obtain the corresponding check result, which is fed back to the target editor; and when any user uses the target editor to process the knowledge addition or modification task, the knowledge item information added or modified at that time is taken as the corresponding current knowledge item, and a synonym item query is performed on the target knowledge base based on the current knowledge item to obtain the corresponding synonym item sequence, and when the synonym item sequence is not empty, a consistency check is performed based on the current knowledge item, the synonym item sequence and the knowledge consistency discrimination model to obtain the corresponding check result, which is fed back to the target editor; and when any user uses the target editor to complete a knowledge query and selects a knowledge item obtained by the query, the currently selected knowledge item information is taken as the corresponding current knowledge item, and the first user historical behavior data sequence corresponding to the current user is taken as the corresponding current user historical behavior data sequence, and an editing strategy recommendation process is performed based on the current knowledge item, the current user historical behavior data sequence and the knowledge editing strategy discrimination model to obtain the corresponding recommendation strategy, which is fed back to the target editor. Developers of custom editors can better solve or improve the compliance problems, consistency problems and user experience problems existing in conventional custom editors by using the three types of discrimination models (knowledge compliance discrimination model, knowledge consistency discrimination model, and knowledge editing strategy discrimination model) provided by the embodiments of the present invention; the embodiments of the present invention not only improve the data compliance verification capability and data consistency assurance capability of the custom editor, but also improve the user experience of the custom editor. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A schematic diagram of a processing method of a discriminator model for knowledge editing provided in the first embodiment of the present invention;
[0070] Figure 2 A module structure diagram of a benchmark discriminator model provided in Embodiment 1 of the present invention;
[0071] Figure 3 A schematic diagram illustrating the derived relationship between the reference discriminator model and the three-category discriminant model and the input / output of the three-category discriminant model provided in the first embodiment of the present invention;
[0072] Figure 4 A module structure diagram of a processing device for a discriminator model for knowledge editing provided in Embodiment 2 of the present invention;
[0073] Figure 5 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0074] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0075] Embodiment 1 of the present invention provides a processing method for a discriminator model for knowledge editing, such as Figure 1 As shown in the schematic diagram of a processing method of a discriminator model for knowledge editing provided in the first embodiment of the present invention, the method mainly includes the following steps:
[0076] Step 1: construct a data set for knowledge compliance verification task training based on the preset target knowledge base and record it as the corresponding first data set; construct a data set for knowledge consistency verification task training based on the target knowledge base and record it as the corresponding second data set; record the knowledge editor corresponding to the target knowledge base as the corresponding target editor; continuously track the user behavior data of all users using the target editor and refresh the first user historical behavior data sequence corresponding to each user based on the tracking results; and when all the first user historical behavior data sequences obtained can cover all knowledge domain categories of the target knowledge base and all knowledge editing strategies of the target editor, construct a data set for knowledge editing strategy identification task training based on all the first user historical behavior data sequences obtained and record it as the corresponding third data set;
[0077] Specifically, it includes: step 11, constructing a data set for knowledge compliance verification task training based on a preset target knowledge base and recording it as a corresponding first data set;
[0078] Specifically, it includes: step 111, taking out all first knowledge items that meet the knowledge structure rule in the target knowledge base to form a corresponding first item set;
[0079] Here, the target knowledge base of the embodiment of the present invention includes multiple first knowledge items; the data elements of the first knowledge items at least include a first item identifier, a first creation / update time, a first triple element, a first knowledge weight, and a first knowledge domain category; the first triple element includes a first knowledge subject, a first subject-object relationship, and a first knowledge object; the knowledge structure rules corresponding to the target knowledge base include multiple knowledge structure constraints; each knowledge structure constraint is used to constrain the data format or data type of a class of data elements of the knowledge item;
[0080] Step 112, and perform a round of traversal on all first knowledge items of the first item set; and in this round of traversal, the first knowledge item currently traversed is used as the corresponding current knowledge item; and a first positive sample record generation process is performed based on the current knowledge item to obtain a corresponding first data record; and a first negative sample record generation process is performed based on the current knowledge item to obtain a corresponding first data record; and at the end of this round of traversal, all the first data records obtained form a corresponding first data set;
[0081] Here, the first data set of the embodiment of the present invention includes multiple first data records; the first data record includes a first training sequence and a first label vector; the first training sequence is a text sequence, which is sequentially spliced by a first training knowledge subject, a first separator, a first training subject-object relationship, a first separator and a first training knowledge object; the first label vector is composed of multiple first label probabilities, and the first label probabilities correspond to the knowledge structure constraints one by one; if the first training sequence satisfies the constraint condition of a certain knowledge structure constraint, the first label probability corresponding to the current knowledge structure constraint in the first label vector is 1; if the first training sequence does not satisfy the constraint condition of a certain knowledge structure constraint, the first label probability corresponding to the current knowledge structure constraint in the first label vector is 0;
[0082] It should be noted that in the current step 112, the specific processing steps of generating a first positive sample record based on the current knowledge entry to obtain a corresponding first data record include: extracting the first knowledge subject, the first subject-object relationship and the first knowledge object of the first triple element of the current knowledge entry as the corresponding first training knowledge subject, the first training subject-object relationship and the first training knowledge object; and sequentially splicing the first training knowledge subject, the first separator, the first training subject-object relationship, the first separator and the first training knowledge object and using the obtained spliced text sequence as the corresponding first training sequence; and constructing a numerical vector with all vector data being 1 as the corresponding first label vector with the total number of knowledge structure constraints of the knowledge structure rules as the vector length; and forming a corresponding first data record by the first training sequence and the first label vector corresponding to the current knowledge entry;
[0083] It should be noted that in the current step 112, the specific processing steps for generating a first negative sample record based on the current knowledge entry to obtain a corresponding first data record include: extracting the first knowledge subject, the first subject-object relationship and the first knowledge object of the first triple element of the current knowledge entry as the corresponding first training knowledge subject, the first training subject-object relationship and the first training knowledge object; and randomly modifying the obtained first training knowledge subject and / or the first training subject-object relationship and / or the first training knowledge object in a violation modification manner that violates the knowledge structure rules; and after completing this violation modification, modifying each of the knowledge structure rules that is modified by this violation The knowledge structure constraint that causes its constraint condition to be unsatisfied is recorded as the corresponding violation constraint; and the latest first training knowledge subject, the first separator, the latest first training subject-object relationship, the first separator and the latest first training knowledge object are sequentially spliced and the obtained spliced text sequence is used as the corresponding first training sequence; and a numerical vector with all vector data of 1 is constructed with the total number of knowledge structure constraints of the knowledge structure rules as the vector length as the corresponding first label vector; and the vector data corresponding to each violation constraint in the current first label vector is reset to 0; and the first training sequence and the first label vector finally obtained form a corresponding first data record;
[0084] Step 12, constructing a data set for knowledge consistency verification task training based on the target knowledge base and recording it as the corresponding second data set;
[0085] Specifically, it includes: step 121, extracting a group of first knowledge items in the target knowledge base, whose first knowledge subjects are synonyms with each other, whose first subject-object relationships are synonyms with each other, whose contents of the first knowledge objects are consistent, and whose contents of the first knowledge domain categories are consistent, to form a corresponding first synonymous item sequence; and forming a corresponding first sequence set from all the obtained first synonymous item sequences;
[0086] Step 122, perform a round of traversal on all first synonymous item sequences of the first sequence set; and in this round of traversal, use the currently traversed first synonymous item sequence as the corresponding current synonymous item sequence; and perform a second positive sample record generation process based on the current synonymous item sequence to obtain a corresponding second data record; and perform a second negative sample record generation process based on the current synonymous item sequence to obtain a corresponding second data record; and at the end of this round of traversal, all the obtained second data records form a corresponding second data set;
[0087] Here, the second data set of the embodiment of the present invention includes multiple second data records; the second data record includes a second training sequence and a second label vector; the second training sequence is formed by sorting multiple first training item element groups; the first item training element group includes a first item object and a first item knowledge domain category; the second label vector is composed of multiple second label probabilities, and the second label probabilities correspond to the first training item element groups one by one; if a first training item element group in the second training sequence is consistent with the content of all other first training item element groups, the corresponding second label probability is 1; if a first training item element group in the second training sequence is not consistent with the content of any other first training item element group, the corresponding second label probability is 0;
[0088] It should be noted that in the current step 122, the specific processing steps of performing the second positive sample record generation processing based on the current synonymous item sequence to obtain a corresponding second data record include: extracting the first knowledge object and the first knowledge domain category of each first knowledge item in the current synonymous item sequence as the corresponding first item object and the first item knowledge domain category to form a corresponding first training item element group; and sequentially sorting all the obtained first training item element groups to form a corresponding second training sequence; and constructing a numerical vector with all vector data being 1 as the corresponding second label vector with the total number of first knowledge items in the current synonymous item sequence as the vector length; and forming a corresponding second data record with the second training sequence and the second label vector corresponding to the current synonymous item sequence;
[0089] It should be noted that in the current step 122, the specific processing steps of performing the second negative sample record generation processing based on the current synonymous item sequence to obtain a corresponding second data record include: extracting the first knowledge object and the first knowledge domain category of each first knowledge item in the current synonymous item sequence as the corresponding first item object and the first item knowledge domain category to form a corresponding first training item element group; and sequentially sorting all the obtained first training item element groups to form a corresponding second training sequence; and randomly modifying the first item object and / or the first item knowledge domain category of some or all of the first training item element groups of the obtained second training sequence, so that the data content of some or all of the first training item element groups of the second training sequence cannot be consistent; and after completing the sequence modification, the first training item element group in the second training sequence that is inconsistent with the data content of any other first training item element group is recorded as the corresponding inconsistent element group; and constructing a numerical vector with all vector data being 1 as the corresponding second label vector with the total number of first knowledge items in the current synonymous item sequence as the vector length; and resetting the vector data corresponding to each inconsistent element group in the second label vector to 0; and forming a corresponding second data record with the finally obtained second training sequence and the second label vector;
[0090] Step 13, and record the knowledge editor corresponding to the target knowledge base as the corresponding target editor;
[0091] Step 14, continuously tracking the user behavior data of all users using the target editor and refreshing the first user historical behavior data sequence corresponding to each user based on the tracking result;
[0092] Specifically, it includes: step 141, when any user uses the target editor for the first time, creating an empty sequence for the current user as the corresponding first user historical behavior data sequence;
[0093] Step 142, each time any user uses the target editor to add or modify a first knowledge item in the target knowledge base, the first knowledge domain category of the first knowledge item being processed by the current user is extracted as the corresponding first user knowledge domain selection, and the knowledge editing strategy being used by the current user on the target editor is taken as the corresponding first user editing strategy selection, and the first user knowledge domain selection and the first user editing strategy selection obtained this time form a corresponding first user historical behavior data that is added to the first user historical behavior data sequence corresponding to the current user;
[0094] Here, the first user historical behavior data sequence of the embodiment of the present invention is formed by sorting a plurality of first user historical behavior data in chronological order when the sequence is not empty; the first user historical behavior data includes a first user knowledge domain selection and a first user editing strategy selection; the first user knowledge domain selection includes multiple knowledge domain categories, and the first user editing strategy selection includes multiple knowledge editing strategies;
[0095] Step 15, when all the first user historical behavior data sequences obtained can cover all knowledge domain categories of the target knowledge base and all knowledge editing strategies of the target editor, a data set for training the knowledge editing strategy identification task is constructed based on all the first user historical behavior data sequences obtained and recorded as the corresponding third data set;
[0096] Specifically, the method comprises: step 151, performing a round of traversal on all obtained first user historical behavior data sequences; and in this round of traversal, taking the currently traversed first user historical behavior data sequence as the corresponding current data sequence; and counting the total number of first user historical behavior data of the current data sequence and taking the counting result as the corresponding current sequence length; and identifying whether the current sequence length exceeds a preset first sequence length threshold; if not, taking the current data sequence as a corresponding first data sequence; and if so, taking the first sequence length threshold as the corresponding maximum slice sequence length, and performing sliding slice processing on the current data sequence based on the preset sliding step length and the maximum slice sequence length to obtain corresponding multiple slice data sequences, and taking each slice data sequence as a corresponding first data sequence;
[0097] Here, the first sequence length threshold and the sliding step size are two preset positive integer parameters;
[0098] Step 152, after the traversal of all first user historical behavior data sequences is completed, continue to traverse all the obtained first data sequences for another round; and in this round of traversal, the currently traversed first data sequence is used as the corresponding current data sequence; and the first user knowledge domain selection and the first user editing strategy selection of each first user historical behavior data in the current data sequence are extracted as the corresponding first training knowledge domain selection and the first training editing strategy selection to form a corresponding first training behavior data; and all the obtained first training behavior data are sorted in chronological order to form a corresponding first temporary sequence; and the last first training behavior data in the first temporary sequence is recorded as the corresponding target behavior data; and the first temporary sequence after the target behavior data is removed is used as a corresponding third training behavior data. training sequence; and identify all domain + strategy combinations of the target knowledge base and the target editor to obtain the corresponding domain + strategy combination set, and count the total number of combinations of the domain + strategy combination set to obtain the corresponding first combination total number; and construct a numerical vector with all vector data being 0 as the corresponding third label vector with the first combination total number as the vector length; and record the domain + strategy combination corresponding to the first training knowledge domain selection of the target behavior data and the first training editing strategy selection as the corresponding target combination; and reset the vector data corresponding to the target combination in the third label vector to 1; and after completing the vector reset, the third training sequence corresponding to the current data sequence and the third label vector form a corresponding third data record; and at the end of this round of traversal, all the obtained third data records form the corresponding third data set;
[0099] Here, the third data set of the embodiment of the present invention includes multiple third data records; the third data records include a third training sequence and a third label vector; the third training sequence is formed by multiple first training behavior data sorted in chronological order; the first training behavior data includes a first training knowledge domain selection and a first training editing strategy selection; the first training knowledge domain selection includes multiple knowledge domain categories, and the first training editing strategy selection includes multiple knowledge editing strategies; the third label vector is composed of multiple third label probabilities, each third label probability corresponds to a domain + strategy combination consisting of a knowledge domain category and a knowledge editing strategy; the value of the third label probability is 0 or 1, and there is only one third label probability of 1 in the third label vector; the third data set should cover all knowledge domain categories of the target knowledge base and all knowledge editing strategies of the target editor.
[0100] Step 2, design a benchmark discriminator model; and train the benchmark discriminator model based on the first data set to obtain a corresponding knowledge compliance discriminant model; and train the benchmark discriminator model based on the second data set to obtain a corresponding knowledge consistency discriminant model; and train the benchmark discriminator model based on the third data set to obtain a corresponding knowledge editing strategy discriminant model;
[0101] Specifically including: step 21, designing a benchmark discriminator model;
[0102] Here, the benchmark discriminator model of the embodiment of the present invention is a basic model framework, and three types of discriminant models for processing specific discriminant tasks will be derived from the basic model framework later; the benchmark discriminator model is used to perform classification and discrimination processing according to the model input sequence and output a corresponding classification discrimination vector, wherein the discrimination prediction vector is composed of multiple classification discrimination probabilities, and each classification discrimination probability corresponds to a discrimination type;
[0103] like Figure 2 As shown in the module structure diagram of the benchmark discriminator model provided in the first embodiment of the present invention, the model components of the benchmark discriminator model include: an encoding layer, a linear attention layer, a pooling layer, a fully connected network and a Softmax layer; wherein the encoding layer is implemented based on the Encoder model structure of the Transformer architecture; the linear attention layer is implemented based on a type of linear attention neural network; the connection relationship between the components of the benchmark discriminator model is: the input end of the encoding layer is connected to the input end of the model, and the output end is connected to the input end of the linear attention layer; the output end of the linear attention layer is connected to the input end of the pooling layer; the output end of the pooling layer is connected to the input end of the fully connected network; the output end of the fully connected network is connected to the input end of the Softmax layer; the output end of the Softmax layer is connected to the output end of the model;
[0104] like Figure 3 As shown in the derived relationship between the benchmark discriminator model and the three types of discriminant models provided in the first embodiment of the present invention and the input / output description diagram of the three types of discriminant models, the embodiment of the present invention will derive three types of discriminant models from the benchmark discriminator model: knowledge compliance discriminant model, knowledge consistency discriminant model, and knowledge editing strategy discriminant model; the following is a brief description of the input / output design requirements of these three types of models:
[0105] 1) The knowledge compliance discrimination model is used to perform compliance classification and discrimination processing on a class of input sequences input by the model and output a corresponding compliance classification discrimination vector;
[0106] Among them, one type of input sequence is a text sequence, which is sequentially spliced by the knowledge subject, the first separator, the subject-object relationship, the first separator and the knowledge object; the first separator is a preset single character; the compliance classification discrimination vector is composed of multiple compliance classification discrimination probabilities; the compliance classification discrimination probability corresponds to the knowledge structure constraint one by one;
[0107] Here, the first separator is usually set to " / " by default, but it can also be customized based on application requirements;
[0108] 2) The knowledge consistency discrimination model is used to perform corresponding consistency classification discrimination processing on the two-category input sequence of the model input and output the corresponding consistency classification discrimination vector;
[0109] Among them, the second-class input sequence is formed by sorting multiple entry element groups; the entry element group includes the entry object and the entry knowledge domain category; the consistency classification discrimination vector is composed of multiple consistency classification discrimination probabilities; the consistency classification discrimination probability corresponds to the entry element group one by one;
[0110] 3) The knowledge editing strategy discrimination model is used to perform corresponding editing strategy classification and discrimination processing on the three types of input sequences of the model input and output the corresponding domain strategy classification discrimination vector;
[0111] Among them, the three types of input sequences are formed by sorting multiple historical behavior data of the same user in chronological order; the historical behavior data include knowledge domain selection and editing strategy selection; the knowledge domain selection includes multiple knowledge domain categories, and the editing strategy selection includes multiple knowledge editing strategies; the domain strategy classification discrimination vector is composed of multiple domain strategy classification discrimination probabilities, and each domain strategy classification discrimination probability corresponds to a domain + strategy combination composed of a knowledge domain category and a knowledge editing strategy; the total number of domain strategy classification discrimination probabilities is consistent with the total number of combinations of domain + strategy combinations of the target knowledge base and the target editor;
[0112] Step 22, training the benchmark discriminator model based on the first data set to obtain a corresponding knowledge compliance discriminant model;
[0113] Specifically, the method comprises: step 221, adaptively adjusting the component parameters of each model component of the benchmark discriminator model based on the model input / output design requirements of the knowledge compliance discrimination model in advance to obtain a knowledge compliance discrimination model that has not been trained;
[0114] Step 222, based on a preset first segmentation ratio, the first data set is divided into two sub-data sets recorded as a corresponding first training set and a first evaluation set;
[0115] The first segmentation ratio is a preset ratio parameter, such as 8:2; the first training set and the first evaluation set are both composed of a plurality of first data records; the ratio of the total number of records in the first training set to the total number of records in the first evaluation set satisfies the first segmentation ratio;
[0116] Step 223, extracting the first first data record of the first training set as the corresponding current training record;
[0117] Step 224, input the first training sequence of the current training record into the knowledge compliance discrimination model to perform corresponding compliance classification and discrimination processing and use the model output vector as the corresponding first prediction vector;
[0118] Step 225, bringing the first prediction vector and the first label vector of the current training record into a preset first model loss function; and performing a round of model parameter optimization on the knowledge compliance discrimination model in a direction of making the first model loss function reach a preset first optimal loss value based on a preset first model optimizer;
[0119] The first model loss function at least includes a cross entropy loss function, and other types of loss functions can also be customized based on application requirements; the first model optimizer at least includes an SGD optimizer and an ADAM optimizer, and other types of model optimizers can also be customized based on application requirements; the first optimal loss value is a preset value corresponding to the loss function type of the first model loss function. If the first model loss function is implemented based on the cross entropy loss function, the first optimal loss value will be set to 0 by default;
[0120] Step 226, identifying whether the current training record is the last first data record of the first training set; if so, going to step 227; if not, extracting the next first data record of the first training set as the new current training record and returning to step 224;
[0121] Step 227, perform a round of traversal on all the first data records of the first evaluation set; and in this round of traversal, use the first data record currently traversed as the corresponding current evaluation record; and input the first training sequence of the current evaluation record into the knowledge compliance discrimination model for corresponding compliance classification discrimination processing and use the model output vector as the corresponding second prediction vector; and form a corresponding first prediction-label pair by the second prediction vector and the first label vector of the current evaluation record; and at the end of this round of traversal, perform corresponding accuracy, precision, recall and F1 score calculations based on all the first prediction-label pairs obtained to obtain the corresponding first accuracy, first precision, first recall and first F1 score;
[0122] Step 228, identifying the obtained first accuracy, first precision, first recall and first F1 score; if the first accuracy does not satisfy the preset first accuracy range or the first precision does not satisfy the preset first precision range or the first recall does not satisfy the preset first recall range or the first F1 score does not satisfy the preset first F1 score range, returning to step 223 to continue training; if the first accuracy satisfies the first accuracy range and the first precision satisfies the first precision range and the first recall satisfies the first recall range and the first F1 score satisfies the first F1 score range, confirming that the knowledge compliance verification task training of the knowledge compliance discrimination model is completed;
[0123] Here, the first accuracy range, the first precision range, the first recall range, and the first F1 score range are four preset value range parameters;
[0124] Step 23, training the benchmark discriminator model based on the second data set to obtain a corresponding knowledge consistency discriminant model;
[0125] Specifically, it includes: step 231, adaptively adjusting the component parameters of each model component of the benchmark discriminator model based on the model input / output design requirements of the knowledge consistency discriminant model in advance to obtain a knowledge consistency discriminant model that has not been trained;
[0126] Step 232, based on a preset second segmentation ratio, the second data set is divided into two sub-data sets recorded as corresponding second training sets and second evaluation sets;
[0127] The second segmentation ratio is a preset ratio parameter, such as 8:2; the second training set and the second evaluation set are both composed of a plurality of second data records; the ratio of the total number of records in the second training set to the total number of records in the second evaluation set satisfies the second segmentation ratio;
[0128] Step 233, extracting the first second data record of the second training set as the corresponding current training record;
[0129] Step 234, input the second training sequence of the current training record into the knowledge consistency discrimination model to perform corresponding consistency classification discrimination processing and use the model output vector as the corresponding third prediction vector;
[0130] Step 235, bringing the third prediction vector and the second label vector of the current training record into a preset second model loss function; and performing a round of model parameter optimization on the knowledge consistency discrimination model in a direction of making the second model loss function reach a preset second optimal loss value based on a preset second model optimizer;
[0131] The second model loss function at least includes a cross entropy loss function, and other types of loss functions can also be customized based on application requirements; the second model optimizer at least includes an SGD optimizer and an ADAM optimizer, and other types of model optimizers can also be customized based on application requirements; the second optimal loss value is a preset value corresponding to the loss function type of the second model loss function. If the second model loss function is implemented based on the cross entropy loss function, the second optimal loss value will be set to 0 by default;
[0132] Step 236, identifying whether the current training record is the last second data record of the second training set; if so, going to step 237; if not, extracting the next second data record of the second training set as the new current training record and returning to step 234;
[0133] Step 237, perform a round of traversal on all second data records of the second evaluation set; and in this round of traversal, use the second data record currently traversed as the corresponding current evaluation record; and input the second training sequence of the current evaluation record into the knowledge consistency discrimination model for corresponding consistency classification discrimination processing and use the model output vector as the corresponding fourth prediction vector; and form a corresponding second prediction-label pair by the fourth prediction vector and the second label vector of the current evaluation record; and at the end of this round of traversal, perform corresponding accuracy, precision, recall and F1 score calculations on all the obtained second prediction-label pairs to obtain the corresponding second accuracy, second precision, second recall and second F1 score;
[0134] Step 238, identifying the obtained second accuracy, second precision, second recall and second F1 score; if the second accuracy does not meet the preset second accuracy range or the second accuracy does not meet the preset second accuracy range or the second recall does not meet the preset second recall range or the second F1 score does not meet the preset second F1 score range, returning to step 233 to continue training; if the second accuracy meets the second accuracy range and the second accuracy meets the second accuracy range and the second recall meets the second recall range and the second F1 score meets the second F1 score range, confirming that the knowledge consistency verification task training of the knowledge consistency discrimination model is completed;
[0135] Here, the second accuracy range, the second precision range, the second recall range, and the second F1 score range are four preset value range parameters;
[0136] Step 24, training the benchmark discriminator model based on the third data set to obtain a corresponding knowledge editing strategy discriminant model;
[0137] Specifically, it includes: step 241, adaptively adjusting the component parameters of each model component of the benchmark discriminator model based on the model input / output design requirements of the knowledge editing strategy discriminant model in advance to obtain a knowledge editing strategy discriminant model that has not been trained;
[0138] Step 242, based on a preset third segmentation ratio, the third data set is divided into two sub-data sets recorded as a corresponding third training set and a third evaluation set;
[0139] The third segmentation ratio is a preset ratio parameter, such as 8:2; the third training set and the third evaluation set are both composed of a plurality of third data records; the ratio of the total number of records in the third training set to the total number of records in the third evaluation set satisfies the third segmentation ratio;
[0140] Step 243, extracting the first third data record of the third training set as the corresponding current training record;
[0141] Step 244, input the second training sequence of the current training record into the knowledge editing strategy discrimination model to perform corresponding editing strategy classification and discrimination processing and use the model output vector as the corresponding fifth prediction vector;
[0142] Step 245, bringing the fifth prediction vector and the third label vector of the current training record into a preset third model loss function; and performing a round of model parameter optimization on the knowledge editing strategy discrimination model in a direction of making the third model loss function reach a preset third optimal loss value based on a preset third model optimizer;
[0143] Among them, the third model loss function at least includes a cross entropy loss function, and other types of loss functions can also be customized based on application requirements; the third model optimizer at least includes an SGD optimizer and an ADAM optimizer, and other types of model optimizers can also be customized based on application requirements; the third optimal loss value is a preset value corresponding to the loss function type of the third model loss function. If the third model loss function is implemented based on the cross entropy loss function, then the third optimal loss value will be set to 0 by default;
[0144] Step 246, identifying whether the current training record is the last third data record of the third training set; if so, going to step 247; if not, extracting the next third data record of the third training set as the new current training record and returning to step 244;
[0145] Step 247, perform a round of traversal on all third data records of the third evaluation set; and in this round of traversal, use the third data record currently traversed as the corresponding current evaluation record; and input the third training sequence of the current evaluation record into the knowledge editing strategy discrimination model for corresponding editing strategy classification discrimination processing and use the model output vector as the corresponding sixth prediction vector; and form a corresponding third prediction-label pair by the sixth prediction vector and the third label vector of the current evaluation record; and at the end of this round of traversal, perform corresponding accuracy, precision, recall and F1 score calculations based on all the obtained third prediction-label pairs to obtain the corresponding third accuracy, third precision, third recall and third F1 score;
[0146] Step 248, identifying the obtained third accuracy, third precision, third recall and third F1 score; if the third accuracy does not meet the preset third accuracy range or the third precision does not meet the preset third precision range or the third recall does not meet the preset third recall range or the third F1 score does not meet the preset third F1 score range, returning to step 243 to continue training; if the third accuracy meets the third accuracy range and the third precision meets the third precision range and the third recall meets the third recall range and the third F1 score meets the third F1 score range, confirming that the knowledge editing strategy identification task training of the knowledge editing strategy discrimination model is completed;
[0147] Here, the third accuracy range, the third precision range, the third recall range and the third F1 score range are four preset numerical range parameters.
[0148] Step 3: When any user uses the target editor to process a knowledge adding task, the knowledge item information added at that time is used as the corresponding current knowledge item; and a compliance check is performed based on the current knowledge item and the knowledge compliance discrimination model to obtain a corresponding first check result and feed it back to the target editor;
[0149] Specifically, it includes: step 31, when any user uses the target editor to process the knowledge adding task, the knowledge item information added at that time is used as the corresponding current knowledge item;
[0150] Step 32, performing compliance check based on the current knowledge item and the knowledge compliance discrimination model to obtain a corresponding first check result and feeding it back to the target editor;
[0151] Specifically, the method comprises: step 321, extracting the corresponding knowledge subject, subject-object relationship and knowledge object from the current knowledge entry as the corresponding current knowledge subject, current subject-object relationship and current knowledge object; and sequentially splicing the current knowledge subject, the first separator, the current subject-object relationship, the first separator and the current knowledge object into a corresponding text sequence as the corresponding first input sequence;
[0152] Step 322, input the first input sequence into the knowledge compliance discrimination model to perform corresponding compliance classification discrimination processing and use the output vector of the model as the corresponding first compliance classification discrimination vector;
[0153] Step 323, identifying whether each compliance classification discrimination probability in the first compliance classification discrimination vector exceeds a preset compliance probability threshold, if so, recording the current compliance classification discrimination probability as a corresponding first compliance probability, if not, recording the current compliance classification discrimination probability as a corresponding first violation probability;
[0154] Here, the compliance probability threshold is a pre-set probability threshold parameter;
[0155] Step 324, setting a corresponding first inspection state for each knowledge structure constraint of the knowledge structure rule; and when the total number of first compliance probabilities is not zero, setting the first inspection state corresponding to each first compliance probability to inspection pass; and when the total number of first violation probabilities is not zero, setting the first inspection state corresponding to each first violation probability to inspection fail;
[0156] Step 325, each completed first inspection state and the corresponding knowledge structure constraint form a corresponding first inspection record; and all the obtained first inspection records form a corresponding first inspection result to be fed back to the target editor.
[0157] Step 4: When any user uses the target editor to process a knowledge addition or modification task, the knowledge item information added or modified at that time is used as the corresponding current knowledge item; and based on the current knowledge item, a synonym item query is performed on the target knowledge base to obtain a corresponding synonym item sequence; and when the synonym item sequence is not empty, a consistency check is performed based on the current knowledge item, the synonym item sequence and the knowledge consistency judgment model to obtain a corresponding second test result and feed it back to the target editor;
[0158] Specifically, it includes: step 41, when any user uses the target editor to process a knowledge adding or modifying task, the knowledge item information added or modified at that time is used as the corresponding current knowledge item;
[0159] Step 42, based on the current knowledge item, a synonymous item query is performed on the target knowledge base to obtain a corresponding synonymous item sequence;
[0160] Specifically, it includes: extracting all first knowledge items in the target knowledge base whose first knowledge subject is a synonym of the knowledge subject of the current knowledge item and whose first subject-object relationship is a synonym of the subject-object relationship of the current knowledge item to form a corresponding synonym item sequence;
[0161] Step 43, when the synonymous item sequence is not empty, a consistency check is performed based on the current knowledge item, the synonymous item sequence and the knowledge consistency discrimination model to obtain a corresponding second check result and feed it back to the target editor;
[0162] Specifically, the method comprises: step 431, extracting the corresponding knowledge object and knowledge domain category from the current knowledge item to form a corresponding first item element group; extracting the first knowledge object and the first knowledge domain category of each first knowledge item in the synonymous item sequence to form a corresponding first item element group; and sequentially sorting all the obtained first item element groups to form a corresponding second input sequence;
[0163] Step 432, input the second input sequence into the knowledge consistency discrimination model to perform corresponding consistency classification discrimination processing and use the output vector of the model as the corresponding first consistency classification discrimination vector;
[0164] Step 433, identifying whether each consistency classification discrimination probability in the first consistency classification discrimination vector exceeds a preset consistency probability threshold, if so, recording the current consistency classification discrimination probability as a corresponding second compliance probability, if not, recording the current consistency classification discrimination probability as a corresponding second violation probability;
[0165] Here, the consistency probability threshold is a pre-set probability threshold parameter;
[0166] Step 434, setting a corresponding second inspection state for each knowledge item corresponding to each first item element group of the second input sequence; and when the total number of second compliance probabilities is not zero, setting the second inspection state corresponding to each second compliance probability to inspection pass; and when the total number of second violation probabilities is not zero, setting the second inspection state corresponding to each second violation probability to inspection fail;
[0167] Step 435, each completed second inspection state and the corresponding knowledge item form a corresponding second inspection record; and all the obtained second inspection records form a corresponding second inspection result to be fed back to the target editor.
[0168] Step 5, when any user completes a knowledge query using the target editor and selects a knowledge item obtained by the query, the currently selected knowledge item information is used as the corresponding current knowledge item; and the first user historical behavior data sequence corresponding to the current user is used as the corresponding current user historical behavior data sequence; and based on the current knowledge item, the current user historical behavior data sequence and the knowledge editing strategy discrimination model, editing strategy recommendation processing is performed to obtain the corresponding strategy recommendation result and feedback to the target editor;
[0169] Specifically, it includes: step 51, when any user completes a knowledge query using the target editor and selects a knowledge item obtained by the query, the currently selected knowledge item information is used as the corresponding current knowledge item;
[0170] Step 52, and taking the first user historical behavior data sequence corresponding to the current user as the corresponding current user historical behavior data sequence;
[0171] Step 53, performing editing strategy recommendation processing based on the current knowledge entry, the current user historical behavior data sequence and the knowledge editing strategy discrimination model to obtain the corresponding strategy recommendation result and feed it back to the target editor;
[0172] Specifically, it includes: step 531, inputting the current user historical behavior data sequence into the knowledge editing strategy discrimination model to perform corresponding editing strategy classification discrimination processing and using the output vector of the model as the corresponding first domain strategy classification discrimination vector;
[0173] Step 532, taking the domain + strategy combination corresponding to the largest domain strategy classification discrimination probability in the first domain strategy classification discrimination vector as the corresponding predicted domain + strategy combination; and taking the knowledge domain category and knowledge editing strategy corresponding to the predicted domain + strategy combination as the corresponding predicted knowledge domain category and predicted knowledge editing strategy;
[0174] Step 533, identify whether the knowledge domain category corresponding to the current knowledge entry matches the predicted knowledge domain category; if they match, use the predicted knowledge editing strategy as the corresponding strategy recommendation result; if they do not match, extract multiple domain + strategy combinations whose knowledge domain categories match the knowledge domain category corresponding to the current knowledge entry from all domain + strategy combinations corresponding to the target knowledge base and the target editor to form a corresponding first combination set, extract the domain strategy classification discrimination probabilities corresponding to each domain + strategy combination of the first combination set in the first domain strategy classification discrimination vector to form a corresponding first probability set, and use the knowledge editing strategy corresponding to the domain + strategy combination corresponding to the maximum probability in the first probability set as the corresponding strategy recommendation result;
[0175] Step 534: Feedback the obtained policy recommendation results to the target editor.
[0176] Figure 4 The module structure diagram of a processing device for a discriminator model for knowledge editing provided in the second embodiment of the present invention, the device is a terminal device or server that implements the aforementioned method embodiment, and can also be a device that enables the aforementioned terminal device or server to implement the aforementioned method embodiment, for example, the device can be a device or chip system of the aforementioned terminal device or server. Figure 4As shown, the device includes: a data set preparation module 201, a model construction and training module 202, a first model application module 203, a second model application module 204 and a third model application module 205.
[0177] The data set preparation module 201 is used to construct a data set for knowledge compliance verification task training based on a preset target knowledge base, which is recorded as the corresponding first data set; and to construct a data set for knowledge consistency verification task training based on the target knowledge base, which is recorded as the corresponding second data set; and to record the knowledge editor corresponding to the target knowledge base as the corresponding target editor; and to continuously track the user behavior data of all users using the target editor and refresh the first user historical behavior data sequence corresponding to each user based on the tracking results; and when all the first user historical behavior data sequences obtained can cover all knowledge domain categories of the target knowledge base and all knowledge editing strategies of the target editor, a data set for knowledge editing strategy identification task training is constructed based on all the first user historical behavior data sequences obtained, which is recorded as the corresponding third data set.
[0178] The model building and training module 202 is used to design a baseline discriminator model; and based on the first data set, the baseline discriminator model is trained to obtain a corresponding knowledge compliance discriminant model; and based on the second data set, the baseline discriminator model is trained to obtain a corresponding knowledge consistency discriminant model; and based on the third data set, the baseline discriminator model is trained to obtain a corresponding knowledge editing strategy discriminant model.
[0179] The first model application module 203 is used to use the knowledge item information added at that time as the corresponding current knowledge item when any user uses the target editor to process a knowledge adding task; and to perform a compliance check based on the current knowledge item and the knowledge compliance judgment model to obtain the corresponding first check result and feed it back to the target editor.
[0180] The second model application module 204 is used to use the knowledge item information added or modified at that time as the corresponding current knowledge item when any user uses the target editor to process the knowledge addition or modification task; and based on the current knowledge item, perform a synonym item query on the target knowledge base to obtain a corresponding synonym item sequence; and when the synonym item sequence is not empty, perform a consistency check based on the current knowledge item, the synonym item sequence and the knowledge consistency judgment model to obtain a corresponding second check result and feed it back to the target editor.
[0181] The third model application module 205 is used to use the currently selected knowledge entry information as the corresponding current knowledge entry when any user completes a knowledge query using the target editor and selects a knowledge entry obtained by the query; and use the first user historical behavior data sequence corresponding to the current user as the corresponding current user historical behavior data sequence; and perform editing strategy recommendation processing based on the current knowledge entry, the current user historical behavior data sequence and the knowledge editing strategy discrimination model to obtain the corresponding strategy recommendation result and feed it back to the target editor.
[0182] A processing device for a discriminator model for knowledge editing provided by an embodiment of the present invention can execute the method steps in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here.
[0183] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the data set preparation module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above-mentioned module is determined. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0184] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0185] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the above method embodiments are generated. The above computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above-mentioned computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above-mentioned computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, Bluetooth, microwave, etc.) methods. The above-mentioned computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The above-mentioned available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0186] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. The electronic device may be a terminal device or a server for implementing the method of the aforementioned embodiment, or may be a terminal device or a server for implementing the method of the aforementioned embodiment connected to the aforementioned terminal device or server. Figure 5As shown, the electronic device may include: a processor 301 (such as a CPU), a memory 302, and a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transceiver 303. Various instructions may be stored in the memory 302 to complete various processing functions and implement the processing steps described in the aforementioned embodiment method. Preferably, the electronic device involved in the embodiment of the present invention also includes: a power supply 304, a system bus 305 and a communication port 306. The system bus 305 is used to realize the communication connection between components. The above-mentioned communication port 306 is used for connecting and communicating between the electronic device and other peripherals.
[0187] exist Figure 5 The system bus 305 mentioned in the figure can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM), and may also include non-volatile memory (Non-Volatile Memory), such as at least one disk storage.
[0188] The above-mentioned processor can be a general-purpose processor, including a central processing unit CPU, a network processor (Network Processor, NP), a graphics processing unit (Graphics Processing Unit, GPU), 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, discrete hardware components.
[0189] It should be noted that an embodiment of the present invention further provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the method and processing process provided in the above embodiments.
[0190] The embodiment of the present invention provides a processing method, device, electronic device and computer-readable storage medium for a discriminator model for knowledge editing. As can be seen from the above content, the embodiment of the present invention constructs a data set for training knowledge compliance verification tasks and a data set for training knowledge consistency verification tasks based on the target knowledge base, which are recorded as the first and second data sets; and the knowledge editor corresponding to the target knowledge base is recorded as the corresponding target editor, and the user behavior data of all users using the target editor is continuously tracked and the first user historical behavior data sequence corresponding to each user is refreshed based on the tracking results, and when all the first user historical behavior data sequences obtained can cover all knowledge domain categories of the target knowledge base and all knowledge editing strategies of the target editor, a data set for training knowledge editing strategy identification tasks is constructed based on all the first user historical behavior data sequences obtained and recorded as the corresponding third data set; and a baseline discriminator model is designed, and then the baseline discriminator model is trained based on the first, second and third data sets to obtain the corresponding knowledge compliance discriminant model, knowledge consistency discriminant model and knowledge editing strategy discriminant model; then, when any user uses the target editor to process the knowledge addition task, the current time is recorded as the corresponding third data set. The added knowledge item information is taken as the corresponding current knowledge item, and a compliance check is performed based on the current knowledge item and the knowledge compliance discrimination model to obtain the corresponding check result, which is fed back to the target editor; and when any user uses the target editor to process the knowledge addition or modification task, the knowledge item information added or modified at that time is taken as the corresponding current knowledge item, and a synonym item query is performed on the target knowledge base based on the current knowledge item to obtain the corresponding synonym item sequence, and when the synonym item sequence is not empty, a consistency check is performed based on the current knowledge item, the synonym item sequence and the knowledge consistency discrimination model to obtain the corresponding check result, which is fed back to the target editor; and when any user uses the target editor to complete a knowledge query and selects a knowledge item obtained by the query, the currently selected knowledge item information is taken as the corresponding current knowledge item, and the first user historical behavior data sequence corresponding to the current user is taken as the corresponding current user historical behavior data sequence, and an editing strategy recommendation process is performed based on the current knowledge item, the current user historical behavior data sequence and the knowledge editing strategy discrimination model to obtain the corresponding recommendation strategy, which is fed back to the target editor. Developers of custom editors can better solve or improve the compliance problems, consistency problems and user experience problems existing in conventional custom editors by using the three types of discrimination models (knowledge compliance discrimination model, knowledge consistency discrimination model, and knowledge editing strategy discrimination model) provided by the embodiments of the present invention; the embodiments of the present invention not only improve the data compliance verification capability and data consistency assurance capability of the custom editor, but also improve the user experience of the custom editor.
[0191] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0192] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A processing method for a discriminator model for knowledge editing, characterized in that: The method comprises: Based on the preset target knowledge base, a data set for training the knowledge compliance verification task is constructed and recorded as the corresponding first data set; and based on the target knowledge base, a data set for training the knowledge consistency verification task is constructed and recorded as the corresponding second data set; and the knowledge editor corresponding to the target knowledge base is recorded as the corresponding target editor; and the user behavior data of all users using the target editor is continuously tracked and the first user historical behavior data sequence corresponding to each user is refreshed based on the tracking results; and when all the first user historical behavior data sequences obtained can cover all knowledge domain categories of the target knowledge base and all knowledge editing strategies of the target editor, a data set for training the knowledge editing strategy identification task is constructed based on all the first user historical behavior data sequences obtained and recorded as the corresponding third data set; Design a benchmark discriminator model; and train the benchmark discriminator model based on the first data set to obtain a corresponding knowledge compliance discriminant model; and train the benchmark discriminator model based on the second data set to obtain a corresponding knowledge consistency discriminant model; and train the benchmark discriminator model based on the third data set to obtain a corresponding knowledge editing strategy discriminant model; When any user uses the target editor to process a knowledge adding task, the knowledge item information added at that time is used as the corresponding current knowledge item; and a compliance check is performed based on the current knowledge item and the knowledge compliance discrimination model to obtain a corresponding first check result and feed it back to the target editor; When any user uses the target editor to process a knowledge addition or modification task, the knowledge item information added or modified at that time is used as the corresponding current knowledge item; and based on the current knowledge item, a synonym item query is performed on the target knowledge base to obtain a corresponding synonym item sequence; and when the synonym item sequence is not empty, a consistency check is performed based on the current knowledge item, the synonym item sequence and the knowledge consistency judgment model to obtain a corresponding second check result and feed it back to the target editor; When any user uses the target editor to complete a knowledge query and selects a knowledge item obtained by the query, the currently selected knowledge item information is used as the corresponding current knowledge item; and the first user historical behavior data sequence corresponding to the current user is used as the corresponding current user historical behavior data sequence; and based on the current knowledge item, the current user historical behavior data sequence and the knowledge editing strategy discrimination model, editing strategy recommendation processing is performed to obtain the corresponding strategy recommendation result and feedback to the target editor.
2. The processing method of the discriminator model for knowledge editing according to claim 1, characterized in that: The target knowledge base includes a plurality of first knowledge items; the data elements of the first knowledge items at least include a first item identifier, a first creation / update time, a first triple element, a first knowledge weight and a first knowledge domain category; The first triple element includes a first knowledge subject, a first subject-object relationship and a first knowledge object; The knowledge structure rules corresponding to the target knowledge base include a plurality of knowledge structure constraints; each of the knowledge structure constraints is used to constrain the data format or data type of a class of data elements of a knowledge item; The first data set includes a plurality of first data records; the first data record includes a first training sequence and a first label vector; the first training sequence is a text sequence, which is sequentially spliced by a first training knowledge subject, the first separator, a first training subject-object relationship, the first separator and a first training knowledge object; the first label vector is composed of a plurality of first label probabilities, and the first label probabilities correspond one-to-one to the knowledge structure constraints; if the first training sequence satisfies a constraint condition of a certain knowledge structure constraint, the first label probability corresponding to the current knowledge structure constraint in the first label vector is 1; if the first training sequence does not satisfy a constraint condition of a certain knowledge structure constraint, the first label probability corresponding to the current knowledge structure constraint in the first label vector is 0; The second data set includes a plurality of second data records; the second data records include a second training sequence and a second label vector; the second training sequence is formed by sorting a plurality of first training item element groups; the first item training element group includes a first item object and a first item knowledge domain category; The second label vector is composed of a plurality of second label probabilities, and the second label probabilities correspond one-to-one to the first training item element groups; If the content of one of the first training item element groups in the second training sequence is consistent with the content of all other first training item element groups, the corresponding second label probability is 1; if the content of one of the first training item element groups in the second training sequence is not consistent with the content of any other first training item element groups, the corresponding second label probability is 0; The third data set includes a plurality of third data records; the third data record includes a third training sequence and a third label vector; the third training sequence is formed by sorting a plurality of first training behavior data in chronological order; The first training behavior data includes a first training knowledge domain selection and a first training editing strategy selection; the first training knowledge domain selection includes multiple types of the knowledge domain categories, and the first training editing strategy selection includes multiple types of the knowledge editing strategies; The third label vector is composed of a plurality of third label probabilities, each of which corresponds to a domain+strategy combination consisting of a class of the knowledge domain category and a class of the knowledge editing strategy; the value of the third label probability is 0 or 1, and there is only one third label probability in the third label vector that is 1; the third data set should cover all the knowledge domain categories of the target knowledge base and all the knowledge editing strategies of the target editor; The first user historical behavior data sequence is composed of multiple first user historical behavior data sorted in chronological order; the first user historical behavior data includes a first user knowledge field selection and a first user editing strategy selection; the first user knowledge field selection includes multiple categories of the knowledge field categories, and the first user editing strategy selection includes multiple categories of the knowledge editing strategies.
3. The processing method of the discriminator model for knowledge editing according to claim 2, characterized in that: The benchmark discriminator model is used to perform classification and discrimination processing according to the model input sequence and output a corresponding classification and discrimination vector; the discrimination prediction vector is composed of a plurality of classification and discrimination probabilities, each of which corresponds to a discrimination type; The benchmark discriminator model includes an encoding layer, a linear attention layer, a pooling layer, a fully connected network and a Softmax layer; the encoding layer is implemented based on the Encoder model structure of the Transformer architecture; the input end of the encoding layer is connected to the model input end, and the output end is connected to the input end of the linear attention layer; the output end of the linear attention layer is connected to the input end of the pooling layer; the output end of the pooling layer is connected to the input end of the fully connected network; the output end of the fully connected network is connected to the input end of the Softmax layer; the output end of the Softmax layer is connected to the output end of the model; The knowledge compliance discrimination model is used to perform corresponding compliance classification discrimination processing on a type of input sequence input to the model and output a corresponding compliance classification discrimination vector; the type of input sequence is a text sequence, which is sequentially spliced by a knowledge subject, a first separator, a subject-object relationship, the first separator and a knowledge object; the first separator is a preset single character; the compliance classification discrimination vector is composed of multiple compliance classification discrimination probabilities; the compliance classification discrimination probabilities correspond one-to-one to the knowledge structure constraints; The knowledge consistency discrimination model is used to perform corresponding consistency classification discrimination processing on the two-category input sequence of the model input and output the corresponding consistency classification discrimination vector; the two-category input sequence is formed by sorting a plurality of item element groups; the item element groups include item objects and item knowledge domain categories; The consistency classification discriminant vector is composed of a plurality of consistency classification discriminant probabilities; the consistency classification discriminant probabilities correspond one-to-one to the entry element groups; The knowledge editing strategy discrimination model is used to perform corresponding editing strategy classification and discrimination processing on three types of input sequences input by the model and output corresponding domain strategy classification discrimination vectors; the three types of input sequences are formed by sorting multiple historical behavior data of the same user in chronological order; the historical behavior data includes knowledge domain selection and editing strategy selection; The knowledge domain selection includes multiple categories of the knowledge domain, and the editing strategy selection includes multiple categories of the knowledge editing strategies; The domain strategy classification discrimination vector is composed of multiple domain strategy classification discrimination probabilities, each of the domain strategy classification discrimination probability corresponds to a domain + strategy combination consisting of a class of the knowledge domain category and a class of the knowledge editing strategy; the total number of the domain strategy classification discrimination probabilities is consistent with the total number of combinations of the domain + strategy combinations of the target knowledge base and the target editor.
4. The processing method of the discriminator model for knowledge editing according to claim 2, characterized in that: The data set for knowledge compliance verification task training based on the preset target knowledge base is recorded as the corresponding first data set, which specifically includes: Extract all the first knowledge items in the target knowledge base that satisfy the knowledge structure rule to form a corresponding first item set; and performing a round of traversal on all the first knowledge items of the first item set; and in this round of traversal, taking the first knowledge item currently traversed as the corresponding current knowledge item; and performing a first positive sample record generation process based on the current knowledge item to obtain a corresponding first data record; and performing a first negative sample record generation process based on the current knowledge item to obtain a corresponding first data record; and at the end of this round of traversal, all the first data records obtained form the corresponding first data set; in, The first positive sample record generation process based on the current knowledge entry is performed to obtain a corresponding first data record, specifically: the first knowledge subject, the first subject-object relationship and the first knowledge object of the first triple element of the current knowledge entry are extracted as the corresponding first training knowledge subject, the first training subject-object relationship and the first training knowledge object; and the first training knowledge subject, the first separator, the first training subject-object relationship, the first separator and the first training knowledge object are sequentially spliced and the obtained spliced text sequence is used as the corresponding first training sequence; and a numerical vector with all vector data being 1 is constructed as the corresponding first label vector with the total number of the knowledge structure constraints of the knowledge structure rule as the vector length; and a corresponding first data record is composed of the first training sequence and the first label vector corresponding to the current knowledge entry; The first negative sample record generation process based on the current knowledge entry obtains a corresponding first data record, specifically: extracting the first knowledge subject, the first subject-object relationship and the first knowledge object of the first triple element of the current knowledge entry as the corresponding first training knowledge subject, the first training subject-object relationship and the first training knowledge object; and randomly modifying the obtained first training knowledge subject and / or the first training subject-object relationship and / or the first training knowledge object in a violation modification manner that violates the knowledge structure rule; and after completing this violation modification, modifying each constraint condition in the knowledge structure rule that is caused by this violation modification to fail The satisfied knowledge structure constraints are recorded as corresponding violation constraints; and the latest first training knowledge subject, the first separator, the latest first training subject-object relationship, the first separator and the latest first training knowledge object are sequentially spliced and the obtained spliced text sequence is used as the corresponding first training sequence; and a numerical vector with all vector data being 1 is constructed with the total number of the knowledge structure constraints of the knowledge structure rules as the vector length as the corresponding first label vector; and the vector data corresponding to each violation constraint in the current first label vector is reset to 0; and the first training sequence and the first label vector finally obtained form a corresponding first data record.
5. The processing method of the discriminator model for knowledge editing according to claim 2, characterized in that: The data set for training the knowledge consistency verification task based on the target knowledge base is recorded as the corresponding second data set, which specifically includes: Extract a group of the first knowledge items in the target knowledge base, whose first knowledge subjects are synonyms to each other, whose first subject-object relationships are synonyms to each other, whose contents of the first knowledge objects are consistent, and whose contents of the first knowledge domain categories are consistent, to form a corresponding first synonymous item sequence; and form a corresponding first sequence set from all the obtained first synonymous item sequences; and performing a round of traversal on all the first synonymous item sequences of the first sequence set; and in the process of this round of traversal, taking the first synonymous item sequence currently traversed as the corresponding current synonymous item sequence; and performing a second positive sample record generation process based on the current synonymous item sequence to obtain a corresponding second data record; and performing a second negative sample record generation process based on the current synonymous item sequence to obtain a corresponding second data record; and at the end of this round of traversal, all the obtained second data records form a corresponding second data set; in, The second positive sample record generation process based on the current synonymous item sequence is performed to obtain a corresponding second data record, specifically: the first knowledge object and the first knowledge domain category of each first knowledge item in the current synonymous item sequence are extracted as the corresponding first item object and the first item knowledge domain category to form a corresponding first training item element group; and all the obtained first training item element groups are sequentially sorted to form a corresponding second training sequence; and a numerical vector with all vector data being 1 is constructed as the corresponding second label vector with the total number of the first knowledge items in the current synonymous item sequence as the vector length; and a corresponding second data record is formed by the second training sequence and the second label vector corresponding to the current synonymous item sequence; The second negative sample record generation process based on the current synonymous item sequence is performed to obtain a corresponding second data record, specifically: the first knowledge object and the first knowledge domain category of each of the first knowledge items in the current synonymous item sequence are extracted as the corresponding first item object and the first item knowledge domain category to form a corresponding first training item element group; and all the obtained first training item element groups are sequentially sorted to form a corresponding second training sequence; and the first item object and / or the first item knowledge domain category of part or all of the first training item element groups of the obtained second training sequence are randomly modified, so that the data content of part or all of the first training item element groups of the second training sequence cannot be consistent; and after completing the sequence modification, the first training item element group in the second training sequence that is inconsistent with the data content of any other first training item element group is recorded as a corresponding inconsistent element group; and a numerical vector with all vector data being 1 is constructed as the corresponding second label vector with the total number of the first knowledge items in the current synonymous item sequence as the vector length; and the vector data corresponding to each of the inconsistent element groups in the second label vector is reset to 0; and the finally obtained second training sequence and the second label vector form a corresponding second data record.
6. The processing method of the discriminator model for knowledge editing according to claim 2, characterized in that: The continuously tracking the user behavior data of all users using the target editor and refreshing the first user historical behavior data sequence corresponding to each user based on the tracking result specifically includes: When any user uses the target editor for the first time, an empty sequence is created for the current user as the corresponding historical behavior data sequence of the first user; And every time any user uses the target editor to add knowledge or modify a first knowledge item in the target knowledge base, the first knowledge domain category of the first knowledge item being processed by the current user is extracted as the corresponding first user knowledge domain selection, and the knowledge editing strategy being used by the current user on the target editor is taken as the corresponding first user editing strategy selection, and the first user knowledge domain selection and the first user editing strategy selection obtained this time form a corresponding first user historical behavior data, which is added to the first user historical behavior data sequence corresponding to the current user.
7. The processing method of the discriminator model for knowledge editing according to claim 2, characterized in that: The data set for training the knowledge editing strategy identification task based on all the first user historical behavior data sequences is constructed as the corresponding third data set, which specifically includes: Perform a round of traversal on all the first user historical behavior data sequences obtained; and in this round of traversal, use the first user historical behavior data sequence currently traversed as the corresponding current data sequence; and count the total number of the first user historical behavior data of the current data sequence and use the statistical result as the corresponding current sequence length; and identify whether the current sequence length exceeds a preset first sequence length threshold; if not, use the current data sequence as a corresponding first data sequence; if so, use the first sequence length threshold as the corresponding maximum slice sequence length, and perform sliding slicing processing on the current data sequence based on a preset sliding step size and the maximum slice sequence length to obtain multiple corresponding slice data sequences, and use each of the slice data sequences as a corresponding first data sequence; After the traversal of all the first user historical behavior data sequences is completed, continue to perform another round of traversal on all the obtained first data sequences; and in this round of traversal, take the currently traversed first data sequence as the corresponding current data sequence; and extract the first user knowledge field selection and the first user editing strategy selection of each of the first user historical behavior data in the current data sequence as the corresponding first training knowledge field selection and the first training editing strategy selection to form a corresponding first training behavior data; and sort all the obtained first training behavior data in chronological order to form a corresponding first temporary sequence; and record the last first training behavior data in the first temporary sequence as the corresponding target behavior data; and take the first temporary sequence with the target behavior data removed as a corresponding third training sequence; and Identify all the domain+strategy combinations of the target knowledge base and the target editor to obtain a corresponding domain+strategy combination set, and count the total number of combinations of the domain+strategy combination set to obtain a corresponding first total number of combinations; and construct a numerical vector with all vector data being 0 as the corresponding third label vector with the first total number of combinations as the vector length; and record the domain+strategy combination corresponding to the first training knowledge domain selection and the first training editing strategy selection of the target behavior data as the corresponding target combination; and reset the vector data corresponding to the target combination in the third label vector to 1; and after completing the vector reset, form a corresponding third data record by the third training sequence corresponding to the current data sequence and the third label vector; and at the end of this round of traversal, form a corresponding third data set by all the obtained third data records.
8. The processing method of the discriminator model for knowledge editing according to claim 3, characterized in that: The compliance check based on the current knowledge item and the knowledge compliance judgment model is performed to obtain a corresponding first check result and to feed back the corresponding first check result to the target editor, specifically including: Step 81, extracting the corresponding knowledge subject, subject-object relationship and knowledge object from the current knowledge entry as the corresponding current knowledge subject, current subject-object relationship and current knowledge object; and sequentially splicing the current knowledge subject, the first separator, the current subject-object relationship, the first separator and the current knowledge object into a corresponding text sequence as the corresponding first input sequence; Step 82, inputting the first input sequence into the knowledge compliance discrimination model to perform corresponding compliance classification discrimination processing and using the output vector of the model as the corresponding first compliance classification discrimination vector; Step 83, identifying whether each compliance classification discrimination probability in the first compliance classification discrimination vector exceeds a preset compliance probability threshold, if so, recording the current compliance classification discrimination probability as a corresponding first compliance probability, if not, recording the current compliance classification discrimination probability as a corresponding first violation probability; Step 84, setting a corresponding first inspection state for each of the knowledge structure constraints of the knowledge structure rule; and when the total number of the first compliance probabilities is not zero, setting the first inspection state corresponding to each of the first compliance probabilities to inspection pass; and when the total number of the first violation probabilities is not zero, setting the first inspection state corresponding to each of the first violation probabilities to inspection fail; Step 85, each of the first inspection states that have been set and the corresponding knowledge structure constraints form a corresponding first inspection record; and all the first inspection records obtained form the corresponding first inspection result and feed it back to the target editor.
9. The processing method of the discriminator model for knowledge editing according to claim 3, characterized in that: The performing consistency check based on the current knowledge item, the synonymous item sequence and the knowledge consistency judgment model to obtain a corresponding second check result and feeding it back to the target editor specifically includes: Step 91, extracting the corresponding knowledge object and knowledge domain category from the current knowledge item to form a corresponding first item element group; extracting the first knowledge object and the first knowledge domain category of each of the first knowledge items in the synonymous item sequence to form a corresponding first item element group; and sequentially sorting all the obtained first item element groups to form a corresponding second input sequence; Step 92, inputting the second input sequence into the knowledge consistency discrimination model to perform corresponding consistency classification discrimination processing and using the output vector of the model as the corresponding first consistency classification discrimination vector; Step 93, identifying whether each consistency classification discrimination probability in the first consistency classification discrimination vector exceeds a preset consistency probability threshold, if so, recording the current consistency classification discrimination probability as a corresponding second compliance probability, if not, recording the current consistency classification discrimination probability as a corresponding second violation probability; Step 94, setting a corresponding second inspection state for each knowledge item corresponding to each of the first item element groups of the second input sequence; and when the total number of the second compliance probabilities is not zero, setting the second inspection state corresponding to each of the second compliance probabilities to inspection passed; and when the total number of the second violation probabilities is not zero, setting the second inspection state corresponding to each of the second violation probabilities to inspection failed; Step 95, each of the second inspection states that have been set and the corresponding knowledge items form a corresponding second inspection record; and all the second inspection records obtained form the corresponding second inspection result and feed it back to the target editor.
10. The processing method of the discriminator model for knowledge editing according to claim 3, characterized in that: The step of performing editing strategy recommendation processing based on the current knowledge entry, the current user historical behavior data sequence and the knowledge editing strategy discrimination model to obtain a corresponding strategy recommendation result and feeding it back to the target editor specifically includes: Step 101, inputting the current user historical behavior data sequence into the knowledge editing strategy discrimination model to perform corresponding editing strategy classification and discrimination processing and using the output vector of the model as the corresponding first domain strategy classification and discrimination vector; Step 102, taking the domain + strategy combination corresponding to the largest domain strategy classification discrimination probability in the first domain strategy classification discrimination vector as the corresponding predicted domain + strategy combination; and taking the knowledge domain category and the knowledge editing strategy corresponding to the predicted domain + strategy combination as the corresponding predicted knowledge domain category and predicted knowledge editing strategy; Step 103, identifying whether the knowledge domain category corresponding to the current knowledge entry matches the predicted knowledge domain category; if so, taking the predicted knowledge editing strategy as the corresponding strategy recommendation result; if not, extracting a plurality of domain + strategy combinations whose knowledge domain categories match the knowledge domain category corresponding to the current knowledge entry from all the domain + strategy combinations corresponding to the target knowledge base and the target editor to form a corresponding first combination set, extracting the domain strategy classification discrimination probabilities corresponding to each of the domain + strategy combinations in the first combination set from the first domain strategy classification discrimination vector to form a corresponding first probability set, and taking the knowledge editing strategy corresponding to the domain + strategy combination corresponding to the maximum probability in the first probability set as the corresponding strategy recommendation result; Step 104: Feedback the obtained strategy recommendation result to the target editor.
11. A device for executing the processing method of the discriminator model for knowledge editing according to any one of claims 1 to 10, characterized in that: The device comprises: a data set preparation module, a model construction and training module, a first model application module, a second model application module and a third model application module; The data set preparation module is used to construct a data set for knowledge compliance verification task training based on a preset target knowledge base, which is recorded as the corresponding first data set; and to construct a data set for knowledge consistency verification task training based on the target knowledge base, which is recorded as the corresponding second data set; and to record the knowledge editor corresponding to the target knowledge base as the corresponding target editor; and to continuously track the user behavior data of all users using the target editor and refresh the first user historical behavior data sequence corresponding to each user based on the tracking results; and when all the first user historical behavior data sequences obtained can cover all knowledge domain categories of the target knowledge base and all knowledge editing strategies of the target editor, a data set for knowledge editing strategy identification task training is constructed based on all the first user historical behavior data sequences obtained, which is recorded as the corresponding third data set; The model building and training module is used to design a benchmark discriminator model; and based on the first data set, the benchmark discriminator model is trained to obtain a corresponding knowledge compliance discriminant model; and based on the second data set, the benchmark discriminator model is trained to obtain a corresponding knowledge consistency discriminant model; and based on the third data set, the benchmark discriminator model is trained to obtain a corresponding knowledge editing strategy discriminant model; The first model application module is used to use the knowledge item information added at that time as the corresponding current knowledge item when any user uses the target editor to process the knowledge adding task; and to perform compliance check based on the current knowledge item and the knowledge compliance discrimination model to obtain the corresponding first check result and feed it back to the target editor; The second model application module is used to use the knowledge item information added or modified at that time as the corresponding current knowledge item when any user uses the target editor to process the knowledge addition or modification task; and based on the current knowledge item, perform a synonymous item query on the target knowledge base to obtain a corresponding synonymous item sequence; and when the synonymous item sequence is not empty, perform a consistency check based on the current knowledge item, the synonymous item sequence and the knowledge consistency judgment model to obtain a corresponding second check result and feed it back to the target editor; The third model application module is used to use the currently selected knowledge entry information as the corresponding current knowledge entry when any user uses the target editor to complete a knowledge query and selects a knowledge entry obtained by the query; and use the first user historical behavior data sequence corresponding to the current user as the corresponding current user historical behavior data sequence; and perform editing strategy recommendation processing based on the current knowledge entry, the current user historical behavior data sequence and the knowledge editing strategy discrimination model to obtain the corresponding strategy recommendation result and feed it back to the target editor.
12. An electronic device, characterized in that: include: memory, processors, and transceivers; The processor is used to couple with the memory, read and execute instructions in the memory, so as to implement the method according to any one of claims 1 to 10; The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer is enabled to execute the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Design method of expert knowledge base oriented to intelligent garment manufacturing
CN105354375A
Knowledge retrieval method and device, electronic equipment and computer readable storage medium
CN115269815A
Equipment use and maintenance knowledge base integrated with intelligent learning function
CN117271700A
LLM-based insurance professional knowledge management system
CN118035418A
Visual development system for knowledge graph
CN118093895A
