Modeling method, extraction method and related device for metadata relationship extraction

By using the BERT model and mask matrix technology, the problems of insufficient data volume and incomplete semantics in metadata relationship extraction are solved, and efficient extraction of metadata relationships is achieved.

CN116932660BActive Publication Date: 2026-04-07CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-11
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies suffer from insufficient data, incomplete semantics, and difficulty in constructing training sets when extracting metadata relationships, making it difficult to effectively transfer sentence relationship extraction models to metadata.

Method used

The BERT model is used to obtain metadata and corresponding sentences, calculate common and individual mask matrices, use multiple BERT models to obtain representations of metadata and sentences, and combine the softmax function to extract metadata relationships.

Benefits of technology

It enables the effective extraction of relationships from metadata, solves the problems of insufficient data volume and incomplete semantics, and improves the accuracy and efficiency of metadata relationship extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116932660B_ABST
    Figure CN116932660B_ABST
Patent Text Reader

Abstract

The embodiment of the present disclosure provides a metadata relationship extraction modeling method, a metadata relationship extraction method, an apparatus, a computer device, a readable storage medium and a program, and relates to the technical field of computers. The method comprises the following steps: obtaining metadata and a sentence corresponding to the metadata; obtaining a common mask matrix and an individual mask matrix according to the metadata and the sentence corresponding to the metadata; inputting the metadata into a first BERT model to obtain metadata representation; inputting the sentence into a second BERT model to obtain sentence representation; obtaining common representation according to the metadata representation, the sentence representation and the common mask matrix; obtaining individual representation according to the sentence representation and the individual mask matrix; and obtaining the relationship of the metadata according to the common representation and the individual representation. The metadata relationship extraction modeling method provided by the embodiment of the present disclosure can obtain a metadata relationship extraction model of the relationship of the metadata.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly relates to a modeling method for metadata relationship extraction, a metadata relationship extraction method, an apparatus, a computer device, a readable storage medium and a program. BACKGROUND

[0002] At present, the relationship extraction technology between entities in a sentence mainly focuses on using large-scale training corpus and BERT pre-training model for relationship classification. However, for metadata, firstly, the data volume cannot meet the basic requirements of constructing a data set, and manually annotating additional data sets consumes a large amount of cost; secondly, compared with a sentence, metadata as a special expression form has differences in form and semantics, and it is difficult to directly migrate the sentence relationship extraction model to metadata. SUMMARY

[0003] The present disclosure provides a modeling method for metadata relationship extraction, a metadata relationship extraction method, an apparatus, a computer device, a readable storage medium and a program, and relates to the technical field of computer. The metadata relationship extraction model established can obtain the relationship of metadata.

[0004] The present disclosure provides a modeling method for metadata relationship extraction, comprising: obtaining metadata and a sentence corresponding to the metadata; obtaining a common mask matrix and an individual mask matrix according to the metadata and the sentence corresponding to the metadata; inputting the metadata into a first BERT model to obtain metadata representation; inputting the sentence into a second BERT model to obtain sentence representation; obtaining common representation according to the metadata representation, the sentence representation and the common mask matrix; obtaining individual representation according to the sentence representation and the individual mask matrix; and obtaining the relationship of the metadata according to the common representation and the individual representation.

[0005] In one embodiment, obtaining metadata and a sentence corresponding to the metadata comprises: obtaining a data document related to the metadata; and splitting the data document into a sentence corresponding to the metadata.

[0006] In one embodiment, obtaining a common mask matrix and an individual mask matrix according to the metadata and the sentence corresponding to the metadata comprises: inputting the metadata and the sentence corresponding to the metadata into an encoding-decoding model; obtaining the common mask matrix according to the attention weight in the encoding-decoding model; and obtaining the individual mask matrix according to the loss of the original representation of the sentence corresponding to the metadata output by the encoding-decoding model and the sentence of the metadata.

[0007] In an embodiment, obtaining the commonality representation according to the metadata representation, the sentence representation and the commonality mask matrix comprises: calculating scores of each hidden layer according to the metadata representation and the sentence representation; calculating a first attention matrix according to the scores of each hidden layer; obtaining a sentence intermediate representation according to the first attention matrix, the sentence representation and the commonality mask matrix; inputting the sentence intermediate representation and the metadata representation into a third BERT model to obtain the commonality representation.

[0008] In an embodiment, obtaining the individuality representation according to the sentence representation and the individuality mask matrix comprises: calculating scores of each hidden layer according to the sentence representation; calculating a second attention matrix according to the scores of each hidden layer; obtaining the individuality representation according to the second attention matrix, the sentence representation and the individuality mask matrix.

[0009] In an embodiment, obtaining the relationship of the metadata according to the commonality representation and the individuality representation comprises: obtaining the relationship of the metadata by a flexible maxout function softmax according to the commonality representation and the individuality representation.

[0010] Embodiments of the present disclosure provide a method for extracting a 7-tuple metadata relationship, comprising: obtaining metadata; inputting the metadata into a trained metadata relationship extraction model to extract the relationship of the metadata; wherein the metadata relationship extraction model is a metadata relationship extraction model established by any one of the above modeling methods.

[0011] Embodiments of the present disclosure provide a modeling device for metadata relationship extraction, comprising: a first obtaining module configured to obtain metadata and a sentence corresponding to the metadata; a mask module configured to obtain a commonality mask matrix and an individuality mask matrix according to the metadata and the sentence corresponding to the metadata; a metadata representation module configured to input the metadata into a first BERT model to obtain a metadata representation; a sentence representation module configured to input the sentence into a second BERT model to obtain a sentence representation; a commonality representation module configured to obtain a commonality representation according to the metadata representation, the sentence representation and the commonality mask matrix; an individuality representation module configured to obtain an individuality representation according to the sentence representation and the individuality mask matrix; and a relationship of metadata module configured to obtain the relationship of the metadata according to the commonality representation and the individuality representation.

[0012] Embodiments of the present disclosure provide a device for extracting a metadata relationship, comprising: a second obtaining module configured to obtain metadata; and an extraction module configured to input the metadata into a trained metadata relationship extraction model to extract the relationship of the metadata; wherein the metadata relationship extraction model is a metadata relationship extraction model established by any one of the above modeling methods.

[0013] This disclosure provides a computer device including a processor, a memory, and an input / output interface; the processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used to receive data and output data, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device performs the method as described in any of the above embodiments.

[0014] This disclosure provides a computer-readable storage medium storing a computer program adapted to be loaded and executed by a processor, such that a computer device having the processor performs the method described in any of the preceding embodiments.

[0015] This disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the above embodiments.

[0016] The metadata relationship extraction modeling method of this application involves: acquiring metadata and sentences corresponding to the metadata; obtaining a commonality mask matrix and a uniqueness mask matrix based on the metadata and sentences; inputting the metadata into a first BERT model to obtain metadata representation; inputting the sentences into a second BERT model to obtain sentence representation; obtaining a commonality representation based on the metadata representation, sentence representation, and commonality mask matrix; obtaining a uniqueness representation based on the sentence representation and uniqueness mask matrix; and obtaining the relationship between the metadata based on the commonality representation and the uniqueness representation, thereby establishing a metadata relationship extraction model capable of obtaining the relationship between metadata. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A schematic diagram of an exemplary system architecture for a modeling method for metadata relationship extraction that can be applied to embodiments of the present disclosure is shown;

[0019] Figure 2 This is a flowchart of a modeling method for metadata relationship extraction provided in an embodiment of this disclosure;

[0020] Figure 3 This is a flowchart illustrating a method for obtaining metadata and sentences corresponding to the metadata, provided in an embodiment of this disclosure.

[0021] Figure 4 This is a flowchart of a method for obtaining a common mask matrix and a unique mask matrix based on the metadata and the sentences corresponding to the metadata, provided in this embodiment of the disclosure;

[0022] Figure 5 This is a flowchart illustrating a method for obtaining a common representation based on the metadata representation, the sentence representation, and the commonality mask matrix, provided in this embodiment of the disclosure.

[0023] Figure 6 This is a flowchart illustrating a method for obtaining a personality representation based on the sentence representation and the personality mask matrix, provided in this embodiment of the disclosure.

[0024] Figure 7 This is a flowchart of a method for extracting metadata relationships provided in an embodiment of this disclosure;

[0025] Figure 8 This is a schematic diagram of the structure of a modeling apparatus for extracting metadata relationships provided in an embodiment of this disclosure;

[0026] Figure 9 This is a schematic diagram of the structure of a metadata relationship extraction device provided in an embodiment of this disclosure;

[0027] Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure. Detailed Implementation

[0028] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0029] In this embodiment of the disclosure, metadata and sentences corresponding to the metadata can be obtained based on technologies such as BERT; a common mask matrix and a unique mask matrix can be obtained based on the metadata and the sentences corresponding to the metadata; the metadata can be input into a first BERT model to obtain a metadata representation; the sentences can be input into a second BERT model to obtain a sentence representation; a common representation can be obtained based on the metadata representation, the sentence representation, and the common mask matrix; a unique representation can be obtained based on the sentence representation and the unique mask matrix; and the relationship between the metadata can be obtained based on the common representation and the unique representation, thereby establishing a metadata relationship extraction model capable of obtaining the relationship between metadata.

[0030] The following is a brief explanation of some of the terms used in this disclosure:

[0031] BERT is a natural language processing model developed by Google that can learn bidirectional representations of text, significantly improving the ability to understand unlabeled text in context for many different tasks.

[0032] Metadata, also known as intermediary data or relay data, is data about data. It primarily describes data properties and supports functions such as indicating storage location, historical data, resource lookup, and file records. Metadata differs from sentences in form and semantics. Metadata uses noun / gerund phrases to express concise semantic information, while sentences mostly express complete factual information using complete syntactic components.

[0033] In machine learning, a sequence typically refers to a collection of data arranged in a specific order. Here, a sequence refers to a text sequence. Sequence data is characterized by the correlation and order among data points; the value of each data point may depend on the preceding data points.

[0034] The solutions provided in this disclosure involve technologies such as BERT and metadata.

[0035] Figure 1 A schematic diagram of an exemplary system architecture 100 for which a modeling method for metadata relationship extraction, applicable to embodiments of the present disclosure, is shown.

[0036] like Figure 1 As shown, system architecture 100 may include one or more of terminals 101, 102, and 103, a network 104, and a server 105. Network 104 is the medium used to provide a communication link between terminals 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0037] It should be understood that Figure 1 The number of terminals, networks, and servers shown is merely illustrative. Depending on implementation needs, there can be any number of terminals, networks, and servers. For example, server 105 could be a server cluster consisting of multiple servers.

[0038] Terminals 101, 102, and 103 interact with server 105 via network 104, and can receive or send messages, etc. Terminals 101, 102, and 103 can be various electronic devices with displays, including but not limited to smartphones, tablets, laptops, and desktop computers, etc.

[0039] Server 105 can be a server providing various services. For example, terminal 103 (or terminal 101 or 102) sends a metadata relationship extraction modeling instruction to server 105. Server 105 can obtain metadata and sentences corresponding to the metadata; obtain a commonality mask matrix and a uniqueness mask matrix based on the metadata and sentences; input the metadata into a first BERT model to obtain metadata representation; input the sentences into a second BERT model to obtain sentence representation; obtain a commonality representation based on the metadata representation, sentence representation, and commonality mask matrix; obtain a uniqueness representation based on the sentence representation and uniqueness mask matrix; and obtain the relationship between the metadata based on the commonality representation and uniqueness representation, so that the metadata relationship extraction model has the ability to identify the relationship between metadata based on the metadata.

[0040] Figure 1 The metadata relationship extraction method of this application can also be applied to the system architecture. After the metadata relationship extraction model of this application is completed, it can be set on server 105. When a user sends a metadata relationship extraction request to server 105 through terminal 103 (or terminal 101 or 102), the metadata relationship extraction model on server 105 can extract the relationship from the metadata.

[0041] The terminal can be a mobile phone (e.g., terminal 101), a tablet computer (e.g., terminal 102), or a desktop computer (e.g., terminal 101), etc., without limitation. The terminal can display an application, which can be an application for metadata relationship extraction and modeling, etc. Figure 1 The terminals mentioned are only a portion of the devices cited in this disclosure; the terminals are not limited to these. Figure 1 The equipment listed in the text.

[0042] It is understood that the terminal mentioned in the embodiments of this disclosure can be a user device, and the server in the embodiments of this disclosure includes, but is not limited to, a server or a cluster of servers. The terminal mentioned above can be an electronic device, including but not limited to mobile phones, tablets, smart voice interaction devices, smart home appliances, in-vehicle terminals, desktop computers, laptops, handheld computers, in-vehicle equipment, augmented reality / virtual reality (AR / VR) devices, head-mounted displays, smart TVs, wearable devices, smart speakers, digital cameras, webcams, and other mobile internet devices (MIDs) with network access capabilities, or terminal devices in scenarios such as trains, ships, and flights.

[0043] The servers mentioned above can be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, vehicle-road cooperation, content delivery networks (CDN), and big data and artificial intelligence platforms. They can also be independent physical servers, or server clusters or distributed systems composed of multiple physical servers.

[0044] Optionally, the data involved in the embodiments of this disclosure may be stored in a cloud platform, or may be stored based on cloud storage technology or blockchain technology, without limitation.

[0045] Natural language processing models based on related technologies suffer from problems such as insufficient metadata volume, incomplete semantics, and difficulty in constructing training sets when dealing with metadata.

[0046] Figure 2 This is a flowchart illustrating a modeling method for metadata relationship extraction provided in this disclosure. The method provided in this disclosure can be... Figure 1 The terminal or server in the embodiments executes the commands, or the commands are executed by the interaction between the terminal and the server.

[0047] like Figure 2 As shown, the method provided in this disclosure embodiment may include the following steps.

[0048] In step S210, metadata and the sentence corresponding to the metadata are obtained.

[0049] In this step, the terminal or server obtains metadata and the sentences corresponding to the metadata.

[0050] In step S220, a common mask matrix and a unique mask matrix are obtained based on the metadata and the sentences corresponding to the metadata.

[0051] In this step, the terminal or server obtains a common mask matrix and a unique mask matrix based on the metadata and the sentences corresponding to the metadata.

[0052] In step S230, the metadata is input into the first BERT model to obtain a metadata representation.

[0053] In this step, the terminal or server inputs the metadata into the first BERT model to obtain a metadata representation.

[0054] In step S240, the root inputs the sentence into the second BERT model to obtain the sentence representation.

[0055] In this step, the terminal or server inputs the sentence into the second BERT model to obtain the sentence representation.

[0056] In step S250, a common representation is obtained based on the metadata representation, the sentence representation, and the commonality mask matrix.

[0057] In this step, the terminal or server obtains the common representation based on the metadata representation, the sentence representation, and the common mask matrix.

[0058] In step S260, the personality representation is obtained based on the sentence representation and the personality mask matrix.

[0059] In this step, the terminal or server obtains the personality representation based on the sentence representation and the personality mask matrix.

[0060] In step S270, the relationship between the metadata is obtained based on the commonality representation and the individuality representation.

[0061] In this step, the terminal or server obtains the relationship between the metadata based on the common representation and the individual representation.

[0062] In one embodiment, the relationship between the metadata is obtained through a softmax function based on the commonality representation and the individuality representation.

[0063] Figure 2 The metadata relationship extraction modeling method shown involves: acquiring metadata and the sentences corresponding to the metadata; obtaining a commonality mask matrix and a uniqueness mask matrix based on the metadata and the sentences; inputting the metadata into a first BERT model to obtain metadata representation; inputting the sentences into a second BERT model to obtain sentence representation; obtaining a commonality representation based on the metadata representation, the sentence representation, and the commonality mask matrix; obtaining a uniqueness representation based on the sentence representation and the uniqueness mask matrix; and obtaining the relationship between the metadata based on the commonality representation and the uniqueness representation, thereby establishing a metadata relationship extraction model capable of obtaining the relationship between metadata.

[0064] The method proposed in this invention transfers sentence relation extraction technology, solving the problems of insufficient metadata, incomplete semantics, and difficulty in constructing training sets in existing technologies.

[0065] Figure 3 This is a flowchart illustrating a method for obtaining metadata and sentences corresponding to the metadata, provided in an embodiment of this disclosure. The method provided in this embodiment can be... Figure 1 The terminal or server in the embodiments executes the commands, or the commands are executed by the interaction between the terminal and the server.

[0066] likeFigure 3 As shown, the method provided in this disclosure embodiment may include the following steps.

[0067] In step S310, the data document related to the metadata is obtained.

[0068] In this step, the terminal or server obtains data documents related to the metadata.

[0069] Among them, a data document is a data document that belongs to a certain type of metadata.

[0070] In step S320, the data document is split into sentences corresponding to the metadata.

[0071] In this step, the terminal or server breaks down the data document into sentences corresponding to the metadata.

[0072] Among them, data document splitting refers to extracting sentences of a certain type of metadata; the specific splitting is done through programming.

[0073] Figure 3 The method involves retrieving data documents related to metadata, splitting the data documents, and assembling them into sentence-like formats (each sentence belongs to a certain metadata).

[0074] Figure 4 This is a flowchart illustrating a method for obtaining a commonality mask matrix and a uniqueness mask matrix based on the metadata and the sentences corresponding to the metadata, as provided in this disclosure embodiment. The method provided in this disclosure embodiment can be... Figure 1 The terminal or server in the embodiments executes the commands, or the commands are executed by the interaction between the terminal and the server.

[0075] like Figure 4 As shown, the method provided in this disclosure embodiment may include the following steps.

[0076] In step S410, the metadata and the sentence corresponding to the metadata are input into the encoding / decoding model.

[0077] In this step, the terminal or server inputs the metadata and the sentence corresponding to the metadata into the encoding / decoding model.

[0078] In one embodiment, the input is metadata and the sentence corresponding to the metadata. The sentence corresponding to the metadata is used to output a sequence through the Encoder-Decoder model, and the loss is calculated by comparing it with the original representation of the sentence.

[0079] In step S420, the common mask matrix is ​​obtained according to the attention weights in the encoding / decoding model.

[0080] In this step, the terminal or server obtains the common mask matrix based on the attention weights in the encoding / decoding model.

[0081] In one embodiment, the attention weights a of the Encoder-Decoder part are... m->s In each row, the first k1 positions of the weight values ​​are assigned 1, resulting in a commonality mask matrix, where m->s represents the relationship between metadata and the corresponding sentences. k1 is an integer greater than 1.

[0082] In step S430, the personality mask matrix is ​​obtained based on the loss between the sequence corresponding to the sentence of the metadata output by the encoding / decoding model and the original representation of the sentence of the metadata.

[0083] In this step, the terminal or server obtains the personalized mask matrix based on the loss between the sequence corresponding to the sentence of the metadata output by the encoding / decoding model and the original representation of the sentence of the metadata.

[0084] In one embodiment, based on the loss value l m->s Assigning 1 to the first k2 positions yields the personalized mask matrix. This personalized mask matrix is ​​used for classification. k2 represents an integer greater than 1.

[0085] Figure 5 This is a flowchart illustrating a method for obtaining a common representation based on the metadata representation, the sentence representation, and the commonality mask matrix, as provided in this disclosure embodiment. The method provided in this disclosure embodiment can be... Figure 1 The terminal or server in the embodiments executes the commands, or the commands are executed by the interaction between the terminal and the server.

[0086] like Figure 5 As shown, the method provided in this disclosure embodiment may include the following steps.

[0087] In step S510, the score for each hidden layer is calculated based on the metadata representation and the sentence representation.

[0088] In this step, the terminal or server calculates the score for each hidden layer based on the metadata representation and the sentence representation.

[0089] In one embodiment, the metadata representation h is obtained using the first BERT model. m The sentence representation h is obtained using the second BERT model. s .

[0090] Among them, h s This represents the sequence between the two metadata fields after the second BERT encoding, h mThis indicates the concatenation of two data representations after the first BERT encoding. m and h s It can be obtained through the following formulas (1) and (2):

[0091] h s =BERT2(x s (1)

[0092] h m =BERT1(x m (2)

[0093] In one embodiment, a score is calculated for each hidden layer representation h to construct the commonalities between captured metadata and sentences. The score calculation formula can be formula (3).

[0094]

[0095] Where score is the score; t1 and t2 represent the positions of the sequence; b1 represents the bias vector; W1 and W2 represent the weight matrices; and tanh is the bitangent function.

[0096] In step S520, the first attention matrix is ​​calculated based on the score of each hidden layer.

[0097] In this step, the terminal or server calculates the first attention matrix based on the score of each hidden layer.

[0098] In one embodiment, the first attention matrix is ​​calculated using the score of each hidden layer, and the calculation method for each value in the matrix is ​​as follows (4).

[0099]

[0100] Where t1, t2, t3 represent the positions of the sequence, e score Let L represent an exponential function with base e, where e is Euler's constant, approximately 2.71828, and L equal the number of relation types ultimately extracted.

[0101] In step S530, the intermediate representation of the sentence is obtained based on the first attention matrix, the sentence representation, and the commonality mask matrix.

[0102] In this step, the terminal or server obtains the intermediate representation of the sentence based on the first attention matrix, the sentence representation, and the commonality mask matrix.

[0103] In one embodiment, w m->s Positions with a value of 1 in the commonality mask matrix are retained, while other positions are set to 0. The commonality representation is obtained using the first attention matrix and then concatenated with the metadata hidden layer representation.

[0104] The middle part of the sentence represents c. s Calculated using the following formula (5):

[0105] c s =w m→s h s (5)

[0106] In step S540, the intermediate representation of the sentence and the metadata representation are input into the third BERT model to obtain the common representation.

[0107] In this step, the terminal or server inputs the intermediate representation of the sentence and the metadata representation into the third BERT model to obtain the common representation.

[0108] The commonality can be calculated using the following formula (6):

[0109] r s =BERT3(c s h m (6)

[0110] Figure 6 This is a flowchart illustrating a method for obtaining a personality representation based on the sentence representation and the personality mask matrix, as provided in this disclosure embodiment. The method provided in this disclosure embodiment can be... Figure 1 The terminal or server in the embodiments executes the commands, or the commands are executed by the interaction between the terminal and the server.

[0111] like Figure 6 As shown, the method provided in this disclosure embodiment may include the following steps.

[0112] In step S610, the score for each hidden layer is calculated based on the sentence representation.

[0113] In this step, the terminal or server calculates the score for each hidden layer based on the sentence representation, where the specific calculation formula is as shown in formula (7):

[0114]

[0115] Where W3 represents the weight matrix, b2 represents the bias vector, and t represents the sequence position.

[0116] In step S620, the second attention matrix is ​​calculated based on the score of each hidden layer.

[0117] In this step, the terminal or server calculates the second attention matrix based on the score of each hidden layer.

[0118] The formula for calculating the second attention matrix is ​​as shown in formula (8):

[0119]

[0120] Where t represents the position of the sequence, e score Let L represent an exponential function with base e, where e is Euler's constant, approximately 2.71828, and L equal the number of relation types ultimately extracted.

[0121] In step S630, the personality representation is obtained based on the second attention matrix, the sentence representation, and the personality mask matrix.

[0122] In this step, the terminal or server obtains the personality representation based on the second attention matrix, the sentence representation, and the personality mask matrix.

[0123] Among them, the personality mask is inverted and then masked with the score. The personality representation formula (9) is as follows.

[0124] p s =w s h s (9)

[0125] In one embodiment, obtaining the relationship between the metadata based on the common representation and the individual representation includes: obtaining the relationship between the metadata based on the common representation and the individual representation through a softmax transfer function.

[0126] The formula for obtaining the metadata relationship is (10):

[0127]

[0128] in, Read as "y estimate", it is the value obtained by substituting the unknowns into the equation. W4 represents the weight matrix and b4 represents the bias vector.

[0129] In one embodiment, the constructed dataset is randomly divided into a training set and a validation set in a 6:4 ratio. Adjustment Figure 1 The method constructs model parameters and trains the model using the training set. The model extraction performance is evaluated using the validation set.

[0130] Figure 7 This is a flowchart illustrating a method for extracting metadata relationships provided in an embodiment of this disclosure. The method provided in this embodiment can be... Figure 1 The server in the example is executed.

[0131] The metadata relationship extraction model described above in this application can be set after modeling is completed. Figure 1In the system architecture, when a user sends a request to retrieve a relationship to server 105 via terminal 103 (or terminal 101 or 102), the metadata relationship retrieval model on server 105 can be used... Figure 7 The method is used to extract metadata relationships.

[0132] like Figure 7 As shown, the method provided in this disclosure embodiment may include the following steps:

[0133] In step S710, metadata is obtained;

[0134] In step S720, the metadata is input into a trained metadata relationship extraction model to extract the relationships of the metadata;

[0135] The metadata relationship extraction model is a metadata relationship extraction model established by any one of the above metadata relationship extraction modeling methods.

[0136] The disclosed method for extracting metadata relationships involves acquiring metadata and inputting it into a trained metadata relationship extraction model to extract the relationships between the metadata. The metadata relationships can be in the form of triples, such as metadata A, metadata B, and the relationship between metadata A and metadata B; or entity A, entity B, and the relationship between entity A and entity B.

[0137] Figure 8 This is a schematic diagram of the structure of a modeling apparatus for extracting metadata relationships provided in an embodiment of this disclosure.

[0138] like Figure 8 As shown, the metadata relationship extraction modeling apparatus 800 provided in this embodiment may include:

[0139] The first acquisition module 810 is used to acquire metadata and sentences corresponding to the metadata;

[0140] Masking module 820 is used to obtain a common mask matrix and a unique mask matrix based on the metadata and the sentences corresponding to the metadata;

[0141] Metadata representation module 830 is used to input the metadata into the first BERT model to obtain a metadata representation;

[0142] Sentence representation module 840 is used to input the sentence into the second BERT model to obtain a sentence representation;

[0143] The commonality representation module 850 is used to obtain a commonality representation based on the metadata representation, the sentence representation, and the commonality mask matrix;

[0144] The personality representation module 860 is used to obtain a personality representation based on the sentence representation and the personality mask matrix;

[0145] The metadata relationship module 870 is used to obtain the relationship of the metadata based on the common representation and the individual representation.

[0146] The metadata relationship extraction modeling apparatus of this application comprises: a first acquisition module for acquiring metadata and sentences corresponding to the metadata; a masking module for acquiring a commonality mask matrix and a uniqueness mask matrix based on the metadata and the sentences corresponding to the metadata; a metadata representation module for inputting the metadata into a first BERT model to obtain a metadata representation; a sentence representation module for inputting the sentences into a second BERT model to obtain a sentence representation; a commonality representation module for obtaining a commonality representation based on the metadata representation, the sentence representation, and the commonality mask matrix; a uniqueness representation module for obtaining a uniqueness representation based on the sentence representation and the uniqueness mask matrix; and a metadata relationship module for obtaining the relationship between the metadata based on the commonality representation and the uniqueness representation, thereby establishing a metadata relationship extraction model capable of acquiring the relationship between metadata.

[0147] In one embodiment, the first acquisition module is further configured to acquire a data document related to the metadata; and split the data document into sentences corresponding to the metadata.

[0148] The masking module is further configured to input the metadata and the sentences corresponding to the metadata into the encoding-decoding model; obtain the common mask matrix according to the attention weights in the encoding-decoding model; and obtain the individual mask matrix according to the loss between the sequence of sentences corresponding to the metadata output by the encoding-decoding model and the original representation of the sentences of the metadata.

[0149] In one embodiment, the common representation module is further configured to calculate the score of each hidden layer based on the metadata representation and the sentence representation; calculate the first attention matrix based on the score of each hidden layer; obtain the sentence intermediate representation based on the first attention matrix, the sentence representation and the common mask matrix; and input the sentence intermediate representation and the metadata representation into a third BERT model to obtain the common representation.

[0150] In one embodiment, the personality representation module is configured to calculate a score for each hidden layer based on the sentence representation; calculate a second attention matrix based on the score for each hidden layer; and obtain the personality representation based on the second attention matrix, the sentence representation, and the personality mask matrix.

[0151] In one embodiment, the metadata relationship module is used to obtain the relationship of the metadata through a softmax function based on the common representation and the individual representation.

[0152] Figure 9 This is a schematic diagram of the structure of a metadata relationship extraction device provided in an embodiment of this disclosure.

[0153] like Figure 9 As shown, the metadata relationship extraction device 900 provided in this embodiment may include:

[0154] The second acquisition module 910 is used to acquire metadata;

[0155] Extraction module 920 is used to input the metadata into a trained metadata relationship extraction model to extract the relationship of the metadata;

[0156] The metadata relationship extraction model is a metadata relationship extraction model established by any one of the above metadata relationship extraction modeling methods.

[0157] The data relationship extraction device disclosed herein includes a second acquisition module for acquiring metadata, and an extraction module for inputting the metadata into a trained metadata relationship extraction model to extract the relationships of the metadata, thereby enabling the extraction of metadata relationships.

[0158] See Figure 10 , Figure 10 This is a schematic diagram of the structure of a computer device 1000 provided in an embodiment of this disclosure. For example... Figure 10 As shown, the computer device in this embodiment may include one or more processors 1001, a memory 1002, and an input / output interface 1003. The processor 1001, memory 1002, and input / output interface 1003 are connected via a bus 1004. The memory 1002 stores a computer program, which includes program instructions. The input / output interface 1003 receives and outputs data, such as for data interaction between the host machine and the computer device, or for data interaction between various virtual machines within the host machine. The processor 1001 executes the program instructions stored in the memory 1002.

[0159] The processor 1001 can perform the following operations:

[0160] Obtain metadata and sentences corresponding to the metadata; obtain a commonality mask matrix and a uniqueness mask matrix based on the metadata and sentences; input the metadata into a first BERT model to obtain metadata representation; input the sentences into a second BERT model to obtain sentence representation; obtain a commonality representation based on the metadata representation, sentence representation, and commonality mask matrix; obtain a uniqueness representation based on the sentence representation and uniqueness mask matrix; obtain the relationship between the metadata based on the commonality representation and uniqueness representation.

[0161] Alternatively, the processor 1001 can perform the following operations:

[0162] Obtain metadata; input the metadata into a trained metadata relationship extraction model to extract the relationships of the metadata.

[0163] In some feasible implementations, the processor 1001 may be a central processing unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0164] The memory 1002 may include read-only memory and random access memory, and provides instructions and data to the processor 1001 and the input / output interface 1003. A portion of the memory 1002 may also include non-volatile random access memory. For example, the memory 1002 may also store device type information.

[0165] In practice, the computer device can execute the implementation methods provided by the steps in the above embodiments through its built-in functional modules. For details, please refer to the implementation methods provided by the steps in the above embodiments, which will not be repeated here.

[0166] This disclosure provides a computer device including a processor, an input / output interface, and a memory. The processor retrieves a computer program from the memory and executes the steps of the method shown in the above embodiments to perform a transmission operation.

[0167] This disclosure also provides a computer-readable storage medium storing a computer program adapted to be loaded by a processor and execute the methods provided in the steps of the above embodiments. Specific implementations of the steps in the above embodiments can be found therein and will not be repeated here. Furthermore, the beneficial effects of using the same method will not be repeated here either. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this disclosure, please refer to the description of the method embodiments of this disclosure. As an example, the computer program can be deployed to execute on a single computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed across multiple locations and interconnected via a communication network.

[0168] The computer-readable storage medium can be the apparatus provided in any of the foregoing embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0169] This disclosure also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative embodiments described above.

[0170] The terms "first," "second," etc., used in the specification, claims, and drawings of this disclosure are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0171] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.

[0172] The methods and related apparatuses provided in this disclosure are described with reference to the method flowcharts and / or structural diagrams provided in this disclosure. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions are provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable transmission device to create a machine, such that the instructions, which execute via the processor of the computer or other programmable transmission device, generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable transmission device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable transmission device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.

[0173] The above-disclosed embodiments are merely preferred embodiments of this disclosure and should not be construed as limiting the scope of this disclosure. Therefore, any equivalent variations made in accordance with the claims of this disclosure shall still fall within the scope of this disclosure.

Claims

1. A modeling method for extracting metadata relationships, characterized in that, include: Retrieve metadata and the sentences corresponding to the metadata; Obtain a common mask matrix and a unique mask matrix based on the metadata and the sentences corresponding to the metadata; The metadata is input into the first BERT model to obtain a metadata representation; The sentence is input into the second BERT model to obtain a sentence representation; The common representation is obtained based on the metadata representation, the sentence representation, and the commonality mask matrix; The personality representation is obtained based on the sentence representation and the personality mask matrix; The relationship between the metadata is obtained based on the commonality representation and the individuality representation; The acquisition of metadata and the sentences corresponding to the metadata include: Retrieve the data document related to the metadata; The data document is split into sentences corresponding to the metadata.

2. The method according to claim 1, characterized in that, Obtaining the common mask matrix and the individual mask matrix based on the metadata and the sentences corresponding to the metadata includes: The metadata and the sentences corresponding to the metadata are input into the encoding / decoding model; The common mask matrix is ​​obtained based on the attention weights in the encoding / decoding model; The personalized mask matrix is ​​obtained by calculating the loss between the sequence corresponding to the sentence of the metadata output by the encoding / decoding model and the original representation of the sentence of the metadata.

3. The method according to claim 1, characterized in that, Obtaining the common representation based on the metadata representation, the sentence representation, and the commonality mask matrix includes: Calculate the score for each hidden layer based on the metadata representation and the sentence representation; Calculate the first attention matrix based on the score of each hidden layer; The intermediate representation of the sentence is obtained based on the first attention matrix, the sentence representation, and the common mask matrix; The intermediate representation of the sentence and the metadata representation are input into the third BERT model to obtain the common representation.

4. The method according to claim 1, characterized in that, Obtaining the personality representation based on the sentence representation and the personality mask matrix includes: Calculate the score for each hidden layer based on the sentence representation; Calculate the second attention matrix based on the score of each hidden layer; The personality representation is obtained based on the second attention matrix, the sentence representation, and the personality mask matrix.

5. The method according to claim 1, characterized in that, The relationship between obtaining the metadata based on the commonality representation and the individuality representation includes: The relationship between the metadata is obtained through the softmax function based on the commonality representation and the individuality representation.

6. A method for extracting metadata relationships, characterized in that, include: Retrieve metadata; The metadata is input into a trained metadata relationship extraction model to extract the relationships between the metadata. The metadata relationship extraction model mentioned above is the metadata relationship extraction model established by the method of any one of claims 1-5.

7. A modeling apparatus for extracting metadata relationships, characterized in that, include: The first acquisition module is used to acquire metadata and the sentences corresponding to the metadata; The masking module is used to obtain a common mask matrix and a unique mask matrix based on the metadata and the sentences corresponding to the metadata; Metadata representation module, used to input the metadata into the first BERT model to obtain a metadata representation; The sentence representation module is used to input the sentence into the second BERT model to obtain the sentence representation; A commonality representation module is used to obtain a commonality representation based on the metadata representation, the sentence representation, and the commonality mask matrix; A personality representation module is used to obtain a personality representation based on the sentence representation and the personality mask matrix; The metadata relationship module is used to obtain the relationship between the metadata based on the common representation and the individual representation; The first acquisition module is further configured to acquire data documents related to the metadata; and to split the data documents into sentences corresponding to the metadata.

8. A device for extracting metadata relationships, characterized in that, include: The second acquisition module is used to acquire metadata; An extraction module is used to input the metadata into a trained metadata relationship extraction model to extract the relationships of the metadata; The metadata relationship extraction model mentioned above is the metadata relationship extraction model established by the method of any one of claims 1-5.

9. A computer device, characterized in that, Includes processor, memory, and input / output interfaces; The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used to receive and output data, the memory is used to store computer programs, and the processor is used to call the computer programs so that the computer device executes the method of any one of claims 1-5 or 6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-5 or 6.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-5 or 6.

Citation Information

Patent Citations

  • Relationship extraction method, system and equipment and storage medium

    CN114969372A

  • Ternary data knowledge extraction model for equipment abnormity diagnosis and maintenance and ternary data fusion method

    CN116304097A