Knowledge comparison and annotation method, device, electronic device and storage medium
Through keyword extraction and comparison techniques, the keyword sequence of knowledge is generated and the labeling of different granularities is performed, which solves the problem of insufficient knowledge comparison in the existing technology, and achieves a more efficient knowledge acquisition experience.
Patent Information
- Application Number
- CN202111033485.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-03
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2041-09-03
AI Technical Summary
In the knowledge comparison, it is difficult for the existing technology to quickly distinguish the similarities and differences in content, resulting in the inadequate labeling and inability to meet users' convenient needs for knowledge acquisition.
Keyword sequences of knowledge are generated by keyword extraction, weights are used to represent the importance of keywords, and the keyword sequences are marked at different granularities to achieve fine distinction of knowledge.
It provides appropriate granularity, intuitive and convenient knowledge comparison functions, improves users' reading experience of knowledge and can more accurately identify the differences between knowledge.
Smart Images

Figure CN113672707B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and more specifically, to a knowledge comparison and annotation method, device, electronic device and storage medium. Background Art
[0002] There is a vast amount of knowledge in the knowledge base system. There are similarities and differences between knowledge. When conducting knowledge query, how to quickly distinguish the differences between two or more pieces of knowledge makes it easier for us to acquire knowledge.
[0003] At present, traditional knowledge comparison is generally based on the comparison of text characters only, and different characters are marked. When comparing knowledge with very different contents and knowledge with similar contents, it is not possible to mark with appropriate granularity. Often, knowledge with very different contents is only identified with large content differences, and the differences cannot be refined and need to be compared again. For knowledge with similar contents, the differences cannot be marked appropriately. Summary of the invention
[0004] In view of this, in order to solve the above problems, the present invention provides a knowledge comparison and annotation method, device, electronic device and storage medium, and the technical solution is as follows:
[0005] A knowledge comparison and annotation method, the method comprising:
[0006] Determine the knowledge to be compared in the knowledge base;
[0007] Generate a keyword sequence corresponding to the knowledge by keyword extraction, wherein the keyword sequence is composed of a plurality of keywords with the highest weights, and the weights represent the importance of the corresponding keywords in the knowledge;
[0008] For the first knowledge and the second knowledge in the knowledge, different granularity annotations are performed by comparing the keywords in the keyword sequences of the two.
[0009] Preferably, the step of generating a keyword sequence corresponding to the knowledge by keyword extraction includes:
[0010] Extract keywords from the knowledge based on natural language processing technology to determine a first keyword weight set corresponding to the knowledge, where the keyword weight set consists of different keywords and their weights;
[0011] Extract keywords from the knowledge based on triple extraction technology to determine a second keyword weight set corresponding to the knowledge;
[0012] Inputting the first keyword weight set and the second keyword weight set corresponding to the knowledge into a keyword extraction model, wherein the keyword extraction model is obtained by training a basic network model with the first keyword weight set and the second keyword weight set corresponding to the sample knowledge as input and with the goal of making the prediction result of the keyword weight set of the sample knowledge close to its annotation result;
[0013] Obtaining a third keyword weight set corresponding to the knowledge predicted and output by the keyword extraction model;
[0014] According to the weight of each keyword in the third keyword weight set, a keyword sequence corresponding to the knowledge is determined.
[0015] Preferably, the tagging of keywords in keyword sequences of the two with different granularities by comparing them includes:
[0016] Calculating the keyword similarity between the first knowledge and the second knowledge according to the keywords in the keyword sequences corresponding to the first knowledge and the second knowledge;
[0017] When the keyword similarity is less than a corresponding threshold, marking the same / different keywords in the first knowledge and the second knowledge respectively;
[0018] When the keyword similarity is not less than a corresponding threshold, the first knowledge and the second knowledge are processed respectively based on a triple extraction technology to obtain undirected graphs corresponding to the first knowledge and the second knowledge respectively;
[0019] By comparing the nodes and edges of the undirected graph, the keywords corresponding to the non-overlapping nodes / edges in the first knowledge and the second knowledge are respectively marked.
[0020] Preferably, the method further comprises:
[0021] The annotation results of the first knowledge and the second knowledge are output in the form of a floating box.
[0022] A knowledge comparison and annotation device, the device comprising:
[0023] A knowledge determination module is used to determine the knowledge to be compared in the knowledge base;
[0024] A sequence generation module, used to generate a keyword sequence corresponding to the knowledge by keyword extraction, wherein the keyword sequence is composed of a plurality of keywords with the highest weights, and the weights represent the importance of the corresponding keywords in the knowledge;
[0025] The granularity annotation module is used to annotate the first knowledge and the second knowledge in the knowledge with different granularities by comparing the keywords in the keyword sequences of the two.
[0026] Preferably, the sequence generation module is specifically used to:
[0027] Based on natural language processing technology, keywords are extracted from the knowledge to determine a first keyword weight set corresponding to the knowledge, wherein the keyword weight set is composed of different keywords and their weights; based on triple extraction technology, keywords are extracted from the knowledge to determine a second keyword weight set corresponding to the knowledge; the first keyword weight set and the second keyword weight set corresponding to the knowledge are input into a keyword extraction model, wherein the keyword extraction model is obtained by training a basic network model with the first keyword weight set and the second keyword weight set corresponding to the sample knowledge as input and the goal of making the prediction result of the keyword weight set of the sample knowledge close to its annotation result; a third keyword weight set corresponding to the knowledge predicted and output by the keyword extraction model is obtained; and a keyword sequence corresponding to the knowledge is determined according to the weight of each keyword in the third keyword weight set.
[0028] Preferably, the granularity labeling module is specifically used for:
[0029] According to the keywords in the keyword sequences corresponding to the first knowledge and the second knowledge respectively, the keyword similarity between the first knowledge and the second knowledge is calculated; when the keyword similarity is less than the corresponding threshold, the same / different keywords in the first knowledge and the second knowledge are marked respectively; when the keyword similarity is not less than the corresponding threshold, the first knowledge and the second knowledge are processed respectively based on the triple extraction technology to obtain the undirected graphs corresponding to the first knowledge and the second knowledge respectively; by comparing the nodes and edges of the undirected graph, the keywords corresponding to the non-overlapping nodes / edges in the first knowledge and the second knowledge are marked respectively.
[0030] Preferably, the device further comprises:
[0031] The annotation output module is used to output the annotation results of the first knowledge and the second knowledge in the form of a floating box.
[0032] An electronic device comprises: at least one memory and at least one processor; the memory stores a program, the processor calls the program stored in the memory, and the program is used to implement the knowledge comparison and annotation method.
[0033] A storage medium stores computer executable instructions for executing the knowledge comparison and annotation method.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] The present invention provides a knowledge comparison and annotation method, device, electronic device and storage medium. For the knowledge to be compared in the knowledge base, the keyword sequence of the knowledge can be determined by keyword extraction. The keyword sequence is composed of multiple keywords with the highest weights. Since the weights can characterize the importance of the corresponding keywords in the knowledge, the keyword sequence represents the knowledge to the greatest extent. In this regard, for any two pieces of knowledge to be compared, annotations of different granularities can be completed by comparing the keywords in the keyword sequences of the two. Therefore, based on the present invention, it is possible to provide users with a knowledge comparison function of appropriate granularity, intuitiveness and convenience, and improve the user's reading experience of knowledge. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0037] Figure 1 A method flow chart of a knowledge comparison and annotation method provided by an embodiment of the present invention;
[0038] Figure 2 A partial method flow chart of the knowledge comparison and annotation method provided by an embodiment of the present invention;
[0039] Figure 3 A flowchart of another part of the knowledge comparison and annotation method provided by an embodiment of the present invention;
[0040] Figure 4 A schematic diagram of the structure of a knowledge comparison and annotation device provided in an embodiment of the present invention;
[0041] Figure 5 Another structural schematic diagram of the knowledge comparison and annotation device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0044] The embodiment of the present invention provides a knowledge comparison and annotation method, which can realize knowledge comparison of two granularities, identify the differences in knowledge, and better improve the convenience of users to obtain and read knowledge. The method flow chart is as follows: Figure 1 As shown, the method comprises the following steps:
[0045] S10, determining the knowledge to be compared in the knowledge base.
[0046] In the embodiment of the present invention, the user can specify the knowledge to be viewed in the knowledge base and use it as the knowledge to be compared. The knowledge to be compared is at least two pieces.
[0047] S20, generating a keyword sequence corresponding to the knowledge through keyword extraction, wherein the keyword sequence is composed of a plurality of keywords with the highest weights, and the weights represent the importance of the corresponding keywords in the knowledge.
[0048] In the embodiment of the present invention, for each piece of knowledge to be compared, a certain keyword extraction technology can be used to obtain the keywords therein and the weight of the keyword in the knowledge, and the keywords are sorted based on the weight, and the N keywords with the highest weight are selected to form a keyword sequence. It should be noted that N can be set according to the actual scenario.
[0049] In the specific implementation process, the "generating a keyword sequence corresponding to the knowledge by keyword extraction" in step S20 can adopt the following steps, and the method flow chart is as follows: Figure 2 As shown:
[0050] S201, extract keywords from the knowledge based on natural language processing technology, and determine a first keyword weight set corresponding to the knowledge, where the keyword weight set consists of different keywords and their weights.
[0051] In the embodiment of the present invention, for each piece of knowledge to be compared, the natural language processing technology is used to process the knowledge to obtain the keywords in the knowledge and the weights of the keywords, thereby forming a first keyword weight set. In the first keyword weight set, the weight of each keyword represents the importance of the keyword in the knowledge under the language dimension. For example, the more times a keyword appears in the knowledge, that is, the higher the word frequency, the higher its weight.
[0052] It should be noted that the natural language processing technology can be a keyword extraction technology based on TF-IDF.
[0053] S202, extracting keywords from the knowledge based on triple extraction technology, and determining a second keyword weight set corresponding to the knowledge.
[0054] In the embodiment of the present invention, for each piece of knowledge to be compared, the triple extraction technology is used to process the piece of knowledge to obtain the keywords in the piece of knowledge and the weights of the keywords, thereby forming a second keyword weight set. In the second keyword weight set, the weight of each keyword represents the importance of the keyword in the piece of knowledge under the semantic dimension.
[0055] Specifically, based on the entity relationship extraction model, the triple information of "entity-relationship-entity" in the knowledge can be extracted, and the graph model can be further used to convert the triple information into a graph structure, that is, an undirected graph. The nodes in the undirected graph are entity keywords representing entities, some edges are relationship keywords representing relationships, and some edges may not have relationship keywords. Therefore, based on the triple extraction technology, the knowledge can be converted into an undirected graph, so as to extract the entity keywords and relationship keywords in the knowledge, and the respective degrees of the entity keywords and relationship keywords are their respective weights, where the degree of the entity keyword represents the number of edges connected to the entity keyword, and the degree of the relationship keyword represents the number of edges corresponding to the relationship keyword.
[0056] Therefore, based on the present invention, the knowledge is processed using natural language processing technology and triple extraction technology respectively, so as to obtain a set of keyword weights of the knowledge in the language dimension and the semantic dimension. This can comprehensively evaluate the weights of the keywords in the knowledge.
[0057] S203, inputting the first keyword weight set and the second keyword weight set corresponding to the knowledge into the keyword extraction model. The keyword extraction model takes the first keyword weight set and the second keyword weight set corresponding to the sample knowledge as input, and trains the basic network model with the goal of making the prediction result of the keyword weight set of the sample knowledge close to its annotation result.
[0058] In an embodiment of the present invention, for each piece of knowledge to be compared, it has a first keyword weight set in the language dimension and a second keyword weight set in the semantic dimension. In order to comprehensively evaluate the importance of the keywords in the piece of knowledge, the first keyword weight set and the second keyword weight set can be input into a keyword extraction model pre-trained based on a machine learning algorithm. The keyword extraction model predicts the keyword weight set corresponding to the piece of knowledge, that is, the subsequent third keyword weight set.
[0059] It should be noted that the first keyword weight set includes all keywords and their weights in the phonetic dimension, and the second keyword weight set includes all keywords and their weights in the semantic dimension. For a piece of knowledge, the number of keywords that may be involved is very high. Therefore, before inputting the first keyword weight set and the second keyword weight set into the keyword extraction model, the keywords in the first keyword weight set and the second keyword weight set can be screened. For example, the keywords in the first keyword weight set and the second keyword weight set can be sorted based on the weight, and the highest M keywords in the two keyword weight sets are selected respectively, and of course M is greater than N. It should be noted that M can be set according to the actual scenario.
[0060] In addition, in the process of training the keyword extraction model, multiple pieces of knowledge can be configured as sample knowledge, and the sample knowledge can be processed using natural language processing technology and triple extraction technology respectively, so as to obtain the keyword weight set of the sample knowledge in the language dimension and the semantic dimension, that is, the first keyword weight set and the second keyword weight set corresponding to the sample knowledge. Of course, for the sample knowledge, it is also necessary to annotate its keyword weight set, that is, the keywords and their weights required by the user. Further, in the process of each iterative training, the sample knowledge required for this iterative training is selected from the sample knowledge, and the first keyword weight set and the second keyword weight set corresponding to the selected sample knowledge are used as the input of the basic network model. The basic network model adjusts its own network weights to achieve the keyword weight set predicted by the sample knowledge (that is, the prediction result of the keyword weight set) constantly approaching the keyword weight set annotated by the sample knowledge (that is, the annotated result of the keyword weight set). When the number of iterations or the loss function value meets the end condition, the training of the basic network model is terminated, and the basic network model that has been trained is used as the keyword extraction model.
[0061] S204, obtaining a third keyword weight set corresponding to the knowledge predicted and output by the keyword extraction model.
[0062] S205: Determine a keyword sequence corresponding to the knowledge according to the weight of each keyword in the third keyword weight set.
[0063] In the embodiment of the present invention, for the third keyword weight set output by the keyword extraction model, the keywords therein may be sorted based on the weights, and the N keywords with the highest weights may be selected to form a keyword sequence.
[0064] S30, for the first knowledge and the second knowledge in the knowledge, perform annotations of different granularities by comparing the keywords in the keyword sequences of the two.
[0065] In the embodiment of the present invention, for any two pieces of knowledge to be compared (ie, the first knowledge and the second knowledge), the keywords in the keyword sequences of the two pieces of knowledge can be compared, and the two pieces of knowledge can be annotated with coarse and fine granularity according to the comparison result.
[0066] Specifically, in step S30, "comparing the keywords in the keyword sequences of the two to mark the keywords at different granularities" can be performed by the following steps, and the method flow chart is as follows: Figure 3 As shown:
[0067] S301, calculating the keyword similarity between the first knowledge and the second knowledge according to the keywords in the keyword sequences corresponding to the first knowledge and the second knowledge respectively.
[0068] In the embodiment of the present invention, the first knowledge and the second knowledge each have a corresponding keyword sequence, so the keyword sequence corresponding to the first knowledge can be converted into a corresponding word vector, and the keyword sequence corresponding to the second knowledge can be converted into a corresponding word vector. Further, the similarity between the word vector corresponding to the first knowledge and the word vector corresponding to the second knowledge is calculated, and this is used as the keyword similarity between the first knowledge and the second knowledge.
[0069] S302: When the keyword similarity is less than the corresponding threshold, the same / different keywords in the first knowledge and the second knowledge are marked respectively.
[0070] In the embodiment of the present invention, a corresponding threshold value can be set for keyword similarity. When the keyword similarity between the first knowledge and the second knowledge is less than the threshold value, it means that there is a large gap between the first knowledge and the second knowledge, and coarse-grained annotation can be performed; on the contrary, when the keyword similarity between the first knowledge and the second knowledge is not less than the threshold value, it means that the subject content between the first knowledge and the second knowledge is relatively consistent, and fine-grained annotation is required.
[0071] In the process of coarse-grained annotation, for the keyword sequence corresponding to the first knowledge and the keyword sequence corresponding to the second knowledge, the first category of keywords that appear in both keyword sequences and the second category of keywords that appear only in one keyword sequence can be determined. For the first category of keywords, treat them as the same keywords in the first knowledge and the second knowledge, and use one color to annotate them in the first knowledge and the second knowledge; for the second category of keywords, treat them as different keywords in the first knowledge and the second knowledge, and use another verification annotate them in the first knowledge / second knowledge where they are located. In this way, coarse-grained annotation of two pieces of knowledge can be achieved.
[0072] S303: When the keyword similarity is not less than the corresponding threshold, the first knowledge and the second knowledge are processed respectively based on the triple extraction technology to obtain undirected graphs corresponding to the first knowledge and the second knowledge.
[0073] In an embodiment of the present invention, in the process of fine-grained annotation, the first knowledge and the second knowledge can be processed separately based on the triple extraction technology. For each piece of knowledge in the first knowledge and the second knowledge, the triple information of "entity-relationship-entity" in the knowledge can be extracted separately based on the entity relationship extraction model, and the triple information can be further converted into a graph structure, i.e., an undirected graph, using a graph model. Of course, if the undirected graphs of the first knowledge and the second knowledge have been obtained when generating the keyword sequence, they can be directly retrieved at this time.
[0074] S304, by comparing the nodes and edges of the undirected graph, respectively marking the keywords corresponding to the non-overlapping nodes / edges in the first knowledge and the second knowledge.
[0075] In an embodiment of the present invention, since the nodes in the undirected graph are entity keywords and some edges are key keywords, the non-overlapping nodes and edges in the two undirected graphs can be determined by comparing the undirected graph of the first knowledge and the undirected graph of the second knowledge, and then the entity keywords corresponding to the non-overlapping nodes can be marked in the knowledge to which they belong, and the relationship keywords corresponding to the non-overlapping edges can be marked in the knowledge to which they belong.
[0076] Furthermore, to improve the user's preview experience, while the knowledge is coarsely annotated, the annotated results of the first knowledge and the second knowledge can also be output in the form of a floating box. When the user clicks on the annotated keyword in the floating box, the current interface can be jumped to the text where the keyword is located.
[0077] The knowledge comparison and annotation method provided by the embodiment of the present invention can determine the keyword sequence of the knowledge to be compared in the knowledge base through keyword extraction. The keyword sequence is composed of multiple keywords with the highest weights. Since the weights can characterize the importance of the corresponding keywords in the knowledge, the keyword sequence represents the knowledge to the greatest extent. In this regard, for any two pieces of knowledge to be compared, annotations of different granularities can be completed by comparing the keywords in the keyword sequences of the two. Therefore, based on the present invention, it is possible to provide users with a knowledge comparison function of appropriate granularity, intuitiveness, and convenience, thereby improving the user's reading experience of knowledge.
[0078] Based on the knowledge comparison and annotation method provided in the above embodiment, an embodiment of the present invention provides a device for executing the above knowledge comparison and annotation method. The structural diagram of the device is shown in FIG. Figure 4 As shown, including:
[0079] The knowledge determination module 10 is used to determine the knowledge to be compared in the knowledge base;
[0080] A sequence generation module 20 is used to generate a keyword sequence corresponding to the knowledge by keyword extraction, wherein the keyword sequence is composed of a plurality of keywords with the highest weights, and the weights represent the importance of the corresponding keywords in the knowledge;
[0081] The granularity annotation module 30 is used to annotate the first knowledge and the second knowledge in the knowledge with different granularities by comparing the keywords in the keyword sequences of the two.
[0082] Optionally, the sequence generation module 20 is specifically used to:
[0083] Based on natural language processing technology, keywords are extracted from knowledge to determine a first keyword weight set corresponding to the knowledge, where the keyword weight set consists of different keywords and their weights; based on triple extraction technology, keywords are extracted from knowledge to determine a second keyword weight set corresponding to the knowledge; the first keyword weight set and the second keyword weight set corresponding to the knowledge are input into a keyword extraction model, where the keyword extraction model is obtained by training a basic network model with the first keyword weight set and the second keyword weight set corresponding to the sample knowledge as inputs and with the goal of making the predicted result of the keyword weight set of the sample knowledge close to its labeled result; a third keyword weight set corresponding to the knowledge predicted and output by the keyword extraction model is obtained; and a keyword sequence corresponding to the knowledge is determined according to the weight of each keyword in the third keyword weight set.
[0084] Optionally, the granularity labeling module 30 is specifically used for:
[0085] According to the keywords in the keyword sequences corresponding to the first knowledge and the second knowledge respectively, the keyword similarity between the first knowledge and the second knowledge is calculated; when the keyword similarity is less than the corresponding threshold, the same / different keywords in the first knowledge and the second knowledge are marked respectively; when the keyword similarity is not less than the corresponding threshold, the first knowledge and the second knowledge are processed respectively based on the triple extraction technology to obtain the undirected graphs corresponding to the first knowledge and the second knowledge respectively; by comparing the nodes and edges of the undirected graph, the keywords corresponding to the non-overlapping nodes / edges in the first knowledge and the second knowledge are marked respectively.
[0086] Optional, see Figure 5 As shown in the structural schematic diagram, the above device also includes:
[0087] The annotation output module 40 is used to output the annotation results of the first knowledge and the second knowledge in the form of a floating box.
[0088] It should be noted that the detailed functions of each module in the embodiment of the present invention can be found in the corresponding public part of the above-mentioned knowledge comparison and annotation method embodiment, and will not be repeated here.
[0089] Based on the knowledge comparison and annotation method provided in the above embodiment, an embodiment of the present invention provides an electronic device, which includes: at least one memory and at least one processor; the memory stores a program, the processor calls the program stored in the memory, and the program is used to implement the knowledge comparison and annotation method.
[0090] Based on the knowledge comparison and annotation method provided in the above embodiment, an embodiment of the present invention provides a storage medium correspondingly, in which computer executable instructions are stored, and the computer executable instructions are used to execute the knowledge comparison and annotation method.
[0091] It should be noted that the knowledge comparison and annotation method, device, electronic device and storage medium provided by the present invention can be used in the field of artificial intelligence or finance. The above is only an example and does not limit the application field of the knowledge comparison and annotation method, device, electronic device and storage medium provided by the present invention.
[0092] The above is a detailed introduction to a knowledge comparison and annotation method, device, electronic device and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
[0093] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0094] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device that includes a series of elements is inherent to the elements, or also includes elements inherent to these processes, methods, articles or devices. In the absence of further restrictions, the elements defined by the sentence "including a..." do not exclude the presence of other identical elements in the process, method, article or device that includes the elements.
[0095] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A knowledge comparison and annotation method, characterized in that: The method comprises: Determine the knowledge to be compared in the knowledge base; Generate a keyword sequence corresponding to the knowledge by keyword extraction, wherein the keyword sequence is composed of a plurality of keywords with the highest weights, and the weights represent the importance of the corresponding keywords in the knowledge; For the first knowledge and the second knowledge in the knowledge, different granularity annotations are performed by comparing keywords in the keyword sequences of the two knowledge; The step of generating a keyword sequence corresponding to the knowledge by keyword extraction includes: Extract keywords from the knowledge based on natural language processing technology to determine a first keyword weight set corresponding to the knowledge, wherein the keyword weight set consists of different keywords and their weights; Extract keywords from the knowledge based on triple extraction technology to determine a second keyword weight set corresponding to the knowledge; Inputting the first keyword weight set and the second keyword weight set corresponding to the knowledge into a keyword extraction model, wherein the keyword extraction model is obtained by training a basic network model with the first keyword weight set and the second keyword weight set corresponding to the sample knowledge as input and with the goal of making the prediction result of the keyword weight set of the sample knowledge close to its annotation result; Obtaining a third keyword weight set corresponding to the knowledge predicted and output by the keyword extraction model; Determining a keyword sequence corresponding to the knowledge according to the weight of each keyword in the third keyword weight set; The tagging of keywords in keyword sequences of the two websites at different granularities by comparing them includes: Calculating the keyword similarity between the first knowledge and the second knowledge according to the keywords in the keyword sequences corresponding to the first knowledge and the second knowledge; When the keyword similarity is less than a corresponding threshold, marking the same / different keywords in the first knowledge and the second knowledge respectively; When the keyword similarity is not less than a corresponding threshold, the first knowledge and the second knowledge are processed respectively based on a triple extraction technology to obtain undirected graphs corresponding to the first knowledge and the second knowledge respectively; By comparing the nodes and edges of the undirected graph, the keywords corresponding to the non-overlapping nodes / edges in the first knowledge and the second knowledge are respectively marked.
2. The method according to claim 1, characterized in that The method further comprises: The annotation results of the first knowledge and the second knowledge are output in the form of a floating box.
3. A knowledge comparison and annotation device, characterized in that: The device comprises: A knowledge determination module is used to determine the knowledge to be compared in the knowledge base; A sequence generation module, used to generate a keyword sequence corresponding to the knowledge by keyword extraction, wherein the keyword sequence is composed of a plurality of keywords with the highest weights, and the weights represent the importance of the corresponding keywords in the knowledge; A granularity annotation module, for annotating the first knowledge and the second knowledge in the knowledge with different granularities by comparing the keywords in the keyword sequences of the two knowledge; Wherein, the sequence generation module is specifically used for: Perform keyword extraction on the knowledge based on natural language processing technology to determine a first keyword weight set corresponding to the knowledge, wherein the keyword weight set is composed of different keywords and their weights; perform keyword extraction on the knowledge based on triple extraction technology to determine a second keyword weight set corresponding to the knowledge; input the first keyword weight set and the second keyword weight set corresponding to the knowledge into a keyword extraction model, wherein the keyword extraction model is obtained by training a basic network model with the first keyword weight set and the second keyword weight set corresponding to the sample knowledge as input and the goal of making the prediction result of the keyword weight set of the sample knowledge close to its annotation result; obtain a third keyword weight set corresponding to the knowledge predicted and output by the keyword extraction model; determine a keyword sequence corresponding to the knowledge according to the weight of each keyword in the third keyword weight set; Wherein, the granularity labeling module is specifically used for: According to the keywords in the keyword sequences corresponding to the first knowledge and the second knowledge respectively, the keyword similarity between the first knowledge and the second knowledge is calculated; when the keyword similarity is less than the corresponding threshold, the same / different keywords in the first knowledge and the second knowledge are marked respectively; when the keyword similarity is not less than the corresponding threshold, the first knowledge and the second knowledge are processed respectively based on the triple extraction technology to obtain the undirected graphs corresponding to the first knowledge and the second knowledge respectively; by comparing the nodes and edges of the undirected graph, the keywords corresponding to the non-overlapping nodes / edges in the first knowledge and the second knowledge are marked respectively.
4. The device according to claim 3, characterized in that The device also includes: The annotation output module is used to output the annotation results of the first knowledge and the second knowledge in the form of a floating box.
5. An electronic device, characterized in that: The electronic device includes: at least one memory and at least one processor; the memory stores a program, the processor calls the program stored in the memory, and the program is used to implement the knowledge comparison and annotation method described in claim 1 or 2.
6. A storage medium, characterized in that: The storage medium stores computer executable instructions, and the computer executable instructions are used to execute the knowledge comparison and annotation method described in claim 1 or 2.
Citation Information
Patent Citations
Chinese comparative sentence recognizing method and device based on neural network
CN104021115A
Sequence labeling method and apparatus, computer device and storage medium
WO2021027125A1