Apparatus and method for generating entity relation extraction models

By combining pre-annotation on a pre-trained language model with an improved annotation format, the entity relation database is automatically expanded, solving the problems of high cost of manual annotation and slow domain conversion in existing technologies, and realizing fast and efficient training of entity relation extraction models.

CN115730017BActive Publication Date: 2026-05-26DELTA ELECTRONICS INC(CN)

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DELTA ELECTRONICS INC(CN)
Filing Date
2021-08-27
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing entity relationship extraction methods require the involvement of experts or scholars, consume a lot of manual annotation costs and time, and cannot be quickly and flexibly adapted to different fields.

Method used

By employing a pre-trained language model and an improved annotation format, the system rapidly annotates input data and expands the entity relation database through a pre-annotation program, automatically generating a large amount of data and reducing manual intervention.

Benefits of technology

It enables rapid training of entity relationship extraction models, reduces the cost and time of manual annotation, and can quickly adapt to transformations in different fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115730017B_ABST
    Figure CN115730017B_ABST
Patent Text Reader

Abstract

This invention provides an apparatus and method for generating an entity relation extraction model. The apparatus receives text to be labeled and, based on multiple fields in the text and entity information and relation information in an entity relation database, generates at least one entity information to be labeled for each field and at least one relation information to be labeled for each field. The apparatus labels the at least one entity information and the at least one relation information to be labeled for each field according to a modified labeling format. The apparatus generates multiple combinations from the at least one labeled entity information and the at least one labeled relation information and stores them in the entity relation database. Based on a pre-trained language model, the apparatus inputs these combinations into the pre-trained language model to generate an entity relation extraction model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an apparatus and method for generating an entity relation extraction model. More specifically, it relates to an apparatus and method for executing a pre-annotation procedure and a model training procedure to generate an entity relation extraction model. Background Technology

[0002] Knowledge extraction is the most important first step in knowledge management. It involves extracting useful knowledge, including entities and relationships, from a large number of documents. This knowledge enables various application services to make quick and accurate decisions when faced with scenarios requiring judgment, thus completing the tasks in those scenarios. Many applications and solutions rely on structured text information to perform specific functions, such as search engines, automatic navigation, question answering, recommendation systems, and chatbots. To further enhance the level of knowledge, knowledge graphs and semantic knowledge bases are needed. Therefore, entity and relationship extraction is one of the key technologies for constructing knowledge bases.

[0003] Existing entity relation extraction methods primarily rely on manually designed rule templates and syntactic structure analysis. Specifically, manually designed rule templates use template rules designed by domain experts for matching. However, new templates need to be designed for new domains or data, which is time-consuming and only applicable to small domains. Syntactic structure analysis involves linguistic analysts dissecting the syntactic rules and structures of a single language to construct syntax. This involves structurally decomposing the input text sentence and identifying the relationships between nouns and verbs. However, this method suffers from extremely high costs for full-sentence annotation and cannot quickly adapt to different domains or languages. Therefore, regardless of the method used, the involvement of experts or scholars is required, consuming significant manual annotation costs and time, and it cannot be quickly and flexibly adapted to different domains.

[0004] Therefore, how to efficiently and automatically generate entity relationship extraction models is a goal that the industry urgently needs to strive for. Summary of the Invention

[0005] One object of the present invention is to provide an apparatus for generating an entity relation extraction model. The apparatus includes a memory and a processor electrically connected to the memory. The memory stores an entity relation database, wherein the entity relation database contains at least a plurality of entity information and a plurality of relation information. The processor executes a pre-annotation program and a model training program, wherein the pre-annotation program includes the following steps: the processor receives text to be annotated; the processor generates at least one entity information to be annotated and at least one relation information to be annotated corresponding to each field based on a plurality of fields in the text to be annotated and the entity information and relation information in the entity relation database; the processor annotates the at least one entity information to be annotated and the at least one relation information to be annotated for each field according to a modified annotation format to generate at least one annotated entity information and at least one annotated relation information; the processor generates a plurality of combinations from the at least one annotated entity information and the at least one annotated relation information and stores them in the entity relation database. The training model program includes the following steps: the processor takes a pre-trained language model as a basis, inputs the combinations into the pre-trained language model to generate an entity relation extraction model.

[0006] Another object of the present invention is to provide a method for generating an entity relation extraction model. The method is used in an apparatus for generating an entity relation extraction model, the apparatus comprising a memory and a processor. The memory stores an entity relation database, wherein the entity relation database contains at least a plurality of entity information and a plurality of relation information. The method for generating the entity relation extraction model is executed by the processor and includes the following steps: executing a pre-annotation program and a training model program, wherein the pre-annotation program includes the following steps: receiving a text to be annotated; generating corresponding models based on multiple fields in the text to be annotated and the entity information and relation information in the entity relation database. The field contains at least one entity information to be labeled and at least one corresponding relation information to be labeled for each field; the at least one entity information to be labeled and the at least one relation information to be labeled for each field are labeled according to a modified labeling format to generate at least one labeled entity information and at least one labeled relation information; multiple combinations of the at least one labeled entity information and the at least one labeled relation information are stored in the entity relation database; wherein, the training model program includes the following steps: based on a pre-trained language model, the combinations are input into the pre-trained language model to generate an entity relation extraction model.

[0007] As explained above, traditional entity relation extraction model training typically requires starting from scratch and necessitates a large amount of manually labeled / intervened input data to achieve the desired effect. Unlike traditional model generation methods, the entity relation extraction model generation technology (including at least the apparatus and method) provided by this invention is built upon a pre-trained model and utilizes a pre-labeling mechanism to rapidly label input data and expand the entity relation database, automatically generating a large amount of data without human intervention. This allows the entity relation extraction model to be trained quickly. Furthermore, this invention further accelerates the training speed of the entity relation extraction model through an improved labeling format. Therefore, it overcomes the shortcomings of existing technologies where entity relation extraction models require expert or scholar intervention, consuming significant manual labeling costs and time, and lacking the ability to quickly and flexibly adapt to different domains.

[0008] The following detailed description of the invention and its embodiments, in conjunction with the accompanying drawings, will enable those skilled in the art to understand the technical features of the claimed invention. Attached Figure Description

[0009] Figure 1 A schematic diagram depicting the architecture of an apparatus for generating an entity relation extraction model according to an embodiment of the present invention;

[0010] Figure 2 A schematic diagram depicting the entity relation database in the first embodiment;

[0011] Figure 3 This is a schematic diagram depicting the expanded entity relation database in the first embodiment;

[0012] Figure 4 A schematic diagram depicting the architecture of the entity relation extraction model in the first embodiment; and

[0013] Figure 5 A flowchart depicting the method for generating an entity relationship extraction model according to the second embodiment.

[0014] Explanation of icon numbers:

[0015] 1: Device for generating entity relation extraction models

[0016] 11: Memory

[0017] 13: Send / Receive Interface

[0018] 15: Processor

[0019] 133: Text to be annotated

[0020] 400: Entity-Relationship Database

[0021] 409: Neural Networks

[0022] 411: Input Layer

[0023] 413: Pre-trained language models

[0024] 415: Sequence Layer

[0025] S501-S509: Steps Detailed Implementation

[0026] The apparatus and method for generating entity relation extraction models provided by the present invention will be explained below through embodiments. However, these embodiments are not intended to limit the implementation of the present invention to any environment, application, or manner described in these embodiments. Therefore, the description of the embodiments is for illustrative purposes only and is not intended to limit the scope of the present invention. It should be understood that in the following embodiments and drawings, elements not directly related to the present invention have been omitted and are not shown, and the dimensions of each element and the dimensional ratios between elements are merely illustrative and are not intended to limit the scope of the present invention.

[0027] The first embodiment of the present invention is an apparatus 1 for generating an entity relation extraction model, the schematic diagram of which is depicted in... Figure 1 In this embodiment, the apparatus 1 for generating the entity relation extraction model includes a memory 11, a transceiver interface 13, and a processor 15, with the processor 15 electrically connected to the memory 11 and the transceiver interface 13. The memory 11 may be a memory, a Universal Serial Bus (USB) disk, a hard disk, an optical disk, a USB flash drive, or any other storage medium or circuit known to those skilled in the art and having the same function. The transceiver interface 13 is an interface capable of receiving and transmitting data, or other interfaces capable of receiving and transmitting data known to those skilled in the art. The transceiver interface 13 can receive data from sources such as external devices, external web pages, external applications, etc. The processor 15 may be various processing units, a central processing unit (CPU), a microprocessor, or other computing devices known to those skilled in the art. In some embodiments, the apparatus 1 for generating the entity relation extraction model may be, but is not limited to, a mobile electronic device, a desktop computer, a portable computer, etc.

[0028] In this embodiment, the memory 11 stores an entity-relationship database 400, which contains at least multiple entity information and multiple relationship information. For ease of understanding, Figure 2 An example of an entity-relationship database 400 is illustrated. For example... Figure 2As shown, the entity-relational database 400 records fields such as input data, entity 1, relation, entity 2, and confidence score. Figure 2 Taking the first data entry in Entity Relationship Database 400 as an example, Entity Relationship Database 400 records the input data as "Tom was born in Honolulu, Hawaii". The corresponding entity 1 is "Tom", the relation is "wasborn in", the entity 2 is "Honolulu", and the confidence score is "1.0".

[0029] In some embodiments, the entity-relationship database 400 is generated by the processor 15 executing a web crawler and an entity-relationship database construction program. The web crawler includes the following steps: the processor 15 collects multiple knowledge base data contents, each containing multiple entry names and corresponding entry text. The processor 15 performs sentence segmentation on each entry text to generate input data. The entity-relationship database construction program includes the following steps: the processor 15 inputs the input data to an entity-relationship extraction system to generate output data, wherein the output data contains multiple triplet data, each triplet containing multiple entity information, at least one relation information, and a confidence score. Based on the confidence score, the processor 15 stores triplet data in the output data whose confidence scores exceed a preset value into the entity-relationship database.

[0030] For example, in a web crawler program, the processor 15 can execute the crawler to retrieve the entry names (e.g., databases related to a certain category) and entry text (e.g., articles related to a certain category) from various data sources such as general knowledge bases (e.g., dbpedia, YAGO, freebase, Wikipedia, etc.), domain knowledge bases (e.g., patent knowledge bases, manufacturing terminology knowledge bases, etc.), and standard entity relation dataset knowledge bases (e.g., OPIEC, OIE2016). Then, the processor 15 performs sentence segmentation on the entry text, using periods as the punctuation rule, generating multiple input data units of single sentences. It should be noted that after the web crawler program retrieves the entry names and entry text from each knowledge base, the processor 15 can further perform preprocessing operations on the entry text, such as extracting text paragraphs, removing HTML tags, removing duplicate sentences, and removing abnormal garbled information.

[0031] For example, in the construction process of the entity relation database 400, the processor 15 inputs input data to an entity relation extraction system. This entity relation extraction system can be an open-source entity relation extraction tool trained based on machine learning, such as OpenIE5 or RnnOIE. Then, the processor 15 uses this entity relation extraction system to extract multiple triples containing multiple entity information, at least one relation information, and a confidence score from the segmented text of the entries (i.e., the input data). Figure 2 As shown, each triplet data includes entity 1, relation, entity 2, and a confidence score, where the confidence score represents the degree of confidence in the extraction result of the triplet data. The confidence score can be automatically generated by the entity relation extraction system. Finally, the processor 15 can store triplet data with confidence scores greater than 0.85 in the entity relation database 400 by setting the preset value of the confidence score to 0.85.

[0032] In some embodiments, the entity relation database 400 may also be generated by an external device, and received by the processor 15 through the transceiver interface 13 and stored in the memory 11. It should be noted that... Figure 2 This is merely an example and is not intended to limit the scope of the invention. In actual operation, the entity relation database 400 may also include other fields (e.g., data source).

[0033] Next, for a detailed explanation of the operation of device 1 that generates the entity relation extraction model, please refer to [link to relevant documentation]. Figure 1 In this embodiment, the processor 15 executes a pre-annotation procedure and a model training procedure. First, in the pre-annotation procedure, the processor 15 receives a text 133 to be annotated through the transceiver interface 13. It should be noted that the text 133 to be annotated is an article that has not yet been annotated with entities and relationships. It may be, for example, an article of a certain category or an article related to the domain of this model training. The text 133 to be annotated will be used to subsequently expand the data of the entity-relationship database 400.

[0034] In some implementations, the processor 15 performs sentence segmentation on the text 133 to be annotated, generating multiple fields based on single sentences. In some implementations, the processor 15 performs a text preprocessing operation on the text 133 to be annotated, such as extracting text paragraphs, removing HTML tags, removing duplicate sentences, and removing abnormal garbled information, etc.

[0035] Next, the processor 15 generates at least one entity information to be labeled and at least one relationship information to be labeled corresponding to each field, based on multiple fields in the text to be labeled 133 and the entity information and relationship information in the entity relation database 400. Specifically, generating the at least one entity information to be labeled and the at least one relationship information to be labeled corresponding to each field may include the following steps: First, the processor 15 compares the fields in the text to be labeled 133 with the entity information in the entity relation database 400 to generate the at least one entity information to be labeled corresponding to each field. Next, the processor 15 compares each field containing at least two entity information to be labeled with the relationship information in the entity relation database 400 to generate the at least one relationship information to be labeled corresponding to each field.

[0036] Subsequently, the processor 15 annotates the at least one entity information to be annotated and the at least one relation information to be annotated in each field according to a modified annotation format, to generate at least one annotated entity information and at least one annotated relation information. The processor 15 generates multiple combinations from the at least one annotated entity information and the at least one annotated relation information and stores them in the entity relation database 400. In some embodiments, the processor 15 generates these combinations from the at least one annotated entity information and the at least one annotated relation information according to a certain order of the at least one annotated entity information and the at least one annotated relation information in each field. In some embodiments, the modified annotation format consists of a traditional sequence labeling format (e.g., BMES, BIO, BIOES, etc.) and an entity label and a relation label corresponding to the traditional sequence labeling format.

[0037] To facilitate understanding, a specific example is provided to illustrate the process of executing the pre-annotation procedure. Please refer to [link / reference]. Figure 1 , Figure 2 and Figure 3 However, this is not intended to limit the scope of the invention. In this example, the text to be annotated 133 contains field A, which includes the sentence "Wang was born in Taiwan, Tainan, Zhongshan street". First, the processor 15 compares field A with... Figure 2The entity information in the entity relation database 400 is compared (i.e., the entity 1 and entity 2 fields) to determine which words / phrases in field A belong to entities. In this example, since “Wang”, “Taiwan”, “Tainan”, and “Zhongshan street” in field A have been labeled as entities in the 4th, 5th, and 6th records of the entity relation database 400, respectively, after comparison, the processor 15 generates the entity information to be labeled for the corresponding field A as “Wang”, “Taiwan”, “Tainan”, and “Zhongshan street” (in the order of their appearance in field A).

[0038] Next, processor 15 determines which fields contain at least two entity information to be labeled (i.e., there is a possibility of forming a combination through two entities and a relation; because if there are no two entities, even with a relation, a combination cannot be formed). In this example, since field A has more than two entity information to be labeled, processor 15 will combine field A with... Figure 2 The processor 15 compares the relation information (i.e., relation fields) in the entity relation database 400 to determine which words / phrases in field A belong to the relation. In this example, since "was born in" has already been marked as a relation in the first and second entries of the entity relation database 400, after comparison, the processor 15 generates the relation information to be marked for the corresponding field A as "was born in".

[0039] Subsequently, the processor 15 annotates the at least one annotated entity information and the at least one annotated relation information of each field according to the improved annotation format. In this example, BMES annotation is used (i.e., B is the beginning position of a word, M is the middle position of a word, E is the end position of a word, and S is a single word). Taking the entity information and relation information to be labeled in the aforementioned field A as an example, the processor 15 labels the entity information "Wang" and adds the prefix "Entity" before the traditional sequence labeling format S to become "Wang[Entity-S]", labels "Taiwan" as "Taiwan[Entity-S]", labels "Tainan" as "Tainan[Entity-S]", and labels "Zhongshan street" as "Zhongshan[Entity-B]street[Entity-E]". The labeled "Wang[Entity-S]", "Taiwan[Entity-S]", "Tainan[Entity-S]", and "Zhongshan[Entity-B]street[Entity-E]" are the labeled entity information. Processor 15 annotates the relation information to be labeled "was born in", and adds the prefix Relation before the traditional sequence labeling format B, M or E to become "was[Relation-B]born[Relation-M]in[Relation-E]". The labeled "was[Relation-B]born[Relation-M]in[Relation-E]" is the labeled entity information.

[0040] Next, processor 15 generates multiple combinations of the labeled entity information and labeled relation information in each field according to their order of appearance in field A, and stores them in entity relation database 400. For example, regarding the labeled entity information and labeled relation information in field A, please refer to... Figure 3Based on the annotated entity information "Wang[Entity-S]", "Taiwan[Entity-S]", "Tainan[Entity-S]", and "Zhongshan[Entity-B]street[Entity-E]" of field A, and the annotated relation information "was[Relation-B]born[Relation-M]in[Relation-E]", processor 15 generates combinations "Wang was born inTaiwan", "Wang was born in Tainan", and "Wang was born in Zhongshan street" that respectively conform to the permutations of entity 1, relation, and entity 2, and stores them in [the relevant database / system]. Figure 3 The 7th, 8th, and 9th records in the entity relation database 400 (in this example, the confidence score is preset to 1).

[0041] Accordingly, the processor 15 can perform the same operation on multiple fields contained in the labeled text 133. The processor 15 automatically labels the data by comparing strings in the entity relation database 400, and can generate multiple combinations of fields that are several times larger than the original fields, thereby expanding the data content in the entity relation database 400. In addition, since the processor 15 labels the entities and relations in each field using a modified labeling format, the data content in the entity relation database 400 contains positional feature information in addition to entity and relation information, which will benefit the efficiency and time of subsequent model training.

[0042] In some embodiments, the processor 15 may also be arranged in other ways to generate combinations. Those skilled in the art should understand how combinations can be generated based on the foregoing description, and will not be elaborated upon here. It should be noted that, for the sake of brevity, Figure 3 The modified annotation format illustrated herein shows only a portion of the content, but it is not intended to limit the scope of the invention. Those skilled in the art should be able to understand the operation based on the foregoing description, which will not be elaborated upon here.

[0043] The following will explain the steps of processor 15 executing the training model program. Please refer to [link / reference]. Figure 4In this embodiment, the processor 15 uses a pre-trained language model 413 as a basis, and inputs the combinations into the pre-trained language model 413 to generate an entity relation extraction model, wherein the entity extraction model is used to identify the entity information and relation information in a text paragraph. It should be noted that the pre-trained language model 413 includes at least a pre-trained language layer model. Since a multi-layer network structure has been trained based on a large amount of text, the language layer already contains multiple trained weight parameters. For example, the pre-trained language model BERT (Bidirectional Encoder Representations from Transformers) proposed by Google, where each "Transformer" is a model that uses a self-attention mechanism to strengthen the internal association of attention sequences.

[0044] Specifically, the model training procedure may include the following steps. First, as... Figure 4 As shown, the processor 15 concatenates an input layer 411 and a sequence layer 415 with the pre-trained language model 413 to effectively reduce the complexity of model training. The input layer 411 is used to segment the fields into multiple words as input to the pre-trained language model 413. The sequence layer 415 performs an analysis based on the modified annotation format to generate the entity information and relation information in the text paragraph. Then, the processor 15 inputs the combinations from the entity relation database 400 into the input layer 411, and works with the pre-trained language model 413 and the sequence layer 415 to generate the entity relation extraction model.

[0045] It should be noted that the input layer 411 takes multiple text sequences as input (i.e., input data from the entity relation database 400), splits the text sequences into multiple token sequences, and then inputs the token sequences into the pre-trained language model 413 (i.e., the BERT layer). The sequence layer 415 receives the output of the pre-trained language model 413 and finally produces the entity relations and traditional sequence labeling formats (e.g., BMES, BIO, BIOES, etc.) for each text sequence. Since the sequence layer (CRFLayer) can add constraints to the serialized tags (i.e., regulate the probability of the next character being generated), it ensures the effectiveness of the predicted tags and effectively reduces the complexity of model training. Therefore, concatenating the sequence layer after the language layer (i.e., the BERT layer) can enhance the effect of sequence analysis. It should be noted that, for simplicity... Figure 4 Only a portion of the content is shown in the foregoing description. Those skilled in the art should be able to understand the operation of machine learning training through the concatenation of neural networks based on the foregoing description, which will not be elaborated upon here.

[0046] In some implementations, such as Figure 4As shown, machine learning can be performed through a neural network 409 consisting of three interconnected networks: an input layer 411, a pre-trained language model 413, and a sequence layer 415. The pre-trained language model 413 is fine-tuned based on data from the entity relation database 400 to train an entity relation extraction model. The input to this entity relation extraction model is a text sequence and annotation information. Once trained, the model can predict which words in a new text sequence are entities and relations.

[0047] As described above, the apparatus 1 for generating the entity relation extraction model executes a pre-annotation program and a model training program. In the pre-annotation program, the processor 15 generates at least one entity information to be annotated and at least one relation information to be annotated corresponding to each field, based on multiple fields in the text 133 to be annotated and the entity information and relation information in the entity relation database 400. It then annotates the at least one entity information to be annotated and the at least one relation information to be annotated according to a modified annotation format to generate at least one annotated entity information and at least one annotated relation information. Multiple combinations are generated from the at least one annotated entity information and the at least one annotated relation information and stored in the entity relation database 400. In the model training program, the processor 15 inputs these combinations into a pre-trained language model to generate an entity relation extraction model.

[0048] As explained above, traditional entity relation extraction model training typically requires starting from scratch and necessitates a large amount of manually labeled / intervened input data to achieve the desired effect. Unlike traditional model generation methods, the entity relation extraction model generation device provided by this invention is built on a pre-trained model and utilizes a pre-labeling mechanism to quickly label input data and expand the entity relation database, automatically generating a large amount of data without human intervention. This allows the entity relation extraction model to be trained rapidly. Furthermore, this invention accelerates the training speed of the entity relation extraction model through an improved labeling format. Therefore, it overcomes the shortcomings of existing technologies where entity relation extraction models require expert or scholar intervention, incurring significant manual labeling costs and time, and lacking the ability to quickly and flexibly adapt to different domains.

[0049] The second embodiment of the present invention is a method for generating an entity relation extraction model, the flowchart of which is depicted in... Figure 5The method for generating an entity relation extraction model is used in an apparatus for generating an entity relation extraction model (hereinafter referred to as "the apparatus"), such as the apparatus 1 for generating an entity relation extraction model described in the first embodiment. The apparatus includes a memory, a transceiver interface, and a processor. The memory stores an entity relation database, such as the entity relation database 400 described in the first embodiment, wherein the entity relation database contains at least multiple entity information and multiple relation information. The method for generating an entity relation extraction model generates the entity relation extraction model through steps S501 to S507 of the pre-annotation procedure and step S509 of the model training procedure.

[0050] In some embodiments, the entity-relationship database is generated by a web crawler and an entity-relationship database construction program. Executing the web crawler includes the following steps: collecting multiple knowledge base data contents, each containing multiple entry names and corresponding entry text; performing sentence segmentation on each entry text to generate input data; and the entity-relationship database construction program includes the following steps: inputting the input data into an entity-relationship extraction system to generate output data, wherein the output data contains multiple triplet data, each triplet data containing multiple entity information, at least one relation information, and a confidence score; and storing triplet data in the output data whose confidence scores exceed a preset value into the entity-relationship database based on the confidence score.

[0051] The following describes steps S501 to S507 of the pre-annotation procedure. First, in step S501, the device receives text to be annotated.

[0052] Next, in step S503, the device generates at least one entity information to be annotated and at least one relationship information to be annotated corresponding to each field based on multiple fields in the text to be annotated and the entity information and relationship information in the entity relation database. In some embodiments, generating the at least one entity information to be annotated and the at least one relationship information to be annotated corresponding to each field includes the following steps: comparing the fields in the text to be annotated and the entity information in the entity relation database to generate the at least one entity information to be annotated corresponding to each field; and comparing each field containing at least two entity information to be annotated and the relationship information in the entity relation database to generate the at least one relationship information to be annotated corresponding to each field.

[0053] Subsequently, in step S505, the device annotates the at least one entity information to be annotated and the at least one relation information to be annotated in each field according to a modified annotation format, so as to generate at least one annotated entity information and at least one annotated relation information. In some embodiments, the modified annotation format consists of a conventional sequence annotation format and an entity label and a relation label corresponding to the conventional sequence annotation format.

[0054] Next, in step S507, the device generates multiple combinations from the at least one labeled entity information and the at least one labeled relationship information and stores them in the entity relationship database. In some embodiments, generating such combinations from the at least one labeled entity information and the at least one labeled relationship information includes the following steps: generating the multiple combinations of the at least one labeled entity information and the at least one labeled relationship information in each field according to a sequence of the at least one labeled entity information and the at least one labeled relationship information in each field.

[0055] The following describes step S509 of the training model procedure. In step S509, the device inputs the combinations into a pre-trained language model based on the pre-trained language model to generate an entity relation extraction model.

[0056] In some embodiments, the training model procedure further includes: concatenating an input layer and a sequence layer with the pre-trained language model to effectively reduce the complexity of model training, wherein the input layer is used to segment the fields into multiple words as input to the pre-trained language model, and the sequence layer performs an analysis operation based on the modified annotation format to generate entity information and relation information in the text paragraph; and inputting the combinations containing the modified annotation format from the entity relation database into the input layer, in conjunction with the pre-trained language model and the sequence layer, to generate the entity relation extraction model.

[0057] In addition to the steps described above, the second embodiment can also perform all the operations and steps of the apparatus 1 for generating entity relationship extraction models described in the first embodiment, and has the same function and achieves the same technical effect. Those skilled in the art to which this invention pertains can directly understand how the second embodiment performs these operations and steps based on the first embodiment described above, has the same function, and achieves the same technical effect, so it will not be described in detail here.

[0058] In summary, traditional entity relation extraction (ERP) model training typically requires starting from scratch and consuming a large amount of manually labeled / intervened input data to achieve the desired results. Unlike traditional model generation methods, the ERP model generation method provided in this invention is built upon a pre-trained model and utilizes a pre-labeling mechanism to rapidly label input data and expand the entity relation database, automatically generating a large amount of data without human intervention. This allows the ERP model to be trained quickly. Furthermore, this invention accelerates the training speed of the ERP model through an improved labeling format. Therefore, it overcomes the shortcomings of existing technologies, which require expert or scholar intervention, incurring significant manual labeling costs and time, and lacking the ability to quickly and flexibly adapt to different domains.

[0059] The above embodiments are merely illustrative of some implementations of the present invention and to explain the technical features of the present invention, and are not intended to limit the scope and range of protection of the present invention. Any changes or equivalent arrangements that can be easily made by those skilled in the art to which this invention pertains are within the scope of the present invention, and the scope of protection of the present invention is determined by the scope of the claims.

Claims

1. An apparatus for generating an entity relation extraction model, comprising: A memory for storing an entity-relationship database, wherein the entity-relationship database contains at least multiple entity information and multiple relationship information; and A processor, electrically connected to the memory, is used to execute a pre-labeling program and a model training program, wherein the pre-labeling program includes the following steps: Receive the text to be annotated; Based on multiple fields in the text to be annotated and multiple entity information and multiple relationship information in the entity relationship database, at least one entity information to be annotated and at least one relationship information to be annotated corresponding to each field are generated. According to the improved annotation format, the at least one entity information to be annotated and the at least one relation information to be annotated in each of the fields are annotated to generate at least one annotated entity information and at least one annotated relation information. as well as Multiple combinations are generated from the at least one labeled entity information and the at least one labeled relationship information and stored in the entity relationship database; The training model program includes the following steps: Based on a pre-trained language model, the multiple combinations are input into the pre-trained language model to generate an entity relation extraction model; The generation of at least one entity information to be labeled corresponding to each of the fields and at least one relation information to be labeled corresponding to each of the fields includes the following steps: comparing the multiple fields in the text to be labeled and the multiple entity information in the entity relation database to generate at least one entity information to be labeled corresponding to each of the fields; And compare each of the fields containing at least two entity information to be labeled with the plurality of relation information in the entity relation database to generate at least one relation information to be labeled corresponding to each of the fields.

2. The apparatus for generating an entity relation extraction model according to claim 1, wherein the entity relation database is generated by a crawler program and an entity relation database construction program, wherein executing the crawler program includes the following steps: Collect data from multiple knowledge bases, each containing multiple entry names and corresponding entry text; and The text of each of the aforementioned entries is segmented into sentences to generate input data; in, The entity-relationship database construction procedure includes the following steps: The input data is fed into the entity relation extraction system to generate output data, wherein the output data includes multiple triple data, and each triple data includes multiple entity information, at least one relation information and a confidence score; as well as Based on the confidence score, the triples whose confidence scores exceed a preset value in the output data are stored in the entity relation database.

3. The apparatus for generating an entity relation extraction model according to claim 1, wherein generating the plurality of combinations from the at least one labeled entity information and the at least one labeled relation information comprises the following steps: Based on the order of the at least one labeled entity information and the at least one labeled relation information in each field, the plurality of combinations of the at least one labeled entity information and the at least one labeled relation information in each field are generated.

4. The apparatus for generating an entity relation extraction model according to claim 1, wherein the training model program further comprises: The input layer and sequence layer are concatenated with the pre-trained language model; and The entity relation database contains multiple combinations of the modified annotation format, which are input into the input layer. This is combined with the pre-trained language model and the sequence layer to generate the entity relation extraction model.

5. The apparatus for generating an entity relation extraction model according to claim 1, wherein the improved annotation format is composed of a traditional sequence annotation format and entity tags and relation tags corresponding to the traditional sequence annotation format.

6. A method for generating an entity relation extraction model, and an apparatus for generating an entity relation extraction model, the apparatus comprising a memory and a processor, the memory storing an entity relation database, wherein the entity relation database contains at least a plurality of entity information and a plurality of relation information, the method for generating the entity relation extraction model being executed by the processor and comprising the following steps: Execute the pre-annotation procedure and the model training procedure, wherein the pre-annotation procedure includes the following steps: Receive the text to be annotated; Based on multiple fields in the text to be annotated and multiple entity information and multiple relationship information in the entity relationship database, at least one entity information to be annotated and at least one relationship information to be annotated corresponding to each field are generated. According to the improved annotation format, the at least one entity information to be annotated and the at least one relation information to be annotated in each of the fields are annotated to generate at least one annotated entity information and at least one annotated relation information. as well as Multiple combinations are generated from the at least one labeled entity information and the at least one labeled relationship information and stored in the entity relationship database; The training model program includes the following steps: Based on a pre-trained language model, the multiple combinations are input into the pre-trained language model to generate an entity relation extraction model; The generation of at least one entity information to be labeled corresponding to each of the fields and at least one relation information to be labeled corresponding to each of the fields includes the following steps: comparing the multiple fields in the text to be labeled and the multiple entity information in the entity relation database to generate at least one entity information to be labeled corresponding to each of the fields; And compare each of the fields containing at least two entity information to be labeled with the plurality of relation information in the entity relation database to generate at least one relation information to be labeled corresponding to each of the fields.

7. The method for generating an entity relation extraction model according to claim 6, wherein the entity relation database is generated by a web crawler and an entity relation database construction program, wherein executing the web crawler includes the following steps: Collect data from multiple knowledge bases, each containing multiple entry names and corresponding entry text; and The text of each of the aforementioned entries is segmented into sentences to generate input data; in, The entity-relationship database construction procedure includes the following steps: The input data is fed into the entity relation extraction system to generate output data, wherein the output data includes multiple triple data, and each triple data includes multiple entity information, at least one relation information and a confidence score; as well as Based on the confidence score, the triples whose confidence scores exceed a preset value in the output data are stored in the entity relation database.

8. The method for generating an entity relation extraction model according to claim 6, wherein generating the plurality of combinations from the at least one labeled entity information and the at least one labeled relation information comprises the following steps: Based on the order of the at least one labeled entity information and the at least one labeled relation information in each field, the plurality of combinations of the at least one labeled entity information and the at least one labeled relation information in each field are generated.

9. The method for generating an entity relation extraction model according to claim 6, wherein the model training program further comprises: The input layer and sequence layer are concatenated with the pre-trained language model; and The entity relation database contains multiple combinations of the modified annotation format, which are input into the input layer. This is combined with the pre-trained language model and the sequence layer to generate the entity relation extraction model.

10. The method for generating an entity relation extraction model according to claim 6, wherein the improved annotation format is composed of a traditional sequence annotation format and entity tags and relation tags corresponding to the traditional sequence annotation format.