Semantic disambiguation method, device, electronic device and storage medium

By performing entity linking and knowledge graph pattern element linking on the text data input by users in the KBQA system, generating candidate subgraphs and calculating scores, the problem of low accuracy of the existing KBQA system in semantic disambiguation is solved, and a more efficient and accurate semantic disambiguation effect is achieved.

CN114625889BActive Publication Date: 2025-09-09DATAGRAND TECH INC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210305889.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-25
Publication Date
2025-09-09
Estimated Expiration
2042-03-25

AI Technical Summary

Technical Problem

The existing KBQA system has low accuracy and efficiency in semantic disambiguation, especially in high-demand scenarios, where it is difficult to effectively resolve ambiguous problems.

Method used

By obtaining text data input by the user, each word is linked to entities and knowledge graph pattern elements, determining at least two semantic combinations and generating corresponding candidate subgraphs. Scores are calculated based on the node relationship scores in the candidate subgraphs. The target candidate subgraphs that meet the preset conditions are used to determine the disambiguated semantic combinations, ultimately determining the semantic disambiguation results for the text data.

Benefits of technology

The accuracy and efficiency of semantic disambiguation have been improved, which enables more accurate identification and elimination of semantic ambiguity in text data, and improves the accuracy of answers in the KBQA system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114625889B_ABST
    Figure CN114625889B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a semantic disambiguation method, device, electronic device and storage medium, including: obtaining text data input by a user, performing entity linking and knowledge graph pattern element linking on each word in the text data, and obtaining link results for each word; determining at least two semantic combinations based on the link results, and generating candidate subgraphs corresponding to each semantic combination; calculating the score of each candidate subgraph based on the score corresponding to the relationship between the nodes in each candidate subgraph, and determining the semantic combination after disambiguation based on the target candidate subgraph whose score meets the preset conditions; and determining the semantic disambiguation result of the text data based on the semantic combination after disambiguation. Semantic disambiguation is performed by simultaneously linking the knowledge graph pattern elements and the candidate subgraph elements, and by constructing corresponding candidate subgraphs for multiple semantic combinations and calculating the score of each candidate subgraph to disambiguate the semantic combination, thereby improving the accuracy and efficiency of semantic disambiguation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing, and in particular to a semantic disambiguation method, device, electronic device and storage medium. Background Art

[0002] Knowledge-based question answering (KBQA) is an advanced form of information retrieval system. Its purpose is to answer user questions posed in natural language using concise natural language. The current KBQA process includes question preprocessing, entity linking, entity and semantic disambiguation, intent identification, and answer query and return. Due to the inherent complexity and ambiguity of natural language, it is difficult for the system to accurately understand the user's intent. If the input question is ambiguous, the system cannot identify and disambiguate it, resulting in no answer or an incorrect answer.

[0003] Currently, common KBQA systems do not provide a good solution for semantic disambiguation. The conventional approach is to disambiguate the entities mentioned in the sentence based on an established entity mapping dictionary or based on the semantic similarity characteristics between the question and the entity. However, this method cannot disambiguate other knowledge graph pattern elements mentioned in the sentence; the second approach is to generate a subgraph based on the constructed knowledge graph for the semantically mentioned elements, calculate the similarity between the text data and the candidate subgraphs, sort the candidate subgraphs, and select the candidate subgraph with the highest similarity as the disambiguation result. The problem with this method is that the results have certain errors and cannot be used in scenarios where high accuracy is required. Therefore, existing semantic disambiguation methods have low accuracy and low efficiency, and urgently need to be improved. Summary of the Invention

[0004] The present invention provides a semantic disambiguation method, device, electronic device and storage medium to improve the accuracy and efficiency of semantic disambiguation.

[0005] According to one aspect of the present invention, a semantic disambiguation method is provided, comprising: obtaining text data input by a user, performing entity linking and knowledge graph pattern element linking on each word in the text data, and obtaining link results for each word;

[0006] Determine at least two semantic combinations according to the linking result, and generate candidate subgraphs corresponding to each of the semantic combinations;

[0007] Calculating the score of each candidate subgraph according to the score corresponding to the relationship between the nodes in each candidate subgraph, and determining the disambiguated semantic combination according to the target candidate subgraph whose score meets the preset conditions;

[0008] A semantic disambiguation result of the text data is determined according to the disambiguated semantic combination.

[0009] According to another aspect of the present invention, a semantic disambiguation device is provided, comprising: a link result acquisition module, configured to acquire text data input by a user, perform entity linking and knowledge graph pattern element linking on each word in the text data, and obtain link results for each word;

[0010] a candidate subgraph determining module, configured to determine at least two semantic combinations according to the linking result, and generate candidate subgraphs corresponding to the respective semantic combinations;

[0011] A score calculation module is used to calculate the score of each candidate subgraph according to the score corresponding to the relationship between the nodes in each candidate subgraph, and determine the disambiguated semantic combination according to the target candidate subgraph whose score meets the preset conditions;

[0012] A semantic disambiguation result determination module is used to determine the semantic disambiguation result of the text data according to the disambiguated semantic combination.

[0013] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform a semantic disambiguation method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a semantic disambiguation method described in any embodiment of the present invention when executed.

[0018] The technical solution of the embodiment of the present invention can simultaneously link knowledge graph pattern elements and candidate subgraph elements for semantic disambiguation, and construct corresponding candidate subgraphs for multiple semantic combinations, and disambiguate the semantic combinations by calculating the scores of the candidate subgraphs, thereby improving the accuracy and efficiency of semantic disambiguation.

[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 This is a flowchart of a semantic disambiguation method provided according to the first embodiment of the present invention;

[0022] Figure 2 This is an applicable scenario diagram of a semantic disambiguation method provided by an embodiment of the present invention;

[0023] Figure 3 This is an applicable scenario diagram of a semantic disambiguation method provided by an embodiment of the present invention;

[0024] Figure 4 This is an applicable scenario diagram of a semantic disambiguation method provided by an embodiment of the present invention;

[0025] Figure 5 This is an applicable scenario diagram of a semantic disambiguation method provided by an embodiment of the present invention;

[0026] Figure 6 This is a flowchart of a semantic disambiguation method provided according to the second embodiment of the present invention;

[0027] Figure 7 This is a flowchart of a semantic disambiguation method provided according to Embodiment 3 of the present invention;

[0028] Figure 8 2 is a schematic diagram of the structure of a semantic disambiguation device provided according to a fourth embodiment of the present invention;

[0029] Figure 9 It is a structural diagram of an electronic device for implementing a semantic disambiguation method provided in Example 5 of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described 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 making creative efforts should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or electronic device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products or electronic devices.

[0032] Example 1

[0033] Figure 1 A flowchart of a semantic disambiguation method is provided for the first embodiment of the present invention. This embodiment is applicable to semantic disambiguation scenarios. The method can be performed by a semantic disambiguation device. The semantic disambiguation device can be implemented in the form of hardware and / or software. The semantic disambiguation device can be integrated into an electronic device. Figure 1 As shown, the method includes:

[0034] S110. Obtain text data input by the user, perform entity linking and knowledge graph pattern element linking on each word in the text data, and obtain link results for each word.

[0035] The text data in this embodiment may refer to question text data; the source of the text data may be a piece of text data obtained by parsing audio, video, or images; it may also be a search question entered by a user in a search engine; or it may be a question entered by a user in the KBQA system. This embodiment does not impose any specific restrictions here.

[0036] It is understood that before performing word segmentation on text data, the text data must first be preprocessed, that is, special characters and punctuation marks are removed from the text data, retaining only the text portion, and then word segmentation is performed. A set of text data can obtain at least two word segmentation results. Commonly used word segmentation algorithms may include, but are not limited to, the shortest path algorithm, the new word discovery algorithm, and the maximum cut algorithm, etc., and this embodiment does not impose specific limitations here.

[0037] In this embodiment, entity linking can refer to identifying entity names in text data and linking them to knowledge graph schema elements. The knowledge graph can be a triple that stores entity-attribute-entity knowledge. The knowledge graph can be a Freebase knowledge graph, a Wordnet knowledge graph, a YAGO knowledge graph, or other knowledge graphs. This embodiment does not impose specific restrictions on this. Linking entity names to knowledge graph schema elements means mapping entity names on the knowledge graph to represent the relationship between entities.

[0038] Exemplarily, S110 may include: obtaining text data input by the user, performing word segmentation processing on the text data, obtaining a word segmentation list corresponding to the text data, and performing entity linking and knowledge graph pattern element linking on each word segmentation list in turn to obtain linking results for each word segmentation; wherein the linking results include at least one of the following elements: entity type, entity name, entity attribute, relationship type, and relationship attribute.

[0039] Specifically, the link result includes the permutations and combinations of entity type, entity name, entity attributes, relationship type, and relationship attributes.

[0040] In this embodiment, "Who are the executives of Apple?" can be used as an example to illustrate. First, the question mark in the text data, that is, "?", is removed. Then, some words that have no entity meaning, that is, "of", "have", and "which" are removed. Then, the text data is segmented to obtain two segmentations, "Apple" and "executives", and the obtained segmentations are stored in a segmentation list.

[0041] Among them, the entity type can be the type of semantic elements involved in the text data; the entity name can be understood as the specific subordinate description of the entity type; the entity attribute is the characteristics contained in the entity; the relationship type can be the association relationship between entities, and the relationship attribute can be the relevant attribute information of the association relationship between entities.

[0042] This embodiment uses Figure 2 For example, when the user inputs the question mark text data: "Who are the executives of Apple?", after the question mark text data is segmented and each word is entity linked and linked to the knowledge graph model elements, the link result of "Apple" can be obtained as "Entity Name" corresponds to a company and a fruit respectively, "Executive" is linked to "Relationship Type" and also linked to an "Entity Name".

[0043] Further, such as Figure 3 As shown, when the user inputs: "Who are the executives of Apple?", "What is the relationship between Steve Jobs and Tim Cook?", "What do Steve Jobs and Tim Cook like?" and "Who are the executives of Tencent? What do they like?", the link result of "Enterprise" can be obtained as "Entity Name", which can correspond to "Tencent" and "Apple" respectively. Correspondingly, the link results of the characters can be "Steve Jobs", "Cook" and "Ma Huateng" respectively. Correspondingly, "Like" can be linked to "Relationship Type" and also linked to the corresponding "Relationship Attribute".

[0044] S120 : Determine at least two semantic combinations according to the linking result, and generate candidate subgraphs corresponding to each semantic combination.

[0045] In this embodiment, it is possible to determine whether the text data input by the user generates semantic ambiguity based on the linking results. Specifically, when a word segmentation is subjected to entity linking and knowledge graph pattern element linking, and the linking results obtained correspond to the linking results of multiple different elements, it is determined that the current text data generates semantic ambiguity. Furthermore, at least two semantic combinations can be determined based on the linking results. For example, a semantic combination with semantic ambiguity can be {"apple":["entity name"]} and {"executive":["relationship type","entity name"]}. By combining them, two sets of results can be obtained, namely {"apple":"entity name","executive":"relationship type"} and {"apple":"entity name","executive":"entity name"}.

[0046] Furthermore, each semantic combination can be converted into a corresponding candidate subgraph according to the existing knowledge graph model. Figure 4 As an example, the conversion of the knowledge graph pattern into the corresponding candidate subgraph is explained, where r1 to r5 respectively represent the identifiers corresponding to different semantic relationships. The candidate subgraph may include nodes and edges, and its nodes may respectively correspond to elements in different link results, i.e., entity type, entity name, entity attribute, relationship type, and relationship attribute.

[0047] Exemplarily, S120 may include: combining the elements in the link result according to a preset combination method to obtain a combination result; if the combination result is at least two semantic combinations, determining the relationship between each element in each semantic combination based on the preset relationship between the link results; taking the entity name of each semantic combination as the center and the relationship between each element as the edge to generate a candidate subgraph corresponding to each semantic combination.

[0048] The preset combination method may be a Cartesian product operation method. Further, Table 1 may be used to determine the relationship between the elements in each semantic combination.

[0049] The relationship between the various components in each semantic combination in Table 1

[0050]

[0051] Further, Figure 5 This can represent the four candidate subgraphs of different types obtained by taking the question "Who are Apple's executives?" as an example. For example, graph A corresponds to {"Apple":"Entity Name","Executive":"Relationship Type"}. The entity type of "Apple" is "Enterprise", and "Executive" has a relationship with "Enterprise", so we can obtain a relationship called r2.

[0052] S130 , calculating the score of each candidate subgraph according to the score corresponding to the relationship between the nodes in each candidate subgraph, and determining the disambiguated semantic combination according to the target candidate subgraph whose score meets the preset conditions.

[0053] The scores corresponding to the relationships between nodes in each candidate subgraph can be defined in advance, and then the scores of the candidate subgraphs can be calculated using the following formula:

[0054] score sub_graph =∑score r

[0055] Exemplarily, S130 may include: matching the relationship between nodes in the candidate subgraph with a preset relationship, and assigning values ​​to the edges of the candidate subgraph based on the matching results; calculating the score of the candidate subgraph based on the score of the edge of the candidate subgraph, sorting the score results in descending order, and determining the target semantic combination corresponding to the candidate subgraph with the highest score as the semantic combination after disambiguation.

[0056] For example, in the above steps, the scores corresponding to the semantic identification relations r1, r2, r3, r4, and r5 are defined as 50, 40, 30, 20, and 10, respectively. The scores of the remaining relations are all 0. Next, all relations in the candidate subgraph are summed up, and the scores corresponding to all candidate subgraphs are sorted in descending order. The candidate subgraph with the highest score is selected as the semantic combination after disambiguation.

[0057] S140: Determine a semantic disambiguation result of the text data according to the disambiguated semantic combination.

[0058] In this embodiment, the target semantic combination corresponding to the highest score of the candidate subgraph is determined as the disambiguated semantic combination, thereby determining the semantic disambiguation result of the text data by combining the disambiguated semantic combinations corresponding to each word segmentation according to the order of the word segmentations in the text data.

[0059] Among them, the semantic disambiguation results correspond to the corresponding query statements. Users can query relevant answers in the graph database, and the semantic disambiguation results are presented to users in the form of a display interface.

[0060] The embodiment of the present invention can combine the knowledge graph pattern elements and the question-answering system of the candidate subgraph to perform semantic disambiguation. At the same time, by constructing corresponding subgraphs for multiple semantic combinations and designing path scores to calculate the path scores of the candidate subgraphs, the semantics can be disambiguated, thereby improving the accuracy and efficiency of semantic disambiguation.

[0061] Example 2

[0062] Figure 6This is a flowchart of a semantic disambiguation method provided in Example 2 of the present invention. After obtaining the link results of each word segmentation, this embodiment further includes: taking ambiguous entity names as candidate entities, and determining the semantic disambiguation results of the text data based on the semantic combination after disambiguation. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 6 The semantic disambiguation method provided in this embodiment specifically includes the following steps:

[0063] S610: Obtain text data input by the user, perform entity linking and knowledge graph pattern element linking on each word in the text data, and obtain link results for each word.

[0064] S620: Take at least one ambiguous entity name as a candidate entity.

[0065] Among them, an ambiguous entity name may be an entity that results from text data linking with multiple entity names but does not contain elements of a knowledge graph pattern, and whose entity name is also ambiguous.

[0066] S630: Calculate the score of the candidate entity according to the scores corresponding to the relationships between the candidate entity and other unambiguous entity names in the link results.

[0067] Among them, it is calculated whether each entity in the candidate entity has a relationship with other unambiguous entity names, for example: the score of a first-degree relationship is 10, the score of a second-degree relationship is 5, and the score of a third-degree or above relationship is 0.

[0068] S640: Determine the disambiguated entity name based on the target candidate entity whose score meets the preset conditions.

[0069] Calculate the score for each candidate entity and select the one with the highest score as the entity after disambiguation. For example, when a user inputs "Apple and Jobs?", "Apple" has two entities in the graph: "Apple" as a business and "Apple" as a "fruit." Since "Apple" of type "Business" has a first-degree relationship with "Jobs," while "Apple" of type "Fruit" has no relationship with "Jobs," the former scores higher than the latter and is retained as the semantic disambiguation result.

[0070] S650 , determining a semantic disambiguation result of the text data according to the disambiguated semantic combination, including: determining a semantic disambiguation result of the text data according to the disambiguated entity name and the disambiguated semantic combination.

[0071] The embodiments of the present invention can also achieve the effect of overall disambiguation by disambiguating entities in text data, not just the knowledge graph pattern elements. Therefore, the accuracy of disambiguation is high and the effect is predictable, further improving the effect and quality of the question-answering system.

[0072] Example 3

[0073] Figure 7 This is a flowchart of a semantic disambiguation method provided in Example 3 of the present invention. Before the step of selecting at least one ambiguous entity name as a candidate entity, this embodiment further includes: determining whether the link result contains only entity names, and executing corresponding steps based on the determination result. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 7 The semantic disambiguation method provided in this embodiment specifically includes the following steps:

[0074] S710. Obtain text data input by the user, perform entity linking and knowledge graph pattern element linking on each word in the text data, and obtain link results for each word.

[0075] S720 , determine whether the link result only contains the entity name, if not, execute S730 , otherwise execute S780 .

[0076] Among them, when the link result only contains the entity name element, it means that the entity type to which the entity name belongs determines that the entity name has semantic ambiguity.

[0077] S730: Combine the elements in the link result according to a preset combination method to obtain a combination result.

[0078] S740 , determine whether the combination result is a semantic combination. If so, execute S780 ; otherwise, execute S750 .

[0079] S750: If the combination result is at least two semantic combinations, determine the relationship between the elements in each semantic combination based on the preset relationship between the link results.

[0080] S760 , taking the entity name of each semantic combination as the center and the relationship between each element as the edge, generating a candidate subgraph corresponding to each semantic combination.

[0081] S770 , calculating the score of each candidate subgraph according to the score corresponding to the relationship between the nodes in each candidate subgraph, and determining the disambiguated semantic combination according to the target candidate subgraph whose score meets the preset conditions.

[0082] S780. Determine whether the entity name is ambiguous based on the entity type to which the entity name belongs. If so, execute S790; otherwise, execute S7120.

[0083] S790: Take at least one ambiguous entity name in the link result as a candidate entity.

[0084] S7100. Calculate the score of the candidate entity based on the scores corresponding to the relationships between the candidate entity and other unambiguous entity names in the link results.

[0085] S7110. Determine the disambiguated entity name based on the target candidate entity whose score meets the preset conditions.

[0086] S7120: The entity names in the link result are not ambiguous. S7130: Determine the semantic disambiguation result of the text data based on the disambiguated entity names and the disambiguated semantic combinations.

[0087] The embodiment of the present invention can also make the entity disambiguation judgment result more accurate by judging whether the link result only contains the entity name. Therefore, the accuracy of disambiguation is high and the effect is predictable, further improving the effect and quality of the question-answering system.

[0088] Example 4

[0089] Figure 8 This is a structural diagram of a semantic disambiguation device provided in the fourth embodiment of the present invention. Figure 8 As shown, the device includes:

[0090] The link result acquisition module 810 is used to obtain the text data input by the user, perform entity linking and knowledge graph pattern element linking on each word in the text data, and obtain the link results of each word;

[0091] A candidate subgraph determination module 820 is configured to determine at least two semantic combinations based on the linking results, and generate candidate subgraphs corresponding to the respective semantic combinations;

[0092] A score calculation module 830 is used to calculate the score of each candidate subgraph based on the score corresponding to the relationship between the nodes in each candidate subgraph, and determine the disambiguated semantic combination based on the target candidate subgraph whose score meets the preset conditions;

[0093] The semantic disambiguation result determination module 840 is configured to determine the semantic disambiguation result of the text data according to the disambiguated semantic combination.

[0094] Optionally, after the link result acquisition module 810, the following steps may be included:

[0095] a candidate entity confirmation module, configured to take at least one ambiguous entity name as a candidate entity;

[0096] A candidate entity score calculation module is used to calculate the score of the candidate entity based on the scores corresponding to the relationship between the candidate entity and other unambiguous entity names in the link results;

[0097] A module for determining the entity name after disambiguation, configured to determine the entity name after disambiguation based on the target candidate entity whose score meets the preset conditions;

[0098] The entity disambiguation result determination module determines the semantic disambiguation result of the text data according to the disambiguated semantic combination, including: determining the semantic disambiguation result of the text data according to the disambiguated entity name and the disambiguated semantic combination.

[0099] Optionally, the candidate entity confirmation module may include:

[0100] A link result judgment module is used to judge whether the link result only contains entity names; if so, determine whether the entity name is ambiguous based on the entity type to which the entity name belongs; when at least one entity name in the link result is ambiguous, execute the step of determining whether the entity name is ambiguous based on the entity type to which the entity name belongs.

[0101] Optionally, the link result acquisition module 810 may include:

[0102] A word segmentation link result determination unit is used to obtain text data input by the user, perform word segmentation processing on the text data, obtain a word segmentation list corresponding to the text data, and sequentially perform entity linking and knowledge graph pattern element linking on each word in the word segmentation list to obtain link results for each word segmentation;

[0103] The link result includes at least one of the following elements: entity type, entity name, entity attribute, relationship type and relationship attribute.

[0104] Optionally, the candidate subgraph determining module 820 may include: a combining unit, configured to combine elements in the link result according to a preset combining method to obtain a combined result;

[0105] an element relationship determination unit, configured to determine, if the combination result is at least two semantic combinations, the relationship between the elements in each semantic combination based on the preset relationship between the link results;

[0106] The candidate subgraph generation unit takes the entity name of each semantic combination as the center and the relationship between each element as the edge to generate the candidate subgraph corresponding to each semantic combination.

[0107] Optionally, after the combination unit you can include:

[0108] The candidate entity semantic disambiguation subunit is used to execute the step of taking at least one ambiguous entity name as a candidate entity if the combination result is a semantic combination.

[0109] Optionally, the score calculation module 830 may include:

[0110] A matching unit, configured to match the relationships between nodes in the candidate subgraph with the preset relationships, and assign values ​​to the edges of the candidate subgraph based on the matching results;

[0111] The semantic combination disambiguation determination unit is used to calculate the scores of the candidate subgraphs according to the scores of the edges of the candidate subgraphs, sort the score results in descending order, and determine the target semantic combination corresponding to the candidate subgraph with the highest score as the disambiguated semantic combination.

[0112] A semantic disambiguation device provided in an embodiment of the present invention can execute a semantic disambiguation method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0113] Example 5

[0114] Figure 9 This is a schematic diagram of the structure of an electronic device provided by the fifth embodiment of the present invention. Figure 9 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0115] The processor 11 may be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. When the processor 11 executes the various methods described above, the following are achieved:

[0116] Obtain the text data input by the user, perform entity linking and knowledge graph pattern element linking on each word in the text data, and obtain the link results of each word;

[0117] Determine at least two semantic combinations based on the linking results, and generate candidate subgraphs corresponding to each semantic combination;

[0118] Calculate the score of each candidate subgraph based on the score corresponding to the relationship between the nodes in each candidate subgraph, and determine the disambiguated semantic combination based on the target candidate subgraph whose score meets the preset conditions;

[0119] The semantic disambiguation result of the text data is determined according to the semantic combination after disambiguation.

[0120] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0121] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use by an instruction execution system, device or electronic device or used in combination with an instruction execution system, device or electronic device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or electronic devices, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage electronic devices, magnetic storage electronic devices, or any suitable combination of the foregoing.

[0122] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0123] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A semantic disambiguation method, characterized in that: include: Obtain text data input by the user, perform entity linking and knowledge graph pattern element linking on each word in the text data, and obtain link results for each word; Determine at least two semantic combinations according to the linking result, and generate candidate subgraphs corresponding to each of the semantic combinations; Calculating the score of each candidate subgraph according to the score corresponding to the relationship between the nodes in each candidate subgraph, and determining the disambiguated semantic combination according to the target candidate subgraph whose score meets the preset conditions; Determining a semantic disambiguation result of the text data according to the disambiguated semantic combination; The text data input by the user is obtained, and entity linking and knowledge graph pattern element linking are performed on each word in the text data to obtain link results for each word, including: Obtain text data input by the user, perform word segmentation on the text data, obtain a word segmentation list corresponding to the text data, and sequentially perform entity linking and knowledge graph pattern element linking on each word in the word segmentation list to obtain link results for each word segmentation; The link result includes at least one of the following elements: entity type, entity name, entity attribute, relationship type and relationship attribute; The relationship attributes are the related attribute information of the association relationship between entities; The entity linking is to identify entity names in text data; After obtaining the link results of each word, it also includes: Taking at least one ambiguous entity name as a candidate entity; Calculating a score for the candidate entity based on scores corresponding to relationships between the candidate entity and other unambiguous entity names in the link results; Determine the disambiguated entity name according to the target candidate entity whose score meets the preset conditions; And, determining a semantic disambiguation result of the text data according to the disambiguated semantic combination, comprising: A semantic disambiguation result of the text data is determined according to the disambiguated entity name and the disambiguated semantic combination.

2. The method according to claim 1, characterized in that Before considering at least one ambiguous entity name as a candidate entity, it also includes: Determining whether the link result only contains entity names; If so, determining whether the entity name is ambiguous based on the entity type to which the entity name belongs; When at least one entity name in the link result is ambiguous, a step of taking the at least one ambiguous entity name as a candidate entity is performed.

3. The method according to claim 2, characterized in that The determining of at least two semantic combinations according to the linking result and generating candidate subgraphs corresponding to the respective semantic combinations includes: Combining the elements in the link result according to a preset combination method to obtain a combination result; If the combination result is at least two semantic combinations, determining the relationship between the elements in each of the semantic combinations based on the preset relationship between the link results; Taking the entity name of each semantic combination as the center and the relationship between the elements as the edge, a candidate subgraph corresponding to each semantic combination is generated.

4. The method according to claim 3, characterized in that After combining the elements in the link result according to a preset combination method to obtain a combination result, the method further includes: If the combination result is a semantic combination, a step of determining whether the entity name is ambiguous based on the entity type to which the entity name belongs is performed.

5. The method according to claim 1, wherein The step of calculating the score of each candidate subgraph according to the score corresponding to the relationship between the nodes in each candidate subgraph, and determining the disambiguated semantic combination according to the target candidate subgraph whose score meets the preset condition, includes: Matching the relationship between nodes in the candidate subgraph with a preset relationship, and assigning values ​​to the edges of the candidate subgraph according to the matching results; The scores of the candidate subgraphs are calculated according to the scores of the edges of the candidate subgraphs, the score results are sorted in descending order, and the target semantic combination corresponding to the candidate subgraph with the highest score is determined as the semantic combination after disambiguation.

6. A semantic disambiguation device, characterized in that: include: A link result acquisition module is used to obtain text data input by the user, perform entity linking and knowledge graph pattern element linking on each word in the text data, and obtain link results for each word; a candidate subgraph determining module, configured to determine at least two semantic combinations according to the linking result, and generate candidate subgraphs corresponding to the respective semantic combinations; A score calculation module is used to calculate the score of each candidate subgraph according to the score corresponding to the relationship between the nodes in each candidate subgraph, and determine the disambiguated semantic combination according to the target candidate subgraph whose score meets the preset conditions; a semantic disambiguation result determination module, configured to determine a semantic disambiguation result of the text data based on the disambiguated semantic combination; The link result acquisition module includes: A word segmentation link result determination unit is used to obtain text data input by the user, perform word segmentation processing on the text data, obtain a word segmentation list corresponding to the text data, and sequentially perform entity linking and knowledge graph pattern element linking on each word in the word segmentation list to obtain link results for each word segmentation; The link result includes at least one of the following elements: entity type, entity name, entity attribute, relationship type and relationship attribute; The relationship attributes are the related attribute information of the association relationship between entities; The entity linking is to identify entity names in text data; After the link result acquisition module, it also includes: a candidate entity confirmation module, configured to take at least one ambiguous entity name as a candidate entity; A candidate entity score calculation module is used to calculate the score of the candidate entity based on the scores corresponding to the relationship between the candidate entity and other unambiguous entity names in the link results; A module for determining the entity name after disambiguation, configured to determine the entity name after disambiguation based on the target candidate entity whose score meets the preset conditions; The entity disambiguation result determination module determines the semantic disambiguation result of the text data according to the disambiguated semantic combination, including: determining the semantic disambiguation result of the text data according to the disambiguated entity name and the disambiguated semantic combination.

7. An electronic device, characterized in that The electronic equipment comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the semantic disambiguation method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the semantic disambiguation method according to any one of claims 1 to 5 when executed.

Citation Information

Patent Citations

  • Semantic disambiguation method and device based on bidirectional association, equipment and storage medium

    CN110390106A

  • Knowledge graph question-answering method and system based on entity relationship disambiguation, and terminal

    CN111259653A

  • Label disambiguation method, device and equipment and computer readable storage medium

    CN112256885A