Method, apparatus, electronic device, and medium for determining term relationships
By utilizing corpus component analysis and deep learning models in the power industry, terminology relationships are automatically mined, solving the problems of high cost and poor transferability of manual annotation in existing technologies. This achieves low-cost and efficient terminology relationship mining and constructs a knowledge graph with rich information.
Patent Information
- Application Number
- CN202211635173.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-19
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2042-12-19
AI Technical Summary
Existing technologies for term relationship mining require extensive manual annotation and corpora, which are costly and lack transferability. They are also difficult to effectively mine isA and partOf relationships between terms, especially when industry corpora are limited, making it difficult for existing methods to construct rich knowledge graphs.
By using corpus-based component analysis and deep learning models, combined with the characteristics of the power industry, and utilizing the information inherent in the terms themselves to mine term relationships, constructing hierarchical concepts, including the deletion and adjustment of dependencies, and combining self-supervised data pre-training and fine-tuning models, automatic mining of term relationships is achieved.
It reduces labor costs, improves the efficiency and accuracy of terminology relationship mining, can effectively complete the terminology system with limited corpus, constructs a knowledge graph with rich hierarchical information, and supports refined retrieval and question answering tasks.
Smart Images

Figure CN115965016B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of data processing and artificial intelligence, in particular to natural language processing and knowledge graph, and specifically to a method and apparatus for determining term relationship, an electronic device, a computer readable storage medium and a computer program product. BACKGROUND
[0002] The term relationship mining technology can be used for the construction of a term system, and is of great significance to knowledge graph construction. Through the term relationship mining technology, the constructed knowledge graph can have more rich hierarchical information, which is helpful for assisting downstream question answering and refined retrieval tasks.
[0003] Artificial intelligence is a discipline that studies enabling computers to simulate some thinking processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.) of humans, and includes both hardware and software technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing, etc. Artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, and machine learning / deep learning, big data processing technology, knowledge graph technology, etc.
[0004] The methods described in this section can not necessarily be the methods previously conceived or used. Unless otherwise indicated, nothing in this section should be assumed to be prior art merely because it is included in this section. Similarly, issues mentioned in this section should not be assumed to have been admitted to be prior art in any jurisdiction unless otherwise indicated. SUMMARY
[0005] The present disclosure provides a method and apparatus for determining term relationship, an electronic device, a computer readable storage medium and a computer program product.
[0006] According to an aspect of the present disclosure, a computer-implemented method for determining term relationship is provided, comprising: obtaining a plurality of words, the plurality of words being obtained by performing word segmentation on a first term from a corpus; determining one or more dependency relationships between the plurality of words; constructing a second term from at least two words of the plurality of words based on at least one dependency relationship of the one or more dependency relationships; and in response to determining that the second term is in the corpus, determining the second term as a sub-concept of the first term.
[0007] According to another aspect of the disclosure, there is provided a computer-implemented apparatus for determining a term relationship, comprising: a token obtaining unit configured to obtain a plurality of tokens, the plurality of tokens being obtained by performing tokenization on a first term from a corpus; a dependency relationship determining unit configured to determine one or more dependency relationships between the plurality of tokens; a term constructing unit configured to construct a second term from at least two tokens of the plurality of tokens based on at least one dependency relationship of the one or more dependency relationships; and a term relationship determining unit configured to determine the second term as a sub-concept of the first term in response to determining that the second term is in the corpus.
[0008] According to another aspect of the disclosure, there is provided an electronic device comprising: at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method for determining a term relationship according to one or more embodiments of the disclosure.
[0009] According to another aspect of the disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform a method for determining a term relationship according to one or more embodiments of the disclosure.
[0010] According to another aspect of the disclosure, there is provided a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements a method for determining a term relationship according to one or more embodiments of the disclosure.
[0011] According to one or more embodiments of the disclosure, term relationships can be mined based on information inherently contained in the terms themselves.
[0012] It is to be understood that the details described in this section are not intended to identify key or critical features of the embodiments of the disclosure, nor are they used to limit the scope of the disclosure. Other features of the disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0013] The accompanying drawings illustrate exemplary embodiments and constitute a part of the specification. Together with the written description, the drawings serve to explain exemplary implementations of the embodiments. The illustrated embodiments are merely examples and do not limit the scope of the claims. In all the drawings, like reference numerals refer to like but not necessarily identical elements.
[0014] Figure 1 A schematic diagram of an exemplary system in which the various methods described herein can be implemented according to embodiments of the disclosure is shown.
[0015] Figure 2 A flowchart of a method for determining term relationships according to an embodiment of the present disclosure is shown;
[0016] Figure 3 A flowchart of a method for determining term relationships according to another example embodiment of the present disclosure is shown;
[0017] Figures 4A-4C Examples of various dependencies in terms are shown;
[0018] Figure 5 A method for term relationship mining according to yet another example embodiment of the present disclosure is shown;
[0019] Figure 6 A schematic diagram of a model that can implement example embodiments according to the present disclosure is shown;
[0020] Figure 7 A structural block diagram of an apparatus for determining term relationships according to an embodiment of the present disclosure is shown;
[0021] Figure 8 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0022] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to assist in understanding them. These should be considered in their context only as illustrative. Thus, those of ordinary skill in the art will recognize various changes and modifications of the embodiments described herein, without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
[0023] In the present disclosure, the terms "first", "second", and the like are used to describe various elements only and do not intend to limit the positional relationship, the chronological relationship, or the importance of the elements, and such terms are used only to distinguish one element from another element. In some examples, the first element and the second element can refer to the same instance of the element, and in some cases, based on the context of the description, they can also refer to different instances.
[0024] The terms used in the description of various described examples in the present disclosure are only for the purpose of describing particular examples and are not intended to be limiting. Unless the context clearly indicates otherwise, the term can be one or more if the number of elements is not specifically limited. In addition, the term "and / or" used in the present disclosure encompasses any one of the listed items and all possible combinations thereof.
[0025] Embodiments of the present disclosure will be described below in detail with reference to the accompanying drawings.
[0026] Figure 1 A schematic diagram of an example system 100 in which various methods and apparatus described herein can be implemented in accordance with embodiments of the present disclosure is shown. Referring to Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 can be configured to execute one or more application programs.
[0027] In embodiments of the present disclosure, the server 120 can run one or more services or software applications that enable performance of methods for determining term relationships in accordance with the present disclosure.
[0028] In certain embodiments, the server 120 can also provide other services or software applications, which can include non-virtual and virtual environments. In certain embodiments, these services can be provided as web-based services or cloud services, for example, to users of the client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.
[0029] In Figure 1 In the illustrated configuration, the server 120 can include one or more components that implement the functionality performed by the server 120. These components can include software components, hardware components, or a combination thereof, executable by one or more processors. Users operating the client devices 101, 102, 103, 104, 105, and / or 106 can in turn utilize one or more client application programs to interact with the server 120 to utilize the services provided by the components. It should be understood that various different system configurations are possible, which can differ from the system 100. Thus, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
[0030] A user can use the client devices 101, 102, 103, 104, 105, and / or 106 to input terms, control determination of term relationships, view determination results, etc. The client devices can provide an interface that enables a user of the client device to interact with the client device. The client devices can also output information to the user via the interface. Although Figure 1 Only six client devices are depicted, but one of skill in the art will appreciate that the present disclosure can support any number of client devices.
[0031] Client devices 101, 102, 103, 104, 105, and / or 106 can include various types of computer devices, such as portable handheld devices, general purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service kiosk devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, and the like. These computer devices can run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices can include cellular telephones, smartphones, tablet computers, personal digital assistants (PDAs), and the like. Wearable devices can include head-mounted displays (such as smart glasses) and other devices. Gaming systems can include various handheld gaming devices, Internet-enabled gaming devices, and the like. Client devices are capable of executing a variety of different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and can use various communication protocols.
[0032] Network 110 can be any type of network familiar to those skilled in the art that can support data communications using any of a variety of available protocols, including without limitation TCP / IP, SNA, IPX, etc. As examples, one or more of networks 110 can be a LAN, an Ethernet network, a Token Ring network, a WAN, the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a local area network (LAN), a wide area network (WAN), a wireless network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., a Bluetooth network, a WIFI network), and / or any combination of these and / or other networks.
[0033] Server 120 can include one or more general purpose computers, special purpose server computers (e.g., PC (personal computer) servers, UNIX servers, midrange servers), blade servers, mainframe computers, server clusters, or any other appropriate arrangement and / or combination. Server 120 can include one or more virtual machines running a virtual operating system, or other computing architectures involving virtualization (such as one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for servers). In various embodiments, server 120 can run one or more services or software applications that provide the functionality described below.
[0034] The computing units in the server 120 can run one or more operating systems including any of the operating systems described above, as well as any commercially available server operating systems. Server 120 can also run any of a variety of additional server applications and / or mid-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0035] In some embodiments, the server 120 can include one or more applications to analyze and consolidate data feeds and / or event updates from users of the client devices 101, 102, 103, 104, 105, and 106. The server 120 can also include one or more applications to display the data feeds and / or real-time events via one or more display devices of the client devices 101, 102, 103, 104, 105, and 106.
[0036] In some embodiments, the server 120 can be a server of a distributed system, or a server combined with a blockchain. The server 120 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. The cloud server is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and virtual private server (VPS, Virtual Private Server) services.
[0037] The system 100 can also include one or more databases 130. In certain embodiments, these databases can be used to store data and other information. For example, one or more of the databases 130 can be used to store information such as audio files and video files. The databases 130 can reside in a variety of locations. For example, databases used by the server 120 can reside locally to the server 120, or can be remote from the server 120 and can communicate with the server 120 via a network- or application-specific connection. The databases 130 can be of different types. In certain embodiments, databases used by the server 120 can be, for example, relational databases. One or more of these databases can store, update, and retrieve data to and from the databases in response to commands.
[0038] In certain embodiments, one or more of the databases 130 can also be used by applications to store application data. Databases used by applications can be different types of databases, such as key-value stores, object stores, or regular stores backed by file systems.
[0039] Figure 1The system 100 can be configured and operated in various ways to enable the application of various methods and apparatuses described according to the present disclosure.
[0040] Reference is made below to Figure 2 A computer-implemented method 200 for determining a term relationship according to an example embodiment of the present disclosure is described.
[0041] At step S201, a plurality of segmented terms is obtained, the plurality of segmented terms being obtained by performing a segmentation process on a first term from a corpus.
[0042] At step S202, one or more dependency relationships between the plurality of segmented terms is determined.
[0043] At step S203, a second term is constructed from at least two segmented terms of the plurality of segmented terms based on at least one dependency relationship of the one or more dependency relationships.
[0044] At step S204, in response to determining that the second term is in the corpus, the second term is determined to be a sub-concept of the first term.
[0045] The method according to an embodiment of the present disclosure can mine term relationships based on information contained in the terms themselves. In particular, in related art, a general term relationship mining method can require a large amount of manual annotation or a sufficient corpus having relationships between terms. According to one or more embodiments of the present disclosure, the method provided has the ability to mine term relationships from information contained in the terms themselves, and the method is based on data features, has low implementation costs, and can effectively complete a term system in the case of limited industry corpus.
[0046] According to some embodiments, constructing a second term from at least two segmented terms of the plurality of segmented terms based on at least one dependency relationship of the one or more dependency relationships can include deleting at least two segmented terms having the at least one dependency relationship in the first term to form the second term.
[0047] Based on the at least one dependency relationship, a first segmented term and a second segmented term modifying the first segmented term in the first term are deleted to form the second term.
[0048] In Chinese, modifiers are often stacked in parallel in front of core words to further subdivide and describe the core words. For example, in “young and talented artist”, “young” and “talented” modify “artist” in parallel, and any removal of part of the modifiers can obtain a superordinate word of the term, such as “young and talented artist” isA “young artist”, that is, “young and talented artist” is a sub-concept of “young artist”.
[0049] The components in the term can be further disassembled through component analysis, and the modifiers, core words and relationships between different words are identified, so that the superior-inferior relationship is realized based on the information mining of the term itself.
[0050] According to some embodiments, constructing a second term according to at least two tokens in the plurality of tokens based on at least one dependency relationship in the one or more dependency relationships can include adjusting an order of at least two tokens in the first term that have the at least one dependency relationship with a same token to form the second term.
[0051] According to such embodiments, for example, an order of at least two modifiers that modify a same token in the first term can be adjusted based on the at least one dependency relationship to form the second term.
[0052] According to some embodiments, determining one or more dependency relationships between the plurality of tokens can include determining at least one modifier and at least one core word in the plurality of tokens, and determining one or more modifier relationships based on the at least one modifier and the at least one core word.
[0053] For example, determining at least one modifier in the plurality of tokens includes determining a token type of each token in the plurality of tokens, the token type being selected from a group consisting of: modifier, core word. It can be understood that a modifier can be used to modify a core word, or can also be used to modify other modifiers.
[0054] According to some embodiments, determining at least one modifier and at least one core word in the plurality of tokens can include determining a probability that each token in the plurality of tokens is a core word based on a position and a frequency of occurrence of each token in the plurality of tokens in the plurality of terms in the corpus, and determining the at least one modifier and the at least one core word from the plurality of tokens based on the probability.
[0055] According to such embodiments, for example, a word that always appears at the end can be determined as a core word based on the terms in the corpus.
[0056] According to some embodiments, determining one or more modifier relationships based on the at least one modifier and the at least one core word can include, for each token in the plurality of tokens, determining a co-occurrence frequency of the token and an immediately adjacent token in the plurality of tokens based on the corpus, and determining the one or more modifier relationships based on the co-occurrence frequency.
[0057] According to such an embodiment, the probability of a modifier word and its possible modified core word, i.e. co-occurrence, can be determined based on the existing close relationship of the corpus, and thus the modifier relationship is determined.
[0058] According to some embodiments, determining the one or more modifier relationships based on the co-occurrence frequency can comprise, for the determined at least one modifier word in the plurality of segmented words, determining the word modified by the modifier word based on the co-occurrence frequency. Thus, for the determined at least one modifier word, the word modified by the modifier word, i.e. the dependency relationship, is further determined.
[0059] According to some embodiments, the method 200 can further comprise, in response to determining that the second term is not in the corpus, deleting the at least one dependency relationship.
[0060] According to such an embodiment, if the thus constructed term does not exist, it proves that the dependency relationship is problematic, and the dependency relationship is deleted.
[0061] According to some embodiments, the corpus can be a power industry corpus.
[0062] According to the present disclosure, in the power industry, although there are a large number of term modifier words, the description mode of the term is relatively simple compared with the general corpus. For example, for the words constituting the term, the relationship between the words can be divided into two categories: modifier and no relationship; the category of the word can be divided into two categories: modifier word and core word. The co-occurrence statistics of the appearance mode of the words in the term constructs a classical probability model, which can quickly realize the term component analysis at low cost, and thus is used to solve the hyponymy and hypernymy mining problem.
[0063] The following will be described in conjunction with Figure 3 The specific exemplary steps of the method 300 according to another example embodiment of the present disclosure will be described.
[0064] At step S301, the term is segmented. Various segmentation methods consistent with those skilled in the art can be used, as an example, an open source segmentation tool such as jieba, etc. can be used.
[0065] For example, for the first term "on-load tap changer of converter transformer", the corresponding segmentation can include: converter, transformer, on-load, tap, and switch.
[0066] At step S302, the segmented words are classified. For example, the segmented words can be divided into two categories: modifier words and core words. Specifically, step S302 can include, for example, first, the frequency of each word as a term ending word in all terms is counted to obtain the probability of each word as a core word; then, for each word of the current term after segmentation, the word category is classified based on the core word probability model constructed in the previous step.
[0067] Based on the above examples, the following exemplary classification results can be obtained:
[0068] Converter (modifier)
[0069] Transformer (core word)
[0070] On-load (modifier)
[0071] Voltage-regulating (modifier)
[0072] Switch (core word)
[0073] At step S303, the relationship between the segmented words is classified. For example, the relationship between the segmented words can include a “modifier relationship” and a “no relationship”. It can be understood that the present disclosure is not limited thereto. As will be further described in connection with the following, the relationship between the segmented words can also include, for example, an indirect relationship between multi-hop entities, and the like.
[0074] For example, step S303 can include, first, counting the co-occurrence frequency of each word and its immediately adjacent word in all terms to obtain the co-occurrence probability of each word and the word possibly modified thereby; and then, classifying the modifier word in the term based on the modifier relationship probability model constructed in the previous step to obtain the word modified thereby. Figure 4A Examples of the modifier word in the term and the related dependency relationship are given.
[0075] At step S304, construction of a new term is performed. For example, after completion of the term component analysis, the modifier word in the term can be recombined to construct a new term based on the dependency relationship between the words. If the constructed new term actually appears in the corpus, then it is considered that the new term and the original term constitute a hyponym-hypernym relationship, and the original term is a hyponym concept of the new term (or, the original term “isA” the new term).
[0076] As an example, the recombination manner of the term can include deletion of the modifier word based on the dependency relationship, deletion + scrambling, and the like.
[0077] Referring to, for example, Figure 4B , an example of constructing a new term by deletion is given. As shown in the figure, if “voltage level” is deleted, then “110kV” modifying it is also deleted accordingly, obtaining a new term “transformer”, and further obtaining “110kV voltage level transformer” isA “transformer”.
[0078] Referring to, for example, Figure 4C , an example of constructing a new term by deletion and scrambling is given. By means of “deletion + scrambling”, as shown in the figure, “high voltage” and “direct current” modifying “system” together can be scrambled while deleting “power transmission”, obtaining a new term “direct current high voltage system”. Then, comparison with the corpus is performed. When it is determined that the term does not appear in the corpus, then no hyponym-hypernym relationship is constituted.
[0079] It can be understood that the above is only an example, and the present disclosure is not limited thereto. For example, only the modifiers can be disordered without deletion operation, or other types of word segmentation types and dependency types can be used to construct new terms in other ways, and the present disclosure is not limited thereto.
[0080] According to one or more embodiments of the present disclosure, the relationship belonging to the information contained in the self information can be mined based on component analysis.
[0081] Specifically, according to one or more embodiments of the present disclosure, the relationship between terms can be mined from the information contained in the terms themselves based on the Chinese language usage habits. For example, based on the habit of stacking adjectives in front of the core word in Chinese and the statistical component analysis method, it can be mined that “oil-immersed double-winding transformer” isA “oil-immersed transformer”, “oil-immersed transformer” isA “transformer”, etc.
[0082] The term relationship mining technology can be used for the construction of the term system, and is of great significance for the construction of the knowledge graph. Through the term relationship mining technology, the problem of limited coverage of the manually predefined schema (schema: defines the relationship between concepts, attributes and constraints of entity / concept data) can be solved, so that the constructed knowledge graph has more rich hierarchical information, which helps to assist the downstream question answering and refined retrieval tasks. Thanks to the development of artificial intelligence technology, natural language processing related technologies have developed rapidly in recent years. The model training paradigm of pre-training on a large amount of self-supervised data and fine-tuning on a small amount of labeled data has become the mainstream method, making it possible to obtain better results with a smaller amount of data.
[0083] Term relationship mining can be based on the following methods: manual annotation: manually annotating the relationship between terms in the document based on templates: extracting the relationship contained in the fixed pattern by manually configuring a certain template; mining through a model: mining by training a model on a certain corpus. However, manual annotation has high labor cost and low efficiency, and the method is not transferable; it has poor flexibility, and whenever a new expression method or new document appears, a new template needs to be configured manually; it has poor generalization ability, and can only mine the relationship in a specific sentence pattern. If you want to improve the recall rate of the mining method, you need to spend a high labor cost to configure the template; the mining method in the related art is often used to extract the relationship expressed in the sentence semantics, and it is difficult to mine from the information contained in the terms themselves.
[0084] According to one or more embodiments of the present disclosure, the isA and partOf relationships between power terms can be mined by using the semantics contained in the context of the terms and the information contained in the terms themselves in combination with the characteristics of the Chinese corpus (e.g., the power industry corpus). This method takes into account the characteristics of the industry corpus and can fully mine knowledge from limited corpus with low labor cost and certain portability.
[0085] The input of the present solution is the corpus and its related terms, and the output is the isA and partOf relationships between the terms. The entire relationship mining solution is divided into two parts: sentence-level relationship mining and term-level relationship mining. The sentence-level relationship mining mines the relationships contained in the sentence semantics based on a deep learning model; the term-level relationship mining mines the relationships contained in the term information based on component analysis.
[0086] The following will be described in conjunction with Figure 5 A method 500 for term relationship mining according to another embodiment of the present disclosure is described below. The method 500 can mine the relationships contained in the sentence semantics based on a deep learning model.
[0087] Since the industry corpus has different common proper names and common sentence patterns from general corpora, in order to improve the effect of the model on a specific industry (e.g., the power industry), the training strategy of the model can include first pre-training on a pre-trained language model that has been pre-trained on general corpora, then using the industry corpus to further pre-train the model at step S501, and then fine-tuning the model on the relationship mining task at step S502.
[0088] For industry corpus pre-training, the following arrangement can be used.
[0089] Data: The source of the industry corpus can be user-provided documents; if not, relevant corpora can also be obtained by crawling the content on the open domain web. The crawling method can be to crawl the entire website from the vertical website of the relevant industry, or to crawl the relevant results by searching for key terms on the search engine.
[0090] Model structure: the Encoder part of the Transformer can be used, or other model structures known to those skilled in the art.
[0091] The training task: the pre-training task of further pre-training using the industry corpus can select commonly used NextSentence Prediction and Mask Language Model, and the present disclosure is not limited thereto. Specifically, the input of NextSentence Prediction is two sentences, and the target is to predict whether the two sentences are continuous sentences; in the input of Mask Language Model, a certain proportion of tokens are replaced by special characters, and the target is to restore the replaced tokens according to the un-replaced context information.
[0092] It can be understood that the above method is applicable to various industries, and is not limited to the power industry.
[0093] The following describes an exemplary fine-tuning process for a relation mining task in combination with the model 600 shown in FIG. 6. Figure 6
[0094] As shown in FIG. 6, the input of the model part 610 can include terms containing sentences, wherein the positions of the terms in the sentences are marked with special symbols. The model part 610 can be an Encoder part of a Transformer, or other model structures known to those skilled in the art. Figure 6 As known to those skilled in the art, in a relation expression such as "A is A B", A is called the head node in the relation, and B is the tail node in the relation. As described above, the head node in the relation can be marked in the sentence using the [S1][\S1] symbol, and the tail node in the relation can be marked at the end of the sentence using the [O1][\O1], [O2][\O2], etc. special symbols. Multiple candidate tail nodes can be marked, wherein [On][\On] respectively share position embedding with the first word and the last word of the corresponding term in the sentence.
[0095] Figure 6 After the model part 610, there can be one or more hidden layers 620 and a concatenation layer 630.
[0096] The output of the model can include a first output 640 and a second output 660.
[0097] The first output 640 can represent the probability distribution of the relationship between each pair of terms. As a specific example, four relationships can be defined: isA, partOf, indirect, None. Among them,
[0098] - isA: refers to the semantic relationship between a child term of a sub-type and a parent term of a parent type,
[0099] - isA: refers to the semantic relationship between a child term of a sub-type and a parent term of a parent type,
[0100] For example, "pine" isA "tree", "apple" isA "fruit";
[0101] Part of: The relationship between a part and a device is called partOf relationship. For example, "winding" partOf "transformer";
[0102] Part of: The relationship between a part and a device is called partOf relationship. For example, "winding" partOf "transformer";
[0103] None: None can represent no relationship.
[0104] Indirect: Indirect can represent a multi-hop indirect relationship between two entities. For example, assuming A partOf B, B partOf C, then A indirect C can be obtained. Thus, the relationship between two or more terms belonging to a term can be represented.
[0105] By introducing the indirect relationship, the effect of the model in the case of missing input terms can be improved.
[0106] The second output 650 can include a completeness result, for example, whether the terms in the current sentence are complete, to improve the effect of the model in the case of missing input terms.
[0107] The following data processing strategy can be used: in order to further improve the effect of the model in the case of missing input terms, in addition to adding indirect relationship and term completeness judgment task, a certain proportion of terms in the sample can be randomly discarded during data processing. Thus, on the one hand, term missing samples can be constructed to help the model have the ability to judge the term missing condition; on the other hand, the data volume is also increased to help the model further improve the effect
[0108] According to one or more embodiments of the present disclosure, a term relationship mining scheme is described, especially a term relationship mining scheme applicable to the power industry. By fully utilizing the semantics contained in the context of the term and the information contained in the term itself, the superordinate (isA), component (partOf) relationship, etc. between the terms such as power terms can be mined.
[0109] According to one or more embodiments of the present disclosure, at least one of the following advantages can be obtained: low labor cost, no need to label a large amount of data; high flexibility based on semantic model, method has migratory ability, not limited to document type, specific sentence; has the ability to mine term relationship from the information contained in the term itself, the method is based on data characteristics, the implementation cost is low, and the term system can be effectively completed in the case of limited industry corpus.
[0110] According to one or more embodiments of the present disclosure, a relationship graph can be output based on the input term or sentence. The term can come from the upstream term mining model.
[0111] It can be understood that the methods described according to various embodiments of the present disclosure can be used individually respectively, or in combination, and unless described otherwise, the elements described according to one example embodiment of the present disclosure can be used in combination with another embodiment, and the like. For example, an “indirect” multi-hop relationship between terms can be determined based on re-structuring of word segmentation and dependency relationships, or a hyponym relationship between terms can be mined based on a transformer model, and the like.
[0112] Reference is now made to Figure 7 An apparatus 700 for determining term relationships performed by a computer according to an embodiment of the present disclosure is described. The apparatus 700 for determining term relationships can include a word segmentation obtaining unit 701, a dependency relationship determining unit 702, a term constructing unit 703, and a term relationship determining unit 704.
[0113] The word segmentation obtaining unit 701 can be configured to obtain a plurality of word segments, which are obtained by performing word segmentation processing on a first term from a corpus. The dependency relationship determining unit 702 can be configured to determine one or more dependency relationships between the plurality of word segments. The term constructing unit 703 can be configured to construct a second term from at least two word segments of the plurality of word segments based on at least one dependency relationship of the one or more dependency relationships. The term relationship determining unit 704 can be configured to determine the second term as a hyponym concept of the first term in response to determining that the second term is in the corpus.
[0114] The apparatus according to an embodiment of the present disclosure can mine term relationships based on information contained in the terms themselves.
[0115] According to some embodiments, the term constructing unit can include a unit configured to delete at least two word segments of the first term having the at least one dependency relationship to form the second term.
[0116] According to some embodiments, the term constructing unit can include a unit configured to adjust an order of at least two word segments of the first term having the at least one dependency relationship with the same word segment to form the second term.
[0117] According to some embodiments, the dependency relationship determining unit can include a unit configured to determine at least one modifier and at least one core of the plurality of word segments, and determine one or more modifier relationships based on the at least one modifier and the at least one core.
[0118] According to some embodiments, determining the at least one modifier and the at least one core word in the plurality of tokens can include: determining, based on the position and frequency of occurrence of each token in the plurality of tokens in the plurality of terms in the corpus, a probability that each token in the plurality of tokens is a core word; and determining, based on the probability, the at least one modifier and the at least one core word from the plurality of tokens.
[0119] According to some embodiments, determining one or more modifier relationships based on the at least one modifier and the at least one core word can include: for each token in the plurality of tokens, determining, based on the corpus, a co-occurrence frequency of the token with an immediately adjacent token in the plurality of tokens; and determining the one or more modifier relationships based on the co-occurrence frequency.
[0120] According to some embodiments, determining the one or more modifier relationships based on the co-occurrence frequency can include, for the at least one modifier determined in the plurality of tokens, determining, based on the co-occurrence frequency, a word that is modified by the modifier.
[0121] According to some embodiments, the apparatus 700 can further include a unit for deleting the at least one dependency relationship in response to determining that the second term is not in the corpus.
[0122] In the technical solutions of the present disclosure, the collection, acquisition, storage, use, processing, transmission, provision and public application of user personal information involved all comply with the relevant legal regulations and do not violate public order and good customs.
[0123] According to embodiments of the present disclosure, an electronic device, a readable storage medium and a computer program product are also provided.
[0124] Reference Figure 8 A block diagram of an electronic device 800 that can be used as a server or a client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent a wide variety of digital electronic computing devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computing devices. The electronic device can also represent a variety of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown here, their connections, and their functions, are meant to be examples only, and are not intended to limit implementations of the present disclosure described and / or claimed in this document.
[0125] As Figure 8As shown, the electronic device 800 includes a computing unit 801 that can perform various appropriate actions and processes in accordance with a computer program stored in a read only memory (ROM) 802 or a computer program loaded into a random access memory (RAM) 803 from a storage unit 808. Various programs and data required for the operation of the electronic device 800 can also be stored in the RAM 803. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0126] A plurality of components in the electronic device 800 are connected to the I / O interface 805, including an input unit 806, an output unit 807, a storage unit 808, and a communication unit 809. The input unit 806 can be any type of device that can input information to the electronic device 800, can receive inputted digital or character information, and generate key signal inputs related to user settings and / or function controls of the electronic device, and can include, but is not limited to, a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 807 can be any type of device that can present information, and can include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 808 can include, but is not limited to, a magnetic disk, an optical disk. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0127] The computing unit 801 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 performs various methods and processes described above, such as the methods 200, 300, and / or 500 and variations thereof, etc. For example, in some embodiments, the methods 200, 300, and / or 500 and variations thereof, etc. can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded onto the RAM 803 and executed by the computing unit 801, one or more steps of the methods 200, 300, and / or 500 and variations thereof, etc. described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform the methods 200, 300, and / or 500 and variations thereof, etc. by any other appropriate means, such as by means of firmware.
[0128] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0129] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a standalone software package, or entirely on a remote machine or server.
[0130] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0131] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0132] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0133] The computer system can include clients and servers. This relationship can be. The servers are typically remote from the clients with the interactions between them occurring over a communication network. The relationship between client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The servers can be cloud servers, servers of a distributed system, or servers incorporating blockchain.
[0134] It should be understood that various forms of flow shown above can be used with orders of steps being re-sequenced. For example, steps recited in the present disclosure can be performed in parallel, in series, or in a different order, as long as the desired results of the technology disclosed in the present disclosure are achieved, which is not limited herein.
[0135] While embodiments or examples of this disclosure have been described with reference to the figures, it is understood that the methods, systems, and devices described above are merely exemplary embodiments or examples and that the scope of the application is not limited to these embodiments or examples. Various elements of the embodiments or examples can be omitted or replaced by equivalents thereof. Furthermore, the steps can be performed in an order different from that described in the present disclosure. Further, the various elements of the embodiments or examples can be combined in various ways. It is important that many of the elements described herein can be replaced by equivalents that appear after the present disclosure as technology evolves.
Claims
1. A computer-implemented method for determining term relationships, comprising: obtaining a plurality of tokens, the plurality of tokens being obtained by tokenizing a first term from a corpus; determining at least one modifier and at least one core among the plurality of tokens, wherein the core is determined based on a position and a frequency of occurrence of each token in the plurality of tokens in a plurality of terms in the corpus; determining one or more modifier relationships as dependency relationships based on the at least one modifier and the at least one core; constructing a second term by deleting the at least one modifier from the first term based on the one or more modifier relationships; and in response to determining that the second term is in the corpus, determining the first term as a hyponym of the second term.
2. The method of claim 1, wherein, constructing a second term from at least two tokens in the plurality of tokens based on at least one dependency relationship in the one or more dependency relationships comprises: adjusting an order of the at least two tokens in the first term that have the at least one dependency relationship with a same token to form the second term.
3. The method of claim 1, wherein, determining at least one modifier and at least one core among the plurality of tokens comprises determining a probability that each token in the plurality of tokens is a core based on a position and a frequency of occurrence of each token in the plurality of tokens in a plurality of terms in the corpus, and determining the at least one modifier and the at least one core from the plurality of tokens based on the probability.
4. The method of claim 3, wherein, determining one or more modifier relationships based on the at least one modifier and the at least one core comprises: for each token in the plurality of tokens, determining a co-occurrence frequency of the token with an immediately adjacent token in the plurality of tokens based on the corpus; and determining the one or more modifier relationships based on the co-occurrence frequency.
5. The method of claim 4, wherein, determining the one or more modifier relationships based on the co-occurrence frequency comprises, for the determined at least one modifier in the plurality of tokens, determining a token modified by the modifier based on the co-occurrence frequency. 6.The method of any one of claims 1-5, further comprising: in response to determining that the second term is not in the corpus, deleting at least one dependency relationship.
7. The method according to any one of claims 1-5, wherein, the corpus is a power industry corpus. 8.A computer-implemented apparatus for determining term relationships, comprising: a token obtaining unit configured to obtain a plurality of tokens, the plurality of tokens being obtained by tokenizing a first term from a corpus; a dependency determining unit configured to determine at least one modifier and at least one core among the plurality of tokens, wherein the core is determined based on a position and a frequency of occurrence of each token in the plurality of tokens in a plurality of terms in the corpus, and determine one or more modifier relationships as dependency relationships based on the at least one modifier and the at least one core; a term constructing unit configured to construct a second term by deleting the at least one modifier from the first term based on the one or more modifier relationships; and The term relationship determining unit is configured to determine, in response to determining that the second term is in the corpus, a first term as a lower-level concept of the second term.
9. The apparatus of claim 8, wherein, The term constructing unit comprises units configured to: adjust an order of at least two tokens in the first term that have the at least one dependency relationship with the same token to form the second term.
10. The apparatus of claim 8, wherein, Determining the at least one modifier and the at least one core term in the plurality of tokens comprises: determining, based on a position and a frequency of occurrence of each token in the plurality of tokens in a plurality of terms in the corpus, a probability that each token in the plurality of tokens is a core term; and determining, based on the probability, the at least one modifier and the at least one core term from the plurality of tokens.
11. The apparatus of claim 10, wherein, Determining one or more modifier relationships based on the at least one modifier and the at least one core term comprises: for each token in the plurality of tokens, determining, based on the corpus, a co-occurrence frequency of the token with an immediately adjacent token in the plurality of tokens; determining the one or more modifier relationships based on the co-occurrence frequency.
12. The apparatus of claim 11, wherein, Determining the one or more modifier relationships based on the co-occurrence frequency comprises, for the at least one modifier in the plurality of tokens, determining, based on the co-occurrence frequency, a token that is modified by the at least one modifier.
13. The apparatus of any one of claims 8-12, further comprising a unit configured to, in response to determining that the second term is not in the corpus, remove the at least one dependency relationship.
14. An electronic device, comprising: at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
15. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are for causing the computer to perform the method of any one of claims 1-7.
16. A computer program product comprising a computer program, wherein, The computer program, when executed by a processor, implements the method of any one of claims 1-7. The computer program, when executed by a processor, implements the method of any one of claims 1-7.
Citation Information
Patent Citations
Dependency relationship-based teaching domain ontology automatic generation method and apparatus
CN108491385A
Modeling method and system of power quality ontology model, and application method
CN110990493A
Rail transit industry term extraction method based on multi-modal natural language features
CN111897917A